linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] i2c: ls1/ls2: add workaround for erratum ERR010027
@ 2016-01-27  8:44 ying.zhang22455
  2016-01-27  8:44 ` [PATCH 2/2] drivers/i2c/i2c-imx.c: improve i2c bus error recovery ying.zhang22455
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: ying.zhang22455 @ 2016-01-27  8:44 UTC (permalink / raw)
  To: linux-i2c; +Cc: xiaobo.xie, york.sun, Ying Zhang

From: Ying Zhang <b40530@freescale.com>

ERR010027/ERR008951: 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: Ying Zhang <b40530@freescale.com>
---
 drivers/i2c/busses/i2c-imx.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index a2b132c..f1fe599 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -889,6 +889,13 @@ 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 fail0;
+
 	result = pm_runtime_get_sync(i2c_imx->adapter.dev.parent);
 	if (result < 0)
 		goto out;
-- 
2.1.0.27.g96db324

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-04-26 21:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-27  8:44 [PATCH 1/2] i2c: ls1/ls2: add workaround for erratum ERR010027 ying.zhang22455
2016-01-27  8:44 ` [PATCH 2/2] drivers/i2c/i2c-imx.c: improve i2c bus error recovery ying.zhang22455
2016-03-03 21:37   ` Wolfram Sang
2016-04-26 21:29 ` [PATCH 1/2] i2c: ls1/ls2: add workaround for erratum ERR010027 Wolfram Sang
2016-04-26 21:30 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).