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

Commit b8816ebd authored by Pratham Pratap's avatar Pratham Pratap Committed by Gerrit - the friendly Code Review server
Browse files

usb: dwc3-msm: Resume before notifying cable connect to PHY



Resuming phy before notifying cable connect prevents
unclocked access to the phy registers in host init
sequence.

Change-Id: I27c2db156050fdc6af8930f91ad5a7d2ed2ce7b0
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent ad1e28d6
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3761,6 +3761,9 @@ static int dwc3_otg_start_host(struct dwc3_msm *mdwc, int on)
	if (on) {
		dev_dbg(mdwc->dev, "%s: turn on host\n", __func__);

		pm_runtime_get_sync(mdwc->dev);
		dbg_event(0xFF, "StrtHost gync",
			atomic_read(&mdwc->dev->power.usage_count));
		mdwc->hs_phy->flags |= PHY_HOST_MODE;
		if (dwc->maximum_speed >= USB_SPEED_SUPER) {
			mdwc->ss_phy->flags |= PHY_HOST_MODE;
@@ -3769,9 +3772,6 @@ static int dwc3_otg_start_host(struct dwc3_msm *mdwc, int on)
		}

		usb_phy_notify_connect(mdwc->hs_phy, USB_SPEED_HIGH);
		pm_runtime_get_sync(mdwc->dev);
		dbg_event(0xFF, "StrtHost gync",
			atomic_read(&mdwc->dev->power.usage_count));
		if (!IS_ERR_OR_NULL(mdwc->vbus_reg))
			ret = regulator_enable(mdwc->vbus_reg);
		if (ret) {