diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2014-01-09 07:31:48 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-01-11 10:34:32 -0500 |
commit | 162e68c08c916d0b701331a85291537fed2ad537 (patch) | |
tree | 5fa540de925df512e636cd3739742bcccb62cdfc /arch | |
parent | 15cc324aca0a78e5882228e7e2eedf57e732d8f5 (diff) |
ARM: 7935/1: sa1100: collie: add gpio-keys configuration
collie has several GPIO lines that act like keys - Sync/Wakeup button on
dock station is connected to GPIO line. Another one is connected to
on/off button. Add corresponding gpio-keys configuration.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-sa1100/collie.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c index 7fb96ebdc0fb..831a15824ec8 100644 --- a/arch/arm/mach-sa1100/collie.c +++ b/arch/arm/mach-sa1100/collie.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <linux/mtd/mtd.h> | 27 | #include <linux/mtd/mtd.h> |
28 | #include <linux/mtd/partitions.h> | 28 | #include <linux/mtd/partitions.h> |
29 | #include <linux/timer.h> | 29 | #include <linux/timer.h> |
30 | #include <linux/gpio_keys.h> | ||
31 | #include <linux/input.h> | ||
30 | #include <linux/gpio.h> | 32 | #include <linux/gpio.h> |
31 | #include <linux/pda_power.h> | 33 | #include <linux/pda_power.h> |
32 | 34 | ||
@@ -242,10 +244,43 @@ struct platform_device collie_locomo_device = { | |||
242 | .resource = locomo_resources, | 244 | .resource = locomo_resources, |
243 | }; | 245 | }; |
244 | 246 | ||
247 | static struct gpio_keys_button collie_gpio_keys[] = { | ||
248 | { | ||
249 | .type = EV_PWR, | ||
250 | .code = KEY_RESERVED, | ||
251 | .gpio = COLLIE_GPIO_ON_KEY, | ||
252 | .desc = "On key", | ||
253 | .wakeup = 1, | ||
254 | .active_low = 1, | ||
255 | }, | ||
256 | { | ||
257 | .type = EV_PWR, | ||
258 | .code = KEY_WAKEUP, | ||
259 | .gpio = COLLIE_GPIO_WAKEUP, | ||
260 | .desc = "Sync", | ||
261 | .wakeup = 1, | ||
262 | .active_low = 1, | ||
263 | }, | ||
264 | }; | ||
265 | |||
266 | static struct gpio_keys_platform_data collie_gpio_keys_data = { | ||
267 | .buttons = collie_gpio_keys, | ||
268 | .nbuttons = ARRAY_SIZE(collie_gpio_keys), | ||
269 | }; | ||
270 | |||
271 | static struct platform_device collie_gpio_keys_device = { | ||
272 | .name = "gpio-keys", | ||
273 | .id = -1, | ||
274 | .dev = { | ||
275 | .platform_data = &collie_gpio_keys_data, | ||
276 | }, | ||
277 | }; | ||
278 | |||
245 | static struct platform_device *devices[] __initdata = { | 279 | static struct platform_device *devices[] __initdata = { |
246 | &collie_locomo_device, | 280 | &collie_locomo_device, |
247 | &colliescoop_device, | 281 | &colliescoop_device, |
248 | &collie_power_device, | 282 | &collie_power_device, |
283 | &collie_gpio_keys_device, | ||
249 | }; | 284 | }; |
250 | 285 | ||
251 | static struct mtd_partition collie_partitions[] = { | 286 | static struct mtd_partition collie_partitions[] = { |