i2c: algo-bit: add I2C_AQ_NO_CLK_STRETCH
authorNicola Corna <nicola@corna.info>
Thu, 29 Oct 2015 11:34:24 +0000 (12:34 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 30 Nov 2015 17:37:25 +0000 (18:37 +0100)
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>
drivers/i2c/algos/i2c-algo-bit.c

index 899bede81b31b37e7a5ee4ec45d37afadb13971d..9d233bbde5e193a0b0484a8388e8c0f50f707156 100644 (file)
@@ -617,6 +617,10 @@ const struct i2c_algorithm i2c_bit_algo = {
 };
 EXPORT_SYMBOL(i2c_bit_algo);
 
+const struct i2c_adapter_quirks i2c_bit_quirk_no_clk_stretch = {
+       .flags = I2C_AQ_NO_CLK_STRETCH,
+};
+
 /*
  * registering functions to load algorithms at runtime
  */
@@ -635,6 +639,8 @@ static int __i2c_bit_add_bus(struct i2c_adapter *adap,
        /* register new adapter to i2c module... */
        adap->algo = &i2c_bit_algo;
        adap->retries = 3;
+       if (bit_adap->getscl == NULL)
+               adap->quirks = &i2c_bit_quirk_no_clk_stretch;
 
        ret = add_adapter(adap);
        if (ret < 0)