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 <quic_msavaliy@quicinc.com>
This commit is contained in:
Mukesh Kumar Savaliya 2022-04-25 12:32:48 +05:30 • committed by Gerrit - the friendly Code Review server
commit 2654bcc4e1

View file

@ -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);