summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDongil Park <dongil01.park@samsung.com>2016-05-26 10:04:27 +0900
committerwansu.yoo <wansu.yoo@samsung.com>2016-08-24 10:15:13 +0900
commit96574aaadfab9acc5a7d354c384fbf24061eb851 (patch)
tree33285515b596931e6c1a1a2bf0151cdeac905395 /drivers
parent85fbbdc6c2de88d67b91b41c9ee1963a6e7cc19f (diff)
downloadlinux-3.10-artik-96574aaadfab9acc5a7d354c384fbf24061eb851.tar.gz
linux-3.10-artik-96574aaadfab9acc5a7d354c384fbf24061eb851.tar.bz2
linux-3.10-artik-96574aaadfab9acc5a7d354c384fbf24061eb851.zip
i2c: s3c24xx: Add clear pending bit for i2c stop.
This patch adds clear pending bit for i2c stop to avoid interrupt flooding while i2c stop. Change-Id: I424207bf2ccc905e4c266d632478e66e02f5d12c Signed-off-by: Dongil Park <dongil01.park@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index b58d73bf8fb..c47104be2c0 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -323,6 +323,7 @@ static void s3c24xx_i2c_message_start(struct s3c24xx_i2c *i2c,
static inline void s3c24xx_i2c_stop(struct s3c24xx_i2c *i2c, int ret)
{
unsigned long iicstat = readl(i2c->regs + S3C2410_IICSTAT);
+ unsigned long iiccon = 0;
dev_dbg(i2c->dev, "STOP\n");
@@ -369,10 +370,16 @@ static inline void s3c24xx_i2c_stop(struct s3c24xx_i2c *i2c, int ret)
}
writel(iicstat, i2c->regs + S3C2410_IICSTAT);
- i2c->state = STATE_STOP;
+ /* Clear pending bit */
+ iiccon = readl(i2c->regs + S3C2410_IICCON);
+ iiccon &= ~S3C2410_IICCON_IRQPEND;
+ writel(iiccon, i2c->regs + S3C2410_IICCON);
- s3c24xx_i2c_master_complete(i2c, ret);
s3c24xx_i2c_disable_irq(i2c);
+
+ s3c24xx_i2c_master_complete(i2c, ret);
+
+ i2c->state = STATE_STOP;
}
/* helper functions to determine the current state in the set of