i2c: xlp9xx: Handle NACK on DATA properly
authorGeorge Cherian <george.cherian@cavium.com>
Tue, 27 Feb 2018 13:26:19 +0000 (13:26 +0000)
committerWolfram Sang <wsa@the-dreams.de>
Sat, 17 Mar 2018 20:57:44 +0000 (21:57 +0100)
commite349d7d08e7044caf37a36409305edbd5af013c7
tree6f9452cfc36d0baac54a3233275194d6dfb2d4e1
parentd3898a78521cd383d287b3ed5683f914c48c3be9
i2c: xlp9xx: Handle NACK on DATA properly

In case we receive NACK on DATA we shouldn't be resetting the controller,
rather we should issue STOP command. This will terminate the current
transaction and -EIO is returned.

While at that handle the SMBus Quick Command properly.
We shouldn't be setting the XLP9XX_I2C_CMD_READ/WRITE for such
transactions.

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