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

Commit 9065cd49 authored by Manu Gautam's avatar Manu Gautam Committed by Gerrit - the friendly Code Review server
Browse files

USB: phy: msm: Perform runtimePM_put as soon as SDP is detected



Charger work performs runtime PM put after charger detection is
complete. In case of SDP, it marks charger state as DETECTED
and queues chg_work. If charger work is cancelled (due to VBUS low)
then runtimePM put from chg_work could have been missed.
Since, chg_state is DETECTED to sm_work ends up with extra pm
usage count.

Change-Id: I962ce562c035d60f3cbc8a91d998c92870c15019
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent 365fabdd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2545,6 +2545,7 @@ static void msm_chg_detect_work(struct work_struct *w)

			motg->chg_state = USB_CHG_STATE_DETECTED;
			delay = 0;
			goto state_detected;
		}
		break;
	case USB_CHG_STATE_PRIMARY_DONE:
@@ -2558,6 +2559,7 @@ static void msm_chg_detect_work(struct work_struct *w)
	case USB_CHG_STATE_SECONDARY_DONE:
		motg->chg_state = USB_CHG_STATE_DETECTED;
	case USB_CHG_STATE_DETECTED:
state_detected:
		/*
		 * Notify the charger type to power supply
		 * owner as soon as we determine the charger.