[PATCH v2] i2c: rcar_i2c: Fix i2c read/write errors

Lad, Prabhakar prabhakar.csengg at gmail.com
Wed Sep 30 12:35:01 CEST 2020


Hi Marek,

Thank you for the review.

On Wed, Sep 30, 2020 at 10:57 AM Marek Vasut <marek.vasut at gmail.com> wrote:
>
> 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.
>
Agreed will fix that and post a v3.

Cheers,
Prabhakar


More information about the U-Boot mailing list