[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+V-a8stmK48P3R8-hvf-MjwFkOH2KAXBgjWjuyMWFt4VhuY4w@mail.gmail.com>
Date: Sun, 22 Dec 2024 04:14:47 +0000
From: "Lad, Prabhakar" <prabhakar.csengg@...il.com>
To: Claudiu Beznea <claudiu.beznea@...on.dev>
Cc: Chris Brandt <chris.brandt@...esas.com>, Andi Shyti <andi.shyti@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>, Wolfram Sang <wsa@...nel.org>,
Geert Uytterhoeven <geert+renesas@...der.be>, linux-renesas-soc@...r.kernel.org,
linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
Biju Das <biju.das.jz@...renesas.com>,
Fabrizio Castro <fabrizio.castro.jz@...esas.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Subject: Re: [PATCH v2 9/9] i2c: riic: Implement bus recovery
On Sat, Dec 21, 2024 at 9:13 AM Claudiu Beznea <claudiu.beznea@...on.dev> wrote:
>
>
>
> On 18.12.2024 02:16, Prabhakar wrote:
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
> >
> > Implement bus recovery by reinitializing the hardware to reset the bus
> > state and generating 9 clock cycles (and a stop condition) to release
> > the SDA line.
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
> > ---
> > v1->v2
> > - Used single register read to check SDA/SCL lines
> > ---
> > drivers/i2c/busses/i2c-riic.c | 100 ++++++++++++++++++++++++++++++----
> > 1 file changed, 90 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c
> > index 586092454bb2..d93c371a22de 100644
> > --- a/drivers/i2c/busses/i2c-riic.c
> > +++ b/drivers/i2c/busses/i2c-riic.c
> > @@ -50,6 +50,7 @@
> >
>
> [ ... ]
>
> > +static int riic_recover_bus(struct i2c_adapter *adap)
> > +{
> > + struct riic_dev *riic = i2c_get_adapdata(adap);
> > + struct device *dev = riic->adapter.dev.parent;
> > + int ret;
> > + u8 val;
> > +
> > + ret = riic_init_hw(riic, true);
> > + if (ret)
> > + return -EINVAL;
>
> Any reason for not returning directly the ret? It is true the
> riic_init_hw() can, ATM, return only -EINVAL in case of failure.
>
No reason, I will fix that to return ret directly on failure.
Cheers,
Prabhakar
Powered by blists - more mailing lists