aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-10 03:58:56 -0500
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-17 04:01:32 -0500
commit3f880141b8d12cdbb5faf0b9941ee50ac515ea1e (patch)
treead50ed7f31b47c4375d48df0a4c54e655423adc1 /arch/arm/mach-imx
parentbd455ed36c487b949068182bfee478b785ee090b (diff)
ARM: imx: dynamically allocate imx-keypad devices
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/Kconfig2
-rw-r--r--arch/arm/mach-imx/devices-imx21.h4
-rw-r--r--arch/arm/mach-imx/devices-imx27.h4
-rw-r--r--arch/arm/mach-imx/devices.c19
-rw-r--r--arch/arm/mach-imx/devices.h1
-rw-r--r--arch/arm/mach-imx/eukrea_mbimx27-baseboard.c6
-rw-r--r--arch/arm/mach-imx/mach-mx27_3ds.c5
7 files changed, 15 insertions, 26 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index e50a164d08f7..86bab49798c6 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -163,6 +163,7 @@ choice
163config MACH_EUKREA_MBIMX27_BASEBOARD 163config MACH_EUKREA_MBIMX27_BASEBOARD
164 bool "Eukrea MBIMX27 development board" 164 bool "Eukrea MBIMX27 development board"
165 select IMX_HAVE_PLATFORM_IMX_FB 165 select IMX_HAVE_PLATFORM_IMX_FB
166 select IMX_HAVE_PLATFORM_IMX_KEYPAD
166 select IMX_HAVE_PLATFORM_IMX_SSI 167 select IMX_HAVE_PLATFORM_IMX_SSI
167 select IMX_HAVE_PLATFORM_IMX_UART 168 select IMX_HAVE_PLATFORM_IMX_UART
168 select IMX_HAVE_PLATFORM_MXC_MMC 169 select IMX_HAVE_PLATFORM_MXC_MMC
@@ -175,6 +176,7 @@ endchoice
175 176
176config MACH_MX27_3DS 177config MACH_MX27_3DS
177 bool "MX27PDK platform" 178 bool "MX27PDK platform"
179 select IMX_HAVE_PLATFORM_IMX_KEYPAD
178 select IMX_HAVE_PLATFORM_IMX_UART 180 select IMX_HAVE_PLATFORM_IMX_UART
179 select IMX_HAVE_PLATFORM_MXC_MMC 181 select IMX_HAVE_PLATFORM_MXC_MMC
180 help 182 help
diff --git a/arch/arm/mach-imx/devices-imx21.h b/arch/arm/mach-imx/devices-imx21.h
index a97e921bc225..0c0eab17ccfd 100644
--- a/arch/arm/mach-imx/devices-imx21.h
+++ b/arch/arm/mach-imx/devices-imx21.h
@@ -21,6 +21,10 @@ extern const struct imx_imx_i2c_data imx21_imx_i2c_data __initconst;
21#define imx21_add_imx_i2c(pdata) \ 21#define imx21_add_imx_i2c(pdata) \
22 imx_add_imx_i2c(&imx21_imx_i2c_data, pdata) 22 imx_add_imx_i2c(&imx21_imx_i2c_data, pdata)
23 23
24extern const struct imx_imx_keypad_data imx21_imx_keypad_data __initconst;
25#define imx21_add_imx_keypad(pdata) \
26 imx_add_imx_keypad(&imx21_imx_keypad_data, pdata)
27
24extern const struct imx_imx_ssi_data imx21_imx_ssi_data[] __initconst; 28extern const struct imx_imx_ssi_data imx21_imx_ssi_data[] __initconst;
25#define imx21_add_imx_ssi(id, pdata) \ 29#define imx21_add_imx_ssi(id, pdata) \
26 imx_add_imx_ssi(&imx21_imx_ssi_data[id], pdata) 30 imx_add_imx_ssi(&imx21_imx_ssi_data[id], pdata)
diff --git a/arch/arm/mach-imx/devices-imx27.h b/arch/arm/mach-imx/devices-imx27.h
index 51bb42d8536e..f1272d4b5a33 100644
--- a/arch/arm/mach-imx/devices-imx27.h
+++ b/arch/arm/mach-imx/devices-imx27.h
@@ -29,6 +29,10 @@ extern const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst;
29#define imx27_add_imx_i2c(id, pdata) \ 29#define imx27_add_imx_i2c(id, pdata) \
30 imx_add_imx_i2c(&imx27_imx_i2c_data[id], pdata) 30 imx_add_imx_i2c(&imx27_imx_i2c_data[id], pdata)
31 31
32extern const struct imx_imx_keypad_data imx27_imx_keypad_data __initconst;
33#define imx27_add_imx_keypad(pdata) \
34 imx_add_imx_keypad(&imx27_imx_keypad_data, pdata)
35
32extern const struct imx_imx_ssi_data imx27_imx_ssi_data[] __initconst; 36extern const struct imx_imx_ssi_data imx27_imx_ssi_data[] __initconst;
33#define imx27_add_imx_ssi(id, pdata) \ 37#define imx27_add_imx_ssi(id, pdata) \
34 imx_add_imx_ssi(&imx27_imx_ssi_data[id], pdata) 38 imx_add_imx_ssi(&imx27_imx_ssi_data[id], pdata)
diff --git a/arch/arm/mach-imx/devices.c b/arch/arm/mach-imx/devices.c
index d026cfbe6130..4360b9c8f893 100644
--- a/arch/arm/mach-imx/devices.c
+++ b/arch/arm/mach-imx/devices.c
@@ -149,23 +149,4 @@ struct platform_device mx21_usbhc_device = {
149}; 149};
150#endif 150#endif
151 151
152static struct resource imx_kpp_resources[] = {
153 {
154 .start = MX2x_KPP_BASE_ADDR,
155 .end = MX2x_KPP_BASE_ADDR + 0xf,
156 .flags = IORESOURCE_MEM
157 }, {
158 .start = MX2x_INT_KPP,
159 .end = MX2x_INT_KPP,
160 .flags = IORESOURCE_IRQ,
161 },
162};
163
164struct platform_device imx_kpp_device = {
165 .name = "imx-keypad",
166 .id = -1,
167 .num_resources = ARRAY_SIZE(imx_kpp_resources),
168 .resource = imx_kpp_resources,
169};
170
171#endif 152#endif
diff --git a/arch/arm/mach-imx/devices.h b/arch/arm/mach-imx/devices.h
index a788566c1938..d1e7f48f7d52 100644
--- a/arch/arm/mach-imx/devices.h
+++ b/arch/arm/mach-imx/devices.h
@@ -1,4 +1,3 @@
1#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27) 1#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27)
2extern struct platform_device mx21_usbhc_device; 2extern struct platform_device mx21_usbhc_device;
3extern struct platform_device imx_kpp_device;
4#endif 3#endif
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
index fa5aaded7c2e..3aaa3b9b604c 100644
--- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
@@ -26,7 +26,6 @@
26#include <linux/spi/ads7846.h> 26#include <linux/spi/ads7846.h>
27#include <linux/backlight.h> 27#include <linux/backlight.h>
28#include <video/platform_lcd.h> 28#include <video/platform_lcd.h>
29#include <linux/input/matrix_keypad.h>
30 29
31#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
32 31
@@ -109,7 +108,8 @@ static const uint32_t eukrea_mbimx27_keymap[] = {
109 KEY(1, 1, KEY_LEFT), 108 KEY(1, 1, KEY_LEFT),
110}; 109};
111 110
112static struct matrix_keymap_data eukrea_mbimx27_keymap_data = { 111static const struct matrix_keymap_data
112eukrea_mbimx27_keymap_data __initconst = {
113 .keymap = eukrea_mbimx27_keymap, 113 .keymap = eukrea_mbimx27_keymap,
114 .keymap_size = ARRAY_SIZE(eukrea_mbimx27_keymap), 114 .keymap_size = ARRAY_SIZE(eukrea_mbimx27_keymap),
115}; 115};
@@ -384,7 +384,7 @@ void __init eukrea_mbimx27_baseboard_init(void)
384 gpio_request(GPIO_PORTA | 25, "lcd_enable"); 384 gpio_request(GPIO_PORTA | 25, "lcd_enable");
385 platform_device_register(&eukrea_mbimx27_lcd_powerdev); 385 platform_device_register(&eukrea_mbimx27_lcd_powerdev);
386 386
387 mxc_register_device(&imx_kpp_device, &eukrea_mbimx27_keymap_data); 387 imx27_add_imx_keypad(&eukrea_mbimx27_keymap_data);
388 388
389 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 389 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
390} 390}
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index e6212c3d53b5..80399b268052 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -22,7 +22,6 @@
22 22
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/input/matrix_keypad.h>
26#include <linux/irq.h> 25#include <linux/irq.h>
27#include <asm/mach-types.h> 26#include <asm/mach-types.h>
28#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
@@ -91,7 +90,7 @@ static const uint32_t mx27_3ds_keymap[] = {
91 KEY(2, 3, KEY_F10), 90 KEY(2, 3, KEY_F10),
92}; 91};
93 92
94static struct matrix_keymap_data mx27_3ds_keymap_data = { 93static const struct matrix_keymap_data mx27_3ds_keymap_data __initconst = {
95 .keymap = mx27_3ds_keymap, 94 .keymap = mx27_3ds_keymap,
96 .keymap_size = ARRAY_SIZE(mx27_3ds_keymap), 95 .keymap_size = ARRAY_SIZE(mx27_3ds_keymap),
97}; 96};
@@ -127,7 +126,7 @@ static void __init mx27pdk_init(void)
127 mx27_3ds_sdhc1_enable_level_translator(); 126 mx27_3ds_sdhc1_enable_level_translator();
128 imx27_add_imx_uart0(&uart_pdata); 127 imx27_add_imx_uart0(&uart_pdata);
129 imx27_add_fec(NULL); 128 imx27_add_fec(NULL);
130 mxc_register_device(&imx_kpp_device, &mx27_3ds_keymap_data); 129 imx27_add_imx_keypad(&mx27_3ds_keymap_data);
131 imx27_add_mxc_mmc(0, &sdhc1_pdata); 130 imx27_add_mxc_mmc(0, &sdhc1_pdata);
132} 131}
133 132