i2c: rcar: improve bus busy detection
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sat, 29 Aug 2020 20:38:09 +0000 (22:38 +0200)
committerWolfram Sang <wsa@kernel.org>
Fri, 18 Sep 2020 21:02:02 +0000 (23:02 +0200)
commit9374ed1dfe1f862f6dd7552b8164252fe5cc424f
tree52e7739d351c90fed59629fe29e029df696a8510
parent6af077194600d5445f802ce4587a3254a215a851
i2c: rcar: improve bus busy detection

I2C doesn't define a timeout for bus busy, so an arbitrary value like
LOOP_TIMEOUT is not a good idea. Let's use the timeout value in struct
adapter which is meant for such cases and is user-configurable (via
IOCTL). To reduce the load, wait 10us instead of 1us which is good
enough for the slow frequencies used by I2C. Finally, use the
poll_timeout helper instead of open coding it.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-rcar.c