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: Ashish Chavan <ashichav@codeaurora.org>
This commit is contained in:
Ashish Chavan 2020-08-18 12:40:00 +05:30 • committed by Gerrit - the friendly Code Review server
commit 3402e90ecb

View file

@ -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",