diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-au1550.c')
-rw-r--r-- | drivers/i2c/busses/i2c-au1550.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/i2c/busses/i2c-au1550.c b/drivers/i2c/busses/i2c-au1550.c index d06edce03bf4..d7e7c359fc36 100644 --- a/drivers/i2c/busses/i2c-au1550.c +++ b/drivers/i2c/busses/i2c-au1550.c | |||
@@ -34,8 +34,7 @@ | |||
34 | #include <linux/errno.h> | 34 | #include <linux/errno.h> |
35 | #include <linux/i2c.h> | 35 | #include <linux/i2c.h> |
36 | 36 | ||
37 | #include <asm/mach-au1x00/au1000.h> | 37 | #include <asm/mach-au1x00/au1xxx.h> |
38 | #include <asm/mach-pb1x00/pb1550.h> | ||
39 | #include <asm/mach-au1x00/au1xxx_psc.h> | 38 | #include <asm/mach-au1x00/au1xxx_psc.h> |
40 | 39 | ||
41 | #include "i2c-au1550.h" | 40 | #include "i2c-au1550.h" |
@@ -118,13 +117,19 @@ do_address(struct i2c_au1550_data *adap, unsigned int addr, int rd) | |||
118 | 117 | ||
119 | /* Reset the FIFOs, clear events. | 118 | /* Reset the FIFOs, clear events. |
120 | */ | 119 | */ |
121 | sp->psc_smbpcr = PSC_SMBPCR_DC; | 120 | stat = sp->psc_smbstat; |
122 | sp->psc_smbevnt = PSC_SMBEVNT_ALLCLR; | 121 | sp->psc_smbevnt = PSC_SMBEVNT_ALLCLR; |
123 | au_sync(); | 122 | au_sync(); |
124 | do { | 123 | |
125 | stat = sp->psc_smbpcr; | 124 | if (!(stat & PSC_SMBSTAT_TE) || !(stat & PSC_SMBSTAT_RE)) { |
125 | sp->psc_smbpcr = PSC_SMBPCR_DC; | ||
126 | au_sync(); | 126 | au_sync(); |
127 | } while ((stat & PSC_SMBPCR_DC) != 0); | 127 | do { |
128 | stat = sp->psc_smbpcr; | ||
129 | au_sync(); | ||
130 | } while ((stat & PSC_SMBPCR_DC) != 0); | ||
131 | udelay(50); | ||
132 | } | ||
128 | 133 | ||
129 | /* Write out the i2c chip address and specify operation | 134 | /* Write out the i2c chip address and specify operation |
130 | */ | 135 | */ |
@@ -279,10 +284,10 @@ au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) | |||
279 | static u32 | 284 | static u32 |
280 | au1550_func(struct i2c_adapter *adap) | 285 | au1550_func(struct i2c_adapter *adap) |
281 | { | 286 | { |
282 | return I2C_FUNC_I2C; | 287 | return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; |
283 | } | 288 | } |
284 | 289 | ||
285 | static struct i2c_algorithm au1550_algo = { | 290 | static const struct i2c_algorithm au1550_algo = { |
286 | .master_xfer = au1550_xfer, | 291 | .master_xfer = au1550_xfer, |
287 | .functionality = au1550_func, | 292 | .functionality = au1550_func, |
288 | }; | 293 | }; |