RE: [PATCH v4 3/9] reset: rzg2l-usbphy-ctrl: Add RZ/G3L support

Biju Das <[email protected]> Thu, 23 Jul 2026 09:29:01 +0000
Newsgroups org.kernel.vger.linux-renesas-soc,org.kernel.vger.linux-kernel
Message-ID <TY3PR01MB11346CC104651388DC82800A686C02@TY3PR01MB11346.jpnprd01.prod.outlook.com>
Hi Philipp,

Thanks for the feedback.

> -----Original Message-----
> From: Philipp Zabel <[email protected]>
> Sent: 23 July 2026 10:19
> Subject: Re: [PATCH v4 3/9] reset: rzg2l-usbphy-ctrl: Add RZ/G3L support
> 
> On Do, 2026-07-09 at 09:30 +0100, Biju wrote:
> > From: Biju Das <[email protected]>
> >
> > Add the renesas,r9a08g046-usbphy-ctrl compatible string to the OF
> > match table for the RZ/G3L (r9a08g046) SoC, using a dedicated
> > rzg3l_info struct with pwrrdy set, similar to RZ/G3S.
> >
> > The RZ/G3L SoC has 2 OTG controllers compared to one on RZ/G3S, so it
> > uses a separate rzg3l-vbus-regulator driver to handle the additional
> > VBUSEN control for port 2. The regulator_driver_name field is used as
> > the platform device name passed to platform_device_alloc(), and must
> > exactly match the name the corresponding regulator driver registers
> > via its id_table for platform bus matching to succeed.
> >
> > Signed-off-by: Biju Das <[email protected]>
> > ---
> > v3->v4:
> >  * Updated the commit description.
> >  * Migrated to id_table match using driver_name and reduced the length
> >    < 24.
> > v2->v3:
> >  * No change.
> > v1->v2:
> >  * No change.
> > ---
> >  drivers/reset/reset-rzg2l-usbphy-ctrl.c | 14 ++++++++++++--
> >  1 file changed, 12 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/reset/reset-rzg2l-usbphy-ctrl.c
> > b/drivers/reset/reset-rzg2l-usbphy-ctrl.c
> > index 84e745e49240..0803195080bd 100644
> > --- a/drivers/reset/reset-rzg2l-usbphy-ctrl.c
> > +++ b/drivers/reset/reset-rzg2l-usbphy-ctrl.c
> > @@ -42,6 +42,7 @@ struct rzg2l_usbphy_ctrl_priv {  };
> >
> >  struct rzg2l_usbphy_ctrl_info {
> > +	const char *regulator_driver_name;
> 
> After patch 4, this will not be driver.name anymore.
> Maybe call this regulator_name or regulator_device_name?

OK. Will use regulator_name.

> 
> >  	bool pwrrdy;
> >  };
> >
> > @@ -110,15 +111,24 @@ static void rzg2l_usbphy_ctrl_init(struct rzg2l_usbphy_ctrl_priv *priv)
> >  	spin_unlock_irqrestore(&priv->lock, flags);  }
> >
> > -static const struct rzg2l_usbphy_ctrl_info rzg2l_info = {};
> > +static const struct rzg2l_usbphy_ctrl_info rzg2l_info = {
> > +	.regulator_driver_name = "rzg2l-vbus-regulator", };
> >
> >  static const struct rzg2l_usbphy_ctrl_info rzg3s_info = {
> > +	.regulator_driver_name = "rzg2l-vbus-regulator",
> > +	.pwrrdy = true,
> > +};
> > +
> > +static const struct rzg2l_usbphy_ctrl_info rzg3l_info = {
> > +	.regulator_driver_name = "rzg3l-vbus-regulator",
> >  	.pwrrdy = true,
> >  };
> >
> >  static const struct of_device_id rzg2l_usbphy_ctrl_match_table[] = {
> >  	{ .compatible = "renesas,rzg2l-usbphy-ctrl", .data = &rzg2l_info },
> >  	{ .compatible = "renesas,r9a08g045-usbphy-ctrl", .data = &rzg3s_info
> > },
> > +	{ .compatible = "renesas,r9a08g046-usbphy-ctrl", .data = &rzg3l_info
> > +},
> >  	{ /* Sentinel */ }
> >  };
> >  MODULE_DEVICE_TABLE(of, rzg2l_usbphy_ctrl_match_table); @@ -245,7
> > +255,7 @@ static int rzg2l_usbphy_ctrl_probe(struct platform_device *pdev)
> >  	if (error)
> >  		goto err_pm_runtime_put;
> >
> > -	vdev = platform_device_alloc("rzg2l-usb-vbus-regulator", pdev->id);
> > +	vdev = platform_device_alloc(info->regulator_driver_name, pdev->id);
> 
> Switching from "rzg2l-usb-vbus-regulator" to "rzg2l-vbus-regulator"
> breaks bisectability. Any reason not to just use "rzg2l-usb-vbus- regulator" and "rzg3l-usb-vbus-
> regulator"?

I had an issue in probing the device related to id_table match due to string length
restriction in [1], so adjusted the length to less than 24 chars.

Should I create a patch to increase the length to 32chars? Please let me know.

[1]https://elixir.bootlin.com/linux/v7.1.2/source/include/linux/mod_devicetable.h#L604

Cheers,
Biju