diff options
Diffstat (limited to 'arch/arm/mach-pxa/spitz.c')
-rw-r--r-- | arch/arm/mach-pxa/spitz.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index ee8d6038ce82..82ff5733e4dc 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
18 | #include <linux/gpio_keys.h> | ||
18 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
19 | #include <linux/leds.h> | 20 | #include <linux/leds.h> |
20 | #include <linux/mtd/physmap.h> | 21 | #include <linux/mtd/physmap.h> |
@@ -375,6 +376,43 @@ static struct platform_device spitzkbd_device = { | |||
375 | }; | 376 | }; |
376 | 377 | ||
377 | 378 | ||
379 | static struct gpio_keys_button spitz_gpio_keys[] = { | ||
380 | { | ||
381 | .type = EV_PWR, | ||
382 | .code = KEY_SUSPEND, | ||
383 | .gpio = SPITZ_GPIO_ON_KEY, | ||
384 | .desc = "On/Off", | ||
385 | .wakeup = 1, | ||
386 | }, | ||
387 | /* Two buttons detecting the lid state */ | ||
388 | { | ||
389 | .type = EV_SW, | ||
390 | .code = 0, | ||
391 | .gpio = SPITZ_GPIO_SWA, | ||
392 | .desc = "Display Down", | ||
393 | }, | ||
394 | { | ||
395 | .type = EV_SW, | ||
396 | .code = 1, | ||
397 | .gpio = SPITZ_GPIO_SWB, | ||
398 | .desc = "Lid Closed", | ||
399 | }, | ||
400 | }; | ||
401 | |||
402 | static struct gpio_keys_platform_data spitz_gpio_keys_platform_data = { | ||
403 | .buttons = spitz_gpio_keys, | ||
404 | .nbuttons = ARRAY_SIZE(spitz_gpio_keys), | ||
405 | }; | ||
406 | |||
407 | static struct platform_device spitz_gpio_keys_device = { | ||
408 | .name = "gpio-keys", | ||
409 | .id = -1, | ||
410 | .dev = { | ||
411 | .platform_data = &spitz_gpio_keys_platform_data, | ||
412 | }, | ||
413 | }; | ||
414 | |||
415 | |||
378 | /* | 416 | /* |
379 | * Spitz LEDs | 417 | * Spitz LEDs |
380 | */ | 418 | */ |
@@ -689,6 +727,7 @@ static struct platform_device sharpsl_rom_device = { | |||
689 | static struct platform_device *devices[] __initdata = { | 727 | static struct platform_device *devices[] __initdata = { |
690 | &spitzscoop_device, | 728 | &spitzscoop_device, |
691 | &spitzkbd_device, | 729 | &spitzkbd_device, |
730 | &spitz_gpio_keys_device, | ||
692 | &spitzled_device, | 731 | &spitzled_device, |
693 | &sharpsl_nand_device, | 732 | &sharpsl_nand_device, |
694 | &sharpsl_rom_device, | 733 | &sharpsl_rom_device, |