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

Commit ff828138 authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa
Browse files

USB: dwc3-msm: Turn ON clocks before bringing PHYs out of suspend in resume



On some platforms, USB3 controller sits on PCNOC. For those targets, needs
to turn ON iface_clk before accessing PHY registers while bringing PHYs
out of suspend.  Otherwise PHY register access fails during suspend exit.
Hence move enabling clocks before bringing PHYs out of suspend to fix it.

Change-Id: Ifcac85ccb77d1d2be4dff39310bf91ffa21ae313
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent 0aca91df
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -2021,16 +2021,6 @@ static int dwc3_msm_resume(struct dwc3_msm *mdwc)
		clk_prepare_enable(mdwc->sleep_clk);
	}

	/* Resume SS PHY */
	if (mdwc->lpm_flags & MDWC3_SS_PHY_SUSPEND) {
		usb_phy_set_suspend(mdwc->ss_phy, 0);
		mdwc->ss_phy->flags &= ~DEVICE_IN_SS_MODE;
		mdwc->lpm_flags &= ~MDWC3_SS_PHY_SUSPEND;
	}

	/* Resume HS PHY */
	usb_phy_set_suspend(mdwc->hs_phy, 0);

	/*
	 * Enable clocks
	 * Turned ON iface_clk before core_clk due to FSM depedency.
@@ -2042,6 +2032,16 @@ static int dwc3_msm_resume(struct dwc3_msm *mdwc)
	if (mdwc->bus_aggr_clk)
		clk_prepare_enable(mdwc->bus_aggr_clk);

	/* Resume SS PHY */
	if (mdwc->lpm_flags & MDWC3_SS_PHY_SUSPEND) {
		usb_phy_set_suspend(mdwc->ss_phy, 0);
		mdwc->ss_phy->flags &= ~DEVICE_IN_SS_MODE;
		mdwc->lpm_flags &= ~MDWC3_SS_PHY_SUSPEND;
	}

	/* Resume HS PHY */
	usb_phy_set_suspend(mdwc->hs_phy, 0);

	/* Recover from controller power collapse */
	if (mdwc->lpm_flags & MDWC3_POWER_COLLAPSE) {
		dev_dbg(mdwc->dev, "%s: exit power collapse\n", __func__);