]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - drivers/i2c/at91_i2c.c
i2c: at91_i2c: Wait for TXRDY after sending the first byte
[people/ms/u-boot.git] / drivers / i2c / at91_i2c.c
index d394044f80de5362d8b8a77862800093f878602c..20d09296a1320f672267b995af1286659981cf0d 100644 (file)
@@ -72,6 +72,8 @@ static int at91_i2c_xfer_msg(struct at91_i2c_bus *bus, struct i2c_msg *msg)
 
        } else {
                writel(msg->buf[0], &reg->thr);
+               ret = at91_wait_for_xfer(bus, TWI_SR_TXRDY);
+
                for (i = 1; !ret && (i < msg->len); i++) {
                        writel(msg->buf[i], &reg->thr);
                        ret = at91_wait_for_xfer(bus, TWI_SR_TXRDY);