[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aAFgwEB4SdgH-1fQ@shikoro>
Date: Thu, 17 Apr 2025 22:12:48 +0200
From: Wolfram Sang <wsa+renesas@...g-engineering.com>
To: "Lad, Prabhakar" <prabhakar.csengg@...il.com>
Cc: Chris Brandt <chris.brandt@...esas.com>,
Andi Shyti <andi.shyti@...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>,
Claudiu Beznea <claudiu.beznea.uj@...renesas.com>,
Andy Shevchenko <andy@...nel.org>
Subject: Re: [PATCH v8] i2c: riic: Implement bus recovery
> As suggested I have the below now, (are there any changes Ive missed?)
Well, get_sda should really only get SDA :)
>
> +static int riic_get_sda(struct i2c_adapter *adap)
> +{
> + struct riic_dev *riic = i2c_get_adapdata(adap);
> +
> + /* Check if the bus is busy or SDA is not high */
> + if ((riic_readb(riic, RIIC_ICCR2) & ICCR2_BBSY) ||
> + !(riic_readb(riic, RIIC_ICCR1) & ICCR1_SDAI))
> + return -EBUSY;
> +
> + return 1;
> +}
I have
+static int riic_get_sda(struct i2c_adapter *adap)
+{
+ struct riic_dev *riic = i2c_get_adapdata(adap);
+
+ return !!(riic_readb(riic, RIIC_ICCR1) & ICCR1_SDAI);
+}
I believe the BBSY handling could be why it does not work.
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists