diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2018-07-17 10:03:42 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2018-07-17 10:03:42 +0200 |
commit | 08948b75939f72bd013699963cc7187f25197653 (patch) | |
tree | 5fea43325a7cc2d94620ebeacab31c9c505af281 /drivers/i2c/i2c-core-base.c | |
parent | fb2896a77989314ea89d89c3bdfee93002a760c9 (diff) | |
parent | 9d3cce1e8b8561fed5f383d22a4d6949db4eadbe (diff) | |
download | linux-08948b75939f72bd013699963cc7187f25197653.tar.gz linux-08948b75939f72bd013699963cc7187f25197653.tar.bz2 linux-08948b75939f72bd013699963cc7187f25197653.zip |
Merge tag 'v4.18-rc5' into i2c/for-4.19
Linux 4.18-rc5
Diffstat (limited to 'drivers/i2c/i2c-core-base.c')
-rw-r--r-- | drivers/i2c/i2c-core-base.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 31d16ada6e7d..301285c54603 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -198,7 +198,16 @@ int i2c_generic_scl_recovery(struct i2c_adapter *adap) val = !val; bri->set_scl(adap, val); - ndelay(RECOVERY_NDELAY); + + /* + * If we can set SDA, we will always create STOP here to ensure + * the additional pulses will do no harm. This is achieved by + * letting SDA follow SCL half a cycle later. + */ + ndelay(RECOVERY_NDELAY / 2); + if (bri->set_sda) + bri->set_sda(adap, val); + ndelay(RECOVERY_NDELAY / 2); } /* check if recovery actually succeeded */ |