diff options
author | Michael-Luke Jones <mlj28@cam.ac.uk> | 2008-01-27 12:14:46 -0500 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2008-01-27 12:14:46 -0500 |
commit | 5a4a2387717ec57ec2a9154beb281e09c19fc26e (patch) | |
tree | 320f2932100e5b078c88cccade6f995f6876fa72 /arch/arm | |
parent | eee87d3196c9a7ac3422f4298e2250ca68d791c1 (diff) |
ixp4xx-i2c-gpio
Migrate all ixp4xx devices to the bitbanging I2C bus driver utilizing
the arch-neutral GPIO API (linux/i2c-gpio.h).
Tested by the nslu2-linux and openwrt projects in public firmware releases.
Signed-off-by: Michael-Luke Jones <mlj28@cam.ac.uk>
Acked-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-ixp4xx/avila-setup.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/dsmg600-setup.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/ixdp425-setup.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/nas100d-setup.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/nslu2-setup.c | 14 |
5 files changed, 38 insertions, 31 deletions
diff --git a/arch/arm/mach-ixp4xx/avila-setup.c b/arch/arm/mach-ixp4xx/avila-setup.c index d59b8dc7dc7a..e38f45fa58ae 100644 --- a/arch/arm/mach-ixp4xx/avila-setup.c +++ b/arch/arm/mach-ixp4xx/avila-setup.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/tty.h> | 18 | #include <linux/tty.h> |
19 | #include <linux/serial_8250.h> | 19 | #include <linux/serial_8250.h> |
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | #include <linux/i2c-gpio.h> | ||
21 | 22 | ||
22 | #include <asm/types.h> | 23 | #include <asm/types.h> |
23 | #include <asm/setup.h> | 24 | #include <asm/setup.h> |
@@ -47,18 +48,17 @@ static struct platform_device avila_flash = { | |||
47 | .resource = &avila_flash_resource, | 48 | .resource = &avila_flash_resource, |
48 | }; | 49 | }; |
49 | 50 | ||
50 | static struct ixp4xx_i2c_pins avila_i2c_gpio_pins = { | 51 | static struct i2c_gpio_platform_data avila_i2c_gpio_data = { |
51 | .sda_pin = AVILA_SDA_PIN, | 52 | .sda_pin = AVILA_SDA_PIN, |
52 | .scl_pin = AVILA_SCL_PIN, | 53 | .scl_pin = AVILA_SCL_PIN, |
53 | }; | 54 | }; |
54 | 55 | ||
55 | static struct platform_device avila_i2c_controller = { | 56 | static struct platform_device avila_i2c_gpio = { |
56 | .name = "IXP4XX-I2C", | 57 | .name = "i2c-gpio", |
57 | .id = 0, | 58 | .id = 0, |
58 | .dev = { | 59 | .dev = { |
59 | .platform_data = &avila_i2c_gpio_pins, | 60 | .platform_data = &avila_i2c_gpio_data, |
60 | }, | 61 | }, |
61 | .num_resources = 0 | ||
62 | }; | 62 | }; |
63 | 63 | ||
64 | static struct resource avila_uart_resources[] = { | 64 | static struct resource avila_uart_resources[] = { |
@@ -133,7 +133,7 @@ static struct platform_device avila_pata = { | |||
133 | }; | 133 | }; |
134 | 134 | ||
135 | static struct platform_device *avila_devices[] __initdata = { | 135 | static struct platform_device *avila_devices[] __initdata = { |
136 | &avila_i2c_controller, | 136 | &avila_i2c_gpio, |
137 | &avila_flash, | 137 | &avila_flash, |
138 | &avila_uart | 138 | &avila_uart |
139 | }; | 139 | }; |
diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c index 1e75e105c4f7..c473d408aa7c 100644 --- a/arch/arm/mach-ixp4xx/dsmg600-setup.c +++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/serial.h> | 15 | #include <linux/serial.h> |
16 | #include <linux/serial_8250.h> | 16 | #include <linux/serial_8250.h> |
17 | #include <linux/i2c-gpio.h> | ||
17 | 18 | ||
18 | #include <asm/mach-types.h> | 19 | #include <asm/mach-types.h> |
19 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
@@ -37,15 +38,17 @@ static struct platform_device dsmg600_flash = { | |||
37 | .resource = &dsmg600_flash_resource, | 38 | .resource = &dsmg600_flash_resource, |
38 | }; | 39 | }; |
39 | 40 | ||
40 | static struct ixp4xx_i2c_pins dsmg600_i2c_gpio_pins = { | 41 | static struct i2c_gpio_platform_data dsmg600_i2c_gpio_data = { |
41 | .sda_pin = DSMG600_SDA_PIN, | 42 | .sda_pin = DSMG600_SDA_PIN, |
42 | .scl_pin = DSMG600_SCL_PIN, | 43 | .scl_pin = DSMG600_SCL_PIN, |
43 | }; | 44 | }; |
44 | 45 | ||
45 | static struct platform_device dsmg600_i2c_controller = { | 46 | static struct platform_device dsmg600_i2c_gpio = { |
46 | .name = "IXP4XX-I2C", | 47 | .name = "i2c-gpio", |
47 | .id = 0, | 48 | .id = 0, |
48 | .dev.platform_data = &dsmg600_i2c_gpio_pins, | 49 | .dev = { |
50 | .platform_data = &dsmg600_i2c_gpio_data, | ||
51 | }, | ||
49 | }; | 52 | }; |
50 | 53 | ||
51 | #ifdef CONFIG_LEDS_CLASS | 54 | #ifdef CONFIG_LEDS_CLASS |
@@ -116,7 +119,7 @@ static struct platform_device dsmg600_uart = { | |||
116 | }; | 119 | }; |
117 | 120 | ||
118 | static struct platform_device *dsmg600_devices[] __initdata = { | 121 | static struct platform_device *dsmg600_devices[] __initdata = { |
119 | &dsmg600_i2c_controller, | 122 | &dsmg600_i2c_gpio, |
120 | &dsmg600_flash, | 123 | &dsmg600_flash, |
121 | }; | 124 | }; |
122 | 125 | ||
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c index d5008d8fc9a5..e89070da28bf 100644 --- a/arch/arm/mach-ixp4xx/ixdp425-setup.c +++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/tty.h> | 15 | #include <linux/tty.h> |
16 | #include <linux/serial_8250.h> | 16 | #include <linux/serial_8250.h> |
17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
18 | #include <linux/i2c-gpio.h> | ||
18 | #include <linux/io.h> | 19 | #include <linux/io.h> |
19 | #include <linux/mtd/mtd.h> | 20 | #include <linux/mtd/mtd.h> |
20 | #include <linux/mtd/nand.h> | 21 | #include <linux/mtd/nand.h> |
@@ -120,18 +121,17 @@ static struct platform_device ixdp425_flash_nand = { | |||
120 | }; | 121 | }; |
121 | #endif /* CONFIG_MTD_NAND_PLATFORM */ | 122 | #endif /* CONFIG_MTD_NAND_PLATFORM */ |
122 | 123 | ||
123 | static struct ixp4xx_i2c_pins ixdp425_i2c_gpio_pins = { | 124 | static struct i2c_gpio_platform_data ixdp425_i2c_gpio_data = { |
124 | .sda_pin = IXDP425_SDA_PIN, | 125 | .sda_pin = IXDP425_SDA_PIN, |
125 | .scl_pin = IXDP425_SCL_PIN, | 126 | .scl_pin = IXDP425_SCL_PIN, |
126 | }; | 127 | }; |
127 | 128 | ||
128 | static struct platform_device ixdp425_i2c_controller = { | 129 | static struct platform_device ixdp425_i2c_gpio = { |
129 | .name = "IXP4XX-I2C", | 130 | .name = "i2c-gpio", |
130 | .id = 0, | 131 | .id = 0, |
131 | .dev = { | 132 | .dev = { |
132 | .platform_data = &ixdp425_i2c_gpio_pins, | 133 | .platform_data = &ixdp425_i2c_gpio_data, |
133 | }, | 134 | }, |
134 | .num_resources = 0 | ||
135 | }; | 135 | }; |
136 | 136 | ||
137 | static struct resource ixdp425_uart_resources[] = { | 137 | static struct resource ixdp425_uart_resources[] = { |
@@ -178,7 +178,7 @@ static struct platform_device ixdp425_uart = { | |||
178 | }; | 178 | }; |
179 | 179 | ||
180 | static struct platform_device *ixdp425_devices[] __initdata = { | 180 | static struct platform_device *ixdp425_devices[] __initdata = { |
181 | &ixdp425_i2c_controller, | 181 | &ixdp425_i2c_gpio, |
182 | &ixdp425_flash, | 182 | &ixdp425_flash, |
183 | #if defined(CONFIG_MTD_NAND_PLATFORM) || \ | 183 | #if defined(CONFIG_MTD_NAND_PLATFORM) || \ |
184 | defined(CONFIG_MTD_NAND_PLATFORM_MODULE) | 184 | defined(CONFIG_MTD_NAND_PLATFORM_MODULE) |
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c index 78a17413ceca..54d884fb2517 100644 --- a/arch/arm/mach-ixp4xx/nas100d-setup.c +++ b/arch/arm/mach-ixp4xx/nas100d-setup.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/serial.h> | 16 | #include <linux/serial.h> |
17 | #include <linux/serial_8250.h> | 17 | #include <linux/serial_8250.h> |
18 | #include <linux/leds.h> | 18 | #include <linux/leds.h> |
19 | #include <linux/i2c-gpio.h> | ||
19 | 20 | ||
20 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
21 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
@@ -68,16 +69,17 @@ static struct platform_device nas100d_leds = { | |||
68 | }; | 69 | }; |
69 | #endif | 70 | #endif |
70 | 71 | ||
71 | static struct ixp4xx_i2c_pins nas100d_i2c_gpio_pins = { | 72 | static struct i2c_gpio_platform_data nas100d_i2c_gpio_data = { |
72 | .sda_pin = NAS100D_SDA_PIN, | 73 | .sda_pin = NAS100D_SDA_PIN, |
73 | .scl_pin = NAS100D_SCL_PIN, | 74 | .scl_pin = NAS100D_SCL_PIN, |
74 | }; | 75 | }; |
75 | 76 | ||
76 | static struct platform_device nas100d_i2c_controller = { | 77 | static struct platform_device nas100d_i2c_gpio = { |
77 | .name = "IXP4XX-I2C", | 78 | .name = "i2c-gpio", |
78 | .id = 0, | 79 | .id = 0, |
79 | .dev.platform_data = &nas100d_i2c_gpio_pins, | 80 | .dev = { |
80 | .num_resources = 0, | 81 | .platform_data = &nas100d_i2c_gpio_data, |
82 | }, | ||
81 | }; | 83 | }; |
82 | 84 | ||
83 | static struct resource nas100d_uart_resources[] = { | 85 | static struct resource nas100d_uart_resources[] = { |
@@ -124,7 +126,7 @@ static struct platform_device nas100d_uart = { | |||
124 | }; | 126 | }; |
125 | 127 | ||
126 | static struct platform_device *nas100d_devices[] __initdata = { | 128 | static struct platform_device *nas100d_devices[] __initdata = { |
127 | &nas100d_i2c_controller, | 129 | &nas100d_i2c_gpio, |
128 | &nas100d_flash, | 130 | &nas100d_flash, |
129 | #ifdef CONFIG_LEDS_IXP4XX | 131 | #ifdef CONFIG_LEDS_IXP4XX |
130 | &nas100d_leds, | 132 | &nas100d_leds, |
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c index 9bf8ccbcaccf..77277d27fcc5 100644 --- a/arch/arm/mach-ixp4xx/nslu2-setup.c +++ b/arch/arm/mach-ixp4xx/nslu2-setup.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/serial.h> | 18 | #include <linux/serial.h> |
19 | #include <linux/serial_8250.h> | 19 | #include <linux/serial_8250.h> |
20 | #include <linux/leds.h> | 20 | #include <linux/leds.h> |
21 | #include <linux/i2c-gpio.h> | ||
21 | 22 | ||
22 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
23 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
@@ -41,7 +42,7 @@ static struct platform_device nslu2_flash = { | |||
41 | .resource = &nslu2_flash_resource, | 42 | .resource = &nslu2_flash_resource, |
42 | }; | 43 | }; |
43 | 44 | ||
44 | static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = { | 45 | static struct i2c_gpio_platform_data nslu2_i2c_gpio_data = { |
45 | .sda_pin = NSLU2_SDA_PIN, | 46 | .sda_pin = NSLU2_SDA_PIN, |
46 | .scl_pin = NSLU2_SCL_PIN, | 47 | .scl_pin = NSLU2_SCL_PIN, |
47 | }; | 48 | }; |
@@ -82,11 +83,12 @@ static struct platform_device nslu2_leds = { | |||
82 | }; | 83 | }; |
83 | #endif | 84 | #endif |
84 | 85 | ||
85 | static struct platform_device nslu2_i2c_controller = { | 86 | static struct platform_device nslu2_i2c_gpio = { |
86 | .name = "IXP4XX-I2C", | 87 | .name = "i2c-gpio", |
87 | .id = 0, | 88 | .id = 0, |
88 | .dev.platform_data = &nslu2_i2c_gpio_pins, | 89 | .dev = { |
89 | .num_resources = 0, | 90 | .platform_data = &nslu2_i2c_gpio_data, |
91 | }, | ||
90 | }; | 92 | }; |
91 | 93 | ||
92 | static struct platform_device nslu2_beeper = { | 94 | static struct platform_device nslu2_beeper = { |
@@ -139,7 +141,7 @@ static struct platform_device nslu2_uart = { | |||
139 | }; | 141 | }; |
140 | 142 | ||
141 | static struct platform_device *nslu2_devices[] __initdata = { | 143 | static struct platform_device *nslu2_devices[] __initdata = { |
142 | &nslu2_i2c_controller, | 144 | &nslu2_i2c_gpio, |
143 | &nslu2_flash, | 145 | &nslu2_flash, |
144 | &nslu2_beeper, | 146 | &nslu2_beeper, |
145 | #ifdef CONFIG_LEDS_IXP4XX | 147 | #ifdef CONFIG_LEDS_IXP4XX |