diff options
Diffstat (limited to 'arch/arm/mach-pxa/tosa.c')
-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 | ||