From 2654bcc4e1cbf85f12c9dea0af945d5ecbf040f8 Mon Sep 17 00:00:00 2001 From: Mukesh Kumar Savaliya Date: Mon, 25 Apr 2022 12:32:48 +0530 Subject: [PATCH] i2c: i2c-msm-geni: Handle NACK interrupt as an error condition This change adds the NACK bit into the error condition check. So far driver was expecting for the M_CMD_FAILURE bit also to be raised by GENI whenever NACK comes, but it's observed that some cases we have first NACK and then immediately M_CMD_FAILURE. This patch helps i2c client to detect NACK as an error and then can proceed with CMD_FAILURE/CMD_SUCCESS as raised by HW. Change-Id: I2a81739fcf5924fe296fe8b3a444edeef1d8cfd7 Signed-off-by: Mukesh Kumar Savaliya --- drivers/i2c/busses/i2c-msm-geni.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-msm-geni.c b/drivers/i2c/busses/i2c-msm-geni.c index 9c508aa56efe..d7568e24544c 100644 --- a/drivers/i2c/busses/i2c-msm-geni.c +++ b/drivers/i2c/busses/i2c-msm-geni.c @@ -336,7 +336,8 @@ static irqreturn_t geni_i2c_irq(int irq, void *dev) if ((m_stat & M_CMD_FAILURE_EN) || (dm_rx_st & (DM_I2C_CB_ERR)) || (m_stat & M_CMD_CANCEL_EN) || - (m_stat & M_CMD_ABORT_EN)) { + (m_stat & M_CMD_ABORT_EN) || + (m_stat & M_GP_IRQ_1_EN)) { if (m_stat & M_GP_IRQ_1_EN) geni_i2c_err(gi2c, I2C_NACK);