diff options
author | Linus Walleij <linus.walleij@stericsson.com> | 2010-09-23 03:04:11 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-10-24 21:40:48 -0400 |
commit | f868fc355ad852b476950c2fe4f5bae7480e8f04 (patch) | |
tree | b88fcb6fa1d57c390e4176c26e2720b390f208fa /drivers/i2c/busses | |
parent | 5680bc6ec71f303956f5aa999a3c13e13466c561 (diff) |
i2c-nomadik: fixup bus delays
We were missing a transfer delay in one execution path leading to
hangs and the bus timeout was too low leading to errors under
stress tests.
Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/i2c-nomadik.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index e461de7167e7..c9fffd0389fe 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c | |||
@@ -103,6 +103,9 @@ | |||
103 | /* maximum threshold value */ | 103 | /* maximum threshold value */ |
104 | #define MAX_I2C_FIFO_THRESHOLD 15 | 104 | #define MAX_I2C_FIFO_THRESHOLD 15 |
105 | 105 | ||
106 | /* per-transfer delay, required for the hardware to stabilize */ | ||
107 | #define I2C_DELAY 150 | ||
108 | |||
106 | enum i2c_status { | 109 | enum i2c_status { |
107 | I2C_NOP, | 110 | I2C_NOP, |
108 | I2C_ON_GOING, | 111 | I2C_ON_GOING, |
@@ -118,7 +121,7 @@ enum i2c_operation { | |||
118 | }; | 121 | }; |
119 | 122 | ||
120 | /* controller response timeout in ms */ | 123 | /* controller response timeout in ms */ |
121 | #define I2C_TIMEOUT_MS 500 | 124 | #define I2C_TIMEOUT_MS 2000 |
122 | 125 | ||
123 | /** | 126 | /** |
124 | * struct i2c_nmk_client - client specific data | 127 | * struct i2c_nmk_client - client specific data |
@@ -267,6 +270,7 @@ static int init_hw(struct nmk_i2c_dev *dev) | |||
267 | 270 | ||
268 | clk_disable(dev->clk); | 271 | clk_disable(dev->clk); |
269 | 272 | ||
273 | udelay(I2C_DELAY); | ||
270 | return 0; | 274 | return 0; |
271 | } | 275 | } |
272 | 276 | ||
@@ -599,7 +603,7 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap, | |||
599 | clk_disable(dev->clk); | 603 | clk_disable(dev->clk); |
600 | return status; | 604 | return status; |
601 | } | 605 | } |
602 | mdelay(1); | 606 | udelay(I2C_DELAY); |
603 | } | 607 | } |
604 | clk_disable(dev->clk); | 608 | clk_disable(dev->clk); |
605 | 609 | ||