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

Biju Das <[email protected]> Wed, 5 Aug 2026 10:26:24 +0000
Newsgroups org.kernel.vger.linux-renesas-soc,org.kernel.vger.linux-kernel
Message-ID <TY3PR01MB11346A7ED25E81534A144B22F86D32@TY3PR01MB11346.jpnprd01.prod.outlook.com>
Hi Philipp Zabel,

> -----Original Message-----
> From: Biju <[email protected]>
> Sent: 09 July 2026 09:31
> Subject: [PATCH v4 3/9] reset: rzg2l-usbphy-ctrl: Add RZ/G3L support
>=20
> From: Biju Das <[email protected]>
>=20
> Add the renesas,r9a08g046-usbphy-ctrl compatible string to the OF match t=
able for the RZ/G3L (r9a08g046)
> SoC, using a dedicated rzg3l_info struct with pwrrdy set, similar to RZ/G=
3S.
>=20
> The RZ/G3L SoC has 2 OTG controllers compared to one on RZ/G3S, so it use=
s 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 m=
ust exactly match the name the
> corresponding regulator driver registers via its id_table for platform bu=
s matching to succeed.
>=20
> 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(-)
>=20
> diff --git a/drivers/reset/reset-rzg2l-usbphy-ctrl.c b/drivers/reset/rese=
t-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 {  };
>=20
>  struct rzg2l_usbphy_ctrl_info {
> +	const char *regulator_driver_name;
>  	bool pwrrdy;
>  };
>=20
> @@ -110,15 +111,24 @@ static void rzg2l_usbphy_ctrl_init(struct rzg2l_usb=
phy_ctrl_priv *priv)
>  	spin_unlock_irqrestore(&priv->lock, flags);  }
>=20
> -static const struct rzg2l_usbphy_ctrl_info rzg2l_info =3D {};
> +static const struct rzg2l_usbphy_ctrl_info rzg2l_info =3D {
> +	.regulator_driver_name =3D "rzg2l-vbus-regulator", };
>=20
>  static const struct rzg2l_usbphy_ctrl_info rzg3s_info =3D {
> +	.regulator_driver_name =3D "rzg2l-vbus-regulator",
> +	.pwrrdy =3D true,
> +};
> +
> +static const struct rzg2l_usbphy_ctrl_info rzg3l_info =3D {
> +	.regulator_driver_name =3D "rzg3l-vbus-regulator",
>  	.pwrrdy =3D true,
>  };
>=20
>  static const struct of_device_id rzg2l_usbphy_ctrl_match_table[] =3D {
>  	{ .compatible =3D "renesas,rzg2l-usbphy-ctrl", .data =3D &rzg2l_info },
>  	{ .compatible =3D "renesas,r9a08g045-usbphy-ctrl", .data =3D &rzg3s_inf=
o },
> +	{ .compatible =3D "renesas,r9a08g046-usbphy-ctrl", .data =3D &rzg3l_inf=
o
> +},
>  	{ /* 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;
>=20
> -	vdev =3D platform_device_alloc("rzg2l-usb-vbus-regulator", pdev->id);
> +	vdev =3D platform_device_alloc(info->regulator_driver_name, pdev->id);

Please let me know, should I send a patch to increase the length from 24->3=
2 [1]
So that there won't be any backward compatibility issues.

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

[2] https://elixir.bootlin.com/linux/v7.1.2/source/drivers/base/platform.c#=
L1138

Cheers,
Biju
>  	if (!vdev) {
>  		error =3D -ENOMEM;
>  		goto err_pm_runtime_put;
> --
> 2.43.0