Skip to content

Commit a94d306

Browse files
cornaWolfram Sang
authored andcommitted
i2c: algo-bit: add I2C_AQ_NO_CLK_STRETCH
Add I2C_AQ_NO_CLK_STRETCH to drivers/i2c/algos/i2c-algo-bit.c when getscl is not available. Signed-off-by: Nicola Corna <nicola@corna.info> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
1 parent 749de3d commit a94d306

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/i2c/algos/i2c-algo-bit.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,10 @@ const struct i2c_algorithm i2c_bit_algo = {
617617
};
618618
EXPORT_SYMBOL(i2c_bit_algo);
619619

620+
const struct i2c_adapter_quirks i2c_bit_quirk_no_clk_stretch = {
621+
.flags = I2C_AQ_NO_CLK_STRETCH,
622+
};
623+
620624
/*
621625
* registering functions to load algorithms at runtime
622626
*/
@@ -635,6 +639,8 @@ static int __i2c_bit_add_bus(struct i2c_adapter *adap,
635639
/* register new adapter to i2c module... */
636640
adap->algo = &i2c_bit_algo;
637641
adap->retries = 3;
642+
if (bit_adap->getscl == NULL)
643+
adap->quirks = &i2c_bit_quirk_no_clk_stretch;
638644

639645
ret = add_adapter(adap);
640646
if (ret < 0)

0 commit comments

Comments
 (0)