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

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

phy: msm: ssusb: Power down SSPHY to avoid leakage in probe()



Put SSPHY in power down state explicitly in probe() to avoid
leakage current seen at 1.8V shared LDO between different clients along
with USB on some plaforms, where USB3 is not enabled, even though present.

Change-Id: I577b2d969ee8d4e17e0a3d1f307958a754146738
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent bf26d359
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ Optional properties:
- qcom,vbus-valid-override: If present, indicates VBUS pin is not connected to
the USB PHY and the controller must rely on external VBUS notification in
order to manually relay the notification to the SSPHY.
-qcom,keep-powerdown: If present, power down the SSPHY to avoid leakage current.

Example:
ssphy@f9200000 {
+11 −0
Original line number Diff line number Diff line
@@ -402,6 +402,17 @@ static int msm_ssphy_probe(struct platform_device *pdev)
	if (of_property_read_bool(dev->of_node, "qcom,vbus-valid-override"))
		phy->phy.flags |= PHY_VBUS_VALID_OVERRIDE;

	/* Power down PHY to avoid leakage at 1.8V LDO */
	if (of_property_read_bool(dev->of_node, "qcom,keep-powerdown")) {
		msm_ssusb_ldo_enable(phy, 1);
		msm_ssusb_enable_clocks(phy);
		msm_usb_write_readback(phy->base, SS_PHY_CTRL4,
					TEST_POWERDOWN, TEST_POWERDOWN);
		msm_ssusb_disable_clocks(phy);
		msm_ssusb_ldo_enable(phy, 0);
		msm_ssusb_config_vdd(phy, 0);
	}

	phy->phy.init			= msm_ssphy_init;
	phy->phy.set_suspend		= msm_ssphy_set_suspend;
	phy->phy.notify_connect		= msm_ssphy_notify_connect;