[RFT,1/2] i2c: algos: bit: apply generic delays on initial STOP

Message ID 20180614012714.5937-2-wsa+renesas@sang-engineering.com
State New
Headers show
Series
  • i2c: algos: bit: try to fix bug #200045
Related show

Commit Message

Wolfram Sang June 14, 2018, 1:27 a.m.
When using the generic functions for setting SCL/SDA high, we make sure
necessary delays are met.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/algos/i2c-algo-bit.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch

diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index 3df0efd69ae3..c76cf51975d0 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -650,9 +650,8 @@  static int __i2c_bit_add_bus(struct i2c_adapter *adap,
 		adap->quirks = &i2c_bit_quirk_no_clk_stretch;
 
 	/* Bring bus to a known state. Looks like STOP if bus is not free yet */
-	setscl(bit_adap, 1);
-	udelay(bit_adap->udelay);
-	setsda(bit_adap, 1);
+	sclhi(bit_adap);
+	sdahi(bit_adap);
 
 	ret = add_adapter(adap);
 	if (ret < 0)