Commit 3487568e authored by Eero Nurkkala's avatar Eero Nurkkala Committed by Tony Lindgren

i2c: i2c-omap: Fix BUFSTAT_REG reading

The number of bytes to be received is read from wrong
place with all OMAPs with highspeed I2C support,
which involves a FIFO and BUFSTAT_REG. It is the 6
bits starting from the bit 8 in the BUFSTAT_REG
that indicate this amount of bytes to be read.
Moreover, only the 6 LSB:s are relevant for the
TXSTAT field.
Signed-off-by: default avatarEero Nurkkala <ext-eero.nurkkala@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 2bb68043
...@@ -675,8 +675,9 @@ omap_i2c_isr(int this_irq, void *dev_id) ...@@ -675,8 +675,9 @@ omap_i2c_isr(int this_irq, void *dev_id)
if (stat & OMAP_I2C_STAT_RRDY) if (stat & OMAP_I2C_STAT_RRDY)
num_bytes = dev->fifo_size; num_bytes = dev->fifo_size;
else else
num_bytes = omap_i2c_read_reg(dev, num_bytes = (omap_i2c_read_reg(dev,
OMAP_I2C_BUFSTAT_REG); OMAP_I2C_BUFSTAT_REG)
>> 8) & 0x3F;
} }
while (num_bytes) { while (num_bytes) {
num_bytes--; num_bytes--;
...@@ -714,8 +715,9 @@ omap_i2c_isr(int this_irq, void *dev_id) ...@@ -714,8 +715,9 @@ omap_i2c_isr(int this_irq, void *dev_id)
if (stat & OMAP_I2C_STAT_XRDY) if (stat & OMAP_I2C_STAT_XRDY)
num_bytes = dev->fifo_size; num_bytes = dev->fifo_size;
else else
num_bytes = omap_i2c_read_reg(dev, num_bytes = (omap_i2c_read_reg(dev,
OMAP_I2C_BUFSTAT_REG); OMAP_I2C_BUFSTAT_REG))
& 0x3F;
} }
while (num_bytes) { while (num_bytes) {
num_bytes--; num_bytes--;
......
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