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

Commit 9b4577be authored by Guang Jian Zeng's avatar Guang Jian Zeng
Browse files

usb: phy: msm-hsusb: Rewrite HSPHY override parameters after unplug/plug



The HSPHY override parameters is reset after unplug/plug since dwc3
goes to suspend mode and disable the GDSC. Then GDSC toggle a reset
signal, and that caused registers to lose state when coming out of
power collapse. Rewrite the HSPHY override parameters when hsphy is
resume.

CRs-Fixed: 654109
Change-Id: I97046c0de276eb98bce0f4adee055f60ea5e0fe5
Signed-off-by: default avatarGuang Jian Zeng <gzeng@codeaurora.org>
parent 5fab7171
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -468,6 +468,18 @@ static int msm_hsphy_set_suspend(struct usb_phy *uphy, int suspend)
							OTGDISABLE0, 0);
			}
		}
		/*
		 * write HSPHY init value to QSCRATCH reg to set HSPHY
		 * parameters like VBUS valid threshold, disconnect valid
		 * threshold, DC voltage level,preempasis and rise/fall time
		 */
		if (override_phy_init)
			phy->hsphy_init_seq = override_phy_init;
		if (phy->hsphy_init_seq)
			msm_usb_write_readback(phy->base,
					PARAMETER_OVERRIDE_X_REG(0),
					0x03FFFFFF,
					phy->hsphy_init_seq & 0x03FFFFFF);
	}

	phy->suspended = !!suspend; /* double-NOT coerces to bool value */