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

Commit fa43b983 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: dwc3: Fix re-enumeration of connected peripherals"

parents e4ec2400 4852b6f3
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2001,8 +2001,7 @@ static int dwc3_resume(struct device *dev)
		 * runtime PM state as active to reflect actual state of device
		 * which is now out of LPM. This allows runtime_suspend later.
		 */
		if (dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST &&
		    dwc->host_poweroff_in_pm_suspend)
		if (dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST)
			goto runtime_set_active;

		return 0;
+1 −1
Original line number Diff line number Diff line
@@ -5303,7 +5303,7 @@ static int dwc3_msm_pm_resume(struct device *dev)

	atomic_set(&mdwc->pm_suspended, 0);

	if (!dwc->host_poweroff_in_pm_suspend || !mdwc->in_host_mode) {
	if (!mdwc->in_host_mode) {
		/* kick in otg state machine */
		queue_work(mdwc->dwc3_wq, &mdwc->resume_work);

+24 −1
Original line number Diff line number Diff line
@@ -421,6 +421,29 @@ static int __maybe_unused xhci_plat_runtime_suspend(struct device *dev)
	return xhci_suspend(xhci, true);
}

static int xhci_plat_resume(struct device *dev)
{
	struct usb_hcd  *hcd = dev_get_drvdata(dev);
	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
	int ret;

	if (!xhci)
		return 0;

	dev_dbg(dev, "xhci-plat resume\n");

	ret = xhci_priv_resume_quirk(hcd);
	if (ret)
		return ret;

	ret = xhci_resume(xhci, false);
	pm_runtime_disable(dev);
	pm_runtime_set_active(dev);
	pm_runtime_enable(dev);

	return ret;
}

static int __maybe_unused xhci_plat_runtime_resume(struct device *dev)
{
	struct usb_hcd  *hcd = dev_get_drvdata(dev);
@@ -443,7 +466,7 @@ static int __maybe_unused xhci_plat_runtime_resume(struct device *dev)
}

static const struct dev_pm_ops xhci_plat_pm_ops = {
	SET_SYSTEM_SLEEP_PM_OPS(NULL, NULL)
	SET_SYSTEM_SLEEP_PM_OPS(NULL, xhci_plat_resume)

	SET_RUNTIME_PM_OPS(xhci_plat_runtime_suspend,
			   xhci_plat_runtime_resume,