diff options
author | Alberto Panizzo <maramaopercheseimorto@gmail.com> | 2009-10-15 13:24:51 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-11-14 04:29:12 -0500 |
commit | e33c049cb540602a2554264652e2c717ab7f5ec3 (patch) | |
tree | e5c7136cd4baab9f3d964fb7829306b1d1a7b8c5 /arch/arm/mach-mx3 | |
parent | 115b40c3d7d18d0cb48b4ba306807cc04f259316 (diff) |
Armadillo500 Add support for onboard GPIO Buttons.
There are two low active Buttons on boards.
This patch connect those to the Input Subsystem over gpio-keys driver.
Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3')
-rw-r--r-- | arch/arm/mach-mx3/armadillo5x0.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/armadillo5x0.c b/arch/arm/mach-mx3/armadillo5x0.c index 776c0ee1b3cd..309fa7abc099 100644 --- a/arch/arm/mach-mx3/armadillo5x0.c +++ b/arch/arm/mach-mx3/armadillo5x0.c | |||
@@ -33,6 +33,8 @@ | |||
33 | #include <linux/irq.h> | 33 | #include <linux/irq.h> |
34 | #include <linux/mtd/physmap.h> | 34 | #include <linux/mtd/physmap.h> |
35 | #include <linux/io.h> | 35 | #include <linux/io.h> |
36 | #include <linux/input.h> | ||
37 | #include <linux/gpio_keys.h> | ||
36 | 38 | ||
37 | #include <mach/hardware.h> | 39 | #include <mach/hardware.h> |
38 | #include <asm/mach-types.h> | 40 | #include <asm/mach-types.h> |
@@ -98,6 +100,36 @@ static int armadillo5x0_pins[] = { | |||
98 | MX31_PIN_DRDY0__DRDY0, | 100 | MX31_PIN_DRDY0__DRDY0, |
99 | IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/ | 101 | IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/ |
100 | }; | 102 | }; |
103 | /* GPIO BUTTONS */ | ||
104 | static struct gpio_keys_button armadillo5x0_buttons[] = { | ||
105 | { | ||
106 | .code = KEY_ENTER, /*28*/ | ||
107 | .gpio = IOMUX_TO_GPIO(MX31_PIN_SCLK0), | ||
108 | .active_low = 1, | ||
109 | .desc = "menu", | ||
110 | .wakeup = 1, | ||
111 | }, { | ||
112 | .code = KEY_BACK, /*158*/ | ||
113 | .gpio = IOMUX_TO_GPIO(MX31_PIN_SRST0), | ||
114 | .active_low = 1, | ||
115 | .desc = "back", | ||
116 | .wakeup = 1, | ||
117 | } | ||
118 | }; | ||
119 | |||
120 | static struct gpio_keys_platform_data armadillo5x0_button_data = { | ||
121 | .buttons = armadillo5x0_buttons, | ||
122 | .nbuttons = ARRAY_SIZE(armadillo5x0_buttons), | ||
123 | }; | ||
124 | |||
125 | static struct platform_device armadillo5x0_button_device = { | ||
126 | .name = "gpio-keys", | ||
127 | .id = -1, | ||
128 | .num_resources = 0, | ||
129 | .dev = { | ||
130 | .platform_data = &armadillo5x0_button_data, | ||
131 | } | ||
132 | }; | ||
101 | 133 | ||
102 | /* | 134 | /* |
103 | * NAND Flash | 135 | * NAND Flash |
@@ -300,6 +332,7 @@ static struct imxuart_platform_data uart_pdata = { | |||
300 | 332 | ||
301 | static struct platform_device *devices[] __initdata = { | 333 | static struct platform_device *devices[] __initdata = { |
302 | &armadillo5x0_smc911x_device, | 334 | &armadillo5x0_smc911x_device, |
335 | &armadillo5x0_button_device, | ||
303 | }; | 336 | }; |
304 | 337 | ||
305 | /* | 338 | /* |