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

Commit 89329c49 authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa
Browse files

USB: dwc3-msm: Do not schedule resume work if id state is not changed



PMI driver reports initial id status and its not required to start state
machine if there is no change in id. This will avoid bringing controller
out of power mode. This could cause USB not entering low power mode, when
wall charger is connected during bootup. Hence make required change to
avoid schedule resume work if no change in id status.

CRs-Fixed: 973821
Change-Id: I4e050513e5fa9a5fa2275323acdcdeb6e545958b
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent 676c9bc2
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2318,11 +2318,16 @@ static int dwc3_msm_power_set_property_usb(struct power_supply *psy,
								usb_psy);
	struct dwc3 *dwc = platform_get_drvdata(mdwc->dwc3);
	int ret;
	enum dwc3_id_state id;

	switch (psp) {
	case POWER_SUPPLY_PROP_USB_OTG:
		id = val->intval ? DWC3_ID_GROUND : DWC3_ID_FLOAT;
		if (mdwc->id_state == id)
			break;

		/* Let OTG know about ID detection */
		mdwc->id_state = val->intval ? DWC3_ID_GROUND : DWC3_ID_FLOAT;
		mdwc->id_state = id;
		dbg_event(0xFF, "id_state", mdwc->id_state);
		if (dwc->is_drd)
			queue_delayed_work(mdwc->dwc3_wq,