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

Commit 68fb3582 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-smbcharger: Remove current limit vote on charger removal"

parents 72dc1263 53681f7b
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -4392,9 +4392,18 @@ static int smbchg_change_usb_supply_type(struct smbchg_chip *chip,
	if (!chip->skip_usb_notification)
		power_supply_set_supply_type(chip->usb_psy, type);

	/* otherwise if it is unknown, set type after the vote */
	if (type == POWER_SUPPLY_TYPE_UNKNOWN)
	/*
	 * otherwise if it is unknown, remove vote
	 * and set type after the vote
	 */
	if (type == POWER_SUPPLY_TYPE_UNKNOWN) {
		rc = vote(chip->usb_icl_votable, PSY_ICL_VOTER, false,
				current_limit_ma);
		if (rc < 0)
			pr_err("Couldn't remove ICL vote rc=%d\n", rc);

		chip->usb_supply_type = type;
	}

	/* set the correct buck switching frequency */
	rc = smbchg_set_optimal_charging_mode(chip, type);