* [PATCH 0/2] Restore RZ/V2H(P) USB2PHY reset and VBENCTL mux state on resume
@ 2026-10-08 7:44 Tommaso Merciai
2026-10-08 7:44 ` [PATCH 1/2] reset: rzv2h-usb2phy: Add suspend/resume support Tommaso Merciai
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tommaso Merciai @ 2026-10-08 7:44 UTC (permalink / raw)
To: tomm.merciai, prabhakar.mahadev-lad.rj
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, Peter Rosin,
Fabrizio Castro, Philipp Zabel, Alvin Šipraga, linux-kernel
Hi,
This series adds suspend/resume support to the RZ/V2H(P) USB2PHY reset and
VBENCTL mux drivers.
Thanks,
Tommaso
Tommaso Merciai (2):
reset: rzv2h-usb2phy: Add suspend/resume support
mux: rzv2h-vbenctl: Add suspend and resume support
drivers/mux/rzv2h-vbenctl.c | 24 ++++++++++++
drivers/reset/reset-rzv2h-usb2phy.c | 61 +++++++++++++++++++++++++++--
2 files changed, 81 insertions(+), 4 deletions(-)
--
2.54.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] reset: rzv2h-usb2phy: Add suspend/resume support
2026-10-08 7:44 [PATCH 0/2] Restore RZ/V2H(P) USB2PHY reset and VBENCTL mux state on resume Tommaso Merciai
@ 2026-10-08 7:44 ` Tommaso Merciai
2026-10-08 7:44 ` [PATCH 2/2] mux: rzv2h-vbenctl: Add suspend and resume support Tommaso Merciai
2026-11-02 14:35 ` [PATCH 0/2] Restore RZ/V2H(P) USB2PHY reset and VBENCTL mux state on resume Tommaso Merciai
2 siblings, 0 replies; 4+ messages in thread
From: Tommaso Merciai @ 2026-10-08 7:44 UTC (permalink / raw)
To: tomm.merciai, prabhakar.mahadev-lad.rj
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, Peter Rosin,
Fabrizio Castro, Philipp Zabel, Alvin Šipraga, linux-kernel
The RZ/V2H(P) USB2PHY reset driver is also used on the RZ/G3E SoC,
where deep sleep turns off power to the USB2PHY block.
Part of the initialization sequence written at probe time is cleared,
leaving the PHY unprepared to receive assert and deassert requests.
Add suspend/resume support to assert the reset on suspend, and to
deassert it and rewrite the initialization sequence on resume.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/reset/reset-rzv2h-usb2phy.c | 61 +++++++++++++++++++++++++++--
1 file changed, 57 insertions(+), 4 deletions(-)
diff --git a/drivers/reset/reset-rzv2h-usb2phy.c b/drivers/reset/reset-rzv2h-usb2phy.c
index d96042e28cd5..c14c3fcd7875 100644
--- a/drivers/reset/reset-rzv2h-usb2phy.c
+++ b/drivers/reset/reset-rzv2h-usb2phy.c
@@ -37,6 +37,7 @@ struct rzv2h_usb2phy_reset_priv {
const struct rzv2h_usb2phy_reset_of_data *data;
struct regmap *regmap;
struct device *dev;
+ struct reset_control *rstc;
struct reset_controller_dev rcdev;
};
@@ -132,7 +133,6 @@ static int rzv2h_usb2phy_reset_probe(struct platform_device *pdev)
const struct rzv2h_usb2phy_reset_of_data *data;
struct rzv2h_usb2phy_reset_priv *priv;
struct device *dev = &pdev->dev;
- struct reset_control *rstc;
void __iomem *base;
int error;
@@ -151,9 +151,9 @@ static int rzv2h_usb2phy_reset_probe(struct platform_device *pdev)
if (IS_ERR(priv->regmap))
return PTR_ERR(priv->regmap);
- rstc = devm_reset_control_get_shared_deasserted(dev, NULL);
- if (IS_ERR(rstc))
- return dev_err_probe(dev, PTR_ERR(rstc),
+ priv->rstc = devm_reset_control_get_shared_deasserted(dev, NULL);
+ if (IS_ERR(priv->rstc))
+ return dev_err_probe(dev, PTR_ERR(priv->rstc),
"failed to get deasserted reset\n");
error = devm_pm_runtime_enable(dev);
@@ -188,6 +188,8 @@ static int rzv2h_usb2phy_reset_probe(struct platform_device *pdev)
if (error)
return dev_err_probe(dev, error, "could not register aux mux\n");
+ platform_set_drvdata(pdev, priv);
+
return 0;
}
@@ -229,10 +231,61 @@ static const struct of_device_id rzv2h_usb2phy_reset_of_match[] = {
};
MODULE_DEVICE_TABLE(of, rzv2h_usb2phy_reset_of_match);
+static int rzv2h_usb2phy_reset_suspend(struct device *dev)
+{
+ struct rzv2h_usb2phy_reset_priv *priv = dev_get_drvdata(dev);
+ int error;
+
+ error = reset_control_assert(priv->rstc);
+ if (error)
+ return error;
+
+ error = pm_runtime_put_sync(dev);
+ if (error < 0) {
+ pm_runtime_get_noresume(dev);
+ reset_control_deassert(priv->rstc);
+ return error;
+ }
+
+ return 0;
+}
+
+static int rzv2h_usb2phy_reset_resume(struct device *dev)
+{
+ struct rzv2h_usb2phy_reset_priv *priv = dev_get_drvdata(dev);
+ int error;
+
+ error = pm_runtime_resume_and_get(dev);
+ if (error)
+ return error;
+
+ error = reset_control_deassert(priv->rstc);
+ if (error)
+ goto rpm_put;
+
+ error = regmap_multi_reg_write(priv->regmap, priv->data->init_seq,
+ priv->data->init_nseq);
+ if (error)
+ goto reset_assert;
+
+ return 0;
+
+reset_assert:
+ reset_control_assert(priv->rstc);
+rpm_put:
+ pm_runtime_put_sync(dev);
+ return error;
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(rzv2h_usb2phy_reset_pm_ops,
+ rzv2h_usb2phy_reset_suspend,
+ rzv2h_usb2phy_reset_resume);
+
static struct platform_driver rzv2h_usb2phy_reset_driver = {
.driver = {
.name = "rzv2h_usb2phy_reset",
.of_match_table = rzv2h_usb2phy_reset_of_match,
+ .pm = pm_sleep_ptr(&rzv2h_usb2phy_reset_pm_ops),
},
.probe = rzv2h_usb2phy_reset_probe,
};
--
2.54.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] mux: rzv2h-vbenctl: Add suspend and resume support
2026-10-08 7:44 [PATCH 0/2] Restore RZ/V2H(P) USB2PHY reset and VBENCTL mux state on resume Tommaso Merciai
2026-10-08 7:44 ` [PATCH 1/2] reset: rzv2h-usb2phy: Add suspend/resume support Tommaso Merciai
@ 2026-10-08 7:44 ` Tommaso Merciai
2026-11-02 14:35 ` [PATCH 0/2] Restore RZ/V2H(P) USB2PHY reset and VBENCTL mux state on resume Tommaso Merciai
2 siblings, 0 replies; 4+ messages in thread
From: Tommaso Merciai @ 2026-10-08 7:44 UTC (permalink / raw)
To: tomm.merciai, prabhakar.mahadev-lad.rj
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, Peter Rosin,
Fabrizio Castro, Philipp Zabel, Alvin Šipraga, linux-kernel
On deep sleep the USB2PHY block loses power and the VBUS_SEL bit is
cleared. The mux state is read during suspend and stored in the private
memory of the mux_chip. Then the state is restored during resume.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/mux/rzv2h-vbenctl.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/mux/rzv2h-vbenctl.c b/drivers/mux/rzv2h-vbenctl.c
index 2699458045f3..d088ac3cab2a 100644
--- a/drivers/mux/rzv2h-vbenctl.c
+++ b/drivers/mux/rzv2h-vbenctl.c
@@ -15,6 +15,7 @@
struct mux_rzv2h_vbenctl_priv {
struct regmap_field *field;
+ unsigned int hardware_state;
};
static int mux_rzv2h_vbenctl_set(struct mux_control *mux, int state)
@@ -60,9 +61,29 @@ static int mux_rzv2h_vbenctl_probe(struct auxiliary_device *adev,
if (ret < 0)
return dev_err_probe(dev, ret, "Failed to register mux chip\n");
+ auxiliary_set_drvdata(adev, priv);
+
return 0;
}
+static int mux_rzv2h_vbenctl_suspend(struct device *dev)
+{
+ struct mux_rzv2h_vbenctl_priv *priv = dev_get_drvdata(dev);
+
+ return regmap_field_read(priv->field, &priv->hardware_state);
+}
+
+static int mux_rzv2h_vbenctl_resume(struct device *dev)
+{
+ struct mux_rzv2h_vbenctl_priv *priv = dev_get_drvdata(dev);
+
+ return regmap_field_write(priv->field, priv->hardware_state);
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(mux_rzv2h_vbenctl_pm_ops,
+ mux_rzv2h_vbenctl_suspend,
+ mux_rzv2h_vbenctl_resume);
+
static const struct auxiliary_device_id mux_rzv2h_vbenctl_ids[] = {
{ .name = "rzv2h_usb2phy_reset.vbenctl" },
{ /* sentinel */ }
@@ -73,6 +94,9 @@ static struct auxiliary_driver mux_rzv2h_vbenctl_driver = {
.name = "vbenctl",
.probe = mux_rzv2h_vbenctl_probe,
.id_table = mux_rzv2h_vbenctl_ids,
+ .driver = {
+ .pm = pm_sleep_ptr(&mux_rzv2h_vbenctl_pm_ops),
+ },
};
module_auxiliary_driver(mux_rzv2h_vbenctl_driver);
--
2.54.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] Restore RZ/V2H(P) USB2PHY reset and VBENCTL mux state on resume
2026-10-08 7:44 [PATCH 0/2] Restore RZ/V2H(P) USB2PHY reset and VBENCTL mux state on resume Tommaso Merciai
2026-10-08 7:44 ` [PATCH 1/2] reset: rzv2h-usb2phy: Add suspend/resume support Tommaso Merciai
2026-10-08 7:44 ` [PATCH 2/2] mux: rzv2h-vbenctl: Add suspend and resume support Tommaso Merciai
@ 2026-11-02 14:35 ` Tommaso Merciai
2 siblings, 0 replies; 4+ messages in thread
From: Tommaso Merciai @ 2026-11-02 14:35 UTC (permalink / raw)
To: tomm.merciai, prabhakar.mahadev-lad.rj
Cc: linux-renesas-soc, biju.das.jz, Peter Rosin, Fabrizio Castro,
Philipp Zabel, Alvin Šipraga, linux-kernel
Hi,
Gentle ping on this one.
Kind regards,
Tommaso
On Thu, Oct 08, 2026 at 09:44:45AM +0200, Tommaso Merciai wrote:
> Hi,
>
> This series adds suspend/resume support to the RZ/V2H(P) USB2PHY reset and
> VBENCTL mux drivers.
>
> Thanks,
> Tommaso
>
> Tommaso Merciai (2):
> reset: rzv2h-usb2phy: Add suspend/resume support
> mux: rzv2h-vbenctl: Add suspend and resume support
>
> drivers/mux/rzv2h-vbenctl.c | 24 ++++++++++++
> drivers/reset/reset-rzv2h-usb2phy.c | 61 +++++++++++++++++++++++++++--
> 2 files changed, 81 insertions(+), 4 deletions(-)
>
> --
> 2.54.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-02 14:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-08 7:44 [PATCH 0/2] Restore RZ/V2H(P) USB2PHY reset and VBENCTL mux state on resume Tommaso Merciai
2026-10-08 7:44 ` [PATCH 1/2] reset: rzv2h-usb2phy: Add suspend/resume support Tommaso Merciai
2026-10-08 7:44 ` [PATCH 2/2] mux: rzv2h-vbenctl: Add suspend and resume support Tommaso Merciai
2026-11-02 14:35 ` [PATCH 0/2] Restore RZ/V2H(P) USB2PHY reset and VBENCTL mux state on resume Tommaso Merciai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®