[PATCH v2] i2c: rcar_i2c: Fix i2c read/write errors
Marek Vasut
marek.vasut at gmail.com
Wed Sep 30 11:57:26 CEST 2020
On 9/30/20 11:16 AM, Lad Prabhakar wrote:
[...]
> diff --git a/drivers/i2c/rcar_i2c.c b/drivers/i2c/rcar_i2c.c
> index 4267bbfa5a..e76201df6b 100644
> --- a/drivers/i2c/rcar_i2c.c
> +++ b/drivers/i2c/rcar_i2c.c
> @@ -211,7 +211,7 @@ static int rcar_i2c_xfer(struct udevice *dev, struct i2c_msg *msg, int nmsgs)
> int ret;
>
> for (; nmsgs > 0; nmsgs--, msg++) {
> - ret = rcar_i2c_set_addr(dev, msg->addr, 1);
> + ret = rcar_i2c_set_addr(dev, msg->addr, msg->flags & I2C_M_RD);
Don't you need !!(msg->flags & I2C_M_RD) here ? There is
140 writel((chip << 1) | read, priv->base + RCAR_I2C_ICMAR);
in rcar_i2c_set_addr(), so if I2C_M_RD is ever changed from 0x1 to
anything else, this will fail.
More information about the U-Boot
mailing list