From a74f38c75b4473ead91e7f6e40a065d02756065e Mon Sep 17 00:00:00 2001 From: Stanislav Brabec Date: Fri, 16 Oct 2009 20:50:05 +0200 Subject: [PATCH] --- yaml --- r: 167811 b: refs/heads/master c: f6919eb41127db2e06342efcc2da1eeb4646ec34 h: refs/heads/master i: 167809: 0f64a17b4d98460d608c9233e858637413b00e1c 167807: b7a8ca3f91be3851aa6cdef372803ced7affa92d v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-pxa/spitz.c | 39 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index bbd8696f9c27..42287ee28a27 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0bff2fc319c2a3cb8969c71fdc2f941a15319b2c +refs/heads/master: f6919eb41127db2e06342efcc2da1eeb4646ec34 diff --git a/trunk/arch/arm/mach-pxa/spitz.c b/trunk/arch/arm/mach-pxa/spitz.c index ee8d6038ce82..82ff5733e4dc 100644 --- a/trunk/arch/arm/mach-pxa/spitz.c +++ b/trunk/arch/arm/mach-pxa/spitz.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -375,6 +376,43 @@ static struct platform_device spitzkbd_device = { }; +static struct gpio_keys_button spitz_gpio_keys[] = { + { + .type = EV_PWR, + .code = KEY_SUSPEND, + .gpio = SPITZ_GPIO_ON_KEY, + .desc = "On/Off", + .wakeup = 1, + }, + /* Two buttons detecting the lid state */ + { + .type = EV_SW, + .code = 0, + .gpio = SPITZ_GPIO_SWA, + .desc = "Display Down", + }, + { + .type = EV_SW, + .code = 1, + .gpio = SPITZ_GPIO_SWB, + .desc = "Lid Closed", + }, +}; + +static struct gpio_keys_platform_data spitz_gpio_keys_platform_data = { + .buttons = spitz_gpio_keys, + .nbuttons = ARRAY_SIZE(spitz_gpio_keys), +}; + +static struct platform_device spitz_gpio_keys_device = { + .name = "gpio-keys", + .id = -1, + .dev = { + .platform_data = &spitz_gpio_keys_platform_data, + }, +}; + + /* * Spitz LEDs */ @@ -689,6 +727,7 @@ static struct platform_device sharpsl_rom_device = { static struct platform_device *devices[] __initdata = { &spitzscoop_device, &spitzkbd_device, + &spitz_gpio_keys_device, &spitzled_device, &sharpsl_nand_device, &sharpsl_rom_device,