aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/board-mop500.c
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2010-05-03 03:24:37 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-05-04 12:50:04 -0400
commitf9faf23799d0726afb56ee6c6c53fbea00ec7de3 (patch)
tree02145fb643743488cffd057a687ed3737c96d2ad /arch/arm/mach-ux500/board-mop500.c
parent4b27aa4140c20380a67ecefaa48cf3714cc0b8ea (diff)
ARM: 6085/1: ux500: reorganize i2c devices
Move common i2c devices to devices.c and DB8500-specific I2C devices to devices-db8500.c. Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500.c')
-rw-r--r--arch/arm/mach-ux500/board-mop500.c50
1 files changed, 10 insertions, 40 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 0e595bf3366e..cd0bd36221b9 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -70,27 +70,8 @@ static struct pl022_ssp_controller ssp0_platform_data = {
70 .num_chipselect = 5, 70 .num_chipselect = 5,
71}; 71};
72 72
73#define U8500_I2C_RESOURCES(id, size) \
74static struct resource u8500_i2c_resources_##id[] = { \
75 [0] = { \
76 .start = U8500_I2C##id##_BASE, \
77 .end = U8500_I2C##id##_BASE + size - 1, \
78 .flags = IORESOURCE_MEM, \
79 }, \
80 [1] = { \
81 .start = IRQ_I2C##id, \
82 .end = IRQ_I2C##id, \
83 .flags = IORESOURCE_IRQ \
84 } \
85}
86
87U8500_I2C_RESOURCES(0, SZ_4K);
88U8500_I2C_RESOURCES(1, SZ_4K);
89U8500_I2C_RESOURCES(2, SZ_4K);
90U8500_I2C_RESOURCES(3, SZ_4K);
91
92#define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ 73#define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \
93static struct nmk_i2c_controller u8500_i2c_##id = { \ 74static struct nmk_i2c_controller u8500_i2c##id##_data = { \
94 /* \ 75 /* \
95 * slave data setup time, which is \ 76 * slave data setup time, which is \
96 * 250 ns,100ns,10ns which is 14,6,2 \ 77 * 250 ns,100ns,10ns which is 14,6,2 \
@@ -118,22 +99,6 @@ U8500_I2C_CONTROLLER(1, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD);
118U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); 99U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD);
119U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); 100U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD);
120 101
121#define U8500_I2C_PDEVICE(cid) \
122static struct platform_device i2c_controller##cid = { \
123 .name = "nmk-i2c", \
124 .id = cid, \
125 .num_resources = 2, \
126 .resource = u8500_i2c_resources_##cid, \
127 .dev = { \
128 .platform_data = &u8500_i2c_##cid \
129 } \
130}
131
132U8500_I2C_PDEVICE(0);
133U8500_I2C_PDEVICE(1);
134U8500_I2C_PDEVICE(2);
135U8500_I2C_PDEVICE(3);
136
137static struct amba_device *amba_devs[] __initdata = { 102static struct amba_device *amba_devs[] __initdata = {
138 &ux500_uart0_device, 103 &ux500_uart0_device,
139 &ux500_uart1_device, 104 &ux500_uart1_device,
@@ -143,16 +108,21 @@ static struct amba_device *amba_devs[] __initdata = {
143 108
144/* add any platform devices here - TODO */ 109/* add any platform devices here - TODO */
145static struct platform_device *platform_devs[] __initdata = { 110static struct platform_device *platform_devs[] __initdata = {
146 &i2c_controller0, 111 &u8500_i2c0_device,
147 &i2c_controller1, 112 &ux500_i2c1_device,
148 &i2c_controller2, 113 &ux500_i2c2_device,
149 &i2c_controller3, 114 &ux500_i2c3_device,
150}; 115};
151 116
152static void __init u8500_init_machine(void) 117static void __init u8500_init_machine(void)
153{ 118{
154 int i; 119 int i;
155 120
121 u8500_i2c0_device.dev.platform_data = &u8500_i2c0_data;
122 ux500_i2c1_device.dev.platform_data = &u8500_i2c1_data;
123 ux500_i2c2_device.dev.platform_data = &u8500_i2c2_data;
124 ux500_i2c3_device.dev.platform_data = &u8500_i2c3_data;
125
156 u8500_ssp0_device.dev.platform_data = &ssp0_platform_data; 126 u8500_ssp0_device.dev.platform_data = &ssp0_platform_data;
157 127
158 /* Register the active AMBA devices on this board */ 128 /* Register the active AMBA devices on this board */