diff options
author | Roland Stigge <stigge@antcom.de> | 2012-04-22 05:59:47 -0400 |
---|---|---|
committer | Roland Stigge <stigge@antcom.de> | 2012-04-22 05:59:47 -0400 |
commit | 1451ba3a5fa52d874e03a3380d053f3e6a5fcae4 (patch) | |
tree | e40a2b10951eabace15836d658eea8848d47564c /arch/arm/mach-lpc32xx | |
parent | c4cea7fc1bfd8a36d08f8114efcb11d649d97d5a (diff) |
i2c-pnx.c: Use resources in platforms
As a precondition for device tree conversion, the platforms using i2c-pnx.c are
converted to using mem and irq resources instead of platform data.
Signed-off-by: Roland Stigge <stigge@antcom.de>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-lpc32xx')
-rw-r--r-- | arch/arm/mach-lpc32xx/common.c | 67 |
1 files changed, 42 insertions, 25 deletions
diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c index bbbf063a74c2..6f255600fc97 100644 --- a/arch/arm/mach-lpc32xx/common.c +++ b/arch/arm/mach-lpc32xx/common.c | |||
@@ -27,7 +27,6 @@ | |||
27 | 27 | ||
28 | #include <asm/mach/map.h> | 28 | #include <asm/mach/map.h> |
29 | 29 | ||
30 | #include <mach/i2c.h> | ||
31 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
32 | #include <mach/platform.h> | 31 | #include <mach/platform.h> |
33 | #include "common.h" | 32 | #include "common.h" |
@@ -53,46 +52,64 @@ struct platform_device lpc32xx_watchdog_device = { | |||
53 | /* | 52 | /* |
54 | * I2C busses | 53 | * I2C busses |
55 | */ | 54 | */ |
56 | static struct i2c_pnx_data i2c0_data = { | 55 | static struct resource i2c0_resources[] = { |
57 | .name = I2C_CHIP_NAME "1", | 56 | [0] = { |
58 | .base = LPC32XX_I2C1_BASE, | 57 | .start = LPC32XX_I2C1_BASE, |
59 | .irq = IRQ_LPC32XX_I2C_1, | 58 | .end = LPC32XX_I2C1_BASE + 0x100 - 1, |
59 | .flags = IORESOURCE_MEM, | ||
60 | }, | ||
61 | [1] = { | ||
62 | .start = IRQ_LPC32XX_I2C_1, | ||
63 | .end = IRQ_LPC32XX_I2C_1, | ||
64 | .flags = IORESOURCE_IRQ, | ||
65 | }, | ||
60 | }; | 66 | }; |
61 | 67 | ||
62 | static struct i2c_pnx_data i2c1_data = { | 68 | static struct resource i2c1_resources[] = { |
63 | .name = I2C_CHIP_NAME "2", | 69 | [0] = { |
64 | .base = LPC32XX_I2C2_BASE, | 70 | .start = LPC32XX_I2C2_BASE, |
65 | .irq = IRQ_LPC32XX_I2C_2, | 71 | .end = LPC32XX_I2C2_BASE + 0x100 - 1, |
72 | .flags = IORESOURCE_MEM, | ||
73 | }, | ||
74 | [1] = { | ||
75 | .start = IRQ_LPC32XX_I2C_2, | ||
76 | .end = IRQ_LPC32XX_I2C_2, | ||
77 | .flags = IORESOURCE_IRQ, | ||
78 | }, | ||
66 | }; | 79 | }; |
67 | 80 | ||
68 | static struct i2c_pnx_data i2c2_data = { | 81 | static struct resource i2c2_resources[] = { |
69 | .name = "USB-I2C", | 82 | [0] = { |
70 | .base = LPC32XX_OTG_I2C_BASE, | 83 | .start = LPC32XX_OTG_I2C_BASE, |
71 | .irq = IRQ_LPC32XX_USB_I2C, | 84 | .end = LPC32XX_OTG_I2C_BASE + 0x100 - 1, |
85 | .flags = IORESOURCE_MEM, | ||
86 | }, | ||
87 | [1] = { | ||
88 | .start = IRQ_LPC32XX_USB_I2C, | ||
89 | .end = IRQ_LPC32XX_USB_I2C, | ||
90 | .flags = IORESOURCE_IRQ, | ||
91 | }, | ||
72 | }; | 92 | }; |
73 | 93 | ||
74 | struct platform_device lpc32xx_i2c0_device = { | 94 | struct platform_device lpc32xx_i2c0_device = { |
75 | .name = "pnx-i2c", | 95 | .name = "pnx-i2c.0", |
76 | .id = 0, | 96 | .id = 0, |
77 | .dev = { | 97 | .num_resources = ARRAY_SIZE(i2c0_resources), |
78 | .platform_data = &i2c0_data, | 98 | .resource = i2c0_resources, |
79 | }, | ||
80 | }; | 99 | }; |
81 | 100 | ||
82 | struct platform_device lpc32xx_i2c1_device = { | 101 | struct platform_device lpc32xx_i2c1_device = { |
83 | .name = "pnx-i2c", | 102 | .name = "pnx-i2c.1", |
84 | .id = 1, | 103 | .id = 1, |
85 | .dev = { | 104 | .num_resources = ARRAY_SIZE(i2c1_resources), |
86 | .platform_data = &i2c1_data, | 105 | .resource = i2c1_resources, |
87 | }, | ||
88 | }; | 106 | }; |
89 | 107 | ||
90 | struct platform_device lpc32xx_i2c2_device = { | 108 | struct platform_device lpc32xx_i2c2_device = { |
91 | .name = "pnx-i2c", | 109 | .name = "pnx-i2c.2", |
92 | .id = 2, | 110 | .id = 2, |
93 | .dev = { | 111 | .num_resources = ARRAY_SIZE(i2c2_resources), |
94 | .platform_data = &i2c2_data, | 112 | .resource = i2c2_resources, |
95 | }, | ||
96 | }; | 113 | }; |
97 | 114 | ||
98 | /* TSC (Touch Screen Controller) */ | 115 | /* TSC (Touch Screen Controller) */ |