usb: host: Disable system wakeup if remote wakeup is not required

For some platforms, remote wakeup capability from system suspend
is not a default requirement.
Keep system wakeup as disabled from dwc3-msm and xhci-plat.

Change-Id: Ic32af43c818f666228db5921e927f66c3554c0f4
Signed-off-by: Harsh Agarwal <harshq@codeaurora.org>
This commit is contained in:
Harsh Agarwal 2020-12-21 11:52:24 +05:30 • committed by Gerrit - the friendly Code Review server
commit 6076cdc395
3 changed files with 11 additions and 10 deletions

View file

@ -4470,7 +4470,9 @@ static int dwc3_msm_probe(struct platform_device *pdev)
atomic_set(&dwc->in_lpm, 1);
pm_runtime_set_autosuspend_delay(mdwc->dev, 1000);
pm_runtime_use_autosuspend(mdwc->dev);
device_init_wakeup(mdwc->dev, 1);
/* Skip creating device wakeup node if remote wakeup is not a requirement*/
if (!dwc->ignore_wakeup_src_in_hostmode)
device_init_wakeup(mdwc->dev, 1);
if (of_property_read_bool(node, "qcom,disable-dev-mode-pm"))
pm_runtime_get_noresume(mdwc->dev);
@ -5316,7 +5318,7 @@ static int dwc3_msm_pm_suspend(struct device *dev)
}
/* Wakeup not required for automotive/telematics platform host mode */
ret = dwc3_msm_suspend(mdwc, false, false);
ret = dwc3_msm_suspend(mdwc, false, device_may_wakeup(dev));
if (!ret)
atomic_set(&mdwc->pm_suspended, 1);

View file

@ -115,10 +115,6 @@ int dwc3_host_init(struct dwc3 *dwc)
if (dwc->revision <= DWC3_REVISION_300A)
props[prop_idx++] = PROPERTY_ENTRY_BOOL("quirk-broken-port-ped");
if (dwc->ignore_wakeup_src_in_hostmode)
props[prop_idx++] =
PROPERTY_ENTRY_BOOL("ignore-wakeup-src-in-hostmode");
if (prop_idx) {
ret = platform_device_add_properties(xhci, props);
if (ret) {

View file

@ -275,7 +275,8 @@ static int xhci_plat_probe(struct platform_device *pdev)
*priv = *priv_match;
}
device_wakeup_enable(hcd->self.controller);
if (device_may_wakeup(sysdev))
device_wakeup_enable(hcd->self.controller);
xhci->main_hcd = hcd;
xhci->shared_hcd = __usb_create_hcd(driver, sysdev, &pdev->dev,
@ -330,8 +331,10 @@ static int xhci_plat_probe(struct platform_device *pdev)
goto dealloc_usb2_hcd;
device_enable_async_suspend(&pdev->dev);
device_wakeup_enable(&xhci->shared_hcd->self.root_hub->dev);
device_wakeup_enable(&hcd->self.root_hub->dev);
if (device_may_wakeup(sysdev)) {
device_wakeup_enable(&xhci->shared_hcd->self.root_hub->dev);
device_wakeup_enable(&hcd->self.root_hub->dev);
}
pm_runtime_mark_last_busy(&pdev->dev);
pm_runtime_put_autosuspend(&pdev->dev);
@ -402,7 +405,7 @@ static int xhci_plat_suspend(struct device *dev)
dev_dbg(dev, "xhci-plat PM suspend\n");
/* Disable wakeup capability */
return xhci_suspend(xhci, false);
return xhci_suspend(xhci, device_may_wakeup(dev));
}
static int xhci_plat_resume(struct device *dev)