mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
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 <[email protected]> Acked-by: Alan Stern <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
1 parent
a7d5fe0205
commit
c31a401fe7
1 file changed
+20
-2
@@ -454,6 +454,17 @@ static int __maybe_unused ehci_platform_suspend(struct device *dev)
|
||||
if (pdata->power_suspend)
|
||||
pdata->power_suspend(pdev);
|
||||
|
||||
ret = reset_control_assert(priv->rsts);
|
||||
if (ret) {
|
||||
if (pdata->power_on)
|
||||
pdata->power_on(pdev);
|
||||
|
||||
ehci_resume(hcd, false);
|
||||
|
||||
if (priv->quirk_poll)
|
||||
quirk_poll_init(priv);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -464,11 +475,18 @@ static int __maybe_unused ehci_platform_resume(struct device *dev)
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd);
|
||||
struct device *companion_dev;
|
||||
int err;
|
||||
|
||||
err = reset_control_deassert(priv->rsts);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (pdata->power_on) {
|
||||
int err = pdata->power_on(pdev);
|
||||
if (err < 0)
|
||||
err = pdata->power_on(pdev);
|
||||
if (err < 0) {
|
||||
reset_control_assert(priv->rsts);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
companion_dev = usb_of_get_companion_dev(hcd->self.controller);
|
||||
|
||||
Reference in new issue
Block a user