* [PATCH v7 1/4] dt-bindings: reset: renesas,rzv2h-usb2phy: Add '#mux-state-cells' property
2026-01-29 16:52 [PATCH v7 0/4] Add USB2.0 support for RZ/G3E Tommaso Merciai
@ 2026-01-29 16:52 ` Tommaso Merciai
2026-01-29 18:42 ` Rob Herring (Arm)
2026-01-29 16:52 ` [PATCH v7 2/4] dt-bindings: reset: renesas,rzv2h-usb2phy: Document RZ/G3E USB2PHY reset Tommaso Merciai
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Tommaso Merciai @ 2026-01-29 16:52 UTC (permalink / raw)
To: tomm.merciai
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, Fabrizio Castro,
Lad Prabhakar, Philipp Zabel, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, devicetree,
linux-kernel, Krzysztof Kozlowski
Add the '#mux-state-cells' property to support describing the USB VBUS_SEL
multiplexer as a mux-controller in the Renesas RZ/V2H(P) USB2PHY binding.
The mux-controller cannot be integrated into the parent USB2PHY node
because the VBUS source selector is part of a separate hardware block,
not the USB2PHY block itself.
This is required to properly configure USB PHY power selection on
RZ/V2H(P) and RZ/G3E SoCs.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v6->v7:
- No changes
v5->v6:
- Collected KKrzysztof tag
v4->v5:
- No changes
v3->v4:
- Switch back to v2 implementation.
- Improve commit body.
v2->v3:
- Manipulate mux-controller as an internal node.
- Improved commit body.
v1->v2:
- New patch
.../bindings/reset/renesas,rzv2h-usb2phy-reset.yaml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/devicetree/bindings/reset/renesas,rzv2h-usb2phy-reset.yaml b/Documentation/devicetree/bindings/reset/renesas,rzv2h-usb2phy-reset.yaml
index c1b800a10b53..7ed0980b9ee1 100644
--- a/Documentation/devicetree/bindings/reset/renesas,rzv2h-usb2phy-reset.yaml
+++ b/Documentation/devicetree/bindings/reset/renesas,rzv2h-usb2phy-reset.yaml
@@ -37,6 +37,9 @@ properties:
'#reset-cells':
const: 0
+ '#mux-state-cells':
+ const: 1
+
required:
- compatible
- reg
@@ -44,6 +47,7 @@ required:
- resets
- power-domains
- '#reset-cells'
+ - '#mux-state-cells'
additionalProperties: false
@@ -58,4 +62,5 @@ examples:
resets = <&cpg 0xaf>;
power-domains = <&cpg>;
#reset-cells = <0>;
+ #mux-state-cells = <1>;
};
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH v7 1/4] dt-bindings: reset: renesas,rzv2h-usb2phy: Add '#mux-state-cells' property
2026-01-29 16:52 ` [PATCH v7 1/4] dt-bindings: reset: renesas,rzv2h-usb2phy: Add '#mux-state-cells' property Tommaso Merciai
@ 2026-01-29 18:42 ` Rob Herring (Arm)
2026-02-03 8:49 ` Tommaso Merciai
0 siblings, 1 reply; 8+ messages in thread
From: Rob Herring (Arm) @ 2026-01-29 18:42 UTC (permalink / raw)
To: Tommaso Merciai
Cc: devicetree, biju.das.jz, Fabrizio Castro, Philipp Zabel,
linux-kernel, Magnus Damm, linux-renesas-soc, Krzysztof Kozlowski,
Conor Dooley, tomm.merciai, Krzysztof Kozlowski, Lad Prabhakar,
Geert Uytterhoeven
On Thu, 29 Jan 2026 17:52:55 +0100, Tommaso Merciai wrote:
> Add the '#mux-state-cells' property to support describing the USB VBUS_SEL
> multiplexer as a mux-controller in the Renesas RZ/V2H(P) USB2PHY binding.
>
> The mux-controller cannot be integrated into the parent USB2PHY node
> because the VBUS source selector is part of a separate hardware block,
> not the USB2PHY block itself.
>
> This is required to properly configure USB PHY power selection on
> RZ/V2H(P) and RZ/G3E SoCs.
>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v6->v7:
> - No changes
>
> v5->v6:
> - Collected KKrzysztof tag
>
> v4->v5:
> - No changes
>
> v3->v4:
> - Switch back to v2 implementation.
> - Improve commit body.
>
> v2->v3:
> - Manipulate mux-controller as an internal node.
> - Improved commit body.
>
> v1->v2:
> - New patch
>
> .../bindings/reset/renesas,rzv2h-usb2phy-reset.yaml | 5 +++++
> 1 file changed, 5 insertions(+)
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/reset/renesas,rzv2h-usb2phy-reset.example.dtb: reset-controller@15830000 (renesas,r9a09g057-usb2phy-reset): $nodename:0: 'reset-controller@15830000' does not match '^mux-controller(@.*|-([0-9]|[1-9][0-9]+))?$'
from schema $id: http://devicetree.org/schemas/mux/mux-controller.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.kernel.org/project/devicetree/patch/af75145b08e24034dcf367932002079363e5dd81.1769704000.git.tommaso.merciai.xr@bp.renesas.com
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v7 1/4] dt-bindings: reset: renesas,rzv2h-usb2phy: Add '#mux-state-cells' property
2026-01-29 18:42 ` Rob Herring (Arm)
@ 2026-02-03 8:49 ` Tommaso Merciai
2026-02-03 17:56 ` Rob Herring
0 siblings, 1 reply; 8+ messages in thread
From: Tommaso Merciai @ 2026-02-03 8:49 UTC (permalink / raw)
To: Rob Herring (Arm)
Cc: devicetree, biju.das.jz, Fabrizio Castro, Philipp Zabel,
linux-kernel, Magnus Damm, linux-renesas-soc, Krzysztof Kozlowski,
Conor Dooley, tomm.merciai, Krzysztof Kozlowski, Lad Prabhakar,
Geert Uytterhoeven
Hi Rob,
On Thu, Jan 29, 2026 at 12:42:11PM -0600, Rob Herring (Arm) wrote:
>
> On Thu, 29 Jan 2026 17:52:55 +0100, Tommaso Merciai wrote:
> > Add the '#mux-state-cells' property to support describing the USB VBUS_SEL
> > multiplexer as a mux-controller in the Renesas RZ/V2H(P) USB2PHY binding.
> >
> > The mux-controller cannot be integrated into the parent USB2PHY node
> > because the VBUS source selector is part of a separate hardware block,
> > not the USB2PHY block itself.
> >
> > This is required to properly configure USB PHY power selection on
> > RZ/V2H(P) and RZ/G3E SoCs.
> >
> > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > ---
> > v6->v7:
> > - No changes
> >
> > v5->v6:
> > - Collected KKrzysztof tag
> >
> > v4->v5:
> > - No changes
> >
> > v3->v4:
> > - Switch back to v2 implementation.
> > - Improve commit body.
> >
> > v2->v3:
> > - Manipulate mux-controller as an internal node.
> > - Improved commit body.
> >
> > v1->v2:
> > - New patch
> >
> > .../bindings/reset/renesas,rzv2h-usb2phy-reset.yaml | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
>
> My bot found errors running 'make dt_binding_check' on your patch:
>
> yamllint warnings/errors:
>
> dtschema/dtc warnings/errors:
> /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/reset/renesas,rzv2h-usb2phy-reset.example.dtb: reset-controller@15830000 (renesas,r9a09g057-usb2phy-reset): $nodename:0: 'reset-controller@15830000' does not match '^mux-controller(@.*|-([0-9]|[1-9][0-9]+))?$'
> from schema $id: http://devicetree.org/schemas/mux/mux-controller.yaml
>
> doc reference errors (make refcheckdocs):
>
> See https://patchwork.kernel.org/project/devicetree/patch/af75145b08e24034dcf367932002079363e5dd81.1769704000.git.tommaso.merciai.xr@bp.renesas.com
>
> The base for the series is generally the latest rc1. A different dependency
> should be noted in *this* patch.
>
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:
>
> pip3 install dtschema --upgrade
>
> Please check and re-submit after running the above command yourself. Note
> that DT_SCHEMA_FILES can be set to your schema file to speed up checking
> your schema. However, it must be unset to test all examples with your schema.
>
This series depends on related mux series [0].
Was splitted the series into per subsystem series for easy merging.
[0] https://lore.kernel.org/all/cover.1769703480.git.tommaso.merciai.xr@bp.renesas.com/
Thanks & Regards,
Tommaso
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v7 1/4] dt-bindings: reset: renesas,rzv2h-usb2phy: Add '#mux-state-cells' property
2026-02-03 8:49 ` Tommaso Merciai
@ 2026-02-03 17:56 ` Rob Herring
0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2026-02-03 17:56 UTC (permalink / raw)
To: Tommaso Merciai
Cc: devicetree, biju.das.jz, Fabrizio Castro, Philipp Zabel,
linux-kernel, Magnus Damm, linux-renesas-soc, Krzysztof Kozlowski,
Conor Dooley, tomm.merciai, Krzysztof Kozlowski, Lad Prabhakar,
Geert Uytterhoeven
On Tue, Feb 03, 2026 at 09:49:38AM +0100, Tommaso Merciai wrote:
> Hi Rob,
>
> On Thu, Jan 29, 2026 at 12:42:11PM -0600, Rob Herring (Arm) wrote:
> >
> > On Thu, 29 Jan 2026 17:52:55 +0100, Tommaso Merciai wrote:
> > > Add the '#mux-state-cells' property to support describing the USB VBUS_SEL
> > > multiplexer as a mux-controller in the Renesas RZ/V2H(P) USB2PHY binding.
> > >
> > > The mux-controller cannot be integrated into the parent USB2PHY node
> > > because the VBUS source selector is part of a separate hardware block,
> > > not the USB2PHY block itself.
> > >
> > > This is required to properly configure USB PHY power selection on
> > > RZ/V2H(P) and RZ/G3E SoCs.
> > >
> > > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> > > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > > ---
> > > v6->v7:
> > > - No changes
> > >
> > > v5->v6:
> > > - Collected KKrzysztof tag
> > >
> > > v4->v5:
> > > - No changes
> > >
> > > v3->v4:
> > > - Switch back to v2 implementation.
> > > - Improve commit body.
> > >
> > > v2->v3:
> > > - Manipulate mux-controller as an internal node.
> > > - Improved commit body.
> > >
> > > v1->v2:
> > > - New patch
> > >
> > > .../bindings/reset/renesas,rzv2h-usb2phy-reset.yaml | 5 +++++
> > > 1 file changed, 5 insertions(+)
> > >
> >
> > My bot found errors running 'make dt_binding_check' on your patch:
> >
> > yamllint warnings/errors:
> >
> > dtschema/dtc warnings/errors:
> > /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/reset/renesas,rzv2h-usb2phy-reset.example.dtb: reset-controller@15830000 (renesas,r9a09g057-usb2phy-reset): $nodename:0: 'reset-controller@15830000' does not match '^mux-controller(@.*|-([0-9]|[1-9][0-9]+))?$'
> > from schema $id: http://devicetree.org/schemas/mux/mux-controller.yaml
> >
> > doc reference errors (make refcheckdocs):
> >
> > See https://patchwork.kernel.org/project/devicetree/patch/af75145b08e24034dcf367932002079363e5dd81.1769704000.git.tommaso.merciai.xr@bp.renesas.com
> >
> > The base for the series is generally the latest rc1. A different dependency
> > should be noted in *this* patch.
> >
> > If you already ran 'make dt_binding_check' and didn't see the above
> > error(s), then make sure 'yamllint' is installed and dt-schema is up to
> > date:
> >
> > pip3 install dtschema --upgrade
> >
> > Please check and re-submit after running the above command yourself. Note
> > that DT_SCHEMA_FILES can be set to your schema file to speed up checking
> > your schema. However, it must be unset to test all examples with your schema.
> >
>
> This series depends on related mux series [0].
> Was splitted the series into per subsystem series for easy merging.
It's not easier when there's a dependency. I don't care so much as long
as this series is merged after [0] is in linux-next. But don't make the
maintainer figure that out. Either make it clear there is a warning
until that happens or just wait to send this until the dependency is
applied (still need to mention any dependency that's only in linux-next
and not mainline).
Rob
>
> [0] https://lore.kernel.org/all/cover.1769703480.git.tommaso.merciai.xr@bp.renesas.com/
>
> Thanks & Regards,
> Tommaso
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v7 2/4] dt-bindings: reset: renesas,rzv2h-usb2phy: Document RZ/G3E USB2PHY reset
2026-01-29 16:52 [PATCH v7 0/4] Add USB2.0 support for RZ/G3E Tommaso Merciai
2026-01-29 16:52 ` [PATCH v7 1/4] dt-bindings: reset: renesas,rzv2h-usb2phy: Add '#mux-state-cells' property Tommaso Merciai
@ 2026-01-29 16:52 ` Tommaso Merciai
2026-01-29 16:52 ` [PATCH v7 3/4] reset: rzv2h-usb2phy: Keep PHY clock enabled for entire device lifetime Tommaso Merciai
2026-01-29 16:52 ` [PATCH v7 4/4] reset: rzv2h-usb2phy: Add support for VBUS mux controller registration Tommaso Merciai
3 siblings, 0 replies; 8+ messages in thread
From: Tommaso Merciai @ 2026-01-29 16:52 UTC (permalink / raw)
To: tomm.merciai
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, Fabrizio Castro,
Lad Prabhakar, Philipp Zabel, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, devicetree,
linux-kernel, Conor Dooley
Document USB2PHY reset controller bindings for RZ/G3E ("R9A09G047") SoC.
The RZ/G3E USB2PHY reset controller is functionally identical to the one
found on the RZ/V2H(P), so no driver changes are needed. The existing
"renesas,r9a09g057-usb2phy-reset" will be used as a fallback compatible
for this IP.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v6->v7:
- No changes
v5->v6:
- Fixed commit msg
v4->v5:
- No changes
v3->v4:
- No changes
v2->v3:
- No changes
v1->v2:
- Collected CDooley tag
.../bindings/reset/renesas,rzv2h-usb2phy-reset.yaml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/reset/renesas,rzv2h-usb2phy-reset.yaml b/Documentation/devicetree/bindings/reset/renesas,rzv2h-usb2phy-reset.yaml
index 7ed0980b9ee1..66650ef8f772 100644
--- a/Documentation/devicetree/bindings/reset/renesas,rzv2h-usb2phy-reset.yaml
+++ b/Documentation/devicetree/bindings/reset/renesas,rzv2h-usb2phy-reset.yaml
@@ -17,7 +17,9 @@ properties:
compatible:
oneOf:
- items:
- - const: renesas,r9a09g056-usb2phy-reset # RZ/V2N
+ - enum:
+ - renesas,r9a09g047-usb2phy-reset # RZ/G3E
+ - renesas,r9a09g056-usb2phy-reset # RZ/V2N
- const: renesas,r9a09g057-usb2phy-reset
- const: renesas,r9a09g057-usb2phy-reset # RZ/V2H(P)
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH v7 3/4] reset: rzv2h-usb2phy: Keep PHY clock enabled for entire device lifetime
2026-01-29 16:52 [PATCH v7 0/4] Add USB2.0 support for RZ/G3E Tommaso Merciai
2026-01-29 16:52 ` [PATCH v7 1/4] dt-bindings: reset: renesas,rzv2h-usb2phy: Add '#mux-state-cells' property Tommaso Merciai
2026-01-29 16:52 ` [PATCH v7 2/4] dt-bindings: reset: renesas,rzv2h-usb2phy: Document RZ/G3E USB2PHY reset Tommaso Merciai
@ 2026-01-29 16:52 ` Tommaso Merciai
2026-01-29 16:52 ` [PATCH v7 4/4] reset: rzv2h-usb2phy: Add support for VBUS mux controller registration Tommaso Merciai
3 siblings, 0 replies; 8+ messages in thread
From: Tommaso Merciai @ 2026-01-29 16:52 UTC (permalink / raw)
To: tomm.merciai
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, Fabrizio Castro,
Lad Prabhakar, Philipp Zabel, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, devicetree,
linux-kernel, stable
The driver was disabling the USB2 PHY clock immediately after register
initialization in probe() and after each reset operation. This left the
PHY unclocked even though it must remain active for USB functionality.
The behavior appeared to work only when another driver
(e.g., USB controller) had already enabled the clock, making operation
unreliable and hardware-dependent. In configurations where this driver
is the sole clock user, USB functionality would fail.
Fix this by:
- Enabling the clock once in probe() via pm_runtime_resume_and_get()
- Removing all pm_runtime_put() calls from assert/deassert/status
- Registering a devm cleanup action to release the clock at removal
- Removed rzv2h_usbphy_assert_helper() and its call in
rzv2h_usb2phy_reset_probe()
This ensures the PHY clock remains enabled for the entire device lifetime,
preventing instability and aligning with hardware requirements.
Cc: stable@vger.kernel.org
Fixes: e3911d7f865b ("reset: Add USB2PHY port reset driver for Renesas RZ/V2H(P)")
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v6->v7:
- No changes
v5->v6:
- No changes
v4->v5:
- No changes.
v3->v4:
- No changes.
v2->v3:
- Added missing Cc: stable@vger.kernel.org
- Improved commit body describing the removal of rzv2h_usbphy_assert_helper()
from rzv2h_usb2phy_reset_probe().
v1->v2:
- Improve commit body and commit msg
- Added Fixes tag
- Dropped unnecessary rzv2h_usbphy_assert_helper() function
drivers/reset/reset-rzv2h-usb2phy.c | 64 ++++++++---------------------
1 file changed, 18 insertions(+), 46 deletions(-)
diff --git a/drivers/reset/reset-rzv2h-usb2phy.c b/drivers/reset/reset-rzv2h-usb2phy.c
index ae643575b067..5bdd39274612 100644
--- a/drivers/reset/reset-rzv2h-usb2phy.c
+++ b/drivers/reset/reset-rzv2h-usb2phy.c
@@ -49,9 +49,10 @@ static inline struct rzv2h_usb2phy_reset_priv
return container_of(rcdev, struct rzv2h_usb2phy_reset_priv, rcdev);
}
-/* This function must be called only after pm_runtime_resume_and_get() has been called */
-static void rzv2h_usbphy_assert_helper(struct rzv2h_usb2phy_reset_priv *priv)
+static int rzv2h_usbphy_reset_assert(struct reset_controller_dev *rcdev,
+ unsigned long id)
{
+ struct rzv2h_usb2phy_reset_priv *priv = rzv2h_usbphy_rcdev_to_priv(rcdev);
const struct rzv2h_usb2phy_reset_of_data *data = priv->data;
scoped_guard(spinlock, &priv->lock) {
@@ -60,24 +61,6 @@ static void rzv2h_usbphy_assert_helper(struct rzv2h_usb2phy_reset_priv *priv)
}
usleep_range(11, 20);
-}
-
-static int rzv2h_usbphy_reset_assert(struct reset_controller_dev *rcdev,
- unsigned long id)
-{
- struct rzv2h_usb2phy_reset_priv *priv = rzv2h_usbphy_rcdev_to_priv(rcdev);
- struct device *dev = priv->dev;
- int ret;
-
- ret = pm_runtime_resume_and_get(dev);
- if (ret) {
- dev_err(dev, "pm_runtime_resume_and_get failed\n");
- return ret;
- }
-
- rzv2h_usbphy_assert_helper(priv);
-
- pm_runtime_put(dev);
return 0;
}
@@ -87,14 +70,6 @@ static int rzv2h_usbphy_reset_deassert(struct reset_controller_dev *rcdev,
{
struct rzv2h_usb2phy_reset_priv *priv = rzv2h_usbphy_rcdev_to_priv(rcdev);
const struct rzv2h_usb2phy_reset_of_data *data = priv->data;
- struct device *dev = priv->dev;
- int ret;
-
- ret = pm_runtime_resume_and_get(dev);
- if (ret) {
- dev_err(dev, "pm_runtime_resume_and_get failed\n");
- return ret;
- }
scoped_guard(spinlock, &priv->lock) {
writel(data->reset_deassert_val, priv->base + data->reset_reg);
@@ -102,8 +77,6 @@ static int rzv2h_usbphy_reset_deassert(struct reset_controller_dev *rcdev,
writel(data->reset_release_val, priv->base + data->reset_reg);
}
- pm_runtime_put(dev);
-
return 0;
}
@@ -111,20 +84,10 @@ static int rzv2h_usbphy_reset_status(struct reset_controller_dev *rcdev,
unsigned long id)
{
struct rzv2h_usb2phy_reset_priv *priv = rzv2h_usbphy_rcdev_to_priv(rcdev);
- struct device *dev = priv->dev;
- int ret;
u32 reg;
- ret = pm_runtime_resume_and_get(dev);
- if (ret) {
- dev_err(dev, "pm_runtime_resume_and_get failed\n");
- return ret;
- }
-
reg = readl(priv->base + priv->data->reset_reg);
- pm_runtime_put(dev);
-
return (reg & priv->data->reset_status_bits) == priv->data->reset_status_bits;
}
@@ -141,6 +104,11 @@ static int rzv2h_usb2phy_reset_of_xlate(struct reset_controller_dev *rcdev,
return 0;
}
+static void rzv2h_usb2phy_reset_pm_runtime_put(void *data)
+{
+ pm_runtime_put(data);
+}
+
static int rzv2h_usb2phy_reset_probe(struct platform_device *pdev)
{
const struct rzv2h_usb2phy_reset_of_data *data;
@@ -175,14 +143,14 @@ static int rzv2h_usb2phy_reset_probe(struct platform_device *pdev)
if (error)
return dev_err_probe(dev, error, "pm_runtime_resume_and_get failed\n");
+ error = devm_add_action_or_reset(dev, rzv2h_usb2phy_reset_pm_runtime_put,
+ dev);
+ if (error)
+ return dev_err_probe(dev, error, "unable to register cleanup action\n");
+
for (unsigned int i = 0; i < data->init_val_count; i++)
writel(data->init_vals[i].val, priv->base + data->init_vals[i].reg);
- /* keep usb2phy in asserted state */
- rzv2h_usbphy_assert_helper(priv);
-
- pm_runtime_put(dev);
-
priv->rcdev.ops = &rzv2h_usbphy_reset_ops;
priv->rcdev.of_reset_n_cells = 0;
priv->rcdev.nr_resets = 1;
@@ -190,7 +158,11 @@ static int rzv2h_usb2phy_reset_probe(struct platform_device *pdev)
priv->rcdev.of_node = dev->of_node;
priv->rcdev.dev = dev;
- return devm_reset_controller_register(dev, &priv->rcdev);
+ error = devm_reset_controller_register(dev, &priv->rcdev);
+ if (error)
+ return dev_err_probe(dev, error, "could not register reset controller\n");
+
+ return 0;
}
/*
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH v7 4/4] reset: rzv2h-usb2phy: Add support for VBUS mux controller registration
2026-01-29 16:52 [PATCH v7 0/4] Add USB2.0 support for RZ/G3E Tommaso Merciai
` (2 preceding siblings ...)
2026-01-29 16:52 ` [PATCH v7 3/4] reset: rzv2h-usb2phy: Keep PHY clock enabled for entire device lifetime Tommaso Merciai
@ 2026-01-29 16:52 ` Tommaso Merciai
3 siblings, 0 replies; 8+ messages in thread
From: Tommaso Merciai @ 2026-01-29 16:52 UTC (permalink / raw)
To: tomm.merciai
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, Fabrizio Castro,
Lad Prabhakar, Philipp Zabel, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, devicetree,
linux-kernel
The RZ/V2H USB2 PHY requires control of the VBUS selection line
(VBENCTL) through a mux controller described in the device tree as
"mux-controller". This change adds support for registering the
rzv2h-usb-vbenctl auxiliary driver during probe.
This enables proper management of USB2.0 VBUS source selection on
platforms using the RZ/V2H SoC.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v6->v7:
- No changes
v5->v6:
- No changes
v4->v5:
- Update mux_name to "vbenctl" to match the driver name.
- Updated commit message.
v3->v4:
- No changes.
v2->v3:
- Use __devm_auxiliary_device_create() to create the auxiliary device.
v1->v2:
- New patch
drivers/reset/Kconfig | 1 +
drivers/reset/reset-rzv2h-usb2phy.c | 44 +++++++++++++++++++++++++++++
2 files changed, 45 insertions(+)
diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
index 7ce151f6a7e4..0b656a56462d 100644
--- a/drivers/reset/Kconfig
+++ b/drivers/reset/Kconfig
@@ -257,6 +257,7 @@ config RESET_RZG2L_USBPHY_CTRL
config RESET_RZV2H_USB2PHY
tristate "Renesas RZ/V2H(P) (and similar SoCs) USB2PHY Reset driver"
depends on ARCH_RENESAS || COMPILE_TEST
+ select AUXILIARY_BUS
help
Support for USB2PHY Port reset Control found on the RZ/V2H(P) SoC
(and similar SoCs).
diff --git a/drivers/reset/reset-rzv2h-usb2phy.c b/drivers/reset/reset-rzv2h-usb2phy.c
index 5bdd39274612..15447a4f091f 100644
--- a/drivers/reset/reset-rzv2h-usb2phy.c
+++ b/drivers/reset/reset-rzv2h-usb2phy.c
@@ -5,8 +5,10 @@
* Copyright (C) 2025 Renesas Electronics Corporation
*/
+#include <linux/auxiliary_bus.h>
#include <linux/cleanup.h>
#include <linux/delay.h>
+#include <linux/idr.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
@@ -14,6 +16,9 @@
#include <linux/pm_runtime.h>
#include <linux/reset.h>
#include <linux/reset-controller.h>
+#include <linux/reset/reset_rzv2h_usb2phy.h>
+
+static DEFINE_IDA(auxiliary_ids);
struct rzv2h_usb2phy_regval {
u16 reg;
@@ -104,6 +109,41 @@ static int rzv2h_usb2phy_reset_of_xlate(struct reset_controller_dev *rcdev,
return 0;
}
+static void rzv2h_usb2phy_reset_ida_free(void *data)
+{
+ struct auxiliary_device *adev = data;
+
+ ida_free(&auxiliary_ids, adev->id);
+}
+
+static int rzv2h_usb2phy_reset_mux_register(struct device *dev,
+ void __iomem *base,
+ const char *mux_name)
+{
+ struct reset_rzv2h_usb2phy_adev *rdev;
+ struct auxiliary_device *adev;
+ int id;
+
+ rdev = devm_kzalloc(dev, sizeof(*rdev), GFP_KERNEL);
+ if (!rdev)
+ return -ENOMEM;
+
+ rdev->base = base;
+
+ id = ida_alloc(&auxiliary_ids, GFP_KERNEL);
+ if (id < 0)
+ return id;
+
+ adev = __devm_auxiliary_device_create(dev, dev->driver->name,
+ mux_name, rdev, id);
+ if (!adev) {
+ ida_free(&auxiliary_ids, id);
+ return -ENOMEM;
+ }
+
+ return devm_add_action_or_reset(dev, rzv2h_usb2phy_reset_ida_free, adev);
+}
+
static void rzv2h_usb2phy_reset_pm_runtime_put(void *data)
{
pm_runtime_put(data);
@@ -162,6 +202,10 @@ static int rzv2h_usb2phy_reset_probe(struct platform_device *pdev)
if (error)
return dev_err_probe(dev, error, "could not register reset controller\n");
+ error = rzv2h_usb2phy_reset_mux_register(dev, priv->base, "vbenctl");
+ if (error)
+ return dev_err_probe(dev, error, "could not register aux mux\n");
+
return 0;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread