diff options
author | eric miao <eric.miao@marvell.com> | 2008-03-10 22:06:38 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-19 06:29:05 -0400 |
commit | 450d28749c9bf2cc6d274695fe454bb53456428d (patch) | |
tree | 14bad60257b25880691d1143bd2a6c37a2e93c55 | |
parent | c0a596d6a138ea281bed4ff3018c07c45dd245a2 (diff) |
[ARM] pxa: use gpio_keys.c to support mainstone's wakeup switch of GPIO1
NOTE: currently don't know if the key code of KEY_SUSPEND is fit for
such usage.
Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-pxa/mainstone.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index 7fa5a3779e0d..bde60887dd12 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/mtd/mtd.h> | 24 | #include <linux/mtd/mtd.h> |
25 | #include <linux/mtd/partitions.h> | 25 | #include <linux/mtd/partitions.h> |
26 | #include <linux/backlight.h> | 26 | #include <linux/backlight.h> |
27 | #include <linux/input.h> | ||
28 | #include <linux/gpio_keys.h> | ||
27 | 29 | ||
28 | #include <asm/types.h> | 30 | #include <asm/types.h> |
29 | #include <asm/setup.h> | 31 | #include <asm/setup.h> |
@@ -500,11 +502,35 @@ static struct pxaficp_platform_data mainstone_ficp_platform_data = { | |||
500 | .transceiver_mode = mainstone_irda_transceiver_mode, | 502 | .transceiver_mode = mainstone_irda_transceiver_mode, |
501 | }; | 503 | }; |
502 | 504 | ||
505 | static struct gpio_keys_button gpio_keys_button[] = { | ||
506 | [0] = { | ||
507 | .desc = "wakeup", | ||
508 | .code = KEY_SUSPEND, | ||
509 | .type = EV_KEY, | ||
510 | .gpio = 1, | ||
511 | .wakeup = 1, | ||
512 | }, | ||
513 | }; | ||
514 | |||
515 | static struct gpio_keys_platform_data mainstone_gpio_keys = { | ||
516 | .buttons = gpio_keys_button, | ||
517 | .nbuttons = 1, | ||
518 | }; | ||
519 | |||
520 | static struct platform_device mst_gpio_keys_device = { | ||
521 | .name = "gpio-keys", | ||
522 | .id = -1, | ||
523 | .dev = { | ||
524 | .platform_data = &mainstone_gpio_keys, | ||
525 | }, | ||
526 | }; | ||
527 | |||
503 | static struct platform_device *platform_devices[] __initdata = { | 528 | static struct platform_device *platform_devices[] __initdata = { |
504 | &smc91x_device, | 529 | &smc91x_device, |
505 | &mst_audio_device, | 530 | &mst_audio_device, |
506 | &mst_flash_device[0], | 531 | &mst_flash_device[0], |
507 | &mst_flash_device[1], | 532 | &mst_flash_device[1], |
533 | &mst_gpio_keys_device, | ||
508 | }; | 534 | }; |
509 | 535 | ||
510 | static int mainstone_ohci_init(struct device *dev) | 536 | static int mainstone_ohci_init(struct device *dev) |