summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJae Hyun Yoo <jae.hyun.yoo@linux.intel.com>2020-12-16 23:49:16 +0300
committerJae Hyun Yoo <jae.hyun.yoo@intel.com>2021-07-14 20:04:18 +0300
commit1fc2b06b803d89a87c0b489502f18446c517f4bb (patch)
tree53ed04d7dcd6c6c3e8605e0405a353be9f3bc7a6
parent031d4a619b8a7832d3344365ac6d4dd9351ef58c (diff)
downloadlinux-1fc2b06b803d89a87c0b489502f18446c517f4bb.tar.xz
i2c: aspeed: clear slave addresses in probe
Initial value of I2CD18 is undefined according to the datasheet so this commit adds the I2CD18 register clearing code into bus initialization function to prevent any unexpected slave match events. Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
-rw-r--r--drivers/i2c/busses/i2c-aspeed.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
index 6db7b0fb4e4c..2845e700db52 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
@@ -1610,6 +1610,9 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
writel(0, bus->base + ASPEED_I2C_INTR_CTRL_REG);
writel(0xffffffff, bus->base + ASPEED_I2C_INTR_STS_REG);
+ /* Clear slave addresses. */
+ writel(0, bus->base + ASPEED_I2C_DEV_ADDR_REG);
+
parent_clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(parent_clk))
return PTR_ERR(parent_clk);