]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
i2c: i2c-omap.c modified for 2430 I2C controller
authorKhasim Syed Mohammed <x0khasim@ti.com>
Mon, 11 Dec 2006 21:44:55 +0000 (13:44 -0800)
committerTony Lindgren <tony@atomide.com>
Mon, 11 Dec 2006 21:44:55 +0000 (13:44 -0800)
In OMAP 2430 the I2C DATA Register is 8bit wide, the logic to write
16bit word doesn't apply for OMAP2430 I2C controller.

Signed-off-by: Syed Mohammed Khasim <x0khasim@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/i2c/busses/i2c-omap.c

index fa5a4f25e821730be1b2984bacc5bd8eaaac104d..cd299d29906ce2905b6fd631a14c2999618c0122 100644 (file)
@@ -478,9 +478,14 @@ omap_i2c_isr(int this_irq, void *dev_id)
                        if (dev->buf_len) {
                                *dev->buf++ = w;
                                dev->buf_len--;
-                               if (dev->buf_len) {
-                                       *dev->buf++ = w >> 8;
-                                       dev->buf_len--;
+                               /*
+                                * Data reg in 2430 is 8 bit wide,
+                                */
+                               if (!cpu_is_omap2430()) {
+                                       if (dev->buf_len) {
+                                               *dev->buf++ = w >> 8;
+                                               dev->buf_len--;
+                                       }
                                }
                        } else
                                dev_err(dev->dev, "RRDY IRQ while no data"
@@ -493,9 +498,14 @@ omap_i2c_isr(int this_irq, void *dev_id)
                        if (dev->buf_len) {
                                w = *dev->buf++;
                                dev->buf_len--;
-                               if (dev->buf_len) {
-                                       w |= *dev->buf++ << 8;
-                                       dev->buf_len--;
+                               /*
+                                * Data reg in 2430 is 8 bit wide,
+                                */
+                               if (!cpu_is_omap2430()) {
+                                       if (dev->buf_len) {
+                                               w |= *dev->buf++ << 8;
+                                               dev->buf_len--;
+                                       }
                                }
                        } else
                                dev_err(dev->dev, "XRDY IRQ while no"