提交 1ed6faed 编写于 作者: S Sifan Naeem 提交者: Wolfram Sang

i2c: img-scb: Clear line and interrupt status before starting a transfer

Clear line status and all generated interrupts from the interrupt
status register before starting a transfer, as we may have
unserviced interrupts from previous transfers that might be
handled in the context of the new transfer.

Fixes: commit 27bce457 ("i2c: img-scb: Add Imagination Technologies I2C SCB driver")
Signed-off-by: NSifan Naeem <sifan.naeem@imgtec.com>
Acked-by: NJames Hogan <james.hogan@imgtec.com>
Reviewed-by: NJames Hartley <james.hartley@imgtec.com>
Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
上级 0f0a3189
......@@ -1060,6 +1060,15 @@ static int img_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
i2c->last_msg = (i == num - 1);
reinit_completion(&i2c->msg_complete);
/*
* Clear line status and all interrupts before starting a
* transfer, as we may have unserviced interrupts from
* previous transfers that might be handled in the context
* of the new transfer.
*/
img_i2c_writel(i2c, SCB_INT_CLEAR_REG, ~0);
img_i2c_writel(i2c, SCB_CLEAR_REG, ~0);
if (atomic)
img_i2c_atomic_start(i2c);
else if (msg->flags & I2C_M_RD)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册