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

Commit 61b2e379 authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: phy: qmp: Put the QMP PHY in power down state on disconnect



Put the QMP PHY in power down state when cable is disconnected.
When cable is disconnected we don't need to put the PHY in
autonomous mode. Wake-up from XOSD is triggered from PMIC
interrupt. This provides additional power savings of 1mW.

Change-Id: I22f244186b113332ea8d17358f8b0cadd24ef150
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent de724756
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -682,8 +682,11 @@ static int msm_ssphy_qmp_set_suspend(struct usb_phy *uphy, int suspend)

	if (suspend) {
		msm_ssusb_qmp_enable_autonomous(phy);
		if (!phy->cable_connected)
		if (!phy->cable_connected) {
			clk_disable_unprepare(phy->pipe_clk);
			writel_relaxed(0x00,
				phy->base + PCIE_USB3_PHY_POWER_DOWN_CONTROL);
		}
		clk_disable_unprepare(phy->cfg_ahb_clk);
		clk_disable_unprepare(phy->aux_clk);
		phy->in_suspend = true;
@@ -693,8 +696,11 @@ static int msm_ssphy_qmp_set_suspend(struct usb_phy *uphy, int suspend)
		msm_ssphy_power_enable(phy, 1);
		clk_prepare_enable(phy->aux_clk);
		clk_prepare_enable(phy->cfg_ahb_clk);
		if (!phy->cable_connected)
		if (!phy->cable_connected) {
			clk_prepare_enable(phy->pipe_clk);
			writel_relaxed(0x01,
				phy->base + PCIE_USB3_PHY_POWER_DOWN_CONTROL);
		}
		msm_ssusb_qmp_enable_autonomous(phy);
		phy->in_suspend = false;
		dev_dbg(uphy->dev, "QMP PHY is resumed\n");