diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-16 15:27:33 -0500 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-19 15:54:36 -0500 |
commit | d690b4c4778096cde018709efd005dfef9714297 (patch) | |
tree | c19176b853aaa8d2d5584a1179ee370d3323690a /arch | |
parent | 742269e2d971957c84f364c4e9f5c6439964ef01 (diff) |
ARM: mx3: dynamically allocate imx-keypad devices
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-mx3/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-mx3/devices-imx31.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-mx3/devices-imx35.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-mx3/devices.c | 19 | ||||
-rw-r--r-- | arch/arm/mach-mx3/devices.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-mx31_3ds.c | 5 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-imx-keypad.c | 10 |
7 files changed, 21 insertions, 23 deletions
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig index bcfcf9ad76e5..84e4788898a5 100644 --- a/arch/arm/mach-mx3/Kconfig +++ b/arch/arm/mach-mx3/Kconfig | |||
@@ -91,6 +91,7 @@ config MACH_MX31_3DS | |||
91 | select SOC_IMX31 | 91 | select SOC_IMX31 |
92 | select MXC_DEBUG_BOARD | 92 | select MXC_DEBUG_BOARD |
93 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | 93 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC |
94 | select IMX_HAVE_PLATFORM_IMX_KEYPAD | ||
94 | select IMX_HAVE_PLATFORM_IMX_UART | 95 | select IMX_HAVE_PLATFORM_IMX_UART |
95 | select IMX_HAVE_PLATFORM_MXC_NAND | 96 | select IMX_HAVE_PLATFORM_MXC_NAND |
96 | select IMX_HAVE_PLATFORM_SPI_IMX | 97 | select IMX_HAVE_PLATFORM_SPI_IMX |
diff --git a/arch/arm/mach-mx3/devices-imx31.h b/arch/arm/mach-mx3/devices-imx31.h index 109f0bc3b524..40f4e848a671 100644 --- a/arch/arm/mach-mx3/devices-imx31.h +++ b/arch/arm/mach-mx3/devices-imx31.h | |||
@@ -24,6 +24,10 @@ extern const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst; | |||
24 | #define imx31_add_imx_i2c1(pdata) imx31_add_imx_i2c(1, pdata) | 24 | #define imx31_add_imx_i2c1(pdata) imx31_add_imx_i2c(1, pdata) |
25 | #define imx31_add_imx_i2c2(pdata) imx31_add_imx_i2c(2, pdata) | 25 | #define imx31_add_imx_i2c2(pdata) imx31_add_imx_i2c(2, pdata) |
26 | 26 | ||
27 | extern const struct imx_imx_keypad_data imx31_imx_keypad_data __initconst; | ||
28 | #define imx31_add_imx_keypad(pdata) \ | ||
29 | imx_add_imx_keypad(&imx31_imx_keypad_data, pdata) | ||
30 | |||
27 | extern const struct imx_imx_ssi_data imx31_imx_ssi_data[] __initconst; | 31 | extern const struct imx_imx_ssi_data imx31_imx_ssi_data[] __initconst; |
28 | #define imx31_add_imx_ssi(id, pdata) \ | 32 | #define imx31_add_imx_ssi(id, pdata) \ |
29 | imx_add_imx_ssi(&imx31_imx_ssi_data[id], pdata) | 33 | imx_add_imx_ssi(&imx31_imx_ssi_data[id], pdata) |
diff --git a/arch/arm/mach-mx3/devices-imx35.h b/arch/arm/mach-mx3/devices-imx35.h index 763ee9754773..c9fdded7ff39 100644 --- a/arch/arm/mach-mx3/devices-imx35.h +++ b/arch/arm/mach-mx3/devices-imx35.h | |||
@@ -34,6 +34,10 @@ extern const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst; | |||
34 | #define imx35_add_imx_i2c1(pdata) imx35_add_imx_i2c(1, pdata) | 34 | #define imx35_add_imx_i2c1(pdata) imx35_add_imx_i2c(1, pdata) |
35 | #define imx35_add_imx_i2c2(pdata) imx35_add_imx_i2c(2, pdata) | 35 | #define imx35_add_imx_i2c2(pdata) imx35_add_imx_i2c(2, pdata) |
36 | 36 | ||
37 | extern const struct imx_imx_keypad_data imx35_imx_keypad_data __initconst; | ||
38 | #define imx31_add_imx_keypad(pdata) \ | ||
39 | imx_add_imx_keypad(&imx35_imx_keypad_data, pdata) | ||
40 | |||
37 | extern const struct imx_imx_ssi_data imx35_imx_ssi_data[] __initconst; | 41 | extern const struct imx_imx_ssi_data imx35_imx_ssi_data[] __initconst; |
38 | #define imx35_add_imx_ssi(id, pdata) \ | 42 | #define imx35_add_imx_ssi(id, pdata) \ |
39 | imx_add_imx_ssi(&imx35_imx_ssi_data[id], pdata) | 43 | imx_add_imx_ssi(&imx35_imx_ssi_data[id], pdata) |
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c index 448fe5614e4f..b6672db788fb 100644 --- a/arch/arm/mach-mx3/devices.c +++ b/arch/arm/mach-mx3/devices.c | |||
@@ -113,22 +113,3 @@ struct platform_device imx_rtc_device0 = { | |||
113 | .num_resources = ARRAY_SIZE(imx_rtc_resources), | 113 | .num_resources = ARRAY_SIZE(imx_rtc_resources), |
114 | .resource = imx_rtc_resources, | 114 | .resource = imx_rtc_resources, |
115 | }; | 115 | }; |
116 | |||
117 | static struct resource imx_kpp_resources[] = { | ||
118 | { | ||
119 | .start = MX3x_KPP_BASE_ADDR, | ||
120 | .end = MX3x_KPP_BASE_ADDR + 0xf, | ||
121 | .flags = IORESOURCE_MEM | ||
122 | }, { | ||
123 | .start = MX3x_INT_KPP, | ||
124 | .end = MX3x_INT_KPP, | ||
125 | .flags = IORESOURCE_IRQ, | ||
126 | }, | ||
127 | }; | ||
128 | |||
129 | struct platform_device imx_kpp_device = { | ||
130 | .name = "imx-keypad", | ||
131 | .id = -1, | ||
132 | .num_resources = ARRAY_SIZE(imx_kpp_resources), | ||
133 | .resource = imx_kpp_resources, | ||
134 | }; | ||
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h index 2f9f87725e7b..121962c568d1 100644 --- a/arch/arm/mach-mx3/devices.h +++ b/arch/arm/mach-mx3/devices.h | |||
@@ -2,4 +2,3 @@ extern struct platform_device mx3_ipu; | |||
2 | extern struct platform_device mx3_fb; | 2 | extern struct platform_device mx3_fb; |
3 | extern struct platform_device mx3_camera; | 3 | extern struct platform_device mx3_camera; |
4 | extern struct platform_device imx_rtc_device0; | 4 | extern struct platform_device imx_rtc_device0; |
5 | extern struct platform_device imx_kpp_device; | ||
diff --git a/arch/arm/mach-mx3/mach-mx31_3ds.c b/arch/arm/mach-mx3/mach-mx31_3ds.c index 1b46f738b310..3dea40743f81 100644 --- a/arch/arm/mach-mx3/mach-mx31_3ds.c +++ b/arch/arm/mach-mx3/mach-mx31_3ds.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/mfd/mc13783.h> | 22 | #include <linux/mfd/mc13783.h> |
23 | #include <linux/spi/spi.h> | 23 | #include <linux/spi/spi.h> |
24 | #include <linux/regulator/machine.h> | 24 | #include <linux/regulator/machine.h> |
25 | #include <linux/input/matrix_keypad.h> | ||
26 | 25 | ||
27 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
28 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
@@ -101,7 +100,7 @@ static const uint32_t mx31_3ds_keymap[] = { | |||
101 | KEY(2, 3, KEY_F10), | 100 | KEY(2, 3, KEY_F10), |
102 | }; | 101 | }; |
103 | 102 | ||
104 | static struct matrix_keymap_data mx31_3ds_keymap_data = { | 103 | static const struct matrix_keymap_data mx31_3ds_keymap_data __initconst = { |
105 | .keymap = mx31_3ds_keymap, | 104 | .keymap = mx31_3ds_keymap, |
106 | .keymap_size = ARRAY_SIZE(mx31_3ds_keymap), | 105 | .keymap_size = ARRAY_SIZE(mx31_3ds_keymap), |
107 | }; | 106 | }; |
@@ -245,7 +244,7 @@ static void __init mxc_board_init(void) | |||
245 | spi_register_board_info(mx31_3ds_spi_devs, | 244 | spi_register_board_info(mx31_3ds_spi_devs, |
246 | ARRAY_SIZE(mx31_3ds_spi_devs)); | 245 | ARRAY_SIZE(mx31_3ds_spi_devs)); |
247 | 246 | ||
248 | mxc_register_device(&imx_kpp_device, &mx31_3ds_keymap_data); | 247 | imx31_add_imx_keypad(&mx31_3ds_keymap_data); |
249 | 248 | ||
250 | mx31_3ds_usbotg_init(); | 249 | mx31_3ds_usbotg_init(); |
251 | imx31_add_fsl_usb2_udc(&usbotg_pdata); | 250 | imx31_add_fsl_usb2_udc(&usbotg_pdata); |
diff --git a/arch/arm/plat-mxc/devices/platform-imx-keypad.c b/arch/arm/plat-mxc/devices/platform-imx-keypad.c index 5f3b36777c04..40238f0b8643 100644 --- a/arch/arm/plat-mxc/devices/platform-imx-keypad.c +++ b/arch/arm/plat-mxc/devices/platform-imx-keypad.c | |||
@@ -31,6 +31,16 @@ const struct imx_imx_keypad_data imx27_imx_keypad_data __initconst = | |||
31 | imx_imx_keypad_data_entry_single(MX27, SZ_16); | 31 | imx_imx_keypad_data_entry_single(MX27, SZ_16); |
32 | #endif /* ifdef CONFIG_SOC_IMX27 */ | 32 | #endif /* ifdef CONFIG_SOC_IMX27 */ |
33 | 33 | ||
34 | #ifdef CONFIG_SOC_IMX31 | ||
35 | const struct imx_imx_keypad_data imx31_imx_keypad_data __initconst = | ||
36 | imx_imx_keypad_data_entry_single(MX31, SZ_16); | ||
37 | #endif /* ifdef CONFIG_SOC_IMX31 */ | ||
38 | |||
39 | #ifdef CONFIG_SOC_IMX35 | ||
40 | const struct imx_imx_keypad_data imx35_imx_keypad_data __initconst = | ||
41 | imx_imx_keypad_data_entry_single(MX35, SZ_16); | ||
42 | #endif /* ifdef CONFIG_SOC_IMX35 */ | ||
43 | |||
34 | struct platform_device *__init imx_add_imx_keypad( | 44 | struct platform_device *__init imx_add_imx_keypad( |
35 | const struct imx_imx_keypad_data *data, | 45 | const struct imx_imx_keypad_data *data, |
36 | const struct matrix_keymap_data *pdata) | 46 | const struct matrix_keymap_data *pdata) |