89d39903c5fb0a877555d25422313dc818796181
[openwrt.git] / target / linux / ixp4xx / patches-2.6.23 / 020-ixp4xx_i2c_gpio.patch
1 Migrate all ixp4xx devices to the bitbanging I2C bus driver utilizing
2 the arch-neutral GPIO API (linux/i2c-gpio.h).
3
4 Tested by the nslu2-linux and openwrt projects in public firmware releases.
5
6 Acked-by: Rod Whitby <rod@whitby.id.au>
7 Signed-off-by: Michael-Luke Jones <mlj28@cam.ac.uk>
8
9 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/nslu2-setup.c
10 ===================================================================
11 --- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
12 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/nslu2-setup.c
13 @@ -18,6 +18,7 @@
14 #include <linux/serial.h>
15 #include <linux/serial_8250.h>
16 #include <linux/leds.h>
17 +#include <linux/i2c-gpio.h>
18
19 #include <asm/mach-types.h>
20 #include <asm/mach/arch.h>
21 @@ -41,7 +42,7 @@ static struct platform_device nslu2_flas
22 .resource = &nslu2_flash_resource,
23 };
24
25 -static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = {
26 +static struct i2c_gpio_platform_data nslu2_i2c_gpio_data = {
27 .sda_pin = NSLU2_SDA_PIN,
28 .scl_pin = NSLU2_SCL_PIN,
29 };
30 @@ -82,11 +83,12 @@ static struct platform_device nslu2_leds
31 };
32 #endif
33
34 -static struct platform_device nslu2_i2c_controller = {
35 - .name = "IXP4XX-I2C",
36 +static struct platform_device nslu2_i2c_gpio = {
37 + .name = "i2c-gpio",
38 .id = 0,
39 - .dev.platform_data = &nslu2_i2c_gpio_pins,
40 - .num_resources = 0,
41 + .dev = {
42 + .platform_data = &nslu2_i2c_gpio_data,
43 + },
44 };
45
46 static struct platform_device nslu2_beeper = {
47 @@ -139,7 +141,7 @@ static struct platform_device nslu2_uart
48 };
49
50 static struct platform_device *nslu2_devices[] __initdata = {
51 - &nslu2_i2c_controller,
52 + &nslu2_i2c_gpio,
53 &nslu2_flash,
54 &nslu2_beeper,
55 #ifdef CONFIG_LEDS_IXP4XX
56 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/nas100d-setup.c
57 ===================================================================
58 --- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
59 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/nas100d-setup.c
60 @@ -16,6 +16,7 @@
61 #include <linux/serial.h>
62 #include <linux/serial_8250.h>
63 #include <linux/leds.h>
64 +#include <linux/i2c-gpio.h>
65
66 #include <asm/mach-types.h>
67 #include <asm/mach/arch.h>
68 @@ -68,16 +69,17 @@ static struct platform_device nas100d_le
69 };
70 #endif
71
72 -static struct ixp4xx_i2c_pins nas100d_i2c_gpio_pins = {
73 +static struct i2c_gpio_platform_data nas100d_i2c_gpio_data = {
74 .sda_pin = NAS100D_SDA_PIN,
75 .scl_pin = NAS100D_SCL_PIN,
76 };
77
78 -static struct platform_device nas100d_i2c_controller = {
79 - .name = "IXP4XX-I2C",
80 +static struct platform_device nas100d_i2c_gpio = {
81 + .name = "i2c-gpio",
82 .id = 0,
83 - .dev.platform_data = &nas100d_i2c_gpio_pins,
84 - .num_resources = 0,
85 + .dev = {
86 + .platform_data = &nas100d_i2c_gpio_data,
87 + },
88 };
89
90 static struct resource nas100d_uart_resources[] = {
91 @@ -124,7 +126,7 @@ static struct platform_device nas100d_ua
92 };
93
94 static struct platform_device *nas100d_devices[] __initdata = {
95 - &nas100d_i2c_controller,
96 + &nas100d_i2c_gpio,
97 &nas100d_flash,
98 #ifdef CONFIG_LEDS_IXP4XX
99 &nas100d_leds,
100 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
101 ===================================================================
102 --- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/avila-setup.c
103 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
104 @@ -18,6 +18,7 @@
105 #include <linux/tty.h>
106 #include <linux/serial_8250.h>
107 #include <linux/slab.h>
108 +#include <linux/i2c-gpio.h>
109
110 #include <asm/types.h>
111 #include <asm/setup.h>
112 @@ -47,18 +48,17 @@ static struct platform_device avila_flas
113 .resource = &avila_flash_resource,
114 };
115
116 -static struct ixp4xx_i2c_pins avila_i2c_gpio_pins = {
117 +static struct i2c_gpio_platform_data avila_i2c_gpio_data = {
118 .sda_pin = AVILA_SDA_PIN,
119 .scl_pin = AVILA_SCL_PIN,
120 };
121
122 -static struct platform_device avila_i2c_controller = {
123 - .name = "IXP4XX-I2C",
124 +static struct platform_device avila_i2c_gpio = {
125 + .name = "i2c-gpio",
126 .id = 0,
127 - .dev = {
128 - .platform_data = &avila_i2c_gpio_pins,
129 + .dev = {
130 + .platform_data = &avila_i2c_gpio_data,
131 },
132 - .num_resources = 0
133 };
134
135 static struct resource avila_uart_resources[] = {
136 @@ -133,7 +133,7 @@ static struct platform_device avila_pata
137 };
138
139 static struct platform_device *avila_devices[] __initdata = {
140 - &avila_i2c_controller,
141 + &avila_i2c_gpio,
142 &avila_flash,
143 &avila_uart
144 };
145 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/dsmg600-setup.c
146 ===================================================================
147 --- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c
148 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/dsmg600-setup.c
149 @@ -14,6 +14,7 @@
150 #include <linux/kernel.h>
151 #include <linux/serial.h>
152 #include <linux/serial_8250.h>
153 +#include <linux/i2c-gpio.h>
154
155 #include <asm/mach-types.h>
156 #include <asm/mach/arch.h>
157 @@ -37,15 +38,17 @@ static struct platform_device dsmg600_fl
158 .resource = &dsmg600_flash_resource,
159 };
160
161 -static struct ixp4xx_i2c_pins dsmg600_i2c_gpio_pins = {
162 +static struct i2c_gpio_platform_data dsmg600_i2c_gpio_data = {
163 .sda_pin = DSMG600_SDA_PIN,
164 .scl_pin = DSMG600_SCL_PIN,
165 };
166
167 -static struct platform_device dsmg600_i2c_controller = {
168 - .name = "IXP4XX-I2C",
169 +static struct platform_device dsmg600_i2c_gpio = {
170 + .name = "i2c-gpio",
171 .id = 0,
172 - .dev.platform_data = &dsmg600_i2c_gpio_pins,
173 + .dev = {
174 + .platform_data = &dsmg600_i2c_gpio_data,
175 + },
176 };
177
178 #ifdef CONFIG_LEDS_CLASS
179 @@ -116,7 +119,7 @@ static struct platform_device dsmg600_ua
180 };
181
182 static struct platform_device *dsmg600_devices[] __initdata = {
183 - &dsmg600_i2c_controller,
184 + &dsmg600_i2c_gpio,
185 &dsmg600_flash,
186 };
187
188 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/ixdp425-setup.c
189 ===================================================================
190 --- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/ixdp425-setup.c
191 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/ixdp425-setup.c
192 @@ -15,6 +15,7 @@
193 #include <linux/tty.h>
194 #include <linux/serial_8250.h>
195 #include <linux/slab.h>
196 +#include <linux/i2c-gpio.h>
197 #include <linux/io.h>
198 #include <linux/mtd/mtd.h>
199 #include <linux/mtd/nand.h>
200 @@ -120,18 +121,17 @@ static struct platform_device ixdp425_fl
201 };
202 #endif /* CONFIG_MTD_NAND_PLATFORM */
203
204 -static struct ixp4xx_i2c_pins ixdp425_i2c_gpio_pins = {
205 +static struct i2c_gpio_platform_data ixdp425_i2c_gpio_data = {
206 .sda_pin = IXDP425_SDA_PIN,
207 .scl_pin = IXDP425_SCL_PIN,
208 };
209
210 -static struct platform_device ixdp425_i2c_controller = {
211 - .name = "IXP4XX-I2C",
212 +static struct platform_device ixdp425_i2c_gpio = {
213 + .name = "i2c-gpio",
214 .id = 0,
215 - .dev = {
216 - .platform_data = &ixdp425_i2c_gpio_pins,
217 + .dev = {
218 + .platform_data = &ixdp425_i2c_gpio_data,
219 },
220 - .num_resources = 0
221 };
222
223 static struct resource ixdp425_uart_resources[] = {
224 @@ -178,7 +178,7 @@ static struct platform_device ixdp425_ua
225 };
226
227 static struct platform_device *ixdp425_devices[] __initdata = {
228 - &ixdp425_i2c_controller,
229 + &ixdp425_i2c_gpio,
230 &ixdp425_flash,
231 #if defined(CONFIG_MTD_NAND_PLATFORM) || \
232 defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
This page took 0.057803 seconds and 3 git commands to generate.