1 Migrate all ixp4xx devices to the bitbanging I2C bus driver utilizing
2 the arch-neutral GPIO API (linux/i2c-gpio.h).
4 Tested by the nslu2-linux and openwrt projects in public firmware releases.
6 Acked-by: Rod Whitby <rod@whitby.id.au>
7 Signed-off-by: Michael-Luke Jones <mlj28@cam.ac.uk>
9 Index: linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c
10 ===================================================================
11 --- linux-2.6.24-rc6-armeb.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2008-01-05 18:10:05.000000000 +1030
12 +++ linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c 2008-01-05 18:10:10.000000000 +1030
14 #include <linux/serial.h>
15 #include <linux/serial_8250.h>
16 #include <linux/leds.h>
17 +#include <linux/i2c-gpio.h>
19 #include <asm/mach-types.h>
20 #include <asm/mach/arch.h>
22 .resource = &nslu2_flash_resource,
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,
34 -static struct platform_device nslu2_i2c_controller = {
35 - .name = "IXP4XX-I2C",
36 +static struct platform_device nslu2_i2c_gpio = {
39 - .dev.platform_data = &nslu2_i2c_gpio_pins,
42 + .platform_data = &nslu2_i2c_gpio_data,
46 static struct platform_device nslu2_beeper = {
50 static struct platform_device *nslu2_devices[] __initdata = {
51 - &nslu2_i2c_controller,
55 #ifdef CONFIG_LEDS_IXP4XX
56 Index: linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c
57 ===================================================================
58 --- linux-2.6.24-rc6-armeb.orig/arch/arm/mach-ixp4xx/nas100d-setup.c 2008-01-05 18:10:05.000000000 +1030
59 +++ linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c 2008-01-05 18:10:10.000000000 +1030
61 #include <linux/serial.h>
62 #include <linux/serial_8250.h>
63 #include <linux/leds.h>
64 +#include <linux/i2c-gpio.h>
66 #include <asm/mach-types.h>
67 #include <asm/mach/arch.h>
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,
78 -static struct platform_device nas100d_i2c_controller = {
79 - .name = "IXP4XX-I2C",
80 +static struct platform_device nas100d_i2c_gpio = {
83 - .dev.platform_data = &nas100d_i2c_gpio_pins,
86 + .platform_data = &nas100d_i2c_gpio_data,
90 static struct resource nas100d_uart_resources[] = {
94 static struct platform_device *nas100d_devices[] __initdata = {
95 - &nas100d_i2c_controller,
98 #ifdef CONFIG_LEDS_IXP4XX
100 Index: linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/avila-setup.c
101 ===================================================================
102 --- linux-2.6.24-rc6-armeb.orig/arch/arm/mach-ixp4xx/avila-setup.c 2008-01-05 18:10:05.000000000 +1030
103 +++ linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/avila-setup.c 2008-01-05 18:10:10.000000000 +1030
105 #include <linux/tty.h>
106 #include <linux/serial_8250.h>
107 #include <linux/slab.h>
108 +#include <linux/i2c-gpio.h>
110 #include <asm/types.h>
111 #include <asm/setup.h>
113 .resource = &avila_flash_resource,
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,
122 -static struct platform_device avila_i2c_controller = {
123 - .name = "IXP4XX-I2C",
124 +static struct platform_device avila_i2c_gpio = {
125 + .name = "i2c-gpio",
128 - .platform_data = &avila_i2c_gpio_pins,
130 + .platform_data = &avila_i2c_gpio_data,
135 static struct resource avila_uart_resources[] = {
139 static struct platform_device *avila_devices[] __initdata = {
140 - &avila_i2c_controller,
145 Index: linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/dsmg600-setup.c
146 ===================================================================
147 --- linux-2.6.24-rc6-armeb.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c 2008-01-05 18:10:05.000000000 +1030
148 +++ linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/dsmg600-setup.c 2008-01-05 18:10:10.000000000 +1030
150 #include <linux/kernel.h>
151 #include <linux/serial.h>
152 #include <linux/serial_8250.h>
153 +#include <linux/i2c-gpio.h>
155 #include <asm/mach-types.h>
156 #include <asm/mach/arch.h>
158 .resource = &dsmg600_flash_resource,
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,
167 -static struct platform_device dsmg600_i2c_controller = {
168 - .name = "IXP4XX-I2C",
169 +static struct platform_device dsmg600_i2c_gpio = {
170 + .name = "i2c-gpio",
172 - .dev.platform_data = &dsmg600_i2c_gpio_pins,
174 + .platform_data = &dsmg600_i2c_gpio_data,
178 #ifdef CONFIG_LEDS_CLASS
182 static struct platform_device *dsmg600_devices[] __initdata = {
183 - &dsmg600_i2c_controller,
188 Index: linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/ixdp425-setup.c
189 ===================================================================
190 --- linux-2.6.24-rc6-armeb.orig/arch/arm/mach-ixp4xx/ixdp425-setup.c 2008-01-05 18:10:05.000000000 +1030
191 +++ linux-2.6.24-rc6-armeb/arch/arm/mach-ixp4xx/ixdp425-setup.c 2008-01-05 18:10:10.000000000 +1030
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 @@
202 #endif /* CONFIG_MTD_NAND_PLATFORM */
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,
210 -static struct platform_device ixdp425_i2c_controller = {
211 - .name = "IXP4XX-I2C",
212 +static struct platform_device ixdp425_i2c_gpio = {
213 + .name = "i2c-gpio",
216 - .platform_data = &ixdp425_i2c_gpio_pins,
218 + .platform_data = &ixdp425_i2c_gpio_data,
223 static struct resource ixdp425_uart_resources[] = {
227 static struct platform_device *ixdp425_devices[] __initdata = {
228 - &ixdp425_i2c_controller,
231 #if defined(CONFIG_MTD_NAND_PLATFORM) || \
232 defined(CONFIG_MTD_NAND_PLATFORM_MODULE)