aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2011-02-28 12:04:33 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2011-05-19 07:11:06 -0400
commit5309498a56842d0acb723196b7bc57bfb9aee918 (patch)
treeabc5ff4565e8578a229cdc8924775c5ceb6e9b6a /arch/arm/mach-imx
parent9c97f66271a09dedfe26a145fceb74c6efd83571 (diff)
ARM: imx: use imx_add_gpio_keys to register "gpio-keys" devices
LAKML-Reference: 1302207841-12450-1-git-send-email-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/Kconfig2
-rw-r--r--arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c15
-rw-r--r--arch/arm/mach-imx/mach-imx27_visstrim_m10.c14
3 files changed, 8 insertions, 23 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 56b930a13443..4ac00e9fdbe8 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -129,6 +129,7 @@ choice
129 129
130config MACH_EUKREA_MBIMXSD25_BASEBOARD 130config MACH_EUKREA_MBIMXSD25_BASEBOARD
131 bool "Eukrea MBIMXSD development board" 131 bool "Eukrea MBIMXSD development board"
132 select IMX_HAVE_PLATFORM_GPIO_KEYS
132 select IMX_HAVE_PLATFORM_IMX_SSI 133 select IMX_HAVE_PLATFORM_IMX_SSI
133 help 134 help
134 This adds board specific devices that can be found on Eukrea's 135 This adds board specific devices that can be found on Eukrea's
@@ -254,6 +255,7 @@ config MACH_MX27_3DS
254config MACH_IMX27_VISSTRIM_M10 255config MACH_IMX27_VISSTRIM_M10
255 bool "Vista Silicon i.MX27 Visstrim_m10" 256 bool "Vista Silicon i.MX27 Visstrim_m10"
256 select SOC_IMX27 257 select SOC_IMX27
258 select IMX_HAVE_PLATFORM_GPIO_KEYS
257 select IMX_HAVE_PLATFORM_IMX_I2C 259 select IMX_HAVE_PLATFORM_IMX_I2C
258 select IMX_HAVE_PLATFORM_IMX_SSI 260 select IMX_HAVE_PLATFORM_IMX_SSI
259 select IMX_HAVE_PLATFORM_IMX_UART 261 select IMX_HAVE_PLATFORM_IMX_UART
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
index 6269053505f7..176e61bf44b6 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
@@ -22,7 +22,6 @@
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23#include <linux/leds.h> 23#include <linux/leds.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/gpio_keys.h>
26#include <linux/input.h> 25#include <linux/input.h>
27#include <video/platform_lcd.h> 26#include <video/platform_lcd.h>
28 27
@@ -208,23 +207,14 @@ static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = {
208 }, 207 },
209}; 208};
210 209
211static struct gpio_keys_platform_data eukrea_mbimxsd_button_data = { 210static const struct gpio_keys_platform_data
211 eukrea_mbimxsd_button_data __initconst = {
212 .buttons = eukrea_mbimxsd_gpio_buttons, 212 .buttons = eukrea_mbimxsd_gpio_buttons,
213 .nbuttons = ARRAY_SIZE(eukrea_mbimxsd_gpio_buttons), 213 .nbuttons = ARRAY_SIZE(eukrea_mbimxsd_gpio_buttons),
214}; 214};
215 215
216static struct platform_device eukrea_mbimxsd_button_device = {
217 .name = "gpio-keys",
218 .id = -1,
219 .num_resources = 0,
220 .dev = {
221 .platform_data = &eukrea_mbimxsd_button_data,
222 }
223};
224
225static struct platform_device *platform_devices[] __initdata = { 216static struct platform_device *platform_devices[] __initdata = {
226 &eukrea_mbimxsd_leds_gpio, 217 &eukrea_mbimxsd_leds_gpio,
227 &eukrea_mbimxsd_button_device,
228 &eukrea_mbimxsd_lcd_powerdev, 218 &eukrea_mbimxsd_lcd_powerdev,
229}; 219};
230 220
@@ -299,4 +289,5 @@ void __init eukrea_mbimxsd25_baseboard_init(void)
299 ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); 289 ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));
300 290
301 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 291 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
292 imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
302} 293}
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index d7e0d219726a..7ae43b1ec517 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -27,7 +27,6 @@
27#include <linux/mtd/physmap.h> 27#include <linux/mtd/physmap.h>
28#include <linux/i2c.h> 28#include <linux/i2c.h>
29#include <linux/i2c/pca953x.h> 29#include <linux/i2c/pca953x.h>
30#include <linux/gpio_keys.h>
31#include <linux/input.h> 30#include <linux/input.h>
32#include <linux/gpio.h> 31#include <linux/gpio.h>
33#include <linux/delay.h> 32#include <linux/delay.h>
@@ -130,19 +129,12 @@ static struct gpio_keys_button visstrim_gpio_keys[] = {
130 } 129 }
131}; 130};
132 131
133static struct gpio_keys_platform_data visstrim_gpio_keys_platform_data = { 132static const struct gpio_keys_platform_data
133 visstrim_gpio_keys_platform_data __initconst = {
134 .buttons = visstrim_gpio_keys, 134 .buttons = visstrim_gpio_keys,
135 .nbuttons = ARRAY_SIZE(visstrim_gpio_keys), 135 .nbuttons = ARRAY_SIZE(visstrim_gpio_keys),
136}; 136};
137 137
138static struct platform_device visstrim_gpio_keys_device = {
139 .name = "gpio-keys",
140 .id = -1,
141 .dev = {
142 .platform_data = &visstrim_gpio_keys_platform_data,
143 },
144};
145
146/* Visstrim_SM10 has a microSD slot connected to sdhc1 */ 138/* Visstrim_SM10 has a microSD slot connected to sdhc1 */
147static int visstrim_m10_sdhc1_init(struct device *dev, 139static int visstrim_m10_sdhc1_init(struct device *dev,
148 irq_handler_t detect_irq, void *data) 140 irq_handler_t detect_irq, void *data)
@@ -186,7 +178,6 @@ static struct platform_device visstrim_m10_nor_mtd_device = {
186}; 178};
187 179
188static struct platform_device *platform_devices[] __initdata = { 180static struct platform_device *platform_devices[] __initdata = {
189 &visstrim_gpio_keys_device,
190 &visstrim_m10_nor_mtd_device, 181 &visstrim_m10_nor_mtd_device,
191}; 182};
192 183
@@ -255,6 +246,7 @@ static void __init visstrim_m10_board_init(void)
255 imx27_add_mxc_mmc(0, &visstrim_m10_sdhc_pdata); 246 imx27_add_mxc_mmc(0, &visstrim_m10_sdhc_pdata);
256 imx27_add_mxc_ehci_otg(&visstrim_m10_usbotg_pdata); 247 imx27_add_mxc_ehci_otg(&visstrim_m10_usbotg_pdata);
257 imx27_add_fec(NULL); 248 imx27_add_fec(NULL);
249 imx_add_gpio_keys(&visstrim_gpio_keys_platform_data);
258 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 250 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
259} 251}
260 252