mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-02 23:54:33 +01:00
i2c: algo-bit: init the bus to a known state
Ensure the bus is free when we register the adapter. Before the SCL/SDA wires were in an unknown state. It used to work because sending a byte has a retry mechanism which was triggered if the bus was initially in a non-free state. But the graceful way to do it is to initialize correctly. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
This commit is contained in:
1 parent
e535376537
commit
3e5f06bed7
1 file changed
+5
@@ -649,6 +649,11 @@ static int __i2c_bit_add_bus(struct i2c_adapter *adap,
|
||||
if (bit_adap->getscl == NULL)
|
||||
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);
|
||||
|
||||
ret = add_adapter(adap);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
Reference in new issue
Block a user