Patchwork [2/5] i2c: sirf: we need to wait I2C_RESET status in resume

login
register
mail settings
Submitter Barry Song
Date Aug. 13, 2013, 9:11 a.m.
Message ID <1376385091-30597-3-git-send-email-Baohua.Song@csr.com>
Download mbox | patch
Permalink /patch/266757/
State Accepted
Headers show

Comments

Barry Song - Aug. 13, 2013, 9:11 a.m.
From: Zhiwu Song <Zhiwu.Song@csr.com>

this fixes the issue that we lost to wait the i2c reset finished.

Signed-off-by: Zhiwu Song <Zhiwu.Song@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
---
 drivers/i2c/busses/i2c-sirf.c | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
index 055210e..45a8881 100644
--- a/drivers/i2c/busses/i2c-sirf.c
+++ b/drivers/i2c/busses/i2c-sirf.c
@@ -425,6 +425,8 @@  static int i2c_sirfsoc_resume(struct device *dev)
 
 	clk_enable(siic->clk);
 	writel(SIRFSOC_I2C_RESET, siic->base + SIRFSOC_I2C_CTRL);
+	while (readl(siic->base + SIRFSOC_I2C_CTRL) & SIRFSOC_I2C_RESET)
+		cpu_relax();
 	writel(SIRFSOC_I2C_CORE_EN | SIRFSOC_I2C_MASTER_MODE,
 		siic->base + SIRFSOC_I2C_CTRL);
 	writel(siic->clk_div, siic->base + SIRFSOC_I2C_CLK_CTRL);