aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/i2c-pxa.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 5d5fbc518b7b..57fbffd1ccc0 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -189,14 +189,14 @@ static inline int i2c_pxa_is_slavemode(struct pxa_i2c *i2c)
189 189
190static void i2c_pxa_abort(struct pxa_i2c *i2c) 190static void i2c_pxa_abort(struct pxa_i2c *i2c)
191{ 191{
192 unsigned long timeout = jiffies + HZ/4; 192 int i = 250;
193 193
194 if (i2c_pxa_is_slavemode(i2c)) { 194 if (i2c_pxa_is_slavemode(i2c)) {
195 dev_dbg(&i2c->adap.dev, "%s: called in slave mode\n", __func__); 195 dev_dbg(&i2c->adap.dev, "%s: called in slave mode\n", __func__);
196 return; 196 return;
197 } 197 }
198 198
199 while (time_before(jiffies, timeout) && (readl(_IBMR(i2c)) & 0x1) == 0) { 199 while ((i > 0) && (readl(_IBMR(i2c)) & 0x1) == 0) {
200 unsigned long icr = readl(_ICR(i2c)); 200 unsigned long icr = readl(_ICR(i2c));
201 201
202 icr &= ~ICR_START; 202 icr &= ~ICR_START;
@@ -206,7 +206,8 @@ static void i2c_pxa_abort(struct pxa_i2c *i2c)
206 206
207 show_state(i2c); 207 show_state(i2c);
208 208
209 msleep(1); 209 mdelay(1);
210 i --;
210 } 211 }
211 212
212 writel(readl(_ICR(i2c)) & ~(ICR_MA | ICR_START | ICR_STOP), 213 writel(readl(_ICR(i2c)) & ~(ICR_MA | ICR_START | ICR_STOP),