]> git.karo-electronics.de Git - linux-beck.git/commitdiff
i2c: sirf: we need to wait I2C_RESET status in resume
authorZhiwu Song <Zhiwu.Song@csr.com>
Tue, 13 Aug 2013 09:11:28 +0000 (17:11 +0800)
committerWolfram Sang <wsa@the-dreams.de>
Wed, 28 Aug 2013 09:44:03 +0000 (11:44 +0200)
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>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-sirf.c

index ff47a767f7569aec2402fba299852624cd7b6223..efb51a1d97ca3c13841a712e6136586bff99955c 100644 (file)
@@ -422,6 +422,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);