Commit dcc4ec26 authored by Nishanth Menon's avatar Nishanth Menon Committed by Ben Dooks

i2c-omap: Fix I2C status ACK

I2C status ack for [RX]RDR and [RX]RDY could
cause race conditions of clearing the event
twice and a violation of the programing
sequence as defined in TRM This patch fixes
the same.
Signed-off-by: default avatarNishanth Menon <nm@ti.com>
Signed-off-by: default avatarMoiz Sonasath <m-sonasath@ti.com>
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent 64f1607f
...@@ -674,7 +674,14 @@ omap_i2c_isr(int this_irq, void *dev_id) ...@@ -674,7 +674,14 @@ omap_i2c_isr(int this_irq, void *dev_id)
err = 0; err = 0;
complete: complete:
omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat); /*
* Ack the stat in one go, but [R/X]DR and [R/X]RDY should be
* acked after the data operation is complete.
* Ref: TRM SWPU114Q Figure 18-31
*/
omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat &
~(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
if (stat & OMAP_I2C_STAT_NACK) { if (stat & OMAP_I2C_STAT_NACK) {
err |= OMAP_I2C_STAT_NACK; err |= OMAP_I2C_STAT_NACK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment