Skip to content

Commit 1c78850

Browse files
tq-steinawsakernel
authored andcommitted
i2c: imx-lpi2c: check only for enabled interrupt flags
When reading from I2C, the Tx watermark is set to 0. Unfortunately the TDF (transmit data flag) is enabled when Tx FIFO entries is equal or less than watermark. So it is set in every case, hence the reset default of 1. This results in the MSR_RDF _and_ MSR_TDF flags to be set thus trying to send Tx data on a read message. Mask the IRQ status to filter for wanted flags only. Fixes: a55fa9d ("i2c: imx-lpi2c: add low power i2c bus driver") Signed-off-by: Alexander Stein <[email protected]> Tested-by: Emanuele Ghidoli <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 987dd36 commit 1c78850

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/i2c/busses/i2c-imx-lpi2c.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,14 @@ static int lpi2c_imx_xfer(struct i2c_adapter *adapter,
505505
static irqreturn_t lpi2c_imx_isr(int irq, void *dev_id)
506506
{
507507
struct lpi2c_imx_struct *lpi2c_imx = dev_id;
508+
unsigned int enabled;
508509
unsigned int temp;
509510

511+
enabled = readl(lpi2c_imx->base + LPI2C_MIER);
512+
510513
lpi2c_imx_intctrl(lpi2c_imx, 0);
511514
temp = readl(lpi2c_imx->base + LPI2C_MSR);
515+
temp &= enabled;
512516

513517
if (temp & MSR_RDF)
514518
lpi2c_imx_read_rxfifo(lpi2c_imx);

0 commit comments

Comments
 (0)