From: Zhiwu Song <[email protected]>

let i2c core retry 3 times as sometimes we get random noack and timeout
even when we access an existing i2c client.

Signed-off-by: Zhiwu Song <[email protected]>
Signed-off-by: Barry Song <[email protected]>
---
 drivers/i2c/busses/i2c-sirf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
index d2b7913..90adc2d 100644
--- a/drivers/i2c/busses/i2c-sirf.c
+++ b/drivers/i2c/busses/i2c-sirf.c
@@ -230,7 +230,7 @@ static int i2c_sirfsoc_xfer_msg(struct sirfsoc_i2c *siic, 
struct i2c_msg *msg)
                while (readl(siic->base + SIRFSOC_I2C_CTRL) & SIRFSOC_I2C_RESET)
                        cpu_relax();
        }
-       return siic->err_status ? -EIO : 0;
+       return siic->err_status ? -EAGAIN : 0;
 }
 
 static u32 i2c_sirfsoc_func(struct i2c_adapter *adap)
@@ -334,6 +334,7 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev)
 
        adap->algo = &i2c_sirfsoc_algo;
        adap->algo_data = siic;
+       adap->retries = 3;
 
        adap->dev.of_node = pdev->dev.of_node;
        adap->dev.parent = &pdev->dev;
-- 
1.8.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to