i2c: xlp9xx: Check for Bus state before every transfer
authorGeorge Cherian <george.cherian@cavium.com>
Tue, 27 Feb 2018 13:26:18 +0000 (13:26 +0000)
committerWolfram Sang <wsa@the-dreams.de>
Sat, 17 Mar 2018 20:56:35 +0000 (21:56 +0100)
commitd3898a78521cd383d287b3ed5683f914c48c3be9
tree76158470260643e4e9ac5860d345508b2da79265
parent7a20e707aae2562ad1e6fc39bbc0fa9fd47a6390
i2c: xlp9xx: Check for Bus state before every transfer

I2C bus enters the STOP condition after the DATA_DONE interrupt is raised.
Essentially the driver should be checking the bus state before sending
any transaction. In case a transaction is initiated while the
bus is busy, the prior transaction's stop condition is not achieved.
Add the check to make sure the bus is not busy before every transaction.

Signed-off-by: George Cherian <george.cherian@cavium.com>
Reviewed-by: Jan Glauber <jglauber@cavium.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-xlp9xx.c