i2c: octeon: Fix set SCL recovery function
authorDmitry Bazhenov <dmitry.bazhenov@auriga.com>
Wed, 21 Sep 2016 06:51:02 +0000 (08:51 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Wed, 21 Sep 2016 20:58:25 +0000 (22:58 +0200)
The set SCL recovery function unconditionally pulls the SCL line low.
Only pull SCL line low according to val parameter.

Signed-off-by: Dmitry Bazhenov <dmitry.bazhenov@auriga.com>
Signed-off-by: Jan Glauber <jglauber@cavium.com>
[Changed commit message]
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-octeon-core.c

index f45ea5e..f322242 100644 (file)
@@ -767,7 +767,7 @@ static void octeon_i2c_set_scl(struct i2c_adapter *adap, int val)
 {
        struct octeon_i2c *i2c = i2c_get_adapdata(adap);
 
-       octeon_i2c_write_int(i2c, TWSI_INT_SCL_OVR);
+       octeon_i2c_write_int(i2c, val ? 0 : TWSI_INT_SCL_OVR);
 }
 
 static int octeon_i2c_get_sda(struct i2c_adapter *adap)