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

Commit 72b7ef53 authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: phy: qusb: Add support to hold QUSB PHY into reset state



On some platform multiple QUSB PHYs instances are available and
based on platform variant those are used. If QUSB PHY is unused,
there is leakage current observed with that QUSB PHY related voltage
rail as QUSB PHY is out of reset on chip reset. This change adds
support to hold QUSB PHY into reset state if it is required.

Change-Id: I0ee7c42c1a3fb1298200f6348cc80aa621d57d88
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent b245a027
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@ Optional properties:
 - qcom,tune2-efuse-bit-pos: TUNE2 parameter related start bit position with EFUSE register
 - qcom,tune2-efuse-num-bits: Number of bits based value to use for TUNE2 high nibble
 - qcom,emulation: Indicates that we are running on emulation platform.
 - qcom,hold-reset: Indicates that hold QUSB PHY into reset state.

Example:
	qusb_phy: qusb@f9b39000 {
+10 −0
Original line number Diff line number Diff line
@@ -770,6 +770,7 @@ static int qusb_phy_probe(struct platform_device *pdev)
	struct resource *res;
	int ret = 0, size = 0;
	const char *phy_type;
	bool hold_phy_reset;

	qphy = devm_kzalloc(dev, sizeof(*qphy), GFP_KERNEL);
	if (!qphy)
@@ -934,6 +935,7 @@ static int qusb_phy_probe(struct platform_device *pdev)
		return ret;
	}

	hold_phy_reset = of_property_read_bool(dev->of_node, "qcom,hold-reset");
	ret = of_property_read_u32_array(dev->of_node, "qcom,vdd-voltage-level",
					 (u32 *) qphy->vdd_levels,
					 ARRAY_SIZE(qphy->vdd_levels));
@@ -975,6 +977,14 @@ static int qusb_phy_probe(struct platform_device *pdev)
		qphy->phy.notify_disconnect     = qusb_phy_notify_disconnect;
	}

	/*
	 * On some platforms multiple QUSB PHYs are available. If QUSB PHY is
	 * not used, there is leakage current seen with QUSB PHY related voltage
	 * rail. Hence keep QUSB PHY into reset state explicitly here.
	 */
	if (hold_phy_reset)
		clk_reset(qphy->phy_reset, CLK_RESET_ASSERT);

	ret = usb_add_phy_dev(&qphy->phy);
	return ret;
}