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

Commit 4a07c5e7 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: reset unsettled flag upon insertion"

parents 2d51ded0 4034dbb9
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1719,6 +1719,7 @@ qpnp_chg_usb_usbin_valid_irq_handler(int irq, void *_chip)
		return IRQ_HANDLED;

	if (chip->usb_present ^ usb_present) {
		chip->aicl_settled = false;
		chip->usb_present = usb_present;
		if (!usb_present) {
			/* when a valid charger inserted, and increase the
@@ -1751,7 +1752,6 @@ qpnp_chg_usb_usbin_valid_irq_handler(int irq, void *_chip)
			qpnp_chg_iusbmax_set(chip, QPNP_CHG_I_MAX_MIN_100);
			qpnp_chg_iusb_trim_set(chip, chip->usb_trim_default);
			chip->prev_usb_max_ma = -EINVAL;
			chip->aicl_settled = false;
		} else {
			/* when OVP clamped usbin, and then decrease
			 * the charger voltage to lower than the OVP
@@ -3094,7 +3094,12 @@ qpnp_chg_input_current_settled(struct qpnp_chg_chip *chip)
{
	int rc, ibat_max_ma;
	u8 reg, chgr_sts, ibat_trim, i;
	bool usb_present = qpnp_chg_is_usb_chg_plugged_in(chip);

	if (!usb_present) {
		pr_debug("Ignoring AICL settled, since USB is removed\n");
		return 0;
	}
	chip->aicl_settled = true;

	/*