diff options
author | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2008-01-21 01:04:20 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-01-21 01:11:07 -0500 |
commit | 93e9012f40f75b8ab8a37deaf532b3c5e9b527c6 (patch) | |
tree | de4ebf8b33dca1e3466af829fb72bee9fad759a1 /arch/arm/mach-pxa | |
parent | 52fe0cdb090a344cad9d95461ad06239e0c28712 (diff) |
Input: add Tosa keyboard driver
Add keyboard support on tosa (Sharp Zaurus SL-6000x).
Largely based on patches by Dirk Opfer.
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r-- | arch/arm/mach-pxa/tosa.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 240fd042083d..e7e0f52d6083 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c | |||
@@ -21,6 +21,8 @@ | |||
21 | #include <linux/mmc/host.h> | 21 | #include <linux/mmc/host.h> |
22 | #include <linux/pm.h> | 22 | #include <linux/pm.h> |
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/gpio_keys.h> | ||
25 | #include <linux/input.h> | ||
24 | 26 | ||
25 | #include <asm/setup.h> | 27 | #include <asm/setup.h> |
26 | #include <asm/memory.h> | 28 | #include <asm/memory.h> |
@@ -253,6 +255,46 @@ static struct platform_device tosakbd_device = { | |||
253 | .id = -1, | 255 | .id = -1, |
254 | }; | 256 | }; |
255 | 257 | ||
258 | static struct gpio_keys_button tosa_gpio_keys[] = { | ||
259 | { | ||
260 | .type = EV_PWR, | ||
261 | .code = KEY_SUSPEND, | ||
262 | .gpio = TOSA_GPIO_ON_KEY, | ||
263 | .desc = "On key", | ||
264 | .wakeup = 1, | ||
265 | .active_low = 1, | ||
266 | }, | ||
267 | { | ||
268 | .type = EV_KEY, | ||
269 | .code = TOSA_KEY_RECORD, | ||
270 | .gpio = TOSA_GPIO_RECORD_BTN, | ||
271 | .desc = "Record Button", | ||
272 | .wakeup = 1, | ||
273 | .active_low = 1, | ||
274 | }, | ||
275 | { | ||
276 | .type = EV_KEY, | ||
277 | .code = TOSA_KEY_SYNC, | ||
278 | .gpio = TOSA_GPIO_SYNC, | ||
279 | .desc = "Sync Button", | ||
280 | .wakeup = 1, | ||
281 | .active_low = 1, | ||
282 | }, | ||
283 | }; | ||
284 | |||
285 | static struct gpio_keys_platform_data tosa_gpio_keys_platform_data = { | ||
286 | .buttons = tosa_gpio_keys, | ||
287 | .nbuttons = ARRAY_SIZE(tosa_gpio_keys), | ||
288 | }; | ||
289 | |||
290 | static struct platform_device tosa_gpio_keys_device = { | ||
291 | .name = "gpio-keys", | ||
292 | .id = -1, | ||
293 | .dev = { | ||
294 | .platform_data = &tosa_gpio_keys_platform_data, | ||
295 | }, | ||
296 | }; | ||
297 | |||
256 | /* | 298 | /* |
257 | * Tosa LEDs | 299 | * Tosa LEDs |
258 | */ | 300 | */ |
@@ -265,6 +307,7 @@ static struct platform_device *devices[] __initdata = { | |||
265 | &tosascoop_device, | 307 | &tosascoop_device, |
266 | &tosascoop_jc_device, | 308 | &tosascoop_jc_device, |
267 | &tosakbd_device, | 309 | &tosakbd_device, |
310 | &tosa_gpio_keys_device, | ||
268 | &tosaled_device, | 311 | &tosaled_device, |
269 | }; | 312 | }; |
270 | 313 | ||