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

Commit 2e54765a authored by David Keitel's avatar David Keitel
Browse files

power: qpnp-charger: if OTG is on and DC_IN removed resume charging



In the case DC_IN is charging and an OTG device is connected
subsequently and the DC_IN charger removed, battery would be still
reported as full despite the fact that no charger is connected.

Fix this by checking if OTG is enabled in
qpnp_chg_dc_dcin_valid_irq_handler.

Change-Id: Id0f7588fdcfb86261e129ab5b73e7da587889713
CRs-Fixed: 654771
Signed-off-by: default avatarDavid Keitel <dkeitel@codeaurora.org>
parent 38fb8d37
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1907,7 +1907,8 @@ qpnp_chg_dc_dcin_valid_irq_handler(int irq, void *_chip)
		chip->dc_present = dc_present;
		if (qpnp_chg_is_otg_en_set(chip))
			qpnp_chg_force_run_on_batt(chip, !dc_present ? 1 : 0);
		if (!dc_present && !qpnp_chg_is_usb_chg_plugged_in(chip)) {
		if (!dc_present && (!qpnp_chg_is_usb_chg_plugged_in(chip) ||
					qpnp_chg_is_otg_en_set(chip))) {
			chip->delta_vddmax_mv = 0;
			qpnp_chg_set_appropriate_vddmax(chip);
			chip->chg_done = false;