i2c-davinci: Fix lost interrupt
authorTroy Kisky <troy.kisky@boundarydevices.com>
Fri, 11 Apr 2008 10:07:05 +0000 (12:07 +0200)
committerJean Delvare <khali@hyperion.delvare>
Fri, 11 Apr 2008 10:07:05 +0000 (12:07 +0200)
DAVINCI_I2C_STR_REG is a write 1 to clear register,
so don't use a read/modify/write cycle.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Acked-by: Dirk Behme <dirk.behme@gmail.com>
Signed-off-by: Kevin Hilman <khilman@mvista.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/i2c/busses/i2c-davinci.c

index cce5a614758d37b84f8de5e93670b1a93f2e3179..fde26345a379b38993917c797cc584afd38e7034 100644 (file)
@@ -382,9 +382,8 @@ static irqreturn_t i2c_davinci_isr(int this_irq, void *dev_id)
                        break;
 
                case DAVINCI_I2C_IVR_ARDY:
-                       w = davinci_i2c_read_reg(dev, DAVINCI_I2C_STR_REG);
-                       MOD_REG_BIT(w, DAVINCI_I2C_STR_ARDY, 1);
-                       davinci_i2c_write_reg(dev, DAVINCI_I2C_STR_REG, w);
+                       davinci_i2c_write_reg(dev,
+                               DAVINCI_I2C_STR_REG, DAVINCI_I2C_STR_ARDY);
                        complete(&dev->cmd_complete);
                        break;
 
@@ -397,12 +396,9 @@ static irqreturn_t i2c_davinci_isr(int this_irq, void *dev_id)
                                if (dev->buf_len)
                                        continue;
 
-                               w = davinci_i2c_read_reg(dev,
-                                                        DAVINCI_I2C_STR_REG);
-                               MOD_REG_BIT(w, DAVINCI_I2C_IMR_RRDY, 0);
                                davinci_i2c_write_reg(dev,
-                                                     DAVINCI_I2C_STR_REG,
-                                                     w);
+                                       DAVINCI_I2C_STR_REG,
+                                       DAVINCI_I2C_IMR_RRDY);
                        } else
                                dev_err(dev->dev, "RDR IRQ while no "
                                        "data requested\n");
@@ -428,9 +424,8 @@ static irqreturn_t i2c_davinci_isr(int this_irq, void *dev_id)
                        break;
 
                case DAVINCI_I2C_IVR_SCD:
-                       w = davinci_i2c_read_reg(dev, DAVINCI_I2C_STR_REG);
-                       MOD_REG_BIT(w, DAVINCI_I2C_STR_SCD, 1);
-                       davinci_i2c_write_reg(dev, DAVINCI_I2C_STR_REG, w);
+                       davinci_i2c_write_reg(dev,
+                               DAVINCI_I2C_STR_REG, DAVINCI_I2C_STR_SCD);
                        complete(&dev->cmd_complete);
                        break;