Skip to content

Commit e4d9da3

Browse files
claudiubezneagregkh
authored andcommitted
usb: host: ohci-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> Link: https://patch.msgid.link/20251106143625.3050119-4-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c31a401 commit e4d9da3

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

drivers/usb/host/ohci-platform.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ static int ohci_platform_suspend(struct device *dev)
270270
struct usb_hcd *hcd = dev_get_drvdata(dev);
271271
struct usb_ohci_pdata *pdata = dev->platform_data;
272272
struct platform_device *pdev = to_platform_device(dev);
273+
struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd);
273274
bool do_wakeup = device_may_wakeup(dev);
274275
int ret;
275276

@@ -280,6 +281,14 @@ static int ohci_platform_suspend(struct device *dev)
280281
if (pdata->power_suspend)
281282
pdata->power_suspend(pdev);
282283

284+
ret = reset_control_assert(priv->resets);
285+
if (ret) {
286+
if (pdata->power_on)
287+
pdata->power_on(pdev);
288+
289+
ohci_resume(hcd, false);
290+
}
291+
283292
return ret;
284293
}
285294

@@ -288,11 +297,19 @@ static int ohci_platform_resume_common(struct device *dev, bool hibernated)
288297
struct usb_hcd *hcd = dev_get_drvdata(dev);
289298
struct usb_ohci_pdata *pdata = dev_get_platdata(dev);
290299
struct platform_device *pdev = to_platform_device(dev);
300+
struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd);
301+
int err;
302+
303+
err = reset_control_deassert(priv->resets);
304+
if (err)
305+
return err;
291306

292307
if (pdata->power_on) {
293-
int err = pdata->power_on(pdev);
294-
if (err < 0)
308+
err = pdata->power_on(pdev);
309+
if (err < 0) {
310+
reset_control_assert(priv->resets);
295311
return err;
312+
}
296313
}
297314

298315
ohci_resume(hcd, hibernated);

0 commit comments

Comments
 (0)