diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-06-16 08:55:07 -0400 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-06-30 03:00:40 -0400 |
commit | a8ff045603c712d6d61e07260ec2c0e44c40d14c (patch) | |
tree | 3d44fe593838aab8e04e233004023c52d6ffdcb8 /arch | |
parent | 2b92084f75c74a5496380833cb60185985959ec6 (diff) |
ARM: imx: dynamically register imx-i2c devices (imx25)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-mx25/devices-imx25.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-mx25/devices.c | 57 | ||||
-rw-r--r-- | arch/arm/mach-mx25/devices.h | 3 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mx25.h | 14 |
4 files changed, 17 insertions, 64 deletions
diff --git a/arch/arm/mach-mx25/devices-imx25.h b/arch/arm/mach-mx25/devices-imx25.h index f8d4ee0b1eb6..6464be439e90 100644 --- a/arch/arm/mach-mx25/devices-imx25.h +++ b/arch/arm/mach-mx25/devices-imx25.h | |||
@@ -9,5 +9,12 @@ | |||
9 | #include <mach/mx25.h> | 9 | #include <mach/mx25.h> |
10 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
11 | 11 | ||
12 | #define imx25_add_imx_i2c0(pdata) \ | ||
13 | imx_add_imx_i2c(0, MX25_I2C1_BASE_ADDR, SZ_16K, MX25_INT_I2C1, pdata) | ||
14 | #define imx25_add_imx_i2c1(pdata) \ | ||
15 | imx_add_imx_i2c(1, MX25_I2C2_BASE_ADDR, SZ_16K, MX25_INT_I2C2, pdata) | ||
16 | #define imx25_add_imx_i2c2(pdata) \ | ||
17 | imx_add_imx_i2c(2, MX25_I2C3_BASE_ADDR, SZ_16K, MX25_INT_I2C3, pdata) | ||
18 | |||
12 | #define imx25_add_mxc_nand(pdata) \ | 19 | #define imx25_add_mxc_nand(pdata) \ |
13 | imx_add_mxc_nand_v21(MX25_NFC_BASE_ADDR, MX25_INT_NANDFC, pdata) | 20 | imx_add_mxc_nand_v21(MX25_NFC_BASE_ADDR, MX25_INT_NANDFC, pdata) |
diff --git a/arch/arm/mach-mx25/devices.c b/arch/arm/mach-mx25/devices.c index e1c3cd14078c..1af852aa4e30 100644 --- a/arch/arm/mach-mx25/devices.c +++ b/arch/arm/mach-mx25/devices.c | |||
@@ -333,63 +333,6 @@ struct platform_device mxc_pwm_device3 = { | |||
333 | .resource = mxc_pwm_resources3, | 333 | .resource = mxc_pwm_resources3, |
334 | }; | 334 | }; |
335 | 335 | ||
336 | static struct resource mxc_i2c_1_resources[] = { | ||
337 | { | ||
338 | .start = 0x43f80000, | ||
339 | .end = 0x43f83fff, | ||
340 | .flags = IORESOURCE_MEM, | ||
341 | }, { | ||
342 | .start = 3, | ||
343 | .end = 3, | ||
344 | .flags = IORESOURCE_IRQ, | ||
345 | } | ||
346 | }; | ||
347 | |||
348 | struct platform_device mxc_i2c_device0 = { | ||
349 | .name = "imx-i2c", | ||
350 | .id = 0, | ||
351 | .num_resources = ARRAY_SIZE(mxc_i2c_1_resources), | ||
352 | .resource = mxc_i2c_1_resources, | ||
353 | }; | ||
354 | |||
355 | static struct resource mxc_i2c_2_resources[] = { | ||
356 | { | ||
357 | .start = 0x43f98000, | ||
358 | .end = 0x43f9bfff, | ||
359 | .flags = IORESOURCE_MEM, | ||
360 | }, { | ||
361 | .start = 4, | ||
362 | .end = 4, | ||
363 | .flags = IORESOURCE_IRQ, | ||
364 | } | ||
365 | }; | ||
366 | |||
367 | struct platform_device mxc_i2c_device1 = { | ||
368 | .name = "imx-i2c", | ||
369 | .id = 1, | ||
370 | .num_resources = ARRAY_SIZE(mxc_i2c_2_resources), | ||
371 | .resource = mxc_i2c_2_resources, | ||
372 | }; | ||
373 | |||
374 | static struct resource mxc_i2c_3_resources[] = { | ||
375 | { | ||
376 | .start = 0x43f84000, | ||
377 | .end = 0x43f87fff, | ||
378 | .flags = IORESOURCE_MEM, | ||
379 | }, { | ||
380 | .start = 10, | ||
381 | .end = 10, | ||
382 | .flags = IORESOURCE_IRQ, | ||
383 | } | ||
384 | }; | ||
385 | |||
386 | struct platform_device mxc_i2c_device2 = { | ||
387 | .name = "imx-i2c", | ||
388 | .id = 2, | ||
389 | .num_resources = ARRAY_SIZE(mxc_i2c_3_resources), | ||
390 | .resource = mxc_i2c_3_resources, | ||
391 | }; | ||
392 | |||
393 | static struct mxc_gpio_port imx_gpio_ports[] = { | 336 | static struct mxc_gpio_port imx_gpio_ports[] = { |
394 | { | 337 | { |
395 | .chip.label = "gpio-0", | 338 | .chip.label = "gpio-0", |
diff --git a/arch/arm/mach-mx25/devices.h b/arch/arm/mach-mx25/devices.h index f212c93648c9..f2775143d023 100644 --- a/arch/arm/mach-mx25/devices.h +++ b/arch/arm/mach-mx25/devices.h | |||
@@ -14,9 +14,6 @@ extern struct platform_device mxc_pwm_device1; | |||
14 | extern struct platform_device mxc_pwm_device2; | 14 | extern struct platform_device mxc_pwm_device2; |
15 | extern struct platform_device mxc_pwm_device3; | 15 | extern struct platform_device mxc_pwm_device3; |
16 | extern struct platform_device mxc_keypad_device; | 16 | extern struct platform_device mxc_keypad_device; |
17 | extern struct platform_device mxc_i2c_device0; | ||
18 | extern struct platform_device mxc_i2c_device1; | ||
19 | extern struct platform_device mxc_i2c_device2; | ||
20 | extern struct platform_device mx25_fec_device; | 17 | extern struct platform_device mx25_fec_device; |
21 | extern struct platform_device mx25_rtc_device; | 18 | extern struct platform_device mx25_rtc_device; |
22 | extern struct platform_device mx25_fb_device; | 19 | extern struct platform_device mx25_fb_device; |
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h index 4eb6e334bda5..1ebf33fedaaf 100644 --- a/arch/arm/plat-mxc/include/mach/mx25.h +++ b/arch/arm/plat-mxc/include/mach/mx25.h | |||
@@ -11,6 +11,9 @@ | |||
11 | #define MX25_AVIC_BASE_ADDR_VIRT 0xfc400000 | 11 | #define MX25_AVIC_BASE_ADDR_VIRT 0xfc400000 |
12 | #define MX25_AVIC_SIZE SZ_1M | 12 | #define MX25_AVIC_SIZE SZ_1M |
13 | 13 | ||
14 | #define MX25_I2C1_BASE_ADDR (MX25_AIPS1_BASE_ADDR + 0x80000) | ||
15 | #define MX25_I2C3_BASE_ADDR (MX25_AIPS1_BASE_ADDR + 0x84000) | ||
16 | #define MX25_I2C2_BASE_ADDR (MX25_AIPS1_BASE_ADDR + 0x98000) | ||
14 | #define MX25_IOMUXC_BASE_ADDR (MX25_AIPS1_BASE_ADDR + 0xac000) | 17 | #define MX25_IOMUXC_BASE_ADDR (MX25_AIPS1_BASE_ADDR + 0xac000) |
15 | 18 | ||
16 | #define MX25_CRM_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x80000) | 19 | #define MX25_CRM_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x80000) |
@@ -35,10 +38,13 @@ | |||
35 | #define MX25_DRYICE_BASE_ADDR 0x53ffc000 | 38 | #define MX25_DRYICE_BASE_ADDR 0x53ffc000 |
36 | #define MX25_LCDC_BASE_ADDR 0x53fbc000 | 39 | #define MX25_LCDC_BASE_ADDR 0x53fbc000 |
37 | 40 | ||
38 | #define MX25_INT_DRYICE 25 | 41 | #define MX25_INT_I2C1 3 |
39 | #define MX25_INT_FEC 57 | 42 | #define MX25_INT_I2C2 4 |
40 | #define MX25_INT_NANDFC 33 | 43 | #define MX25_INT_I2C3 10 |
41 | #define MX25_INT_LCDC 39 | 44 | #define MX25_INT_DRYICE 25 |
45 | #define MX25_INT_FEC 57 | ||
46 | #define MX25_INT_NANDFC 33 | ||
47 | #define MX25_INT_LCDC 39 | ||
42 | 48 | ||
43 | #if defined(IMX_NEEDS_DEPRECATED_SYMBOLS) | 49 | #if defined(IMX_NEEDS_DEPRECATED_SYMBOLS) |
44 | #define UART1_BASE_ADDR MX25_UART1_BASE_ADDR | 50 | #define UART1_BASE_ADDR MX25_UART1_BASE_ADDR |