diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 11:09:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 11:09:48 -0400 |
commit | a5b08073a0b512d75fa1a7f82ee850e5c105cce9 (patch) | |
tree | 3e609b471ae2ca1f200f974fc65eaf242673db71 /drivers/i2c/busses/i2c-au1550.c | |
parent | ff0972c26bbf209da6f6d244cce60e695df863f6 (diff) | |
parent | 6d3aae9d74221b00e2cbf50a353527e5a71a58ba (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6: (30 commits)
i2c: Drop unimplemented slave functions
i2c: Constify i2c_algorithm declarations, part 2
i2c: Constify i2c_algorithm declarations, part 1
i2c: Let drivers constify i2c_algorithm data
i2c-isa: Restore driver owner
i2c-viapro: Add support for the VT8237A and VT8251
i2c: Warn on i2c client creation failure
i2c-core: Drop useless bitmaskings
i2c-algo-pcf: Discard the mdelay data struct member
i2c-algo-bit: Cleanups
i2c-isa: Fail adding driver on attach_adapter error
i2c: __must_check fixes (chip drivers)
i2c-dev: attach/detach_adapter cleanups
i2c-stub: Chip address as a module parameter
i2c: Plan i2c-isa for removal
i2c: New bus driver for TI OMAP boards
i2c-algo-bit: Discard the mdelay data struct member
i2c-matroxfb: Struct init conversion
i2c: Fix copy-n-paste in subsystem Kconfig
i2c-au1550: Add I2C support for Au1200
...
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 | }; |