diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-06-16 13:25:34 -0400 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-06-30 03:00:44 -0400 |
commit | 7cdc8fa7120f97f40d36547854ae127dc0318e3a (patch) | |
tree | 54d2b57a0f0f14063fa995b99c7a64de9d473dc1 /arch/arm | |
parent | 4a9b8b0b061ef750b5ef31d1e9d2fa0206731f2f (diff) |
ARM: imx: dynamically register imx-i2c devices (imx35)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-mx3/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-mx3/devices-imx35.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-mx3/devices.c | 59 | ||||
-rw-r--r-- | arch/arm/mach-mx3/devices.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-pcm043.c | 7 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mx35.h | 4 |
6 files changed, 12 insertions, 71 deletions
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig index 557a20b48830..b8a7610ade19 100644 --- a/arch/arm/mach-mx3/Kconfig +++ b/arch/arm/mach-mx3/Kconfig | |||
@@ -103,6 +103,7 @@ config MACH_QONG | |||
103 | config MACH_PCM043 | 103 | config MACH_PCM043 |
104 | bool "Support Phytec pcm043 (i.MX35) platforms" | 104 | bool "Support Phytec pcm043 (i.MX35) platforms" |
105 | select ARCH_MX35 | 105 | select ARCH_MX35 |
106 | select IMX_HAVE_PLATFORM_IMX_I2C | ||
106 | select IMX_HAVE_PLATFORM_MXC_NAND | 107 | select IMX_HAVE_PLATFORM_MXC_NAND |
107 | select MXC_ULPI if USB_ULPI | 108 | select MXC_ULPI if USB_ULPI |
108 | help | 109 | help |
diff --git a/arch/arm/mach-mx3/devices-imx35.h b/arch/arm/mach-mx3/devices-imx35.h index 69dac76a7909..6d993ae1d054 100644 --- a/arch/arm/mach-mx3/devices-imx35.h +++ b/arch/arm/mach-mx3/devices-imx35.h | |||
@@ -9,5 +9,12 @@ | |||
9 | #include <mach/mx35.h> | 9 | #include <mach/mx35.h> |
10 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
11 | 11 | ||
12 | #define imx35_add_imx_i2c0(pdata) \ | ||
13 | imx_add_imx_i2c(0, MX35_I2C1_BASE_ADDR, SZ_4K, MX35_INT_I2C1, pdata) | ||
14 | #define imx35_add_imx_i2c1(pdata) \ | ||
15 | imx_add_imx_i2c(1, MX35_I2C2_BASE_ADDR, SZ_4K, MX35_INT_I2C2, pdata) | ||
16 | #define imx35_add_imx_i2c2(pdata) \ | ||
17 | imx_add_imx_i2c(2, MX35_I2C3_BASE_ADDR, SZ_4K, MX35_INT_I2C3, pdata) | ||
18 | |||
12 | #define imx35_add_mxc_nand(pdata) \ | 19 | #define imx35_add_mxc_nand(pdata) \ |
13 | imx_add_mxc_nand_v21(MX35_NFC_BASE_ADDR, MX35_INT_NANDFC, pdata) | 20 | imx_add_mxc_nand_v21(MX35_NFC_BASE_ADDR, MX35_INT_NANDFC, pdata) |
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c index 0743214127a9..a285b1660c8c 100644 --- a/arch/arm/mach-mx3/devices.c +++ b/arch/arm/mach-mx3/devices.c | |||
@@ -167,65 +167,6 @@ struct platform_device mxc_w1_master_device = { | |||
167 | .resource = mxc_w1_master_resources, | 167 | .resource = mxc_w1_master_resources, |
168 | }; | 168 | }; |
169 | 169 | ||
170 | #if defined(CONFIG_ARCH_MX35) | ||
171 | static struct resource mxc_i2c0_resources[] = { | ||
172 | { | ||
173 | .start = I2C_BASE_ADDR, | ||
174 | .end = I2C_BASE_ADDR + SZ_4K - 1, | ||
175 | .flags = IORESOURCE_MEM, | ||
176 | }, { | ||
177 | .start = MXC_INT_I2C, | ||
178 | .end = MXC_INT_I2C, | ||
179 | .flags = IORESOURCE_IRQ, | ||
180 | }, | ||
181 | }; | ||
182 | |||
183 | struct platform_device mxc_i2c_device0 = { | ||
184 | .name = "imx-i2c", | ||
185 | .id = 0, | ||
186 | .num_resources = ARRAY_SIZE(mxc_i2c0_resources), | ||
187 | .resource = mxc_i2c0_resources, | ||
188 | }; | ||
189 | |||
190 | static struct resource mxc_i2c1_resources[] = { | ||
191 | { | ||
192 | .start = I2C2_BASE_ADDR, | ||
193 | .end = I2C2_BASE_ADDR + SZ_4K - 1, | ||
194 | .flags = IORESOURCE_MEM, | ||
195 | }, { | ||
196 | .start = MXC_INT_I2C2, | ||
197 | .end = MXC_INT_I2C2, | ||
198 | .flags = IORESOURCE_IRQ, | ||
199 | }, | ||
200 | }; | ||
201 | |||
202 | struct platform_device mxc_i2c_device1 = { | ||
203 | .name = "imx-i2c", | ||
204 | .id = 1, | ||
205 | .num_resources = ARRAY_SIZE(mxc_i2c1_resources), | ||
206 | .resource = mxc_i2c1_resources, | ||
207 | }; | ||
208 | |||
209 | static struct resource mxc_i2c2_resources[] = { | ||
210 | { | ||
211 | .start = I2C3_BASE_ADDR, | ||
212 | .end = I2C3_BASE_ADDR + SZ_4K - 1, | ||
213 | .flags = IORESOURCE_MEM, | ||
214 | }, { | ||
215 | .start = MXC_INT_I2C3, | ||
216 | .end = MXC_INT_I2C3, | ||
217 | .flags = IORESOURCE_IRQ, | ||
218 | }, | ||
219 | }; | ||
220 | |||
221 | struct platform_device mxc_i2c_device2 = { | ||
222 | .name = "imx-i2c", | ||
223 | .id = 2, | ||
224 | .num_resources = ARRAY_SIZE(mxc_i2c2_resources), | ||
225 | .resource = mxc_i2c2_resources, | ||
226 | }; | ||
227 | #endif | ||
228 | |||
229 | #ifdef CONFIG_ARCH_MX31 | 170 | #ifdef CONFIG_ARCH_MX31 |
230 | static struct resource mxcsdhc0_resources[] = { | 171 | static struct resource mxcsdhc0_resources[] = { |
231 | { | 172 | { |
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h index e108fa3f5d7e..c50596addfc7 100644 --- a/arch/arm/mach-mx3/devices.h +++ b/arch/arm/mach-mx3/devices.h | |||
@@ -5,11 +5,6 @@ extern struct platform_device mxc_uart_device2; | |||
5 | extern struct platform_device mxc_uart_device3; | 5 | extern struct platform_device mxc_uart_device3; |
6 | extern struct platform_device mxc_uart_device4; | 6 | extern struct platform_device mxc_uart_device4; |
7 | extern struct platform_device mxc_w1_master_device; | 7 | extern struct platform_device mxc_w1_master_device; |
8 | #if defined(CONFIG_ARCH_MX35) | ||
9 | extern struct platform_device mxc_i2c_device0; | ||
10 | extern struct platform_device mxc_i2c_device1; | ||
11 | extern struct platform_device mxc_i2c_device2; | ||
12 | #endif | ||
13 | extern struct platform_device mx3_ipu; | 8 | extern struct platform_device mx3_ipu; |
14 | extern struct platform_device mx3_fb; | 9 | extern struct platform_device mx3_fb; |
15 | extern struct platform_device mx3_camera; | 10 | extern struct platform_device mx3_camera; |
diff --git a/arch/arm/mach-mx3/mach-pcm043.c b/arch/arm/mach-mx3/mach-pcm043.c index 58de3055b85e..21305c67afcf 100644 --- a/arch/arm/mach-mx3/mach-pcm043.c +++ b/arch/arm/mach-mx3/mach-pcm043.c | |||
@@ -37,9 +37,6 @@ | |||
37 | #include <mach/hardware.h> | 37 | #include <mach/hardware.h> |
38 | #include <mach/common.h> | 38 | #include <mach/common.h> |
39 | #include <mach/imx-uart.h> | 39 | #include <mach/imx-uart.h> |
40 | #if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE | ||
41 | #include <mach/i2c.h> | ||
42 | #endif | ||
43 | #include <mach/iomux-mx35.h> | 40 | #include <mach/iomux-mx35.h> |
44 | #include <mach/ipu.h> | 41 | #include <mach/ipu.h> |
45 | #include <mach/mx3fb.h> | 42 | #include <mach/mx3fb.h> |
@@ -123,7 +120,7 @@ static struct imxuart_platform_data uart_pdata = { | |||
123 | }; | 120 | }; |
124 | 121 | ||
125 | #if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE | 122 | #if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE |
126 | static struct imxi2c_platform_data pcm043_i2c_1_data = { | 123 | static const struct imxi2c_platform_data pcm043_i2c0_data __initconst = { |
127 | .bitrate = 50000, | 124 | .bitrate = 50000, |
128 | }; | 125 | }; |
129 | 126 | ||
@@ -368,7 +365,7 @@ static void __init mxc_board_init(void) | |||
368 | i2c_register_board_info(0, pcm043_i2c_devices, | 365 | i2c_register_board_info(0, pcm043_i2c_devices, |
369 | ARRAY_SIZE(pcm043_i2c_devices)); | 366 | ARRAY_SIZE(pcm043_i2c_devices)); |
370 | 367 | ||
371 | mxc_register_device(&mxc_i2c_device0, &pcm043_i2c_1_data); | 368 | imx35_add_imx_i2c0(&pcm043_i2c0_data); |
372 | #endif | 369 | #endif |
373 | 370 | ||
374 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); | 371 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); |
diff --git a/arch/arm/plat-mxc/include/mach/mx35.h b/arch/arm/plat-mxc/include/mach/mx35.h index 526a55842ae5..cda60c715127 100644 --- a/arch/arm/plat-mxc/include/mach/mx35.h +++ b/arch/arm/plat-mxc/include/mach/mx35.h | |||
@@ -18,7 +18,7 @@ | |||
18 | #define MX35_ETB_SLOT4_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x10000) | 18 | #define MX35_ETB_SLOT4_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x10000) |
19 | #define MX35_ETB_SLOT5_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x14000) | 19 | #define MX35_ETB_SLOT5_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x14000) |
20 | #define MX35_ECT_CTIO_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x18000) | 20 | #define MX35_ECT_CTIO_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x18000) |
21 | #define MX35_I2C_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x80000) | 21 | #define MX35_I2C1_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x80000) |
22 | #define MX35_I2C3_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x84000) | 22 | #define MX35_I2C3_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x84000) |
23 | #define MX35_UART1_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x90000) | 23 | #define MX35_UART1_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x90000) |
24 | #define MX35_UART2_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x94000) | 24 | #define MX35_UART2_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x94000) |
@@ -123,7 +123,7 @@ | |||
123 | #define MX35_INT_MMC_SDHC1 7 | 123 | #define MX35_INT_MMC_SDHC1 7 |
124 | #define MX35_INT_MMC_SDHC2 8 | 124 | #define MX35_INT_MMC_SDHC2 8 |
125 | #define MX35_INT_MMC_SDHC3 9 | 125 | #define MX35_INT_MMC_SDHC3 9 |
126 | #define MX35_INT_I2C 10 | 126 | #define MX35_INT_I2C1 10 |
127 | #define MX35_INT_SSI1 11 | 127 | #define MX35_INT_SSI1 11 |
128 | #define MX35_INT_SSI2 12 | 128 | #define MX35_INT_SSI2 12 |
129 | #define MX35_INT_CSPI2 13 | 129 | #define MX35_INT_CSPI2 13 |