mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-22 07:01:24 +02:00
Merge tag 'for-v2023-07-rc4' of https://source.denx.de/u-boot/custodians/u-boot-i2c
i2c updates for v2023-07-rc4 Bugfixes: - rockchip: De-initialize the bus after start bit failure from Ondrej Jirman - cdns: Fix broken retry mechanism on arbitration lost
This commit is contained in:
commit
d39277ff42
@ -444,7 +444,7 @@ static int cdns_i2c_xfer(struct udevice *dev, struct i2c_msg *msg,
|
|||||||
|
|
||||||
debug("i2c_xfer: %d messages\n", nmsgs);
|
debug("i2c_xfer: %d messages\n", nmsgs);
|
||||||
for (u8 retry = 0; retry < CDNS_I2C_ARB_LOST_MAX_RETRIES &&
|
for (u8 retry = 0; retry < CDNS_I2C_ARB_LOST_MAX_RETRIES &&
|
||||||
nmsgs > 0; nmsgs--, msg++) {
|
nmsgs > 0;) {
|
||||||
debug("i2c_xfer: chip=0x%x, len=0x%x\n", msg->addr, msg->len);
|
debug("i2c_xfer: chip=0x%x, len=0x%x\n", msg->addr, msg->len);
|
||||||
if (msg->flags & I2C_M_RD) {
|
if (msg->flags & I2C_M_RD) {
|
||||||
ret = cdns_i2c_read_data(i2c_bus, msg->addr, msg->buf,
|
ret = cdns_i2c_read_data(i2c_bus, msg->addr, msg->buf,
|
||||||
@ -461,7 +461,8 @@ static int cdns_i2c_xfer(struct udevice *dev, struct i2c_msg *msg,
|
|||||||
retry);
|
retry);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
nmsgs--;
|
||||||
|
msg++;
|
||||||
if (ret) {
|
if (ret) {
|
||||||
debug("i2c_write: error sending\n");
|
debug("i2c_write: error sending\n");
|
||||||
return -EREMOTEIO;
|
return -EREMOTEIO;
|
||||||
|
@ -342,7 +342,7 @@ static int rockchip_i2c_xfer(struct udevice *bus, struct i2c_msg *msg,
|
|||||||
int nmsgs)
|
int nmsgs)
|
||||||
{
|
{
|
||||||
struct rk_i2c *i2c = dev_get_priv(bus);
|
struct rk_i2c *i2c = dev_get_priv(bus);
|
||||||
int ret;
|
int ret = 0;
|
||||||
|
|
||||||
debug("i2c_xfer: %d messages\n", nmsgs);
|
debug("i2c_xfer: %d messages\n", nmsgs);
|
||||||
for (; nmsgs > 0; nmsgs--, msg++) {
|
for (; nmsgs > 0; nmsgs--, msg++) {
|
||||||
@ -356,14 +356,15 @@ static int rockchip_i2c_xfer(struct udevice *bus, struct i2c_msg *msg,
|
|||||||
}
|
}
|
||||||
if (ret) {
|
if (ret) {
|
||||||
debug("i2c_write: error sending\n");
|
debug("i2c_write: error sending\n");
|
||||||
return -EREMOTEIO;
|
ret = -EREMOTEIO;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rk_i2c_send_stop_bit(i2c);
|
rk_i2c_send_stop_bit(i2c);
|
||||||
rk_i2c_disable(i2c);
|
rk_i2c_disable(i2c);
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rockchip_i2c_set_bus_speed(struct udevice *bus, unsigned int speed)
|
int rockchip_i2c_set_bus_speed(struct udevice *bus, unsigned int speed)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user