Skip to content

Commit 5a02e7c

Browse files
committed
Revert "i2c: imx: Fix reset of I2SR_IAL flag"
This reverts commit fa4d305. An updated version was sent. So, revert this version and give the new version more time for testing. Signed-off-by: Wolfram Sang <[email protected]>
1 parent 1334d3b commit 5a02e7c

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

drivers/i2c/busses/i2c-imx.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -412,19 +412,6 @@ static void i2c_imx_dma_free(struct imx_i2c_struct *i2c_imx)
412412
dma->chan_using = NULL;
413413
}
414414

415-
static void i2c_imx_clear_irq(struct imx_i2c_struct *i2c_imx, unsigned int bits)
416-
{
417-
unsigned int temp;
418-
419-
/*
420-
* i2sr_clr_opcode is the value to clear all interrupts. Here we want to
421-
* clear only <bits>, so we write ~i2sr_clr_opcode with just <bits>
422-
* toggled. This is required because i.MX needs W1C and Vybrid uses W0C.
423-
*/
424-
temp = ~i2c_imx->hwdata->i2sr_clr_opcode ^ bits;
425-
imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2SR);
426-
}
427-
428415
static int i2c_imx_bus_busy(struct imx_i2c_struct *i2c_imx, int for_busy, bool atomic)
429416
{
430417
unsigned long orig_jiffies = jiffies;
@@ -437,7 +424,8 @@ static int i2c_imx_bus_busy(struct imx_i2c_struct *i2c_imx, int for_busy, bool a
437424

438425
/* check for arbitration lost */
439426
if (temp & I2SR_IAL) {
440-
i2c_imx_clear_irq(i2c_imx, I2SR_IAL);
427+
temp &= ~I2SR_IAL;
428+
imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2SR);
441429
return -EAGAIN;
442430
}
443431

@@ -635,7 +623,9 @@ static irqreturn_t i2c_imx_isr(int irq, void *dev_id)
635623
if (temp & I2SR_IIF) {
636624
/* save status register */
637625
i2c_imx->i2csr = temp;
638-
i2c_imx_clear_irq(i2c_imx, I2SR_IIF);
626+
temp &= ~I2SR_IIF;
627+
temp |= (i2c_imx->hwdata->i2sr_clr_opcode & I2SR_IIF);
628+
imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2SR);
639629
wake_up(&i2c_imx->queue);
640630
return IRQ_HANDLED;
641631
}

0 commit comments

Comments
 (0)