summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorZhang Ying-22455 <ying.zhang22455@nxp.com>2017-04-14 09:03:03 (GMT)
committerXie Xiaobo <xiaobo.xie@nxp.com>2017-07-14 10:09:38 (GMT)
commita2d8a0691bc8b300a4d8de5d7d6065e6dad03d02 (patch)
tree269b9e6269c58ffdb77e78848d63059b60e22eec /drivers/i2c
parent1db43fbb418820912b41bc2105a6d9ad87438421 (diff)
downloadlinux-a2d8a0691bc8b300a4d8de5d7d6065e6dad03d02.tar.xz
i2c: imx: add workaround for erratum ERR010027
ERR010027: Attempting a start cycle while the bus is busy may generate a short clock pulse. Software must ensure that the I2C BUS is idle by checking the bus busy before switching to master mode and attempting a Start cycle. Signed-off-by: Zhang Ying-22455 <ying.zhang22455@nxp.com>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-imx.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 47fc1f1..6ac0a7c 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -889,6 +889,14 @@ static int i2c_imx_xfer(struct i2c_adapter *adapter,
dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__);
+ /*
+ * workround for ERR010027: ensure that the I2C BUS is idle
+ * before switching to master mode and attempting a Start cycle
+ */
+ result = i2c_imx_bus_busy(i2c_imx, 0);
+ if (result)
+ goto out;
+
result = pm_runtime_get_sync(i2c_imx->adapter.dev.parent);
if (result < 0)
goto out;