> -----Original Message-----
> From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
> ow...@vger.kernel.org] On Behalf Of Sonasath, Moiz
> Sent: Tuesday, July 14, 2009 4:18 PM
> To: linux-omap@vger.kernel.org
> Cc: Kamat, Nishant; Paul Walmsley
> Subject: [PATCH 1/3] [OMAP:I2C]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: Moiz Sonasath<m-sonas...@ti.com>
> Signed-off-by: Jagadeesh Pakaravoor<j-pakarav...@ti.com>
> Signed-off-by: Vikram andita<vikram.pand...@ti.com>
> ---
>  drivers/i2c/busses/i2c-omap.c |   14 ++++++++------
>  1 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index ad8d201..d280acf 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)
>                       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
> -                                     num_bytes = omap_i2c_read_reg(dev,
> -                                                     OMAP_I2C_BUFSTAT_REG);
> +                             else    /* read TXSTAT on XDR interrupt */
> +                                     num_bytes = (omap_i2c_read_reg(dev,
> +                                                     OMAP_I2C_BUFSTAT_REG))
Minor - Remove that extra ()..                                 ^^
> +                                                     & 0x3F;
>                       }
>                       while (num_bytes) {
>                               num_bytes--;
Acked-by: Nishanth Menon <n...@ti.com>

Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to