diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-05 08:27:14 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-05 08:27:14 -0700 |
commit | f328ddc154605be11c4ca38fee6ace8adb140087 (patch) | |
tree | 53589963a1b6af22d0a26db7ab1e03dfeedb2b89 /drivers/i2c/algos/i2c-algo-pca.c | |
parent | 80445de57764b45fc26315c19fe7dc9fc57c2c65 (diff) | |
parent | 2196d1cf4afab93fb64c2e5b417096e49b661612 (diff) |
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
i2c-algo-pca: Let PCA9564 recover from unacked data byte (state 0x30)
i2c-algo-bit: Fix timeout test
i2c: Timeouts off by 1
Diffstat (limited to 'drivers/i2c/algos/i2c-algo-pca.c')
-rw-r--r-- | drivers/i2c/algos/i2c-algo-pca.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c index 6318f7ddc1d..78d42aae008 100644 --- a/drivers/i2c/algos/i2c-algo-pca.c +++ b/drivers/i2c/algos/i2c-algo-pca.c @@ -287,10 +287,21 @@ static int pca_xfer(struct i2c_adapter *i2c_adap, case 0x30: /* Data byte in I2CDAT has been transmitted; NOT ACK has been received */ DEB2("NOT ACK received after data byte\n"); + pca_stop(adap); goto out; case 0x38: /* Arbitration lost during SLA+W, SLA+R or data bytes */ DEB2("Arbitration lost\n"); + /* + * The PCA9564 data sheet (2006-09-01) says "A + * START condition will be transmitted when the + * bus becomes free (STOP or SCL and SDA high)" + * when the STA bit is set (p. 11). + * + * In case this won't work, try pca_reset() + * instead. + */ + pca_start(adap); goto out; case 0x58: /* Data byte has been received; NOT ACK has been returned */ |