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

Commit bcf6bed2 authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: phy: qusb: Make sure to enable VDD on USB Cable connect



Commit 55b93e25 ("USB: Add support to invoke DP and DM sourcing
and pulsing") has moved usage of DP_DM based functionality from
controller driver to QUSB PHY driver. With this change, VDD is not
being turned ON to QUSB PHY on connecting USB cable. Hence fix this
issue to make sure that toggle_vdd flag is considered to check
previous status of power_enabled flag as DP_DM based LDOs functionality
is already being check against rm_pulldown flag.

Change-Id: Ideff32ebef07e5be9e9fd72a6e803e636cf94287
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent da9777c8
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -162,7 +162,7 @@ static int qusb_phy_enable_power(struct qusb_phy *qphy, bool on,
	dev_dbg(qphy->phy.dev, "%s turn %s regulators. power_enabled:%d\n",
			__func__, on ? "on" : "off", qphy->power_enabled);

	if (qphy->power_enabled == on) {
	if (toggle_vdd && qphy->power_enabled == on) {
		dev_dbg(qphy->phy.dev, "PHYs' regulators are already ON.\n");
		return 0;
	}
@@ -225,7 +225,9 @@ static int qusb_phy_enable_power(struct qusb_phy *qphy, bool on,
		goto unset_vdd33;
	}

	if (toggle_vdd)
		qphy->power_enabled = true;

	pr_debug("%s(): QUSB PHY's regulators are turned ON.\n", __func__);
	return ret;

@@ -275,6 +277,7 @@ unconfig_vdd:
								ret);
	}
err_vdd:
	if (toggle_vdd)
		qphy->power_enabled = false;
	dev_dbg(qphy->phy.dev, "QUSB PHY's regulators are turned OFF.\n");
	return ret;