From 561f52b36ca85576a156620d2bd23e62c3a878d7 Mon Sep 17 00:00:00 2001 From: Kyungwoo Kang Date: Thu, 4 May 2017 13:50:21 +0900 Subject: [PATCH] [COMMON] i2c: exynos5: I2C transfer sequence change for Clock changes Transfer sequence has been changed for input clock. We no longer wait until Master status IDLE between transfer and another transfer. If we put SFR access or print log for debugging, it will increase transfer latency. Change-Id: I512adcbb7394e9566c535020e7aea29d23838188 Signed-off-by: Kyungwoo Kang --- drivers/i2c/busses/i2c-exynos5.c | 35 +------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c index a97cf79cb23c..d3bf839226fd 100644 --- a/drivers/i2c/busses/i2c-exynos5.c +++ b/drivers/i2c/busses/i2c-exynos5.c @@ -566,7 +566,6 @@ static int exynos5_i2c_xfer_msg(struct exynos5_i2c *i2c, struct i2c_msg *msgs, int stop) { unsigned long timeout; - unsigned long trans_status; unsigned long i2c_ctl; unsigned long i2c_auto_conf; unsigned long i2c_timeout; @@ -675,21 +674,6 @@ static int exynos5_i2c_xfer_msg(struct exynos5_i2c *i2c, (&i2c->msg_complete, EXYNOS5_I2C_TIMEOUT); ret = 0; - if (i2c->scl_clk_stretch) { - unsigned long timeout = jiffies + msecs_to_jiffies(100); - - do { - trans_status = readl(i2c->regs + HSI2C_TRANS_STATUS); - if ((!(trans_status & HSI2C_MAST_ST_MASK)) || - ((stop == 0) && (trans_status & HSI2C_MASTER_BUSY))){ - timeout = 0; - break; - } - } while(time_before(jiffies, timeout)); - - if (timeout) - dev_err(i2c->dev, "SDA check timeout!!! = 0x%8lx\n",trans_status); - } disable_irq(i2c->irq); if (i2c->trans_done < 0) { @@ -757,25 +741,8 @@ static int exynos5_i2c_xfer_msg(struct exynos5_i2c *i2c, dev_err(i2c->dev, "ack was not received at write\n"); ret = i2c->trans_done; exynos5_i2c_reset(i2c); - } else { - if (i2c->scl_clk_stretch) { - unsigned long timeout = jiffies + msecs_to_jiffies(100); - - do { - trans_status = readl(i2c->regs + HSI2C_TRANS_STATUS); - if ((!(trans_status & HSI2C_MAST_ST_MASK)) || - ((stop == 0) && (trans_status & HSI2C_MASTER_BUSY))){ - timeout = 0; - break; - } - } while(time_before(jiffies, timeout)); - - if (timeout) - dev_err(i2c->dev, "SDA check timeout!!! = 0x%8lx\n",trans_status); - } - + } else ret = 0; - } } } -- 2.20.1