i2c: ensure SDA is released in recovery if SDA is controllable
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 9 Jan 2018 13:58:57 +0000 (14:58 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 15 Jan 2018 23:04:30 +0000 (00:04 +0100)
If we have a function to control SDA, we should ensure that SDA is not
held down by us. So, release the GPIO in this case.

Tested-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/i2c-core-base.c

index a8b3fbe16fa08c4529b4ccb29da9e481c9942481..54cef80990a11aab4238a9968056246ec9c32b42 100644 (file)
@@ -169,6 +169,8 @@ int i2c_generic_scl_recovery(struct i2c_adapter *adap)
                bri->prepare_recovery(adap);
 
        bri->set_scl(adap, val);
+       if (bri->set_sda)
+               bri->set_sda(adap, 1);
        ndelay(RECOVERY_NDELAY);
 
        /*