diff options
author | eric miao <eric.miao@marvell.com> | 2008-03-11 03:06:38 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-19 12:29:05 +0200 |
commit | 450d28749c9bf2cc6d274695fe454bb53456428d (patch) | |
tree | 14bad60257b25880691d1143bd2a6c37a2e93c55 /arch/arm/mach-pxa | |
parent | [ARM] pxa: allow dynamic enable/disable of GPIO wakeup for pxa{25x,27x} (diff) | |
download | linux-450d28749c9bf2cc6d274695fe454bb53456428d.tar.xz linux-450d28749c9bf2cc6d274695fe454bb53456428d.zip |
[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>
Diffstat (limited to 'arch/arm/mach-pxa')
-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 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> #include <linux/backlight.h> +#include <linux/input.h> +#include <linux/gpio_keys.h> #include <asm/types.h> #include <asm/setup.h> @@ -500,11 +502,35 @@ static struct pxaficp_platform_data mainstone_ficp_platform_data = { .transceiver_mode = mainstone_irda_transceiver_mode, }; +static struct gpio_keys_button gpio_keys_button[] = { + [0] = { + .desc = "wakeup", + .code = KEY_SUSPEND, + .type = EV_KEY, + .gpio = 1, + .wakeup = 1, + }, +}; + +static struct gpio_keys_platform_data mainstone_gpio_keys = { + .buttons = gpio_keys_button, + .nbuttons = 1, +}; + +static struct platform_device mst_gpio_keys_device = { + .name = "gpio-keys", + .id = -1, + .dev = { + .platform_data = &mainstone_gpio_keys, + }, +}; + static struct platform_device *platform_devices[] __initdata = { &smc91x_device, &mst_audio_device, &mst_flash_device[0], &mst_flash_device[1], + &mst_gpio_keys_device, }; static int mainstone_ohci_init(struct device *dev) |