diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-iop3xx.c')
-rw-r--r-- | drivers/i2c/busses/i2c-iop3xx.c | 121 |
1 files changed, 61 insertions, 60 deletions
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c index 93f147a96b62..2f99613fd677 100644 --- a/drivers/i2c/busses/i2c-iop3xx.c +++ b/drivers/i2c/busses/i2c-iop3xx.c | |||
@@ -4,13 +4,13 @@ | |||
4 | /* Copyright (C) 2003 Peter Milne, D-TACQ Solutions Ltd | 4 | /* Copyright (C) 2003 Peter Milne, D-TACQ Solutions Ltd |
5 | * <Peter dot Milne at D hyphen TACQ dot com> | 5 | * <Peter dot Milne at D hyphen TACQ dot com> |
6 | * | 6 | * |
7 | * With acknowledgements to i2c-algo-ibm_ocp.c by | 7 | * With acknowledgements to i2c-algo-ibm_ocp.c by |
8 | * Ian DaSilva, MontaVista Software, Inc. idasilva@mvista.com | 8 | * Ian DaSilva, MontaVista Software, Inc. idasilva@mvista.com |
9 | * | 9 | * |
10 | * And i2c-algo-pcf.c, which was created by Simon G. Vogl and Hans Berglund: | 10 | * And i2c-algo-pcf.c, which was created by Simon G. Vogl and Hans Berglund: |
11 | * | 11 | * |
12 | * Copyright (C) 1995-1997 Simon G. Vogl, 1998-2000 Hans Berglund | 12 | * Copyright (C) 1995-1997 Simon G. Vogl, 1998-2000 Hans Berglund |
13 | * | 13 | * |
14 | * And which acknowledged Kyösti Mälkki <kmalkki@cc.hut.fi>, | 14 | * And which acknowledged Kyösti Mälkki <kmalkki@cc.hut.fi>, |
15 | * Frodo Looijaard <frodol@dds.nl>, Martin Bailey<mbailey@littlefeet-inc.com> | 15 | * Frodo Looijaard <frodol@dds.nl>, Martin Bailey<mbailey@littlefeet-inc.com> |
16 | * | 16 | * |
@@ -39,14 +39,15 @@ | |||
39 | #include <linux/platform_device.h> | 39 | #include <linux/platform_device.h> |
40 | #include <linux/i2c.h> | 40 | #include <linux/i2c.h> |
41 | #include <linux/io.h> | 41 | #include <linux/io.h> |
42 | #include <linux/gpio.h> | ||
42 | 43 | ||
43 | #include "i2c-iop3xx.h" | 44 | #include "i2c-iop3xx.h" |
44 | 45 | ||
45 | /* global unit counter */ | 46 | /* global unit counter */ |
46 | static int i2c_id; | 47 | static int i2c_id; |
47 | 48 | ||
48 | static inline unsigned char | 49 | static inline unsigned char |
49 | iic_cook_addr(struct i2c_msg *msg) | 50 | iic_cook_addr(struct i2c_msg *msg) |
50 | { | 51 | { |
51 | unsigned char addr; | 52 | unsigned char addr; |
52 | 53 | ||
@@ -55,38 +56,38 @@ iic_cook_addr(struct i2c_msg *msg) | |||
55 | if (msg->flags & I2C_M_RD) | 56 | if (msg->flags & I2C_M_RD) |
56 | addr |= 1; | 57 | addr |= 1; |
57 | 58 | ||
58 | return addr; | 59 | return addr; |
59 | } | 60 | } |
60 | 61 | ||
61 | static void | 62 | static void |
62 | iop3xx_i2c_reset(struct i2c_algo_iop3xx_data *iop3xx_adap) | 63 | iop3xx_i2c_reset(struct i2c_algo_iop3xx_data *iop3xx_adap) |
63 | { | 64 | { |
64 | /* Follows devman 9.3 */ | 65 | /* Follows devman 9.3 */ |
65 | __raw_writel(IOP3XX_ICR_UNIT_RESET, iop3xx_adap->ioaddr + CR_OFFSET); | 66 | __raw_writel(IOP3XX_ICR_UNIT_RESET, iop3xx_adap->ioaddr + CR_OFFSET); |
66 | __raw_writel(IOP3XX_ISR_CLEARBITS, iop3xx_adap->ioaddr + SR_OFFSET); | 67 | __raw_writel(IOP3XX_ISR_CLEARBITS, iop3xx_adap->ioaddr + SR_OFFSET); |
67 | __raw_writel(0, iop3xx_adap->ioaddr + CR_OFFSET); | 68 | __raw_writel(0, iop3xx_adap->ioaddr + CR_OFFSET); |
68 | } | 69 | } |
69 | 70 | ||
70 | static void | 71 | static void |
71 | iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap) | 72 | iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap) |
72 | { | 73 | { |
73 | u32 cr = IOP3XX_ICR_GCD | IOP3XX_ICR_SCLEN | IOP3XX_ICR_UE; | 74 | u32 cr = IOP3XX_ICR_GCD | IOP3XX_ICR_SCLEN | IOP3XX_ICR_UE; |
74 | 75 | ||
75 | /* | 76 | /* |
76 | * Every time unit enable is asserted, GPOD needs to be cleared | 77 | * Every time unit enable is asserted, GPOD needs to be cleared |
77 | * on IOP3XX to avoid data corruption on the bus. | 78 | * on IOP3XX to avoid data corruption on the bus. |
78 | */ | 79 | */ |
79 | #if defined(CONFIG_ARCH_IOP32X) || defined(CONFIG_ARCH_IOP33X) | 80 | #if defined(CONFIG_ARCH_IOP32X) || defined(CONFIG_ARCH_IOP33X) |
80 | if (iop3xx_adap->id == 0) { | 81 | if (iop3xx_adap->id == 0) { |
81 | gpio_line_set(IOP3XX_GPIO_LINE(7), GPIO_LOW); | 82 | gpio_set_value(7, 0); |
82 | gpio_line_set(IOP3XX_GPIO_LINE(6), GPIO_LOW); | 83 | gpio_set_value(6, 0); |
83 | } else { | 84 | } else { |
84 | gpio_line_set(IOP3XX_GPIO_LINE(5), GPIO_LOW); | 85 | gpio_set_value(5, 0); |
85 | gpio_line_set(IOP3XX_GPIO_LINE(4), GPIO_LOW); | 86 | gpio_set_value(4, 0); |
86 | } | 87 | } |
87 | #endif | 88 | #endif |
88 | /* NB SR bits not same position as CR IE bits :-( */ | 89 | /* NB SR bits not same position as CR IE bits :-( */ |
89 | iop3xx_adap->SR_enabled = | 90 | iop3xx_adap->SR_enabled = |
90 | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD | | 91 | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD | |
91 | IOP3XX_ISR_RXFULL | IOP3XX_ISR_TXEMPTY; | 92 | IOP3XX_ISR_RXFULL | IOP3XX_ISR_TXEMPTY; |
92 | 93 | ||
@@ -96,23 +97,23 @@ iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap) | |||
96 | __raw_writel(cr, iop3xx_adap->ioaddr + CR_OFFSET); | 97 | __raw_writel(cr, iop3xx_adap->ioaddr + CR_OFFSET); |
97 | } | 98 | } |
98 | 99 | ||
99 | static void | 100 | static void |
100 | iop3xx_i2c_transaction_cleanup(struct i2c_algo_iop3xx_data *iop3xx_adap) | 101 | iop3xx_i2c_transaction_cleanup(struct i2c_algo_iop3xx_data *iop3xx_adap) |
101 | { | 102 | { |
102 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); | 103 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); |
103 | 104 | ||
104 | cr &= ~(IOP3XX_ICR_MSTART | IOP3XX_ICR_TBYTE | | 105 | cr &= ~(IOP3XX_ICR_MSTART | IOP3XX_ICR_TBYTE | |
105 | IOP3XX_ICR_MSTOP | IOP3XX_ICR_SCLEN); | 106 | IOP3XX_ICR_MSTOP | IOP3XX_ICR_SCLEN); |
106 | 107 | ||
107 | __raw_writel(cr, iop3xx_adap->ioaddr + CR_OFFSET); | 108 | __raw_writel(cr, iop3xx_adap->ioaddr + CR_OFFSET); |
108 | } | 109 | } |
109 | 110 | ||
110 | /* | 111 | /* |
111 | * NB: the handler has to clear the source of the interrupt! | 112 | * NB: the handler has to clear the source of the interrupt! |
112 | * Then it passes the SR flags of interest to BH via adap data | 113 | * Then it passes the SR flags of interest to BH via adap data |
113 | */ | 114 | */ |
114 | static irqreturn_t | 115 | static irqreturn_t |
115 | iop3xx_i2c_irq_handler(int this_irq, void *dev_id) | 116 | iop3xx_i2c_irq_handler(int this_irq, void *dev_id) |
116 | { | 117 | { |
117 | struct i2c_algo_iop3xx_data *iop3xx_adap = dev_id; | 118 | struct i2c_algo_iop3xx_data *iop3xx_adap = dev_id; |
118 | u32 sr = __raw_readl(iop3xx_adap->ioaddr + SR_OFFSET); | 119 | u32 sr = __raw_readl(iop3xx_adap->ioaddr + SR_OFFSET); |
@@ -126,7 +127,7 @@ iop3xx_i2c_irq_handler(int this_irq, void *dev_id) | |||
126 | } | 127 | } |
127 | 128 | ||
128 | /* check all error conditions, clear them , report most important */ | 129 | /* check all error conditions, clear them , report most important */ |
129 | static int | 130 | static int |
130 | iop3xx_i2c_error(u32 sr) | 131 | iop3xx_i2c_error(u32 sr) |
131 | { | 132 | { |
132 | int rc = 0; | 133 | int rc = 0; |
@@ -135,12 +136,12 @@ iop3xx_i2c_error(u32 sr) | |||
135 | if ( !rc ) rc = -I2C_ERR_BERR; | 136 | if ( !rc ) rc = -I2C_ERR_BERR; |
136 | } | 137 | } |
137 | if ((sr & IOP3XX_ISR_ALD)) { | 138 | if ((sr & IOP3XX_ISR_ALD)) { |
138 | if ( !rc ) rc = -I2C_ERR_ALD; | 139 | if ( !rc ) rc = -I2C_ERR_ALD; |
139 | } | 140 | } |
140 | return rc; | 141 | return rc; |
141 | } | 142 | } |
142 | 143 | ||
143 | static inline u32 | 144 | static inline u32 |
144 | iop3xx_i2c_get_srstat(struct i2c_algo_iop3xx_data *iop3xx_adap) | 145 | iop3xx_i2c_get_srstat(struct i2c_algo_iop3xx_data *iop3xx_adap) |
145 | { | 146 | { |
146 | unsigned long flags; | 147 | unsigned long flags; |
@@ -161,8 +162,8 @@ iop3xx_i2c_get_srstat(struct i2c_algo_iop3xx_data *iop3xx_adap) | |||
161 | typedef int (* compare_func)(unsigned test, unsigned mask); | 162 | typedef int (* compare_func)(unsigned test, unsigned mask); |
162 | /* returns 1 on correct comparison */ | 163 | /* returns 1 on correct comparison */ |
163 | 164 | ||
164 | static int | 165 | static int |
165 | iop3xx_i2c_wait_event(struct i2c_algo_iop3xx_data *iop3xx_adap, | 166 | iop3xx_i2c_wait_event(struct i2c_algo_iop3xx_data *iop3xx_adap, |
166 | unsigned flags, unsigned* status, | 167 | unsigned flags, unsigned* status, |
167 | compare_func compare) | 168 | compare_func compare) |
168 | { | 169 | { |
@@ -192,47 +193,47 @@ iop3xx_i2c_wait_event(struct i2c_algo_iop3xx_data *iop3xx_adap, | |||
192 | } | 193 | } |
193 | 194 | ||
194 | /* | 195 | /* |
195 | * Concrete compare_funcs | 196 | * Concrete compare_funcs |
196 | */ | 197 | */ |
197 | static int | 198 | static int |
198 | all_bits_clear(unsigned test, unsigned mask) | 199 | all_bits_clear(unsigned test, unsigned mask) |
199 | { | 200 | { |
200 | return (test & mask) == 0; | 201 | return (test & mask) == 0; |
201 | } | 202 | } |
202 | 203 | ||
203 | static int | 204 | static int |
204 | any_bits_set(unsigned test, unsigned mask) | 205 | any_bits_set(unsigned test, unsigned mask) |
205 | { | 206 | { |
206 | return (test & mask) != 0; | 207 | return (test & mask) != 0; |
207 | } | 208 | } |
208 | 209 | ||
209 | static int | 210 | static int |
210 | iop3xx_i2c_wait_tx_done(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status) | 211 | iop3xx_i2c_wait_tx_done(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status) |
211 | { | 212 | { |
212 | return iop3xx_i2c_wait_event( | 213 | return iop3xx_i2c_wait_event( |
213 | iop3xx_adap, | 214 | iop3xx_adap, |
214 | IOP3XX_ISR_TXEMPTY | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD, | 215 | IOP3XX_ISR_TXEMPTY | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD, |
215 | status, any_bits_set); | 216 | status, any_bits_set); |
216 | } | 217 | } |
217 | 218 | ||
218 | static int | 219 | static int |
219 | iop3xx_i2c_wait_rx_done(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status) | 220 | iop3xx_i2c_wait_rx_done(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status) |
220 | { | 221 | { |
221 | return iop3xx_i2c_wait_event( | 222 | return iop3xx_i2c_wait_event( |
222 | iop3xx_adap, | 223 | iop3xx_adap, |
223 | IOP3XX_ISR_RXFULL | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD, | 224 | IOP3XX_ISR_RXFULL | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD, |
224 | status, any_bits_set); | 225 | status, any_bits_set); |
225 | } | 226 | } |
226 | 227 | ||
227 | static int | 228 | static int |
228 | iop3xx_i2c_wait_idle(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status) | 229 | iop3xx_i2c_wait_idle(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status) |
229 | { | 230 | { |
230 | return iop3xx_i2c_wait_event( | 231 | return iop3xx_i2c_wait_event( |
231 | iop3xx_adap, IOP3XX_ISR_UNITBUSY, status, all_bits_clear); | 232 | iop3xx_adap, IOP3XX_ISR_UNITBUSY, status, all_bits_clear); |
232 | } | 233 | } |
233 | 234 | ||
234 | static int | 235 | static int |
235 | iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap, | 236 | iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap, |
236 | struct i2c_msg* msg) | 237 | struct i2c_msg* msg) |
237 | { | 238 | { |
238 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); | 239 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); |
@@ -247,7 +248,7 @@ iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap, | |||
247 | } | 248 | } |
248 | 249 | ||
249 | __raw_writel(iic_cook_addr(msg), iop3xx_adap->ioaddr + DBR_OFFSET); | 250 | __raw_writel(iic_cook_addr(msg), iop3xx_adap->ioaddr + DBR_OFFSET); |
250 | 251 | ||
251 | cr &= ~(IOP3XX_ICR_MSTOP | IOP3XX_ICR_NACK); | 252 | cr &= ~(IOP3XX_ICR_MSTOP | IOP3XX_ICR_NACK); |
252 | cr |= IOP3XX_ICR_MSTART | IOP3XX_ICR_TBYTE; | 253 | cr |= IOP3XX_ICR_MSTART | IOP3XX_ICR_TBYTE; |
253 | 254 | ||
@@ -257,8 +258,8 @@ iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap, | |||
257 | return rc; | 258 | return rc; |
258 | } | 259 | } |
259 | 260 | ||
260 | static int | 261 | static int |
261 | iop3xx_i2c_write_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char byte, | 262 | iop3xx_i2c_write_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char byte, |
262 | int stop) | 263 | int stop) |
263 | { | 264 | { |
264 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); | 265 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); |
@@ -277,10 +278,10 @@ iop3xx_i2c_write_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char byte, | |||
277 | rc = iop3xx_i2c_wait_tx_done(iop3xx_adap, &status); | 278 | rc = iop3xx_i2c_wait_tx_done(iop3xx_adap, &status); |
278 | 279 | ||
279 | return rc; | 280 | return rc; |
280 | } | 281 | } |
281 | 282 | ||
282 | static int | 283 | static int |
283 | iop3xx_i2c_read_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char* byte, | 284 | iop3xx_i2c_read_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char* byte, |
284 | int stop) | 285 | int stop) |
285 | { | 286 | { |
286 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); | 287 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); |
@@ -304,19 +305,19 @@ iop3xx_i2c_read_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char* byte, | |||
304 | return rc; | 305 | return rc; |
305 | } | 306 | } |
306 | 307 | ||
307 | static int | 308 | static int |
308 | iop3xx_i2c_writebytes(struct i2c_adapter *i2c_adap, const char *buf, int count) | 309 | iop3xx_i2c_writebytes(struct i2c_adapter *i2c_adap, const char *buf, int count) |
309 | { | 310 | { |
310 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; | 311 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; |
311 | int ii; | 312 | int ii; |
312 | int rc = 0; | 313 | int rc = 0; |
313 | 314 | ||
314 | for (ii = 0; rc == 0 && ii != count; ++ii) | 315 | for (ii = 0; rc == 0 && ii != count; ++ii) |
315 | rc = iop3xx_i2c_write_byte(iop3xx_adap, buf[ii], ii==count-1); | 316 | rc = iop3xx_i2c_write_byte(iop3xx_adap, buf[ii], ii==count-1); |
316 | return rc; | 317 | return rc; |
317 | } | 318 | } |
318 | 319 | ||
319 | static int | 320 | static int |
320 | iop3xx_i2c_readbytes(struct i2c_adapter *i2c_adap, char *buf, int count) | 321 | iop3xx_i2c_readbytes(struct i2c_adapter *i2c_adap, char *buf, int count) |
321 | { | 322 | { |
322 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; | 323 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; |
@@ -325,7 +326,7 @@ iop3xx_i2c_readbytes(struct i2c_adapter *i2c_adap, char *buf, int count) | |||
325 | 326 | ||
326 | for (ii = 0; rc == 0 && ii != count; ++ii) | 327 | for (ii = 0; rc == 0 && ii != count; ++ii) |
327 | rc = iop3xx_i2c_read_byte(iop3xx_adap, &buf[ii], ii==count-1); | 328 | rc = iop3xx_i2c_read_byte(iop3xx_adap, &buf[ii], ii==count-1); |
328 | 329 | ||
329 | return rc; | 330 | return rc; |
330 | } | 331 | } |
331 | 332 | ||
@@ -336,8 +337,8 @@ iop3xx_i2c_readbytes(struct i2c_adapter *i2c_adap, char *buf, int count) | |||
336 | * Each transfer (i.e. a read or a write) is separated by a repeated start | 337 | * Each transfer (i.e. a read or a write) is separated by a repeated start |
337 | * condition. | 338 | * condition. |
338 | */ | 339 | */ |
339 | static int | 340 | static int |
340 | iop3xx_i2c_handle_msg(struct i2c_adapter *i2c_adap, struct i2c_msg* pmsg) | 341 | iop3xx_i2c_handle_msg(struct i2c_adapter *i2c_adap, struct i2c_msg* pmsg) |
341 | { | 342 | { |
342 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; | 343 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; |
343 | int rc; | 344 | int rc; |
@@ -357,8 +358,8 @@ iop3xx_i2c_handle_msg(struct i2c_adapter *i2c_adap, struct i2c_msg* pmsg) | |||
357 | /* | 358 | /* |
358 | * master_xfer() - main read/write entry | 359 | * master_xfer() - main read/write entry |
359 | */ | 360 | */ |
360 | static int | 361 | static int |
361 | iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, | 362 | iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, |
362 | int num) | 363 | int num) |
363 | { | 364 | { |
364 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; | 365 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; |
@@ -375,14 +376,14 @@ iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, | |||
375 | } | 376 | } |
376 | 377 | ||
377 | iop3xx_i2c_transaction_cleanup(iop3xx_adap); | 378 | iop3xx_i2c_transaction_cleanup(iop3xx_adap); |
378 | 379 | ||
379 | if(ret) | 380 | if(ret) |
380 | return ret; | 381 | return ret; |
381 | 382 | ||
382 | return im; | 383 | return im; |
383 | } | 384 | } |
384 | 385 | ||
385 | static u32 | 386 | static u32 |
386 | iop3xx_i2c_func(struct i2c_adapter *adap) | 387 | iop3xx_i2c_func(struct i2c_adapter *adap) |
387 | { | 388 | { |
388 | return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; | 389 | return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; |
@@ -393,11 +394,11 @@ static const struct i2c_algorithm iop3xx_i2c_algo = { | |||
393 | .functionality = iop3xx_i2c_func, | 394 | .functionality = iop3xx_i2c_func, |
394 | }; | 395 | }; |
395 | 396 | ||
396 | static int | 397 | static int |
397 | iop3xx_i2c_remove(struct platform_device *pdev) | 398 | iop3xx_i2c_remove(struct platform_device *pdev) |
398 | { | 399 | { |
399 | struct i2c_adapter *padapter = platform_get_drvdata(pdev); | 400 | struct i2c_adapter *padapter = platform_get_drvdata(pdev); |
400 | struct i2c_algo_iop3xx_data *adapter_data = | 401 | struct i2c_algo_iop3xx_data *adapter_data = |
401 | (struct i2c_algo_iop3xx_data *)padapter->algo_data; | 402 | (struct i2c_algo_iop3xx_data *)padapter->algo_data; |
402 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 403 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
403 | unsigned long cr = __raw_readl(adapter_data->ioaddr + CR_OFFSET); | 404 | unsigned long cr = __raw_readl(adapter_data->ioaddr + CR_OFFSET); |
@@ -419,7 +420,7 @@ iop3xx_i2c_remove(struct platform_device *pdev) | |||
419 | return 0; | 420 | return 0; |
420 | } | 421 | } |
421 | 422 | ||
422 | static int | 423 | static int |
423 | iop3xx_i2c_probe(struct platform_device *pdev) | 424 | iop3xx_i2c_probe(struct platform_device *pdev) |
424 | { | 425 | { |
425 | struct resource *res; | 426 | struct resource *res; |