diff mbox

How to put extra clock cycles on i2c cavinci, problems on omapl138 (logic pd som)

Message ID AANLkTimN0RV4ECQJPZNxk752XGBdfNQFAUQ894syxbp6@mail.gmail.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Ben Gardiner March 17, 2011, 3:49 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 5795c83..ab8e0f3 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -44,7 +44,7 @@ 

 /* ----- global defines ----------------------------------------------- */

-#define DAVINCI_I2C_TIMEOUT    (1*HZ)
+#define DAVINCI_I2C_TIMEOUT    (2*HZ)
 #define DAVINCI_I2C_MAX_TRIES  2
 #define I2C_DAVINCI_INTR_ALL    (DAVINCI_I2C_IMR_AAS | \
                                 DAVINCI_I2C_IMR_SCD | \
@@ -282,7 +282,10 @@  static int i2c_davinci_wait_bus_not_busy(struct
davinci_i2c_dev *dev,
        while (davinci_i2c_read_reg(dev, DAVINCI_I2C_STR_REG)
               & DAVINCI_I2C_STR_BB) {
                if (to_cnt <= DAVINCI_I2C_MAX_TRIES) {
-                       if (time_after(jiffies, timeout)) {
+                       if (time_after(jiffies, timeout)
+                               && (davinci_i2c_read_reg(dev,
+                                               DAVINCI_I2C_STR_REG)
+                                       & DAVINCI_I2C_STR_BB)) {
                                dev_warn(dev->dev,
                                "timeout waiting for bus ready\n");