Skip to content

Commit c31a401

Browse files
claudiubezneagregkh
authored andcommitted
usb: host: ehci-platform: Call reset assert/deassert on suspend/resume
The Renesas RZ/G3S SoC supports a power-saving mode in which power to most of the SoC components is turned off, including the USB blocks. On the resume path, the reset signal must be de-asserted before applying any settings to the USB registers. To handle this properly, call reset_control_assert() and reset_control_deassert() during suspend and resume, respectively. Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Link: https://patch.msgid.link/20251106143625.3050119-3-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a7d5fe0 commit c31a401

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

drivers/usb/host/ehci-platform.c

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,17 @@ static int __maybe_unused ehci_platform_suspend(struct device *dev)
454454
if (pdata->power_suspend)
455455
pdata->power_suspend(pdev);
456456

457+
ret = reset_control_assert(priv->rsts);
458+
if (ret) {
459+
if (pdata->power_on)
460+
pdata->power_on(pdev);
461+
462+
ehci_resume(hcd, false);
463+
464+
if (priv->quirk_poll)
465+
quirk_poll_init(priv);
466+
}
467+
457468
return ret;
458469
}
459470

@@ -464,11 +475,18 @@ static int __maybe_unused ehci_platform_resume(struct device *dev)
464475
struct platform_device *pdev = to_platform_device(dev);
465476
struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd);
466477
struct device *companion_dev;
478+
int err;
479+
480+
err = reset_control_deassert(priv->rsts);
481+
if (err)
482+
return err;
467483

468484
if (pdata->power_on) {
469-
int err = pdata->power_on(pdev);
470-
if (err < 0)
485+
err = pdata->power_on(pdev);
486+
if (err < 0) {
487+
reset_control_assert(priv->rsts);
471488
return err;
489+
}
472490
}
473491

474492
companion_dev = usb_of_get_companion_dev(hcd->self.controller);

0 commit comments

Comments
 (0)