mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-29 18:41:30 +00:00
i2c: at91_i2c: Wait for TXRDY after sending the first byte
The driver must wait for TXRDY after each byte is pushed into the i2c FIFO before pushing the next byte. Previously this was not done for the first byte, causing a race condition with zeros sometimes being sent for the next byte (which is typically the first actual data byte). Signed-off-by: Alan Ott <alan@softiron.com> Reviewed-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
50a69095cb
commit
0afbb0e1c0
1 changed files with 2 additions and 0 deletions
|
@ -72,6 +72,8 @@ static int at91_i2c_xfer_msg(struct at91_i2c_bus *bus, struct i2c_msg *msg)
|
|||
|
||||
} else {
|
||||
writel(msg->buf[0], ®->thr);
|
||||
ret = at91_wait_for_xfer(bus, TWI_SR_TXRDY);
|
||||
|
||||
for (i = 1; !ret && (i < msg->len); i++) {
|
||||
writel(msg->buf[i], ®->thr);
|
||||
ret = at91_wait_for_xfer(bus, TWI_SR_TXRDY);
|
||||
|
|
Loading…
Add table
Reference in a new issue