aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx5
diff options
context:
space:
mode:
authorDaiane Angolini <daiane.angolini@freescale.com>2011-06-30 13:41:46 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2011-07-07 04:01:14 -0400
commit2a90a69f652edb410f7936d0271bfa8566ef6a87 (patch)
tree8e0a0a337075d58e0ab2384eccaef6464e18a6cd /arch/arm/mach-mx5
parentd23cb578cc7c520d17c6a995e78a7a05cb0abe72 (diff)
ARM: mach-mx5/mx53_ard: Add gpio_keys support
Signed-off-by: Daiane Angolini <daiane.angolini@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx5')
-rw-r--r--arch/arm/mach-mx5/Kconfig1
-rw-r--r--arch/arm/mach-mx5/board-mx53_ard.c35
2 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
index 6a47d4c9dd17..b4e7c58bbb38 100644
--- a/arch/arm/mach-mx5/Kconfig
+++ b/arch/arm/mach-mx5/Kconfig
@@ -216,6 +216,7 @@ config MACH_MX53_ARD
216 select IMX_HAVE_PLATFORM_IMX_I2C 216 select IMX_HAVE_PLATFORM_IMX_I2C
217 select IMX_HAVE_PLATFORM_IMX_UART 217 select IMX_HAVE_PLATFORM_IMX_UART
218 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 218 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
219 select IMX_HAVE_PLATFORM_GPIO_KEYS
219 help 220 help
220 Include support for MX53 ARD platform. This includes specific 221 Include support for MX53 ARD platform. This includes specific
221 configurations for the board and its peripherals. 222 configurations for the board and its peripherals.
diff --git a/arch/arm/mach-mx5/board-mx53_ard.c b/arch/arm/mach-mx5/board-mx53_ard.c
index 280cefc1a986..76a67c4a2a0b 100644
--- a/arch/arm/mach-mx5/board-mx53_ard.c
+++ b/arch/arm/mach-mx5/board-mx53_ard.c
@@ -39,6 +39,11 @@
39#define ARD_SD1_CD IMX_GPIO_NR(1, 1) 39#define ARD_SD1_CD IMX_GPIO_NR(1, 1)
40#define ARD_SD1_WP IMX_GPIO_NR(1, 9) 40#define ARD_SD1_WP IMX_GPIO_NR(1, 9)
41#define ARD_I2CPORTEXP_B IMX_GPIO_NR(2, 3) 41#define ARD_I2CPORTEXP_B IMX_GPIO_NR(2, 3)
42#define ARD_VOLUMEDOWN IMX_GPIO_NR(4, 0)
43#define ARD_HOME IMX_GPIO_NR(5, 10)
44#define ARD_BACK IMX_GPIO_NR(5, 11)
45#define ARD_PROG IMX_GPIO_NR(5, 12)
46#define ARD_VOLUMEUP IMX_GPIO_NR(5, 13)
42 47
43static iomux_v3_cfg_t mx53_ard_pads[] = { 48static iomux_v3_cfg_t mx53_ard_pads[] = {
44 /* UART1 */ 49 /* UART1 */
@@ -91,6 +96,35 @@ static iomux_v3_cfg_t mx53_ard_pads[] = {
91 /* I2C3 */ 96 /* I2C3 */
92 MX53_PAD_GPIO_3__I2C3_SCL, 97 MX53_PAD_GPIO_3__I2C3_SCL,
93 MX53_PAD_GPIO_16__I2C3_SDA, 98 MX53_PAD_GPIO_16__I2C3_SDA,
99 /* GPIO */
100 MX53_PAD_DISP0_DAT16__GPIO5_10, /* home */
101 MX53_PAD_DISP0_DAT17__GPIO5_11, /* back */
102 MX53_PAD_DISP0_DAT18__GPIO5_12, /* prog */
103 MX53_PAD_DISP0_DAT19__GPIO5_13, /* vol up */
104 MX53_PAD_GPIO_10__GPIO4_0, /* vol down */
105};
106
107#define GPIO_BUTTON(gpio_num, ev_code, act_low, descr, wake) \
108{ \
109 .gpio = gpio_num, \
110 .type = EV_KEY, \
111 .code = ev_code, \
112 .active_low = act_low, \
113 .desc = "btn " descr, \
114 .wakeup = wake, \
115}
116
117static struct gpio_keys_button ard_buttons[] = {
118 GPIO_BUTTON(ARD_HOME, KEY_HOME, 1, "home", 0),
119 GPIO_BUTTON(ARD_BACK, KEY_BACK, 1, "back", 0),
120 GPIO_BUTTON(ARD_PROG, KEY_PROGRAM, 1, "program", 0),
121 GPIO_BUTTON(ARD_VOLUMEUP, KEY_VOLUMEUP, 1, "volume-up", 0),
122 GPIO_BUTTON(ARD_VOLUMEDOWN, KEY_VOLUMEDOWN, 1, "volume-down", 0),
123};
124
125static const struct gpio_keys_platform_data ard_button_data __initconst = {
126 .buttons = ard_buttons,
127 .nbuttons = ARRAY_SIZE(ard_buttons),
94}; 128};
95 129
96static struct resource ard_smsc911x_resources[] = { 130static struct resource ard_smsc911x_resources[] = {
@@ -199,6 +233,7 @@ static void __init mx53_ard_board_init(void)
199 imx53_add_imx2_wdt(0, NULL); 233 imx53_add_imx2_wdt(0, NULL);
200 imx53_add_imx_i2c(1, &mx53_ard_i2c2_data); 234 imx53_add_imx_i2c(1, &mx53_ard_i2c2_data);
201 imx53_add_imx_i2c(2, &mx53_ard_i2c3_data); 235 imx53_add_imx_i2c(2, &mx53_ard_i2c3_data);
236 imx_add_gpio_keys(&ard_button_data);
202} 237}
203 238
204static void __init mx53_ard_timer_init(void) 239static void __init mx53_ard_timer_init(void)