From: Derek Basehore Date: Thu, 18 Sep 2014 15:18:55 +0000 (+0200) Subject: i2c: i2c-cros-ec-tunnel: Set retries to 3 X-Git-Tag: v3.18-rc1~40^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=97720706084dd8c45eecc61d39353c7b62939b8f;p=karo-tx-linux.git i2c: i2c-cros-ec-tunnel: Set retries to 3 Since the i2c bus can get wedged on the EC sometimes, set the number of retries to 3. Since we un-wedge the bus immediately after the wedge happens, this is the correct fix since only one transfer will fail. Signed-off-by: Derek Basehore Reviewed-by: Doug Anderson Acked-by: Wolfram Sang Signed-off-by: Javier Martinez Canillas Signed-off-by: Lee Jones --- diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c index 43be23dfb115..8ca5cbbcec91 100644 --- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c +++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c @@ -16,6 +16,8 @@ #include #include +#define I2C_MAX_RETRIES 3 + /** * struct ec_i2c_device - Driver data for I2C tunnel * @@ -290,6 +292,7 @@ static int ec_i2c_probe(struct platform_device *pdev) bus->adap.algo_data = bus; bus->adap.dev.parent = &pdev->dev; bus->adap.dev.of_node = np; + bus->adap.retries = I2C_MAX_RETRIES; err = i2c_add_adapter(&bus->adap); if (err) {