From: Kyungwoo Kang Date: Wed, 8 Nov 2017 10:10:09 +0000 (+0900) Subject: [COMMON] i2c: exynos5: Add No Dev interrupt service routine X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3a313b3625dedefc8972896b02af5ba4cdde6675;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] i2c: exynos5: Add No Dev interrupt service routine For some slave devices No ACK needs to be handled. Previously the system considered NACK as an error situation and stops the I2C request. Now we let the i2c transaction go when NACK interrupt occurs until the timeout value is expired. Change-Id: Iab42792fb589782d52e30df5690934a7afefdb4a Signed-off-by: Kyungwoo Kang --- diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c index fe9cf3095646..23a61a5dfb38 100644 --- a/drivers/i2c/busses/i2c-exynos5.c +++ b/drivers/i2c/busses/i2c-exynos5.c @@ -112,6 +112,7 @@ static LIST_HEAD(drvdata_list); #define HSI2C_INT_RX_OVERRUN (1u << 5) #define HSI2C_INT_TRAILING (1u << 6) #define HSI2C_INT_I2C (1u << 9) +#define HSI2C_INT_NODEV (1u << 10) #define HSI2C_RX_INT (HSI2C_INT_RX_ALMOSTFULL | \ HSI2C_INT_RX_UNDERRUN | \ HSI2C_INT_RX_OVERRUN | \ @@ -563,6 +564,12 @@ static irqreturn_t exynos5_i2c_irq(int irqno, void *dev_id) dev_err(i2c->dev, "HSI2C Error Interrupt " "occurred(IS:0x%08x, TR:0x%08x)\n", (unsigned int)reg_val, (unsigned int)trans_status); + + if (reg_val & HSI2C_INT_NODEV) { + dev_err(i2c->dev, "HSI2C NO ACK occured\n"); + goto out; + } + i2c->trans_done = -ENXIO; exynos5_i2c_stop(i2c); goto out;