i2c: exynos5: rework HSI2C_MASTER_ST_LOSE state handling
authorAndrzej Hajda <a.hajda@samsung.com>
Tue, 27 Feb 2018 07:19:00 +0000 (08:19 +0100)
committerJunghoon Kim <jhoon20.kim@samsung.com>
Thu, 14 Feb 2019 05:56:22 +0000 (14:56 +0900)
commit4fdd301e3948a4dfffb030d4b0931977a93e90b7
tree80ea8e4010fbc68459ef2bab683076b972b67848
parentfb8a00d3033bd01020c917b085c5d9b7303510ec
i2c: exynos5: rework HSI2C_MASTER_ST_LOSE state handling

HSI2C_MASTER_ST_LOSE state is not documented properly, extensive tests
show that hardware is usually able to recover from this state without
interrupting the transfer. Moreover documentation says that
such state can be caused by slave clock stretching, and should not be
treated as an error during transaction. The only place it indicates
an error is just before starting transaction. In such case bus recovery
procedure should be performed - master should pulse SCL line nine times
and then send STOP condition, it can be repeated until SDA goes high.
The procedure can be performed using manual commands HSI2C_CMD_READ_DATA
and HSI2C_CMD_SEND_STOP.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-exynos5.c