提交 bfb6b658 编写于 作者: S Sonasath, Moiz 提交者: Ben Dooks

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: NJagadeesh Pakaravoor <j-pakaravoor@ti.com>
Signed-off-by: NMoiz Sonasath <m-sonasath@ti.com>
Signed-off-by: NVikram pandita <vikram.pandita@ti.com>
[ben-linux@fluff.org: fixed mail format and added i2c-omap to subject]
Signed-off-by: NBen Dooks <ben-linux@fluff.org>
上级 ccb3bc16
......@@ -692,9 +692,10 @@ omap_i2c_isr(int this_irq, void *dev_id)
if (dev->fifo_size) {
if (stat & OMAP_I2C_STAT_RRDY)
num_bytes = dev->fifo_size;
else
num_bytes = omap_i2c_read_reg(dev,
OMAP_I2C_BUFSTAT_REG);
else /* read RXSTAT on RDR interrupt */
num_bytes = (omap_i2c_read_reg(dev,
OMAP_I2C_BUFSTAT_REG)
>> 8) & 0x3F;
}
while (num_bytes) {
num_bytes--;
......@@ -731,9 +732,10 @@ omap_i2c_isr(int this_irq, void *dev_id)
if (dev->fifo_size) {
if (stat & OMAP_I2C_STAT_XRDY)
num_bytes = dev->fifo_size;
else
else /* read TXSTAT on XDR interrupt */
num_bytes = omap_i2c_read_reg(dev,
OMAP_I2C_BUFSTAT_REG);
OMAP_I2C_BUFSTAT_REG)
& 0x3F;
}
while (num_bytes) {
num_bytes--;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部