From: Tony Lindgren Date: Sun, 16 Dec 2007 00:08:15 +0000 (-0800) Subject: Merge current mainline tree into linux-omap tree X-Git-Tag: v2.6.24-omap1~113 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=85faa2b7655e0c4cb9c1806bef38f6d7e8a51f89;p=linux-2.6-omap-h63xx.git Merge current mainline tree into linux-omap tree Merge branches 'master' and 'linus' Conflicts: arch/arm/kernel/entry-armv.S drivers/i2c/busses/i2c-omap.c --- 85faa2b7655e0c4cb9c1806bef38f6d7e8a51f89 diff --cc drivers/i2c/busses/i2c-omap.c index 94c29135e55,cb55cf2ba1e..b3a48a8a908 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@@ -591,71 -473,35 +591,71 @@@ omap_i2c_isr(int this_irq, void *dev_id omap_i2c_complete_cmd(dev, 0); continue; } - if (stat & OMAP_I2C_STAT_RRDY) { - w = omap_i2c_read_reg(dev, OMAP_I2C_DATA_REG); - if (dev->buf_len) { - *dev->buf++ = w; - dev->buf_len--; + if (stat & (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR)) { + u8 num_bytes = 1; + if (dev->fifo_size) { + num_bytes = (stat & OMAP_I2C_STAT_RRDY) ? dev->fifo_size : + omap_i2c_read_reg(dev, OMAP_I2C_BUFSTAT_REG); + } + while (num_bytes) { + num_bytes--; + w = omap_i2c_read_reg(dev, OMAP_I2C_DATA_REG); if (dev->buf_len) { - *dev->buf++ = w >> 8; + *dev->buf++ = w; dev->buf_len--; + /* Data reg from 2430 is 8 bit wide */ + if (!cpu_is_omap2430() && + !cpu_is_omap34xx()) { + if (dev->buf_len) { + *dev->buf++ = w >> 8; + dev->buf_len--; + } + } + } else { + if (stat & OMAP_I2C_STAT_RRDY) - dev_err(dev->dev, "RRDY IRQ while no data" ++ dev_err(dev->dev, "RRDY IRQ while no data " + "requested\n"); + if (stat & OMAP_I2C_STAT_RDR) - dev_err(dev->dev, "RDR IRQ while no data" ++ dev_err(dev->dev, "RDR IRQ while no data " + "requested\n"); + break; } - } else - dev_err(dev->dev, "RRDY IRQ while no data " - "requested\n"); - omap_i2c_ack_stat(dev, OMAP_I2C_STAT_RRDY); + } + omap_i2c_ack_stat(dev, stat & (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR)); continue; } - if (stat & OMAP_I2C_STAT_XRDY) { - w = 0; - if (dev->buf_len) { - w = *dev->buf++; - dev->buf_len--; + if (stat & (OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR)) { + u8 num_bytes = 1; + if (dev->fifo_size) { + num_bytes = (stat & OMAP_I2C_STAT_XRDY) ? dev->fifo_size : + omap_i2c_read_reg(dev, OMAP_I2C_BUFSTAT_REG); + } + while (num_bytes) { + num_bytes--; + w = 0; if (dev->buf_len) { - w |= *dev->buf++ << 8; + w = *dev->buf++; dev->buf_len--; + /* Data reg from 2430 is 8 bit wide */ + if (!cpu_is_omap2430() && + !cpu_is_omap34xx()) { + if (dev->buf_len) { + w |= *dev->buf++ << 8; + dev->buf_len--; + } + } + } else { + if (stat & OMAP_I2C_STAT_XRDY) - dev_err(dev->dev, "XRDY IRQ while no" ++ dev_err(dev->dev, "XRDY IRQ while no " + "data to send\n"); + if (stat & OMAP_I2C_STAT_XDR) - dev_err(dev->dev, "XDR IRQ while no" ++ dev_err(dev->dev, "XDR IRQ while no " + "data to send\n"); + break; } - } else - dev_err(dev->dev, "XRDY IRQ while no " - "data to send\n"); - omap_i2c_write_reg(dev, OMAP_I2C_DATA_REG, w); - omap_i2c_ack_stat(dev, OMAP_I2C_STAT_XRDY); + omap_i2c_write_reg(dev, OMAP_I2C_DATA_REG, w); + } + omap_i2c_ack_stat(dev, stat & (OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR)); continue; } if (stat & OMAP_I2C_STAT_ROVR) {