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

Commit d82c15ee authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa
Browse files

USB: phy: msm: Fix poweroff charging issue



During bootup, if cable is connected, PMIC does set online property
of USB power supply and then notifies charger type and cable connect
status to USB driver.  If disconnect happens during this time, USB
driver need to clear online flag. But this causes issues in case of
power off charging mode if msm_otg_notify_charger() with 0mA current.
Hence fix this by having check for charger type is invalid and then
only clear online property.

CRs-Fixed: 1058664
Change-Id: Ibb9e9ba7045d5261cc10fdb5737c1c6e1151dac3
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent 995bb603
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1812,9 +1812,11 @@ static void msm_otg_notify_charger(struct msm_otg *motg, unsigned mA)

	/*
	 * This condition will be true when usb cable is disconnected
	 * during bootup before charger detection mechanism starts.
	 * during bootup before enumeration. Check charger type also
	 * to avoid clearing online flag in case of valid charger.
	 */
	if (motg->online && motg->cur_power == 0 && mA == 0)
	if (motg->online && motg->cur_power == 0 && mA == 0 &&
			(motg->chg_type == USB_INVALID_CHARGER))
		msm_otg_set_online_status(motg);

	if (motg->cur_power == mA)