blob: cd25b34144914480672a0b31e8a767229d0b29c8 [file] [log] [blame]
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -04001/*
Eric Miao0e5f11a2008-01-31 00:56:46 -05002 * linux/drivers/input/keyboard/pxa27x_keypad.c
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -04003 *
4 * Driver for the pxa27x matrix keyboard controller.
5 *
6 * Created: Feb 22, 2007
7 * Author: Rodolfo Giometti <giometti@linux.it>
8 *
9 * Based on a previous implementations by Kevin O'Connor
10 * <kevin_at_koconnor.net> and Alex Osborne <bobofdoom@gmail.com> and
11 * on some suggestions by Nicolas Pitre <nico@cam.org>.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 */
17
18
19#include <linux/kernel.h>
20#include <linux/module.h>
21#include <linux/init.h>
22#include <linux/interrupt.h>
23#include <linux/input.h>
24#include <linux/device.h>
25#include <linux/platform_device.h>
Russell King22d8a732007-08-20 10:19:39 +010026#include <linux/clk.h>
27#include <linux/err.h>
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -040028
29#include <asm/mach-types.h>
30#include <asm/mach/arch.h>
31#include <asm/mach/map.h>
32
33#include <asm/arch/hardware.h>
34#include <asm/arch/pxa-regs.h>
35#include <asm/arch/irqs.h>
Eric Miao0e5f11a2008-01-31 00:56:46 -050036#include <asm/arch/pxa27x_keypad.h>
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -040037
Eric Miao0e5f11a2008-01-31 00:56:46 -050038#define DRIVER_NAME "pxa27x-keypad"
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -040039
Eric Miaod7416f92008-01-31 00:58:52 -050040#define KPC_MKRN(n) ((((n) & 0x7) - 1) << 26) /* matrix key row number */
41#define KPC_MKCN(n) ((((n) & 0x7) - 1) << 23) /* matrix key column number */
42#define KPC_DKN(n) ((((n) & 0x7) - 1) << 6) /* direct key number */
43
Eric Miao62059d92008-01-31 00:59:03 -050044#define KPDK_DKP (0x1 << 31)
45#define KPDK_DK(n) ((n) & 0xff)
46
Eric Miao1814db62008-01-31 00:58:37 -050047#define KPAS_MUKP(n) (((n) >> 26) & 0x1f)
48#define KPAS_RP(n) (((n) >> 4) & 0xf)
49#define KPAS_CP(n) ((n) & 0xf)
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -040050
Eric Miao1814db62008-01-31 00:58:37 -050051#define KPASMKP_MKC_MASK (0xff)
52
53#define MAX_MATRIX_KEY_NUM (8 * 8)
54
55struct pxa27x_keypad {
56 struct pxa27x_keypad_platform_data *pdata;
57
58 struct clk *clk;
59 struct input_dev *input_dev;
60
61 /* matrix key code map */
62 unsigned int matrix_keycodes[MAX_MATRIX_KEY_NUM];
63
64 /* state row bits of each column scan */
65 uint32_t matrix_key_state[MAX_MATRIX_KEY_COLS];
Eric Miao62059d92008-01-31 00:59:03 -050066 uint32_t direct_key_state;
67
68 unsigned int direct_key_mask;
69
70 int rotary_rel_code[2];
71 int rotary_up_key[2];
72 int rotary_down_key[2];
Eric Miao1814db62008-01-31 00:58:37 -050073};
74
75static void pxa27x_keypad_build_keycode(struct pxa27x_keypad *keypad)
76{
77 struct pxa27x_keypad_platform_data *pdata = keypad->pdata;
78 struct input_dev *input_dev = keypad->input_dev;
79 unsigned int *key;
80 int i;
81
82 key = &pdata->matrix_key_map[0];
83 for (i = 0; i < pdata->matrix_key_map_size; i++, key++) {
84 int row = ((*key) >> 28) & 0xf;
85 int col = ((*key) >> 24) & 0xf;
86 int code = (*key) & 0xffffff;
87
88 keypad->matrix_keycodes[(row << 3) + col] = code;
89 set_bit(code, input_dev->keybit);
90 }
Eric Miao62059d92008-01-31 00:59:03 -050091
92 keypad->rotary_up_key[0] = pdata->rotary0_up_key;
93 keypad->rotary_up_key[1] = pdata->rotary1_up_key;
94 keypad->rotary_down_key[0] = pdata->rotary0_down_key;
95 keypad->rotary_down_key[1] = pdata->rotary1_down_key;
96 keypad->rotary_rel_code[0] = pdata->rotary0_rel_code;
97 keypad->rotary_rel_code[1] = pdata->rotary1_rel_code;
98
99 if (pdata->rotary0_up_key && pdata->rotary0_down_key) {
100 set_bit(pdata->rotary0_up_key, input_dev->keybit);
101 set_bit(pdata->rotary0_down_key, input_dev->keybit);
102 } else
103 set_bit(pdata->rotary0_rel_code, input_dev->relbit);
104
105 if (pdata->rotary1_up_key && pdata->rotary1_down_key) {
106 set_bit(pdata->rotary1_up_key, input_dev->keybit);
107 set_bit(pdata->rotary1_down_key, input_dev->keybit);
108 } else
109 set_bit(pdata->rotary1_rel_code, input_dev->relbit);
Eric Miao1814db62008-01-31 00:58:37 -0500110}
111
112static inline unsigned int lookup_matrix_keycode(
113 struct pxa27x_keypad *keypad, int row, int col)
114{
115 return keypad->matrix_keycodes[(row << 3) + col];
116}
117
118static void pxa27x_keypad_scan_matrix(struct pxa27x_keypad *keypad)
119{
120 struct pxa27x_keypad_platform_data *pdata = keypad->pdata;
121 int row, col, num_keys_pressed = 0;
122 uint32_t new_state[MAX_MATRIX_KEY_COLS];
123 uint32_t kpas = KPAS;
124
125 num_keys_pressed = KPAS_MUKP(kpas);
126
127 memset(new_state, 0, sizeof(new_state));
128
129 if (num_keys_pressed == 0)
130 goto scan;
131
132 if (num_keys_pressed == 1) {
133 col = KPAS_CP(kpas);
134 row = KPAS_RP(kpas);
135
136 /* if invalid row/col, treat as no key pressed */
137 if (col >= pdata->matrix_key_cols ||
138 row >= pdata->matrix_key_rows)
139 goto scan;
140
141 new_state[col] = (1 << row);
142 goto scan;
143 }
144
145 if (num_keys_pressed > 1) {
146 uint32_t kpasmkp0 = KPASMKP0;
147 uint32_t kpasmkp1 = KPASMKP1;
148 uint32_t kpasmkp2 = KPASMKP2;
149 uint32_t kpasmkp3 = KPASMKP3;
150
151 new_state[0] = kpasmkp0 & KPASMKP_MKC_MASK;
152 new_state[1] = (kpasmkp0 >> 16) & KPASMKP_MKC_MASK;
153 new_state[2] = kpasmkp1 & KPASMKP_MKC_MASK;
154 new_state[3] = (kpasmkp1 >> 16) & KPASMKP_MKC_MASK;
155 new_state[4] = kpasmkp2 & KPASMKP_MKC_MASK;
156 new_state[5] = (kpasmkp2 >> 16) & KPASMKP_MKC_MASK;
157 new_state[6] = kpasmkp3 & KPASMKP_MKC_MASK;
158 new_state[7] = (kpasmkp3 >> 16) & KPASMKP_MKC_MASK;
159 }
160scan:
161 for (col = 0; col < pdata->matrix_key_cols; col++) {
162 uint32_t bits_changed;
163
164 bits_changed = keypad->matrix_key_state[col] ^ new_state[col];
165 if (bits_changed == 0)
166 continue;
167
168 for (row = 0; row < pdata->matrix_key_rows; row++) {
169 if ((bits_changed & (1 << row)) == 0)
170 continue;
171
172 input_report_key(keypad->input_dev,
173 lookup_matrix_keycode(keypad, row, col),
174 new_state[col] & (1 << row));
175 }
176 }
177 input_sync(keypad->input_dev);
178 memcpy(keypad->matrix_key_state, new_state, sizeof(new_state));
179}
Russell King22d8a732007-08-20 10:19:39 +0100180
Eric Miaod7416f92008-01-31 00:58:52 -0500181#define DEFAULT_KPREC (0x007f007f)
182
Eric Miao62059d92008-01-31 00:59:03 -0500183static inline int rotary_delta(uint32_t kprec)
184{
185 if (kprec & KPREC_OF0)
186 return (kprec & 0xff) + 0x7f;
187 else if (kprec & KPREC_UF0)
188 return (kprec & 0xff) - 0x7f - 0xff;
189 else
190 return (kprec & 0xff) - 0x7f;
191}
192
193static void report_rotary_event(struct pxa27x_keypad *keypad, int r, int delta)
194{
195 struct input_dev *dev = keypad->input_dev;
196
197 if (delta == 0)
198 return;
199
200 if (keypad->rotary_up_key[r] && keypad->rotary_down_key[r]) {
201 int keycode = (delta > 0) ? keypad->rotary_up_key[r] :
202 keypad->rotary_down_key[r];
203
204 /* simulate a press-n-release */
205 input_report_key(dev, keycode, 1);
206 input_sync(dev);
207 input_report_key(dev, keycode, 0);
208 input_sync(dev);
209 } else {
210 input_report_rel(dev, keypad->rotary_rel_code[r], delta);
211 input_sync(dev);
212 }
213}
214
215static void pxa27x_keypad_scan_rotary(struct pxa27x_keypad *keypad)
216{
217 struct pxa27x_keypad_platform_data *pdata = keypad->pdata;
218 uint32_t kprec;
219
220 /* read and reset to default count value */
221 kprec = KPREC;
222 KPREC = DEFAULT_KPREC;
223
224 if (pdata->enable_rotary0)
225 report_rotary_event(keypad, 0, rotary_delta(kprec));
226
227 if (pdata->enable_rotary1)
228 report_rotary_event(keypad, 1, rotary_delta(kprec >> 16));
229}
230
231static void pxa27x_keypad_scan_direct(struct pxa27x_keypad *keypad)
232{
233 struct pxa27x_keypad_platform_data *pdata = keypad->pdata;
234 unsigned int new_state;
235 uint32_t kpdk, bits_changed;
236 int i;
237
238 kpdk = KPDK;
239
240 if (pdata->enable_rotary0 || pdata->enable_rotary1)
241 pxa27x_keypad_scan_rotary(keypad);
242
243 if (pdata->direct_key_map == NULL)
244 return;
245
246 new_state = KPDK_DK(kpdk) & keypad->direct_key_mask;
247 bits_changed = keypad->direct_key_state ^ new_state;
248
249 if (bits_changed == 0)
250 return;
251
252 for (i = 0; i < pdata->direct_key_num; i++) {
253 if (bits_changed & (1 << i))
254 input_report_key(keypad->input_dev,
255 pdata->direct_key_map[i],
256 (new_state & (1 << i)));
257 }
258 input_sync(keypad->input_dev);
259 keypad->direct_key_state = new_state;
260}
261
Eric Miao0e5f11a2008-01-31 00:56:46 -0500262static irqreturn_t pxa27x_keypad_irq_handler(int irq, void *dev_id)
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400263{
Eric Miao1814db62008-01-31 00:58:37 -0500264 struct pxa27x_keypad *keypad = dev_id;
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400265 unsigned long kpc = KPC;
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400266
Eric Miao62059d92008-01-31 00:59:03 -0500267 if (kpc & KPC_DI)
268 pxa27x_keypad_scan_direct(keypad);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400269
Eric Miao1814db62008-01-31 00:58:37 -0500270 if (kpc & KPC_MI)
271 pxa27x_keypad_scan_matrix(keypad);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400272
273 return IRQ_HANDLED;
274}
275
Eric Miaod7416f92008-01-31 00:58:52 -0500276static void pxa27x_keypad_config(struct pxa27x_keypad *keypad)
277{
278 struct pxa27x_keypad_platform_data *pdata = keypad->pdata;
Eric Miao62059d92008-01-31 00:59:03 -0500279 unsigned int mask = 0, direct_key_num = 0;
Eric Miaod7416f92008-01-31 00:58:52 -0500280 unsigned long kpc = 0;
281
282 /* enable matrix keys with automatic scan */
283 if (pdata->matrix_key_rows && pdata->matrix_key_cols) {
284 kpc |= KPC_ASACT | KPC_MIE | KPC_ME | KPC_MS_ALL;
285 kpc |= KPC_MKRN(pdata->matrix_key_rows) |
286 KPC_MKCN(pdata->matrix_key_cols);
287 }
288
Eric Miao62059d92008-01-31 00:59:03 -0500289 /* enable rotary key, debounce interval same as direct keys */
290 if (pdata->enable_rotary0) {
291 mask |= 0x03;
292 direct_key_num = 2;
293 kpc |= KPC_REE0;
294 }
Eric Miaod7416f92008-01-31 00:58:52 -0500295
Eric Miao62059d92008-01-31 00:59:03 -0500296 if (pdata->enable_rotary1) {
297 mask |= 0x0c;
298 direct_key_num = 4;
299 kpc |= KPC_REE1;
300 }
301
302 if (pdata->direct_key_num > direct_key_num)
303 direct_key_num = pdata->direct_key_num;
304
305 keypad->direct_key_mask = ((2 << direct_key_num) - 1) & ~mask;
306
307 /* enable direct key */
308 if (direct_key_num)
309 kpc |= KPC_DE | KPC_DIE | KPC_DKN(direct_key_num);
310
311 KPC = kpc | KPC_RE_ZERO_DEB;
Eric Miaod7416f92008-01-31 00:58:52 -0500312 KPREC = DEFAULT_KPREC;
313}
314
Eric Miao0e5f11a2008-01-31 00:56:46 -0500315static int pxa27x_keypad_open(struct input_dev *dev)
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400316{
Eric Miao1814db62008-01-31 00:58:37 -0500317 struct pxa27x_keypad *keypad = input_get_drvdata(dev);
318
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400319 /* Enable unit clock */
Eric Miao1814db62008-01-31 00:58:37 -0500320 clk_enable(keypad->clk);
Eric Miaod7416f92008-01-31 00:58:52 -0500321 pxa27x_keypad_config(keypad);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400322
323 return 0;
324}
325
Eric Miao0e5f11a2008-01-31 00:56:46 -0500326static void pxa27x_keypad_close(struct input_dev *dev)
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400327{
Eric Miao1814db62008-01-31 00:58:37 -0500328 struct pxa27x_keypad *keypad = input_get_drvdata(dev);
329
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400330 /* Disable clock unit */
Eric Miao1814db62008-01-31 00:58:37 -0500331 clk_disable(keypad->clk);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400332}
333
334#ifdef CONFIG_PM
Eric Miao0e5f11a2008-01-31 00:56:46 -0500335static int pxa27x_keypad_suspend(struct platform_device *pdev, pm_message_t state)
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400336{
Eric Miao1814db62008-01-31 00:58:37 -0500337 struct pxa27x_keypad *keypad = platform_get_drvdata(pdev);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400338
Eric Miaod7416f92008-01-31 00:58:52 -0500339 clk_disable(keypad->clk);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400340 return 0;
341}
342
Eric Miao0e5f11a2008-01-31 00:56:46 -0500343static int pxa27x_keypad_resume(struct platform_device *pdev)
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400344{
Eric Miao1814db62008-01-31 00:58:37 -0500345 struct pxa27x_keypad *keypad = platform_get_drvdata(pdev);
Eric Miao1814db62008-01-31 00:58:37 -0500346 struct input_dev *input_dev = keypad->input_dev;
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400347
348 mutex_lock(&input_dev->mutex);
349
350 if (input_dev->users) {
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400351 /* Enable unit clock */
Eric Miao1814db62008-01-31 00:58:37 -0500352 clk_enable(keypad->clk);
Eric Miaod7416f92008-01-31 00:58:52 -0500353 pxa27x_keypad_config(keypad);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400354 }
355
356 mutex_unlock(&input_dev->mutex);
357
358 return 0;
359}
360#else
Eric Miao0e5f11a2008-01-31 00:56:46 -0500361#define pxa27x_keypad_suspend NULL
362#define pxa27x_keypad_resume NULL
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400363#endif
364
Eric Miao0e5f11a2008-01-31 00:56:46 -0500365static int __devinit pxa27x_keypad_probe(struct platform_device *pdev)
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400366{
Eric Miao1814db62008-01-31 00:58:37 -0500367 struct pxa27x_keypad *keypad;
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400368 struct input_dev *input_dev;
Eric Miaod7416f92008-01-31 00:58:52 -0500369 int error;
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400370
Eric Miao1814db62008-01-31 00:58:37 -0500371 keypad = kzalloc(sizeof(struct pxa27x_keypad), GFP_KERNEL);
372 if (keypad == NULL) {
373 dev_err(&pdev->dev, "failed to allocate driver data\n");
374 return -ENOMEM;
375 }
376
377 keypad->pdata = pdev->dev.platform_data;
378 if (keypad->pdata == NULL) {
379 dev_err(&pdev->dev, "no platform data defined\n");
380 error = -EINVAL;
381 goto failed_free;
382 }
383
384 keypad->clk = clk_get(&pdev->dev, "KBDCLK");
385 if (IS_ERR(keypad->clk)) {
386 dev_err(&pdev->dev, "failed to get keypad clock\n");
387 error = PTR_ERR(keypad->clk);
388 goto failed_free;
Russell King22d8a732007-08-20 10:19:39 +0100389 }
390
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400391 /* Create and register the input driver. */
392 input_dev = input_allocate_device();
393 if (!input_dev) {
Eric Miao1814db62008-01-31 00:58:37 -0500394 dev_err(&pdev->dev, "failed to allocate input device\n");
Russell King22d8a732007-08-20 10:19:39 +0100395 error = -ENOMEM;
Eric Miao1814db62008-01-31 00:58:37 -0500396 goto failed_put_clk;
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400397 }
398
399 input_dev->name = DRIVER_NAME;
400 input_dev->id.bustype = BUS_HOST;
Eric Miao0e5f11a2008-01-31 00:56:46 -0500401 input_dev->open = pxa27x_keypad_open;
402 input_dev->close = pxa27x_keypad_close;
Dmitry Torokhov469ba4d2007-04-12 01:34:58 -0400403 input_dev->dev.parent = &pdev->dev;
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400404
Eric Miao1814db62008-01-31 00:58:37 -0500405 keypad->input_dev = input_dev;
406 input_set_drvdata(input_dev, keypad);
407
Jiri Slaby7b19ada2007-10-18 23:40:32 -0700408 input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
409 BIT_MASK(EV_REL);
Eric Miao1814db62008-01-31 00:58:37 -0500410
411 pxa27x_keypad_build_keycode(keypad);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400412
Eric Miao0e5f11a2008-01-31 00:56:46 -0500413 error = request_irq(IRQ_KEYPAD, pxa27x_keypad_irq_handler, IRQF_DISABLED,
Eric Miao1814db62008-01-31 00:58:37 -0500414 DRIVER_NAME, keypad);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400415 if (error) {
416 printk(KERN_ERR "Cannot request keypad IRQ\n");
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400417 goto err_free_dev;
418 }
419
Eric Miao1814db62008-01-31 00:58:37 -0500420 platform_set_drvdata(pdev, keypad);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400421
422 /* Register the input device */
423 error = input_register_device(input_dev);
424 if (error)
425 goto err_free_irq;
426
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400427 return 0;
428
429 err_free_irq:
430 platform_set_drvdata(pdev, NULL);
431 free_irq(IRQ_KEYPAD, pdev);
432 err_free_dev:
433 input_free_device(input_dev);
Eric Miao1814db62008-01-31 00:58:37 -0500434failed_put_clk:
435 clk_put(keypad->clk);
436failed_free:
437 kfree(keypad);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400438 return error;
439}
440
Eric Miao0e5f11a2008-01-31 00:56:46 -0500441static int __devexit pxa27x_keypad_remove(struct platform_device *pdev)
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400442{
Eric Miao1814db62008-01-31 00:58:37 -0500443 struct pxa27x_keypad *keypad = platform_get_drvdata(pdev);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400444
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400445 free_irq(IRQ_KEYPAD, pdev);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400446
Eric Miao1814db62008-01-31 00:58:37 -0500447 clk_disable(keypad->clk);
448 clk_put(keypad->clk);
449
450 input_unregister_device(keypad->input_dev);
451
452 platform_set_drvdata(pdev, NULL);
453 kfree(keypad);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400454 return 0;
455}
456
Eric Miao0e5f11a2008-01-31 00:56:46 -0500457static struct platform_driver pxa27x_keypad_driver = {
458 .probe = pxa27x_keypad_probe,
459 .remove = __devexit_p(pxa27x_keypad_remove),
460 .suspend = pxa27x_keypad_suspend,
461 .resume = pxa27x_keypad_resume,
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400462 .driver = {
463 .name = DRIVER_NAME,
464 },
465};
466
Eric Miao0e5f11a2008-01-31 00:56:46 -0500467static int __init pxa27x_keypad_init(void)
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400468{
Eric Miao0e5f11a2008-01-31 00:56:46 -0500469 return platform_driver_register(&pxa27x_keypad_driver);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400470}
471
Eric Miao0e5f11a2008-01-31 00:56:46 -0500472static void __exit pxa27x_keypad_exit(void)
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400473{
Eric Miao0e5f11a2008-01-31 00:56:46 -0500474 platform_driver_unregister(&pxa27x_keypad_driver);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400475}
476
Eric Miao0e5f11a2008-01-31 00:56:46 -0500477module_init(pxa27x_keypad_init);
478module_exit(pxa27x_keypad_exit);
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400479
Eric Miao0e5f11a2008-01-31 00:56:46 -0500480MODULE_DESCRIPTION("PXA27x Keypad Controller Driver");
Rodolfo Giometti5a90e5b2007-03-16 00:58:52 -0400481MODULE_LICENSE("GPL");