[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+V-a8tQxJ6y-7odV-V9fZt90v4oiRwvqjcTh8-Fs7xfJAm9fg@mail.gmail.com>
Date: Wed, 6 Aug 2025 21:06:42 +0100
From: "Lad, Prabhakar" <prabhakar.csengg@...il.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Vinod Koul <vkoul@...nel.org>, Kishon Vijay Abraham I <kishon@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Geert Uytterhoeven <geert+renesas@...der.be>, Magnus Damm <magnus.damm@...il.com>,
linux-phy@...ts.infradead.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-renesas-soc@...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 4/5] phy: renesas: rcar-gen3-usb2: Add support for RZ/T2H SoC
Hi Geert,
Thank you for the review.
On Wed, Aug 6, 2025 at 3:59 PM Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
>
> Hi Prabhakar,
>
> On Tue, 5 Aug 2025 at 14:25, Prabhakar <prabhakar.csengg@...il.com> wrote:
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
> >
> > Add initial support for the Renesas RZ/T2H SoC to the R-Car Gen3 USB2 PHY
> > driver. The RZ/T2H SoC requires configuration of additional
> > hardware-specific bits for proper VBUS level control and OTG operation.
> >
> > Introduce the `vblvl_ctrl` flag in the SoC-specific driver data to enable
> > handling of VBUS level selection logic using `VBCTRL.VBLVL` bits. This is
> > required for managing the VBUS status detection and drive logic based on
> > SoC-specific needs.
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
>
> Thanks for your patch!
>
> > --- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c
> > +++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
>
> > @@ -284,6 +293,21 @@ static void rcar_gen3_init_from_a_peri_to_a_host(struct rcar_gen3_chan *ch)
> >
> > static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch)
> > {
> > + if (ch->drvdata->vblvl_ctrl) {
> > + bool vbus_valid = false;
> > + bool device = false;
>
> No need to preinitialize these two variables.
>
Agreed, I will drop it.
> > +
> > + device = !!(readl(ch->base + USB2_ADPCTRL) & USB2_ADPCTRL_IDDIG);
> > + vbus_valid = !!(readl(ch->base + USB2_ADPCTRL) & USB2_ADPCTRL_VBUSVALID);
> > +
> > + if (device && vbus_valid)
> > + return true;
> > + else if (!device && vbus_valid)
>
> No need for else after return, but...
>
> > + return false;
> > +
> > + return !(device && !vbus_valid);
>
> ... all logic above can be simplified to
>
> return vbus_valid ? device : !device;
>
Ahha thanks for the pointer!
Cheers,
Prabhakar
Powered by blists - more mailing lists