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

Commit 15c8cdbf authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

power: qpnp-fg-gen4: Get charge pump enable status for ESR FCC config



Currently, FG driver reads SMB_EN_MODE property to determine
whether charge pump is enabled or not for changing ESR FCC
configuration. This doesn't work well when the charge pump is
disabled. Instead of this, read cp_disable votable that indicates
the charge pump switcher status properly and make use of it for
changing ESR FCC configuration.

Change-Id: Id70f97c7df63d07741f314b65e567b9df0901e73
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent f5edfc6c
Loading
Loading
Loading
Loading
+2 −15
Original line number Diff line number Diff line
@@ -2258,21 +2258,8 @@ static int fg_gen4_esr_fcc_config(struct fg_gen4_chip *chip)
			parallel_en = prop.intval;
	}

	if (usb_psy_initialized(fg)) {
		rc = power_supply_get_property(fg->usb_psy,
			POWER_SUPPLY_PROP_SMB_EN_MODE, &prop);
		if (rc < 0) {
			pr_err("Couldn't read usb SMB_EN_MODE rc=%d\n", rc);
			return rc;
		}

		/*
		 * If SMB_EN_MODE is 1, then charge pump can get enabled for
		 * the charger inserted. However, whether the charge pump
		 * switching happens only if the conditions are met.
		 */
		cp_en = (prop.intval == 1);
	}
	if (chip->cp_disable_votable)
		cp_en = !get_effective_result(chip->cp_disable_votable);

	qnovo_en = is_qnovo_en(fg);