RE: [PATCH v4 4/6] regulator: Add Renesas RZ/G2L USB VBUS regulator driver

Biju Das
2024-07-11T14:58:01Z

Hi Geert,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: Thursday, July 11, 2024 3:40 PM
> Subject: Re: [PATCH v4 4/6] regulator: Add Renesas RZ/G2L USB VBUS regulator driver
>
> Hi Biju,
>
> On Sun, Jun 16, 2024 at 12:54 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > As per the RZ/G2L HW manual, VBUSEN can be controlled by the VBOUT bit
> > of the VBUS Control Register. This register is mapped in the reset
> > framework. The reset driver expose this register as regmap and
> > instantiates this driver. The consumer will use the regulator API to
> > control the VBOUT bit as the control need to be done in the atomic context.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
>
> Thanks for your patch, which is now commit 84fbd6198766336f
> ("regulator: Add Renesas RZ/G2L USB VBUS regulator driver") in regulator/for-next.

OK.

>
> > --- a/drivers/regulator/Kconfig
> > +++ b/drivers/regulator/Kconfig
> > @@ -1634,6 +1634,15 @@ config REGULATOR_UNIPHIER
> > help
> > Support for regulators implemented on Socionext UniPhier SoCs.
> >
> > +config REGULATOR_RZG2L_VBCTRL
> > + tristate "Renesas RZ/G2L USB VBUS regulator driver"
> > + depends on ARCH_RZG2L || COMPILE_TEST
> > + depends on OF
> > + select REGMAP_MMIO
> > + default ARCH_RZG2L
>
> As the "rzg2l-usb-vbus-regulator" platform device is only created by drivers/reset/reset-rzg2l-
> usbphy-ctrl.c, perhaps this should be made stricter by using "default RESET_RZG2L_USBPHY_CTRL"?

OK.
>
> Alternatively, RESET_RZG2L_USBPHY_CTRL could select RESET_RZG2L_USBPHY_CTRL if REGULATOR. Can
> RESET_RZG2L_USBPHY_CTRL work without REGULATOR_RZG2L_VBCTRL? If not, RESET_RZG2L_USBPHY_CTRL should
> depend on REGULATOR, too.

Yes, from functionality point it works for both host and device mode without REGULATOR_RZG2L_VBCTRL.
From specification point, some customers reported on device mode, VBUS is showing 5V.
So, by adding vbus regulator, I am controlling this voltage and forcing to 0 for device mode
and 5V for host mode.

Please share your input how to proceed.

Cheers,
Biju