[PATCH 2/4] i2c: only use set_scl for recovery after calling prepare_recovery

Jan Luebbe jluebbe at debian.org
Wed Jul 8 06:29:16 PDT 2015


set_scl may be ineffective before calling the driver specific
prepare_recovery callback.

Signed-off-by: Jan Luebbe <jluebbe at debian.org>
---
 drivers/i2c/i2c.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
index e350ac5..39837fe 100644
--- a/drivers/i2c/i2c.c
+++ b/drivers/i2c/i2c.c
@@ -299,6 +299,9 @@ static int i2c_generic_recovery(struct i2c_adapter *adap)
 	if (bri->prepare_recovery)
 		bri->prepare_recovery(adap);
 
+	bri->set_scl(adap, val);
+	ndelay(RECOVERY_NDELAY);
+
 	/*
 	 * By this time SCL is high, as we need to give 9 falling-rising edges
 	 */
@@ -329,7 +332,6 @@ static int i2c_generic_recovery(struct i2c_adapter *adap)
 
 int i2c_generic_scl_recovery(struct i2c_adapter *adap)
 {
-	adap->bus_recovery_info->set_scl(adap, 1);
 	return i2c_generic_recovery(adap);
 }
 
-- 
2.1.4




More information about the barebox mailing list