diff options
author | Nishanth Menon <nm@ti.com> | 2009-08-20 12:21:14 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-08-20 17:27:57 -0400 |
commit | dcc4ec26942d3bae2c5a82ab8346ab53b540a171 (patch) | |
tree | 5610adf8611c1c34907d55ad3e537da943ec70fd /drivers/i2c/busses/i2c-omap.c | |
parent | 64f1607ffbbc772685733ea63e6f7f4183df1b16 (diff) |
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: Nishanth Menon <nm@ti.com>
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-omap.c')
-rw-r--r-- | drivers/i2c/busses/i2c-omap.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index d258b02aef44..94639d0aabd5 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
@@ -674,7 +674,14 @@ omap_i2c_isr(int this_irq, void *dev_id) | |||
674 | 674 | ||
675 | err = 0; | 675 | err = 0; |
676 | complete: | 676 | complete: |
677 | omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat); | 677 | /* |
678 | * Ack the stat in one go, but [R/X]DR and [R/X]RDY should be | ||
679 | * acked after the data operation is complete. | ||
680 | * Ref: TRM SWPU114Q Figure 18-31 | ||
681 | */ | ||
682 | omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat & | ||
683 | ~(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR | | ||
684 | OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR)); | ||
678 | 685 | ||
679 | if (stat & OMAP_I2C_STAT_NACK) { | 686 | if (stat & OMAP_I2C_STAT_NACK) { |
680 | err |= OMAP_I2C_STAT_NACK; | 687 | err |= OMAP_I2C_STAT_NACK; |