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

Commit e4211d2d authored by Ashish Chavan's avatar Ashish Chavan
Browse files

power: smb1398: Update min-ilim setting to 1A



At higher SOC Vbatt is close to Vbus which can cause
(Vin/2 - Vout) to cross the 10mV threshold and thus result
in win-uv IRQ to fire. To prevent this CPs should not be
enabled below a certain FCC. Do this by not allowing
"min-ilim" value lower than 1A.

Eg: Master/Slave CP gets disable at following FCC if
main_fcc is 200mA:
slave disables = total_fcc < (3000mA + 200mA)
master disables = total_fcc < (2000mA + 200mA).

Change-Id: Ie67e9ae60b5e3526413a1a4bb256181b0226a1b1
Signed-off-by: default avatarAshish Chavan <ashichav@codeaurora.org>
parent 200519aa
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -2014,6 +2014,7 @@ static int smb1398_div2_cp_hw_init(struct smb1398_chip *chip)
	return rc;
}

#define DIV2_CP_MIN_ILIM_UA 1000000
static int smb1398_div2_cp_parse_dt(struct smb1398_chip *chip)
{
	int rc = 0;
@@ -2036,9 +2037,14 @@ static int smb1398_div2_cp_parse_dt(struct smb1398_chip *chip)
		return rc;
	}

	chip->div2_cp_min_ilim_ua = 750000;
	of_property_read_u32(chip->dev->of_node, "qcom,div2-cp-min-ilim-ua",
			&chip->div2_cp_min_ilim_ua);
	/*
	 * Set minimum allowed ilim configuration to 1A for DIV2_CP
	 * operation.
	 */
	if (chip->div2_cp_min_ilim_ua < DIV2_CP_MIN_ILIM_UA)
		chip->div2_cp_min_ilim_ua = DIV2_CP_MIN_ILIM_UA;

	chip->max_cutoff_soc = 85;
	of_property_read_u32(chip->dev->of_node, "qcom,max-cutoff-soc",