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

Commit e4a840a4 authored by Sriharsha Allenki's avatar Sriharsha Allenki Committed by Gerrit - the friendly Code Review server
Browse files

usb: dwc3: Do not drive a pulse on DP for EUD connect event



With the commit 89bf4e6b ("dwc3: Handle USB spoof
disconnect when EUD is enabled") irrespective of the source
of connect event, a pulse is driven on DP in the case where
the device is connected to a CDP.
In this case if the EUD is enabled after the device has
already been enumerated on a CDP it results in a enumeration
failure. Fix this by preventing the driving a pulse on DP
when the connect event in from the EUD.

Change-Id: I31bc4bfd012e98522caefdfc5e8d31af47b7154a
Signed-off-by: default avatarSriharsha Allenki <sallenki@codeaurora.org>
parent 030a765f
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -3316,8 +3316,12 @@ static int dwc3_msm_vbus_notifier(struct notifier_block *nb,
		mdwc->vbus_active = event;
	}

	/*
	 * Drive a pulse on DP to ensure proper CDP detection
	 * and only when the vbus connect event is a valid one.
	 */
	if (get_psy_type(mdwc) == POWER_SUPPLY_TYPE_USB_CDP &&
			mdwc->vbus_active) {
			mdwc->vbus_active && !mdwc->check_eud_state) {
		dev_dbg(mdwc->dev, "Connected to CDP, pull DP up\n");
		usb_phy_drive_dp_pulse(mdwc->hs_phy, DP_PULSE_WIDTH_MSEC);
	}