[PATCH 2/5] i2c: mt7621: clear pending interrupt on i2c reset

Christian Marangi
2025-07-19T12:56:34Z

On resetting the i2c bus, clear any pending interrupt to have a more
consistent state on the next operation.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
drivers/i2c/busses/i2c-mt7621.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/i2c/busses/i2c-mt7621.c b/drivers/i2c/busses/i2c-mt7621.c
index c0e13f9af3e5..58c3da92cea3 100644
--- a/drivers/i2c/busses/i2c-mt7621.c
+++ b/drivers/i2c/busses/i2c-mt7621.c
@@ -101,6 +101,8 @@ static void mtk_i2c_reset(struct mtk_i2c *i2c)
iowrite32(((i2c->clk_div << 16) & SM0CTL0_CLK_DIV_MASK) | SM0CTL0_EN |
SM0CTL0_SCL_STRETCH, i2c->base + REG_SM0CTL0_REG);
iowrite32(0, i2c->base + REG_SM0CFG2_REG);
+ /* Clear any pending interrupt */
+ iowrite32(1, i2c->base + REG_PINTEN_REG);
}

static void mtk_i2c_dump_reg(struct mtk_i2c *i2c)
--
2.50.0