aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/aaed2000_kbd.c4
-rw-r--r--drivers/input/keyboard/bf54x-keys.c3
-rw-r--r--drivers/input/keyboard/corgikbd.c8
-rw-r--r--drivers/input/keyboard/gpio_keys.c4
-rw-r--r--drivers/input/keyboard/jornada720_kbd.c4
-rw-r--r--drivers/input/keyboard/maple_keyb.c173
-rw-r--r--drivers/input/keyboard/omap-keypad.c11
-rw-r--r--drivers/input/keyboard/pxa27x_keypad.c5
-rw-r--r--drivers/input/keyboard/spitzkbd.c8
-rw-r--r--drivers/input/keyboard/tosakbd.c4
10 files changed, 111 insertions, 113 deletions
diff --git a/drivers/input/keyboard/aaed2000_kbd.c b/drivers/input/keyboard/aaed2000_kbd.c
index 8a77bfcd05bc..18222a689a03 100644
--- a/drivers/input/keyboard/aaed2000_kbd.c
+++ b/drivers/input/keyboard/aaed2000_kbd.c
@@ -20,8 +20,8 @@
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22 22
23#include <asm/arch/hardware.h> 23#include <mach/hardware.h>
24#include <asm/arch/aaed2000.h> 24#include <mach/aaed2000.h>
25 25
26#define KB_ROWS 12 26#define KB_ROWS 12
27#define KB_COLS 8 27#define KB_COLS 8
diff --git a/drivers/input/keyboard/bf54x-keys.c b/drivers/input/keyboard/bf54x-keys.c
index f1d20817ef29..19284016e0f4 100644
--- a/drivers/input/keyboard/bf54x-keys.c
+++ b/drivers/input/keyboard/bf54x-keys.c
@@ -29,7 +29,6 @@
29 */ 29 */
30 30
31#include <linux/module.h> 31#include <linux/module.h>
32#include <linux/version.h>
33 32
34#include <linux/init.h> 33#include <linux/init.h>
35#include <linux/fs.h> 34#include <linux/fs.h>
@@ -44,7 +43,7 @@
44#include <linux/input.h> 43#include <linux/input.h>
45 44
46#include <asm/portmux.h> 45#include <asm/portmux.h>
47#include <asm/mach/bf54x_keys.h> 46#include <mach/bf54x_keys.h>
48 47
49#define DRV_NAME "bf54x-keys" 48#define DRV_NAME "bf54x-keys"
50#define TIME_SCALE 100 /* 100 ns */ 49#define TIME_SCALE 100 /* 100 ns */
diff --git a/drivers/input/keyboard/corgikbd.c b/drivers/input/keyboard/corgikbd.c
index 1aa46ae12630..134e67bf6a90 100644
--- a/drivers/input/keyboard/corgikbd.c
+++ b/drivers/input/keyboard/corgikbd.c
@@ -20,10 +20,10 @@
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22 22
23#include <asm/arch/corgi.h> 23#include <mach/corgi.h>
24#include <asm/arch/hardware.h> 24#include <mach/hardware.h>
25#include <asm/arch/pxa-regs.h> 25#include <mach/pxa-regs.h>
26#include <asm/arch/pxa2xx-gpio.h> 26#include <mach/pxa2xx-gpio.h>
27#include <asm/hardware/scoop.h> 27#include <asm/hardware/scoop.h>
28 28
29#define KB_ROWS 8 29#define KB_ROWS 8
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index fe22ca34d576..05f3f43582c2 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -9,7 +9,6 @@
9 */ 9 */
10 10
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/version.h>
13 12
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/fs.h> 14#include <linux/fs.h>
@@ -108,6 +107,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
108 unsigned int type = button->type ?: EV_KEY; 107 unsigned int type = button->type ?: EV_KEY;
109 108
110 bdata->input = input; 109 bdata->input = input;
110 bdata->button = button;
111 setup_timer(&bdata->timer, 111 setup_timer(&bdata->timer,
112 gpio_check_button, (unsigned long)bdata); 112 gpio_check_button, (unsigned long)bdata);
113 113
@@ -246,7 +246,7 @@ static int gpio_keys_resume(struct platform_device *pdev)
246#define gpio_keys_resume NULL 246#define gpio_keys_resume NULL
247#endif 247#endif
248 248
249struct platform_driver gpio_keys_device_driver = { 249static struct platform_driver gpio_keys_device_driver = {
250 .probe = gpio_keys_probe, 250 .probe = gpio_keys_probe,
251 .remove = __devexit_p(gpio_keys_remove), 251 .remove = __devexit_p(gpio_keys_remove),
252 .suspend = gpio_keys_suspend, 252 .suspend = gpio_keys_suspend,
diff --git a/drivers/input/keyboard/jornada720_kbd.c b/drivers/input/keyboard/jornada720_kbd.c
index ce650af6d649..4e016d823069 100644
--- a/drivers/input/keyboard/jornada720_kbd.c
+++ b/drivers/input/keyboard/jornada720_kbd.c
@@ -24,8 +24,8 @@
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26 26
27#include <asm/arch/jornada720.h> 27#include <mach/jornada720.h>
28#include <asm/hardware.h> 28#include <mach/hardware.h>
29 29
30MODULE_AUTHOR("Kristoffer Ericson <Kristoffer.Ericson@gmail.com>"); 30MODULE_AUTHOR("Kristoffer Ericson <Kristoffer.Ericson@gmail.com>");
31MODULE_DESCRIPTION("HP Jornada 710/720/728 keyboard driver"); 31MODULE_DESCRIPTION("HP Jornada 710/720/728 keyboard driver");
diff --git a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c
index 2b404284c28a..22f17a593be7 100644
--- a/drivers/input/keyboard/maple_keyb.c
+++ b/drivers/input/keyboard/maple_keyb.c
@@ -2,7 +2,7 @@
2 * SEGA Dreamcast keyboard driver 2 * SEGA Dreamcast keyboard driver
3 * Based on drivers/usb/usbkbd.c 3 * Based on drivers/usb/usbkbd.c
4 * Copyright YAEGASHI Takeshi, 2001 4 * Copyright YAEGASHI Takeshi, 2001
5 * Porting to 2.6 Copyright Adrian McMenamin, 2007 5 * Porting to 2.6 Copyright Adrian McMenamin, 2007, 2008
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -27,7 +27,6 @@
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/timer.h> 28#include <linux/timer.h>
29#include <linux/maple.h> 29#include <linux/maple.h>
30#include <asm/mach/maple.h>
31 30
32/* Very simple mutex to ensure proper cleanup */ 31/* Very simple mutex to ensure proper cleanup */
33static DEFINE_MUTEX(maple_keyb_mutex); 32static DEFINE_MUTEX(maple_keyb_mutex);
@@ -46,39 +45,51 @@ struct dc_kbd {
46}; 45};
47 46
48static const unsigned short dc_kbd_keycode[NR_SCANCODES] = { 47static const unsigned short dc_kbd_keycode[NR_SCANCODES] = {
49 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_A, KEY_B, KEY_C, KEY_D, 48 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_A, KEY_B,
50 KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, 49 KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L,
51 KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, 50 KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V,
52 KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_1, KEY_2, 51 KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6,
53 KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_0, 52 KEY_7, KEY_8, KEY_9, KEY_0, KEY_ENTER, KEY_ESC, KEY_BACKSPACE,
54 KEY_ENTER, KEY_ESC, KEY_BACKSPACE, KEY_TAB, KEY_SPACE, KEY_MINUS, KEY_EQUAL, KEY_LEFTBRACE, 53 KEY_TAB, KEY_SPACE, KEY_MINUS, KEY_EQUAL, KEY_LEFTBRACE,
55 KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_BACKSLASH, KEY_SEMICOLON, KEY_APOSTROPHE, KEY_GRAVE, KEY_COMMA, 54 KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_BACKSLASH, KEY_SEMICOLON,
56 KEY_DOT, KEY_SLASH, KEY_CAPSLOCK, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, 55 KEY_APOSTROPHE, KEY_GRAVE, KEY_COMMA, KEY_DOT, KEY_SLASH,
56 KEY_CAPSLOCK, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6,
57 KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12, KEY_SYSRQ, 57 KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12, KEY_SYSRQ,
58 KEY_SCROLLLOCK, KEY_PAUSE, KEY_INSERT, KEY_HOME, KEY_PAGEUP, KEY_DELETE, 58 KEY_SCROLLLOCK, KEY_PAUSE, KEY_INSERT, KEY_HOME, KEY_PAGEUP,
59 KEY_END, KEY_PAGEDOWN, KEY_RIGHT, KEY_LEFT, KEY_DOWN, KEY_UP, 59 KEY_DELETE, KEY_END, KEY_PAGEDOWN, KEY_RIGHT, KEY_LEFT, KEY_DOWN,
60 KEY_NUMLOCK, KEY_KPSLASH, KEY_KPASTERISK, KEY_KPMINUS, KEY_KPPLUS, KEY_KPENTER, KEY_KP1, KEY_KP2, 60 KEY_UP, KEY_NUMLOCK, KEY_KPSLASH, KEY_KPASTERISK, KEY_KPMINUS,
61 KEY_KP3, KEY_KP4, KEY_KP5, KEY_KP6, KEY_KP7, KEY_KP8, KEY_KP9, KEY_KP0, KEY_KPDOT, 61 KEY_KPPLUS, KEY_KPENTER, KEY_KP1, KEY_KP2, KEY_KP3, KEY_KP4, KEY_KP5,
62 KEY_102ND, KEY_COMPOSE, KEY_POWER, KEY_KPEQUAL, KEY_F13, KEY_F14, KEY_F15, 62 KEY_KP6, KEY_KP7, KEY_KP8, KEY_KP9, KEY_KP0, KEY_KPDOT, KEY_102ND,
63 KEY_F16, KEY_F17, KEY_F18, KEY_F19, KEY_F20, 63 KEY_COMPOSE, KEY_POWER, KEY_KPEQUAL, KEY_F13, KEY_F14, KEY_F15,
64 KEY_F21, KEY_F22, KEY_F23, KEY_F24, KEY_OPEN, KEY_HELP, KEY_PROPS, KEY_FRONT, 64 KEY_F16, KEY_F17, KEY_F18, KEY_F19, KEY_F20, KEY_F21, KEY_F22,
65 KEY_STOP, KEY_AGAIN, KEY_UNDO, KEY_CUT, KEY_COPY, KEY_PASTE, KEY_FIND, KEY_MUTE, 65 KEY_F23, KEY_F24, KEY_OPEN, KEY_HELP, KEY_PROPS, KEY_FRONT, KEY_STOP,
66 KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_KPCOMMA, KEY_RESERVED, KEY_RO, KEY_KATAKANAHIRAGANA , KEY_YEN, 66 KEY_AGAIN, KEY_UNDO, KEY_CUT, KEY_COPY, KEY_PASTE, KEY_FIND, KEY_MUTE,
67 KEY_HENKAN, KEY_MUHENKAN, KEY_KPJPCOMMA, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 67 KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
68 KEY_HANGEUL, KEY_HANJA, KEY_KATAKANA, KEY_HIRAGANA, KEY_ZENKAKUHANKAKU, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 68 KEY_KPCOMMA, KEY_RESERVED, KEY_RO, KEY_KATAKANAHIRAGANA , KEY_YEN,
69 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 69 KEY_HENKAN, KEY_MUHENKAN, KEY_KPJPCOMMA, KEY_RESERVED, KEY_RESERVED,
70 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 70 KEY_RESERVED, KEY_HANGEUL, KEY_HANJA, KEY_KATAKANA, KEY_HIRAGANA,
71 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 71 KEY_ZENKAKUHANKAKU, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
72 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 72 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
73 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 73 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
74 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 74 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
75 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 75 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
76 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 76 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
77 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 77 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
78 KEY_LEFTCTRL, KEY_LEFTSHIFT, KEY_LEFTALT, KEY_LEFTMETA, KEY_RIGHTCTRL, KEY_RIGHTSHIFT, KEY_RIGHTALT, KEY_RIGHTMETA, 78 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
79 KEY_PLAYPAUSE, KEY_STOPCD, KEY_PREVIOUSSONG, KEY_NEXTSONG, KEY_EJECTCD, KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_MUTE, 79 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
80 KEY_WWW, KEY_BACK, KEY_FORWARD, KEY_STOP, KEY_FIND, KEY_SCROLLUP, KEY_SCROLLDOWN, KEY_EDIT, KEY_SLEEP, 80 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
81 KEY_SCREENLOCK, KEY_REFRESH, KEY_CALC, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED 81 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
82 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
83 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
84 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
85 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
86 KEY_RESERVED, KEY_RESERVED, KEY_LEFTCTRL, KEY_LEFTSHIFT, KEY_LEFTALT,
87 KEY_LEFTMETA, KEY_RIGHTCTRL, KEY_RIGHTSHIFT, KEY_RIGHTALT,
88 KEY_RIGHTMETA, KEY_PLAYPAUSE, KEY_STOPCD, KEY_PREVIOUSSONG,
89 KEY_NEXTSONG, KEY_EJECTCD, KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_MUTE,
90 KEY_WWW, KEY_BACK, KEY_FORWARD, KEY_STOP, KEY_FIND, KEY_SCROLLUP,
91 KEY_SCROLLDOWN, KEY_EDIT, KEY_SLEEP, KEY_SCREENLOCK, KEY_REFRESH,
92 KEY_CALC, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED
82}; 93};
83 94
84static void dc_scan_kbd(struct dc_kbd *kbd) 95static void dc_scan_kbd(struct dc_kbd *kbd)
@@ -128,12 +139,12 @@ static void dc_scan_kbd(struct dc_kbd *kbd)
128static void dc_kbd_callback(struct mapleq *mq) 139static void dc_kbd_callback(struct mapleq *mq)
129{ 140{
130 struct maple_device *mapledev = mq->dev; 141 struct maple_device *mapledev = mq->dev;
131 struct dc_kbd *kbd = mapledev->private_data; 142 struct dc_kbd *kbd = maple_get_drvdata(mapledev);
132 unsigned long *buf = mq->recvbuf; 143 unsigned long *buf = mq->recvbuf;
133 144
134 /* 145 /*
135 * We should always be getting the lock because the only 146 * We should always get the lock because the only
136 * time it may be locked if driver is in cleanup phase. 147 * time it may be locked is if the driver is in the cleanup phase.
137 */ 148 */
138 if (likely(mutex_trylock(&maple_keyb_mutex))) { 149 if (likely(mutex_trylock(&maple_keyb_mutex))) {
139 150
@@ -146,106 +157,96 @@ static void dc_kbd_callback(struct mapleq *mq)
146 } 157 }
147} 158}
148 159
149static int dc_kbd_connect(struct maple_device *mdev) 160static int probe_maple_kbd(struct device *dev)
150{ 161{
162 struct maple_device *mdev = to_maple_dev(dev);
163 struct maple_driver *mdrv = to_maple_driver(dev->driver);
151 int i, error; 164 int i, error;
152 struct dc_kbd *kbd; 165 struct dc_kbd *kbd;
153 struct input_dev *dev; 166 struct input_dev *idev;
154 167
155 if (!(mdev->function & MAPLE_FUNC_KEYBOARD)) 168 if (!(mdev->function & MAPLE_FUNC_KEYBOARD))
156 return -EINVAL; 169 return -EINVAL;
157 170
158 kbd = kzalloc(sizeof(struct dc_kbd), GFP_KERNEL); 171 kbd = kzalloc(sizeof(struct dc_kbd), GFP_KERNEL);
159 dev = input_allocate_device(); 172 idev = input_allocate_device();
160 if (!kbd || !dev) { 173 if (!kbd || !idev) {
161 error = -ENOMEM; 174 error = -ENOMEM;
162 goto fail; 175 goto fail;
163 } 176 }
164 177
165 mdev->private_data = kbd; 178 kbd->dev = idev;
166
167 kbd->dev = dev;
168 memcpy(kbd->keycode, dc_kbd_keycode, sizeof(kbd->keycode)); 179 memcpy(kbd->keycode, dc_kbd_keycode, sizeof(kbd->keycode));
169 180
170 dev->name = mdev->product_name; 181 idev->name = mdev->product_name;
171 dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); 182 idev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
172 dev->keycode = kbd->keycode; 183 idev->keycode = kbd->keycode;
173 dev->keycodesize = sizeof (unsigned short); 184 idev->keycodesize = sizeof(unsigned short);
174 dev->keycodemax = ARRAY_SIZE(kbd->keycode); 185 idev->keycodemax = ARRAY_SIZE(kbd->keycode);
175 dev->id.bustype = BUS_HOST; 186 idev->id.bustype = BUS_HOST;
176 dev->dev.parent = &mdev->dev; 187 idev->dev.parent = &mdev->dev;
177 188
178 for (i = 0; i < NR_SCANCODES; i++) 189 for (i = 0; i < NR_SCANCODES; i++)
179 __set_bit(dc_kbd_keycode[i], dev->keybit); 190 __set_bit(dc_kbd_keycode[i], idev->keybit);
180 __clear_bit(KEY_RESERVED, dev->keybit); 191 __clear_bit(KEY_RESERVED, idev->keybit);
181 192
182 input_set_capability(dev, EV_MSC, MSC_SCAN); 193 input_set_capability(idev, EV_MSC, MSC_SCAN);
183 input_set_drvdata(dev, kbd); 194 input_set_drvdata(idev, kbd);
184 195
185 error = input_register_device(dev); 196 error = input_register_device(idev);
186 if (error) 197 if (error)
187 goto fail; 198 goto fail;
188 199
189 /* Maple polling is locked to VBLANK - which may be just 50/s */ 200 /* Maple polling is locked to VBLANK - which may be just 50/s */
190 maple_getcond_callback(mdev, dc_kbd_callback, HZ/50, MAPLE_FUNC_KEYBOARD); 201 maple_getcond_callback(mdev, dc_kbd_callback, HZ/50,
191 return 0; 202 MAPLE_FUNC_KEYBOARD);
192 203
193 fail: 204 mdev->driver = mdrv;
194 input_free_device(dev); 205
206 maple_set_drvdata(mdev, kbd);
207
208 return error;
209
210fail:
211 input_free_device(idev);
195 kfree(kbd); 212 kfree(kbd);
196 mdev->private_data = NULL; 213 maple_set_drvdata(mdev, NULL);
197 return error; 214 return error;
198} 215}
199 216
200static void dc_kbd_disconnect(struct maple_device *mdev) 217static int remove_maple_kbd(struct device *dev)
201{ 218{
202 struct dc_kbd *kbd; 219 struct maple_device *mdev = to_maple_dev(dev);
220 struct dc_kbd *kbd = maple_get_drvdata(mdev);
203 221
204 mutex_lock(&maple_keyb_mutex); 222 mutex_lock(&maple_keyb_mutex);
205 223
206 kbd = mdev->private_data;
207 mdev->private_data = NULL;
208 input_unregister_device(kbd->dev); 224 input_unregister_device(kbd->dev);
209 kfree(kbd); 225 kfree(kbd);
210 226
211 mutex_unlock(&maple_keyb_mutex); 227 maple_set_drvdata(mdev, NULL);
212}
213
214/* allow the keyboard to be used */
215static int probe_maple_kbd(struct device *dev)
216{
217 struct maple_device *mdev = to_maple_dev(dev);
218 struct maple_driver *mdrv = to_maple_driver(dev->driver);
219 int error;
220
221 error = dc_kbd_connect(mdev);
222 if (error)
223 return error;
224
225 mdev->driver = mdrv;
226 mdev->registered = 1;
227 228
229 mutex_unlock(&maple_keyb_mutex);
228 return 0; 230 return 0;
229} 231}
230 232
231static struct maple_driver dc_kbd_driver = { 233static struct maple_driver dc_kbd_driver = {
232 .function = MAPLE_FUNC_KEYBOARD, 234 .function = MAPLE_FUNC_KEYBOARD,
233 .connect = dc_kbd_connect,
234 .disconnect = dc_kbd_disconnect,
235 .drv = { 235 .drv = {
236 .name = "Dreamcast_keyboard", 236 .name = "Dreamcast_keyboard",
237 .probe = probe_maple_kbd, 237 .probe = probe_maple_kbd,
238 }, 238 .remove = remove_maple_kbd,
239 },
239}; 240};
240 241
241static int __init dc_kbd_init(void) 242static int __init dc_kbd_init(void)
242{ 243{
243 return maple_driver_register(&dc_kbd_driver.drv); 244 return maple_driver_register(&dc_kbd_driver);
244} 245}
245 246
246static void __exit dc_kbd_exit(void) 247static void __exit dc_kbd_exit(void)
247{ 248{
248 driver_unregister(&dc_kbd_driver.drv); 249 maple_driver_unregister(&dc_kbd_driver);
249} 250}
250 251
251module_init(dc_kbd_init); 252module_init(dc_kbd_init);
diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c
index 10afd2068068..dcea87a0bc56 100644
--- a/drivers/input/keyboard/omap-keypad.c
+++ b/drivers/input/keyboard/omap-keypad.c
@@ -34,14 +34,13 @@
34#include <linux/platform_device.h> 34#include <linux/platform_device.h>
35#include <linux/mutex.h> 35#include <linux/mutex.h>
36#include <linux/errno.h> 36#include <linux/errno.h>
37#include <asm/arch/gpio.h> 37#include <mach/gpio.h>
38#include <asm/arch/keypad.h> 38#include <mach/keypad.h>
39#include <asm/arch/menelaus.h> 39#include <mach/menelaus.h>
40#include <asm/irq.h> 40#include <asm/irq.h>
41#include <asm/hardware.h> 41#include <mach/hardware.h>
42#include <asm/io.h> 42#include <asm/io.h>
43#include <asm/mach-types.h> 43#include <mach/mux.h>
44#include <asm/arch/mux.h>
45 44
46#undef NEW_BOARD_LEARNING_MODE 45#undef NEW_BOARD_LEARNING_MODE
47 46
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index 6f1516f50750..6d30c6d334c3 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -26,12 +26,11 @@
26#include <linux/clk.h> 26#include <linux/clk.h>
27#include <linux/err.h> 27#include <linux/err.h>
28 28
29#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
31#include <asm/mach/map.h> 30#include <asm/mach/map.h>
32 31
33#include <asm/arch/hardware.h> 32#include <mach/hardware.h>
34#include <asm/arch/pxa27x_keypad.h> 33#include <mach/pxa27x_keypad.h>
35 34
36/* 35/*
37 * Keypad Controller registers 36 * Keypad Controller registers
diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c
index 1aa37181c40f..de67b8e0a799 100644
--- a/drivers/input/keyboard/spitzkbd.c
+++ b/drivers/input/keyboard/spitzkbd.c
@@ -20,10 +20,10 @@
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22 22
23#include <asm/arch/spitz.h> 23#include <mach/spitz.h>
24#include <asm/arch/hardware.h> 24#include <mach/hardware.h>
25#include <asm/arch/pxa-regs.h> 25#include <mach/pxa-regs.h>
26#include <asm/arch/pxa2xx-gpio.h> 26#include <mach/pxa2xx-gpio.h>
27 27
28#define KB_ROWS 7 28#define KB_ROWS 7
29#define KB_COLS 11 29#define KB_COLS 11
diff --git a/drivers/input/keyboard/tosakbd.c b/drivers/input/keyboard/tosakbd.c
index b12b7ee4b6aa..44cb50af3ce9 100644
--- a/drivers/input/keyboard/tosakbd.c
+++ b/drivers/input/keyboard/tosakbd.c
@@ -19,8 +19,8 @@
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21 21
22#include <asm/arch/gpio.h> 22#include <mach/gpio.h>
23#include <asm/arch/tosa.h> 23#include <mach/tosa.h>
24 24
25#define KB_ROWMASK(r) (1 << (r)) 25#define KB_ROWMASK(r) (1 << (r))
26#define SCANCODE(r, c) (((r)<<4) + (c) + 1) 26#define SCANCODE(r, c) (((r)<<4) + (c) + 1)