Skip to content

Commit

Permalink
i2c: sirf: retry 3 times as sometimes we get random noack and timeout
Browse files Browse the repository at this point in the history
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 <Zhiwu.Song@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Zhiwu Song authored and Wolfram Sang committed Aug 28, 2013
1 parent 5ebffa6 commit 617da00
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/i2c/busses/i2c-sirf.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,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)
Expand Down Expand Up @@ -333,6 +333,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;
Expand Down

0 comments on commit 617da00

Please sign in to comment.