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

Commit ffb55e5e authored by Manu Gautam's avatar Manu Gautam
Browse files

usb: phy-msm-qusb: Re-initialize PHY after DCD detection



PHY registers are not restored to default values after
DCD sequence which affects electrical compliance results.
Re-initialize PHY after DCD to put PHY in correct state.
While at it also fix DCD happening for CDP as well and
might result in over-writing charger type to SDP for CDP.

Change-Id: Ia841f7ab5f86e582158132777e3657229c904e1d
CRs-fixed: 1031591
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent 450bd44d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3578,7 +3578,8 @@ static void dwc3_otg_sm_work(struct work_struct *w)
					atomic_read(
						&mdwc->dev->power.usage_count));
				/* check dp/dm for SDP & runtime_put if !SDP */
				if (mdwc->detect_dpdm_floating) {
				if (mdwc->detect_dpdm_floating &&
				    mdwc->chg_type == DWC3_SDP_CHARGER) {
					dwc3_check_float_lines(mdwc);
					if (mdwc->chg_type != DWC3_SDP_CHARGER)
						break;
+3 −0
Original line number Diff line number Diff line
@@ -822,6 +822,9 @@ static int qusb_phy_linestate_with_idp_src(struct usb_phy *phy)
	ret = (int_status >> 2) | ((int_status & 0x1) << 1);
	pr_debug("%s: int_status:%x, dpdm:%x\n", __func__, int_status, ret);

	/* Re-initialize PHY */
	qusb_phy_init(phy);

	return ret;
}