diff mbox series

[v5,4/4] arm64: dts: renesas: rz-smarc: Replace fixed regulator for USB VBUS

Message ID 20240702180032.207275-5-biju.das.jz@bp.renesas.com
State Handled Elsewhere
Headers show
Series Add USB VBUS regulator for RZ/G2L | expand

Commit Message

Biju Das July 2, 2024, 6 p.m. UTC
Replace the fixed regulator for USB VBUS and use the proper one that
controls regulator based on VBUS detection.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v4->v5:
 * Updated commit description.
v3->v4:
 * Dropped regulator-{min,max}-microvolt
v2->v3:
 * Upated label name
 * Updated node and regulator name that matches with the bindings.
v1->v2:
 * New patch.
---
 arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

Comments

Geert Uytterhoeven July 3, 2024, 8:36 a.m. UTC | #1
Hi Biju,

On Tue, Jul 2, 2024 at 8:01 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Replace the fixed regulator for USB VBUS and use the proper one that
> controls regulator based on VBUS detection.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v4->v5:
>  * Updated commit description.

Thanks for the update!

> --- a/arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi
> +++ b/arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi
> @@ -54,14 +54,6 @@ codec_dai: simple-audio-card,codec {
>                 };
>         };
>
> -       usb0_vbus_otg: regulator-usb0-vbus-otg {
> -               compatible = "regulator-fixed";
> -
> -               regulator-name = "USB0_VBUS_OTG";
> -               regulator-min-microvolt = <5000000>;
> -               regulator-max-microvolt = <5000000>;
> -       };
> -
>         vccq_sdhi1: regulator-vccq-sdhi1 {
>                 compatible = "regulator-gpio";
>                 regulator-name = "SDHI1 VccQ";
> @@ -139,6 +131,9 @@ &ohci1 {
>
>  &phyrst {
>         status = "okay";
> +       usb0_vbus_otg: regulator-vbus {

The label is not really needed, is it?

> +               regulator-name = "vbus";
> +       };

Also, as the regulator-vbus subnode is required, perhaps it should
be moved to the SoC-specific .dtsi? Or do you keep it here for
board-specific control of the regulator name, i.e. to avoid conflicts?

>  };
>
>  &scif0 {

Anyway, this adheres to the DT bindings, so
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Biju Das July 3, 2024, 8:56 a.m. UTC | #2
Hi Geert,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: Wednesday, July 3, 2024 9:36 AM
> Subject: Re: [PATCH v5 4/4] arm64: dts: renesas: rz-smarc: Replace fixed regulator for USB VBUS
> 
> Hi Biju,
> 
> On Tue, Jul 2, 2024 at 8:01 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > Replace the fixed regulator for USB VBUS and use the proper one that
> > controls regulator based on VBUS detection.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > v4->v5:
> >  * Updated commit description.
> 
> Thanks for the update!
> 
> > --- a/arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi
> > @@ -54,14 +54,6 @@ codec_dai: simple-audio-card,codec {
> >                 };
> >         };
> >
> > -       usb0_vbus_otg: regulator-usb0-vbus-otg {
> > -               compatible = "regulator-fixed";
> > -
> > -               regulator-name = "USB0_VBUS_OTG";
> > -               regulator-min-microvolt = <5000000>;
> > -               regulator-max-microvolt = <5000000>;
> > -       };
> > -
> >         vccq_sdhi1: regulator-vccq-sdhi1 {
> >                 compatible = "regulator-gpio";
> >                 regulator-name = "SDHI1 VccQ"; @@ -139,6 +131,9 @@
> > &ohci1 {
> >
> >  &phyrst {
> >         status = "okay";
> > +       usb0_vbus_otg: regulator-vbus {
> 
> The label is not really needed, is it?

The label is used in usb2_phy0 node.

vbus-supply = <&usb0_vbus_otg>;

> 
> > +               regulator-name = "vbus";
> > +       };
> 
> Also, as the regulator-vbus subnode is required, perhaps it should be moved to the SoC-
> specific .dtsi? Or do you keep it here for board-specific control of the regulator name, i.e. to
> avoid conflicts?

Yes, just to avoid conflicts. Later I can move to individual SoC specific dtsi's

> 
> >  };
> >
> >  &scif0 {
> 
> Anyway, this adheres to the DT bindings, so
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Thanks,
Biju
Philipp Zabel July 3, 2024, 9:08 a.m. UTC | #3
On Mi, 2024-07-03 at 08:56 +0000, Biju Das wrote:
> Hi Geert,
> 
> Thanks for the feedback.
> 
> > -----Original Message-----
> > From: Geert Uytterhoeven <geert@linux-m68k.org>
> > Sent: Wednesday, July 3, 2024 9:36 AM
> > Subject: Re: [PATCH v5 4/4] arm64: dts: renesas: rz-smarc: Replace fixed regulator for USB VBUS
> > 
> > Hi Biju,
> > 
> > On Tue, Jul 2, 2024 at 8:01 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > > Replace the fixed regulator for USB VBUS and use the proper one that
> > > controls regulator based on VBUS detection.
> > > 
> > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > > ---
> > > v4->v5:
> > >  * Updated commit description.
> > 
> > Thanks for the update!
> > 
> > > --- a/arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi
> > > +++ b/arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi
> > > @@ -54,14 +54,6 @@ codec_dai: simple-audio-card,codec {
> > >                 };
> > >         };
> > > 
> > > -       usb0_vbus_otg: regulator-usb0-vbus-otg {
> > > -               compatible = "regulator-fixed";
> > > -
> > > -               regulator-name = "USB0_VBUS_OTG";
> > > -               regulator-min-microvolt = <5000000>;
> > > -               regulator-max-microvolt = <5000000>;
> > > -       };
> > > -
> > >         vccq_sdhi1: regulator-vccq-sdhi1 {
> > >                 compatible = "regulator-gpio";
> > >                 regulator-name = "SDHI1 VccQ"; @@ -139,6 +131,9 @@
> > > &ohci1 {
> > > 
> > >  &phyrst {
> > >         status = "okay";
> > > +       usb0_vbus_otg: regulator-vbus {
> > 
> > The label is not really needed, is it?
> 
> The label is used in usb2_phy0 node.
> 
> vbus-supply = <&usb0_vbus_otg>;
> 
> > 
> > > +               regulator-name = "vbus";
> > > +       };
> > 
> > Also, as the regulator-vbus subnode is required, perhaps it should be moved to the SoC-
> > specific .dtsi? Or do you keep it here for board-specific control of the regulator name, i.e. to
> > avoid conflicts?
> 
> Yes, just to avoid conflicts. Later I can move to individual SoC specific dtsi's

Alright, thanks! Applied to reset/next.

[1/4] dt-bindings: reset: renesas,rzg2l-usbphy-ctrl: Document USB VBUS regulator
      https://git.pengutronix.de/cgit/pza/linux/commit/?id=f64f2d6fdda4
[2/4] reset: renesas: Add USB VBUS regulator device as child
      https://git.pengutronix.de/cgit/pza/linux/commit/?id=4068f22e4b47
[3/4] phy: renesas: phy-rcar-gen3-usb2: Control VBUS for RZ/G2L SoCs
      https://git.pengutronix.de/cgit/pza/linux/commit/?id=24843404efe4
[4/4] arm64: dts: renesas: rz-smarc: Replace fixed regulator for USB VBUS
      https://git.pengutronix.de/cgit/pza/linux/commit/?id=c1267e1afae6

regards
Philipp
Geert Uytterhoeven July 3, 2024, 9:51 a.m. UTC | #4
Hi Biju,

On Wed, Jul 3, 2024 at 10:56 AM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > -----Original Message-----
> > From: Geert Uytterhoeven <geert@linux-m68k.org>
> > Sent: Wednesday, July 3, 2024 9:36 AM
> > Subject: Re: [PATCH v5 4/4] arm64: dts: renesas: rz-smarc: Replace fixed regulator for USB VBUS
> >
> > On Tue, Jul 2, 2024 at 8:01 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > > Replace the fixed regulator for USB VBUS and use the proper one that
> > > controls regulator based on VBUS detection.
> > >
> > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > > ---
> > > v4->v5:
> > >  * Updated commit description.
> >
> > Thanks for the update!
> >
> > > --- a/arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi
> > > +++ b/arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi
> > > @@ -54,14 +54,6 @@ codec_dai: simple-audio-card,codec {
> > >                 };
> > >         };
> > >
> > > -       usb0_vbus_otg: regulator-usb0-vbus-otg {
> > > -               compatible = "regulator-fixed";
> > > -
> > > -               regulator-name = "USB0_VBUS_OTG";
> > > -               regulator-min-microvolt = <5000000>;
> > > -               regulator-max-microvolt = <5000000>;
> > > -       };
> > > -
> > >         vccq_sdhi1: regulator-vccq-sdhi1 {
> > >                 compatible = "regulator-gpio";
> > >                 regulator-name = "SDHI1 VccQ"; @@ -139,6 +131,9 @@
> > > &ohci1 {
> > >
> > >  &phyrst {
> > >         status = "okay";
> > > +       usb0_vbus_otg: regulator-vbus {
> >
> > The label is not really needed, is it?
>
> The label is used in usb2_phy0 node.
>
> vbus-supply = <&usb0_vbus_otg>;

Oh right, that's a different node (too many USB-related nodes).
(my mind must have been mixing this up with the RZ/V2H SDHi regulator)

>
> >
> > > +               regulator-name = "vbus";
> > > +       };
> >
> > Also, as the regulator-vbus subnode is required, perhaps it should be moved to the SoC-
> > specific .dtsi? Or do you keep it here for board-specific control of the regulator name, i.e. to
> > avoid conflicts?
>
> Yes, just to avoid conflicts. Later I can move to individual SoC specific dtsi's

OK. Good to go(ne)...


Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi b/arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi
index b7a3e6caa386..b34855956ae0 100644
--- a/arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi
+++ b/arch/arm64/boot/dts/renesas/rz-smarc-common.dtsi
@@ -54,14 +54,6 @@  codec_dai: simple-audio-card,codec {
 		};
 	};
 
-	usb0_vbus_otg: regulator-usb0-vbus-otg {
-		compatible = "regulator-fixed";
-
-		regulator-name = "USB0_VBUS_OTG";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-	};
-
 	vccq_sdhi1: regulator-vccq-sdhi1 {
 		compatible = "regulator-gpio";
 		regulator-name = "SDHI1 VccQ";
@@ -139,6 +131,9 @@  &ohci1 {
 
 &phyrst {
 	status = "okay";
+	usb0_vbus_otg: regulator-vbus {
+		regulator-name = "vbus";
+	};
 };
 
 &scif0 {