Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Claudiu Beznea and committed by
Greg Kroah-Hartman
e4d9da32 c31a401f

+19 -2
+19 -2
drivers/usb/host/ohci-platform.c
··· 270 270 struct usb_hcd *hcd = dev_get_drvdata(dev); 271 271 struct usb_ohci_pdata *pdata = dev->platform_data; 272 272 struct platform_device *pdev = to_platform_device(dev); 273 + struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd); 273 274 bool do_wakeup = device_may_wakeup(dev); 274 275 int ret; 275 276 ··· 281 280 if (pdata->power_suspend) 282 281 pdata->power_suspend(pdev); 283 282 283 + ret = reset_control_assert(priv->resets); 284 + if (ret) { 285 + if (pdata->power_on) 286 + pdata->power_on(pdev); 287 + 288 + ohci_resume(hcd, false); 289 + } 290 + 284 291 return ret; 285 292 } 286 293 ··· 297 288 struct usb_hcd *hcd = dev_get_drvdata(dev); 298 289 struct usb_ohci_pdata *pdata = dev_get_platdata(dev); 299 290 struct platform_device *pdev = to_platform_device(dev); 291 + struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd); 292 + int err; 293 + 294 + err = reset_control_deassert(priv->resets); 295 + if (err) 296 + return err; 300 297 301 298 if (pdata->power_on) { 302 - int err = pdata->power_on(pdev); 303 - if (err < 0) 299 + err = pdata->power_on(pdev); 300 + if (err < 0) { 301 + reset_control_assert(priv->resets); 304 302 return err; 303 + } 305 304 } 306 305 307 306 ohci_resume(hcd, hibernated);