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

Commit ae3b73de authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: qpnp-charger: allow charging in host mode"

parents bdde824c f49e59f7
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -1218,6 +1218,8 @@ qpnp_chg_dc_dcin_valid_irq_handler(int irq, void *_chip)

	if (chip->dc_present ^ dc_present) {
		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)) {
			chip->delta_vddmax_mv = 0;
			qpnp_chg_set_appropriate_vddmax(chip);
@@ -1420,11 +1422,13 @@ switch_usb_to_host_mode(struct qpnp_chg_chip *chip)
	if (qpnp_chg_is_otg_en_set(chip))
		return 0;

	if (!qpnp_chg_is_dc_chg_plugged_in(chip)) {
		rc = qpnp_chg_force_run_on_batt(chip, 1);
		if (rc) {
			pr_err("Failed to disable charging rc = %d\n", rc);
			return rc;
		}
	}

	/* force usb ovp fet off */
	rc = qpnp_chg_masked_write(chip,