[COMMON] i2c: exynos5: Add checking Transfer done at ISR
authorKyungwoo Kang <kwoo.kang@samsung.com>
Tue, 9 Jan 2018 07:24:06 +0000 (16:24 +0900)
committermyung-su.cha <myung-su.cha@samsung.com>
Wed, 9 May 2018 12:14:45 +0000 (21:14 +0900)
Previously when NACK occurred we just retry the protocol.
But it is possible to TR_DONE interrupt occur at the process
of NACK ISR. To prevent TR_DONE interrupt clear, we consider
TR_DONE at NACK ISR.

Change-Id: I3eb57019de66849e75c5f53dbfeb4d988c81bdc0
Signed-off-by: Kyungwoo Kang <kwoo.kang@samsung.com>
drivers/i2c/busses/i2c-exynos5.c

index 4d7994e627b4a2ac943d9ccf64a95e199e5c72b2..e19cb31ab4be0ed88d7f0815b74c7be970ddce80 100644 (file)
@@ -601,6 +601,8 @@ static irqreturn_t exynos5_i2c_irq(int irqno, void *dev_id)
                if (reg_val & HSI2C_INT_NODEV) {
                        dev_err(i2c->dev, "HSI2C NO ACK occured\n");
                        if (i2c->nack_restart)
+                               if (reg_val & HSI2C_INT_TRANSFER_DONE)
+                                       exynos5_i2c_stop(i2c);
                                goto out;
                }