From 8df76c8a39882030f1e1578540c5388b77da28d8 Mon Sep 17 00:00:00 2001 From: Dmitry Artamonow Date: Fri, 27 Nov 2009 12:13:01 +0100 Subject: [PATCH] --- yaml --- r: 172647 b: refs/heads/master c: c463eb62ac5bd8c26578cae42e1d5bb397aed100 h: refs/heads/master i: 172645: 997ad23d32487959bce8d40c950aab0cdc94a62c 172643: f889854229790ce6cf56ff9b9268642809f14377 172639: adde30c38c1e77b2fbbc41d01150c1bc06468f67 v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-sa1100/h3xxx.c | 39 +++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 10809087c624..637ad294a997 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4aa9755580650c7135c154bd4276411739e8fb60 +refs/heads/master: c463eb62ac5bd8c26578cae42e1d5bb397aed100 diff --git a/trunk/arch/arm/mach-sa1100/h3xxx.c b/trunk/arch/arm/mach-sa1100/h3xxx.c index c054c6494693..a7a1982d8411 100644 --- a/trunk/arch/arm/mach-sa1100/h3xxx.c +++ b/trunk/arch/arm/mach-sa1100/h3xxx.c @@ -12,6 +12,8 @@ #include #include +#include +#include #include #include #include @@ -212,8 +214,44 @@ static struct platform_device h3xxx_egpio = { }, }; +/* + * GPIO keys + */ + +static struct gpio_keys_button h3xxx_button_table[] = { + { + .code = KEY_POWER, + .gpio = H3XXX_GPIO_PWR_BUTTON, + .desc = "Power Button", + .active_low = 1, + .type = EV_KEY, + .wakeup = 1, + }, { + .code = KEY_ENTER, + .gpio = H3XXX_GPIO_ACTION_BUTTON, + .active_low = 1, + .desc = "Action button", + .type = EV_KEY, + .wakeup = 0, + }, +}; + +static struct gpio_keys_platform_data h3xxx_keys_data = { + .buttons = h3xxx_button_table, + .nbuttons = ARRAY_SIZE(h3xxx_button_table), +}; + +static struct platform_device h3xxx_keys = { + .name = "gpio-keys", + .id = -1, + .dev = { + .platform_data = &h3xxx_keys_data, + }, +}; + static struct platform_device *h3xxx_devices[] = { &h3xxx_egpio, + &h3xxx_keys, }; void __init h3xxx_mach_init(void) @@ -260,7 +298,6 @@ void __init h3xxx_map_io(void) /* Configure suspend conditions */ PGSR = 0; - PWER = PWER_GPIO0; PCFR = PCFR_OPDE; PSDR = 0;