[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5242fffa-c028-49dd-a7cc-b6d9330f3c1c@tuxon.dev>
Date: Sat, 21 Dec 2024 11:13:38 +0200
From: Claudiu Beznea <claudiu.beznea@...on.dev>
To: Prabhakar <prabhakar.csengg@...il.com>,
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>
Cc: 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 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.
Thank you,
Claudiu
Powered by blists - more mailing lists