i2c: s3c24xx: Modification codes to avoid unexpected interrupts
authorKisang Lee <kisang80.lee@samsung.com>
Mon, 9 Jun 2014 11:45:01 +0000 (20:45 +0900)
committermyung-su.cha <myung-su.cha@samsung.com>
Thu, 10 May 2018 04:40:49 +0000 (13:40 +0900)
Change-Id: I46ec0faad45d01b0629f1f625044e9a48b105be5
Signed-off-by: Kisang Lee <kisang80.lee@samsung.com>
drivers/i2c/busses/i2c-s3c2410.c

index 80eb0fc634760f7e400194815ca330044a3ea860..4e2821e1b429069f249fff07fa0a4d86aac896eb 100644 (file)
@@ -756,8 +756,11 @@ static void s3c24xx_i2c_wait_idle(struct s3c24xx_i2c *i2c)
                iicstat = readl(i2c->regs + S3C2410_IICSTAT);
        }
 
-       if (iicstat & S3C2410_IICSTAT_START)
+       if (iicstat & S3C2410_IICSTAT_START) {
                dev_warn(i2c->dev, "timeout waiting for bus idle\n");
+               if (i2c->state != STATE_STOP)
+                       s3c24xx_i2c_stop(i2c, -ENXIO);
+       }
 }
 
 /* s3c24xx_i2c_doxfer