aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-omap.c
diff options
context:
space:
mode:
authorSonasath, Moiz <m-sonasath@ti.com>2009-07-21 11:14:06 -0400
committerBen Dooks <ben-linux@fluff.org>2009-07-29 20:03:23 -0400
commitbfb6b6588af5ff762222cee79152d2be738ccc06 (patch)
tree1dd86d274a5b1c1ce8de9be45b4888edf191be57 /drivers/i2c/busses/i2c-omap.c
parentccb3bc16b4891a82649d4bccbeefe60b1d9a62e2 (diff)
i2c-omap: Bug in reading the RXSTAT/TXSTAT values from the I2C_BUFFSTAT register
Fix bug in reading the I2C_BUFFSTAT register for getting byte count on RX/TX interrupt. On Interrupt: I2C_STAT[RDR], read 'RXSTAT' from I2C_BUFFSTAT[8-13] On Interrupt: I2C_STAT[XDR] read 'TXSTAT' from I2C_BUFFSTAT[0-5] Signed-off-by: Jagadeesh Pakaravoor <j-pakaravoor@ti.com> Signed-off-by: Moiz Sonasath <m-sonasath@ti.com> Signed-off-by: Vikram pandita <vikram.pandita@ti.com> [ben-linux@fluff.org: fixed mail format and added i2c-omap to subject] 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.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index f2b82ee39adf..a69665788513 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -692,9 +692,10 @@ omap_i2c_isr(int this_irq, void *dev_id)
692 if (dev->fifo_size) { 692 if (dev->fifo_size) {
693 if (stat & OMAP_I2C_STAT_RRDY) 693 if (stat & OMAP_I2C_STAT_RRDY)
694 num_bytes = dev->fifo_size; 694 num_bytes = dev->fifo_size;
695 else 695 else /* read RXSTAT on RDR interrupt */
696 num_bytes = omap_i2c_read_reg(dev, 696 num_bytes = (omap_i2c_read_reg(dev,
697 OMAP_I2C_BUFSTAT_REG); 697 OMAP_I2C_BUFSTAT_REG)
698 >> 8) & 0x3F;
698 } 699 }
699 while (num_bytes) { 700 while (num_bytes) {
700 num_bytes--; 701 num_bytes--;
@@ -731,9 +732,10 @@ omap_i2c_isr(int this_irq, void *dev_id)
731 if (dev->fifo_size) { 732 if (dev->fifo_size) {
732 if (stat & OMAP_I2C_STAT_XRDY) 733 if (stat & OMAP_I2C_STAT_XRDY)
733 num_bytes = dev->fifo_size; 734 num_bytes = dev->fifo_size;
734 else 735 else /* read TXSTAT on XDR interrupt */
735 num_bytes = omap_i2c_read_reg(dev, 736 num_bytes = omap_i2c_read_reg(dev,
736 OMAP_I2C_BUFSTAT_REG); 737 OMAP_I2C_BUFSTAT_REG)
738 & 0x3F;
737 } 739 }
738 while (num_bytes) { 740 while (num_bytes) {
739 num_bytes--; 741 num_bytes--;