Skip to content

Commit f5b3f43

Browse files
cristiccwsakernel
authored andcommitted
i2c: owl: Clear NACK and BUS error bits
When the NACK and BUS error bits are set by the hardware, the driver is responsible for clearing them by writing "1" into the corresponding status registers. Hence perform the necessary operations in owl_i2c_interrupt(). Fixes: d211e62 ("i2c: Add Actions Semiconductor Owl family S900 I2C driver") Reported-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Cristian Ciocaltea <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 5a02e7c commit f5b3f43

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/i2c/busses/i2c-owl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,19 @@ static irqreturn_t owl_i2c_interrupt(int irq, void *_dev)
176176
fifostat = readl(i2c_dev->base + OWL_I2C_REG_FIFOSTAT);
177177
if (fifostat & OWL_I2C_FIFOSTAT_RNB) {
178178
i2c_dev->err = -ENXIO;
179+
/* Clear NACK error bit by writing "1" */
180+
owl_i2c_update_reg(i2c_dev->base + OWL_I2C_REG_FIFOSTAT,
181+
OWL_I2C_FIFOSTAT_RNB, true);
179182
goto stop;
180183
}
181184

182185
/* Handle bus error */
183186
stat = readl(i2c_dev->base + OWL_I2C_REG_STAT);
184187
if (stat & OWL_I2C_STAT_BEB) {
185188
i2c_dev->err = -EIO;
189+
/* Clear BUS error bit by writing "1" */
190+
owl_i2c_update_reg(i2c_dev->base + OWL_I2C_REG_STAT,
191+
OWL_I2C_STAT_BEB, true);
186192
goto stop;
187193
}
188194

0 commit comments

Comments
 (0)