i2c-algo-pca: Let PCA9564 recover from unacked data byte (state 0x30)
commit0a94a87b54e5c7ee20b42d17108f78eda6c1fe01
authorEnrik Berkhan <Enrik.Berkhan@ge.com>
Thu, 7 May 2009 12:58:48 +0000 (7 14:58 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 18 May 2009 23:34:44 +0000 (18 16:34 -0700)
tree98a82bd00efebadc659d7113e2cc01c95d4573c2
parent73159b9bd36c7b9607b740e76d609fb7b0cf2a7a
i2c-algo-pca: Let PCA9564 recover from unacked data byte (state 0x30)

commit 2196d1cf4afab93fb64c2e5b417096e49b661612 upstream

Currently, the i2c-algo-pca driver does nothing if the chip enters state
0x30 (Data byte in I2CDAT has been transmitted; NOT ACK has been
received).  Thus, the i2c bus connected to the controller gets stuck
afterwards.

I have seen this kind of error on a custom board in certain load
situations most probably caused by interference or noise.

A possible reaction is to let the controller generate a STOP condition.
This is documented in the PCA9564 data sheet (2006-09-01) and the same
is done for other NACK states as well.

Further, state 0x38 isn't handled completely, either. Try to do another
START in this case like the data sheet says. As this couldn't be tested,
I've added a comment to try to reset the chip if the START doesn't help
as suggested by Wolfram Sang.

Signed-off-by: Enrik Berkhan <Enrik.Berkhan@ge.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/i2c/algos/i2c-algo-pca.c