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

Commit 1405069f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: dwc3_otg: Turn on VBUS before starting host"

parents 25cb1304 e97bf632
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -180,6 +180,14 @@ static int dwc3_otg_start_host(struct usb_otg *otg, int on)
	if (on) {
		dev_dbg(otg->phy->dev, "%s: turn on host\n", __func__);

		dwc3_otg_notify_host_mode(otg, on);
		ret = regulator_enable(dotg->vbus_otg);
		if (ret) {
			dev_err(otg->phy->dev, "unable to enable vbus_otg\n");
			dwc3_otg_notify_host_mode(otg, 0);
			return ret;
		}

		/*
		 * This should be revisited for more testing post-silicon.
		 * In worst case we may need to disconnect the root hub
@@ -205,19 +213,13 @@ static int dwc3_otg_start_host(struct usb_otg *otg, int on)
			dev_err(otg->phy->dev,
				"%s: failed to add XHCI pdev ret=%d\n",
				__func__, ret);
			regulator_disable(dotg->vbus_otg);
			dwc3_otg_notify_host_mode(otg, 0);
			return ret;
		}

		hcd = platform_get_drvdata(dwc->xhci);
		dwc3_otg_set_host(otg, &hcd->self);
		dwc3_otg_notify_host_mode(otg, on);

		ret = regulator_enable(dotg->vbus_otg);
		if (ret) {
			dev_err(otg->phy->dev, "unable to enable vbus_otg\n");
			platform_device_del(dwc->xhci);
			return ret;
		}

		/* re-init OTG EVTEN register as XHCI reset clears it */
		if (ext_xceiv && !ext_xceiv->otg_capability)