Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6076cdc3 authored by Harsh Agarwal's avatar Harsh Agarwal Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarHarsh Agarwal <harshq@codeaurora.org>
parent 7fb23e31
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4470,6 +4470,8 @@ 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);
	/* 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"))
@@ -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);

+0 −4
Original line number Diff line number Diff line
@@ -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) {
+7 −4
Original line number Diff line number Diff line
@@ -275,6 +275,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
			*priv = *priv_match;
	}

	if (device_may_wakeup(sysdev))
		device_wakeup_enable(hcd->self.controller);

	xhci->main_hcd = hcd;
@@ -330,8 +331,10 @@ static int xhci_plat_probe(struct platform_device *pdev)
		goto dealloc_usb2_hcd;

	device_enable_async_suspend(&pdev->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)