mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 21:21:37 +00:00
i2c: lpc32xx: fix read timeout
Fix a condition that generate watchdog timeout inside "lpc32xx_i2c_read" when parameters alen != 0 and len = 0. Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
This commit is contained in:
parent
b395a996a6
commit
3d2b6a2e5f
1 changed files with 5 additions and 5 deletions
|
@ -172,12 +172,12 @@ static int lpc32xx_i2c_read(struct i2c_adapter *adap, u8 dev, uint addr,
|
|||
*(data++) = readl(&i2c->rx);
|
||||
}
|
||||
}
|
||||
/* wait for end of transation */
|
||||
while (!((stat = readl(&i2c->stat)) & LPC32XX_I2C_STAT_TDI))
|
||||
;
|
||||
/* clear end-of-transaction flag */
|
||||
writel(1, &i2c->stat);
|
||||
}
|
||||
/* wait for end of transation */
|
||||
while (!((stat = readl(&i2c->stat)) & LPC32XX_I2C_STAT_TDI))
|
||||
;
|
||||
/* clear end-of-transaction flag */
|
||||
writel(1, &i2c->stat);
|
||||
/* success */
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue