mirror of
https://github.com/revyos/thead-kernel.git
synced 2026-09-17 12:52:10 +02:00
driver usb: optimize pm resume time, do resume in runtime_resume
Change-Id: I89ddf31061653767387fd0745eeaaecadfc7fefd
This commit is contained in:
@@ -488,25 +488,25 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev)
|
|||||||
* xhci_suspend() needs `do_wakeup` to know whether host is allowed
|
* xhci_suspend() needs `do_wakeup` to know whether host is allowed
|
||||||
* to do wakeup during suspend.
|
* to do wakeup during suspend.
|
||||||
*/
|
*/
|
||||||
return xhci_suspend(xhci, device_may_wakeup(dev));
|
ret = xhci_suspend(xhci, device_may_wakeup(dev));
|
||||||
|
if (!ret) {
|
||||||
|
pm_runtime_disable(dev);
|
||||||
|
pm_runtime_set_suspended(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __maybe_unused xhci_plat_resume(struct device *dev)
|
static int __maybe_unused xhci_plat_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct usb_hcd *hcd = dev_get_drvdata(dev);
|
struct usb_hcd *hcd = dev_get_drvdata(dev);
|
||||||
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = xhci_priv_resume_quirk(hcd);
|
ret = xhci_priv_resume_quirk(hcd);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = xhci_resume(xhci, 0);
|
/* call xhci_suspend in xhci_plat_runtime_suspend */
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
pm_runtime_disable(dev);
|
|
||||||
pm_runtime_set_active(dev);
|
|
||||||
pm_runtime_enable(dev);
|
pm_runtime_enable(dev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user