diff options
Diffstat (limited to 'arch/arm/mach-sa1100')
-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 | ||