diff options
author | Dmitry Artamonow <mad_soft@inbox.ru> | 2009-11-27 06:13:01 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-12-06 11:52:57 -0500 |
commit | c463eb62ac5bd8c26578cae42e1d5bb397aed100 (patch) | |
tree | 56de5c2c299d40a0d82e8845fd0d77cb454ac98d /arch/arm | |
parent | 4aa9755580650c7135c154bd4276411739e8fb60 (diff) |
ARM: 5823/1: SA1100: h3100/h3600: add support for gpio-keys
Add support for "Power" and "Action" (joystick center) buttons -
the only buttons on iPaq h3100/h3600 connected to GPIOs
(other buttons are controlled by microcontroller)
Also remove setting PWER for wakeup on Power button press -
gpio-keys driver will handle it.
Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-sa1100/h3xxx.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/arch/arm/mach-sa1100/h3xxx.c b/arch/arm/mach-sa1100/h3xxx.c index c054c6494693..a7a1982d8411 100644 --- a/arch/arm/mach-sa1100/h3xxx.c +++ b/arch/arm/mach-sa1100/h3xxx.c | |||
@@ -12,6 +12,8 @@ | |||
12 | 12 | ||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/gpio.h> | 14 | #include <linux/gpio.h> |
15 | #include <linux/gpio_keys.h> | ||
16 | #include <linux/input.h> | ||
15 | #include <linux/mfd/htc-egpio.h> | 17 | #include <linux/mfd/htc-egpio.h> |
16 | #include <linux/mtd/mtd.h> | 18 | #include <linux/mtd/mtd.h> |
17 | #include <linux/mtd/partitions.h> | 19 | #include <linux/mtd/partitions.h> |
@@ -212,8 +214,44 @@ static struct platform_device h3xxx_egpio = { | |||
212 | }, | 214 | }, |
213 | }; | 215 | }; |
214 | 216 | ||
217 | /* | ||
218 | * GPIO keys | ||
219 | */ | ||
220 | |||
221 | static struct gpio_keys_button h3xxx_button_table[] = { | ||
222 | { | ||
223 | .code = KEY_POWER, | ||
224 | .gpio = H3XXX_GPIO_PWR_BUTTON, | ||
225 | .desc = "Power Button", | ||
226 | .active_low = 1, | ||
227 | .type = EV_KEY, | ||
228 | .wakeup = 1, | ||
229 | }, { | ||
230 | .code = KEY_ENTER, | ||
231 | .gpio = H3XXX_GPIO_ACTION_BUTTON, | ||
232 | .active_low = 1, | ||
233 | .desc = "Action button", | ||
234 | .type = EV_KEY, | ||
235 | .wakeup = 0, | ||
236 | }, | ||
237 | }; | ||
238 | |||
239 | static struct gpio_keys_platform_data h3xxx_keys_data = { | ||
240 | .buttons = h3xxx_button_table, | ||
241 | .nbuttons = ARRAY_SIZE(h3xxx_button_table), | ||
242 | }; | ||
243 | |||
244 | static struct platform_device h3xxx_keys = { | ||
245 | .name = "gpio-keys", | ||
246 | .id = -1, | ||
247 | .dev = { | ||
248 | .platform_data = &h3xxx_keys_data, | ||
249 | }, | ||
250 | }; | ||
251 | |||
215 | static struct platform_device *h3xxx_devices[] = { | 252 | static struct platform_device *h3xxx_devices[] = { |
216 | &h3xxx_egpio, | 253 | &h3xxx_egpio, |
254 | &h3xxx_keys, | ||
217 | }; | 255 | }; |
218 | 256 | ||
219 | void __init h3xxx_mach_init(void) | 257 | void __init h3xxx_mach_init(void) |
@@ -260,7 +298,6 @@ void __init h3xxx_map_io(void) | |||
260 | 298 | ||
261 | /* Configure suspend conditions */ | 299 | /* Configure suspend conditions */ |
262 | PGSR = 0; | 300 | PGSR = 0; |
263 | PWER = PWER_GPIO0; | ||
264 | PCFR = PCFR_OPDE; | 301 | PCFR = PCFR_OPDE; |
265 | PSDR = 0; | 302 | PSDR = 0; |
266 | 303 | ||