mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 22:23:14 -04:00
charger: add factory charge limit enable voltage
Charger limit enable when soc to high, but if soc wrong and voltage too low may caused low voltage battery can't charge, add enable voltage to avoid it. Change-Id: I7273351f237c2dd0262bf6f6c3bc18fb41e0860b Signed-off-by: xuxj <xuxj12@motorola.com> Reviewed-on: https://gerrit.mot.com/2786869 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Reviewed-by: Wentao Xu <xuwt2@motorola.com> Reviewed-by: Guobin Zhang <zhanggb@motorola.com> Tested-by: Jira Key Submit-Approved: Jira Key
This commit is contained in:
parent
c78b8b8fbf
commit
5dd18fd47d
1 changed files with 8 additions and 1 deletions
|
|
@ -242,6 +242,7 @@ struct mmi_charger_chip {
|
|||
bool enable_factory_poweroff;
|
||||
bool factory_syspoweroff_wait;
|
||||
bool start_factory_kill_disabled;
|
||||
int upper_limit_en_mv;
|
||||
int upper_limit_capacity;
|
||||
int lower_limit_capacity;
|
||||
|
||||
|
|
@ -1506,7 +1507,8 @@ static void mmi_update_charger_status(struct mmi_charger_chip *chip,
|
|||
if (chip->enable_charging_limit && chip->factory_version) {
|
||||
charging_limit_modes = status->charging_limit_modes;
|
||||
if ((charging_limit_modes != CHARGING_LIMIT_RUN)
|
||||
&& (batt_info->batt_soc >= chip->upper_limit_capacity))
|
||||
&& (batt_info->batt_soc >= chip->upper_limit_capacity)
|
||||
&& (batt_info->batt_mv >= chip->upper_limit_en_mv))
|
||||
charging_limit_modes = CHARGING_LIMIT_RUN;
|
||||
else if ((charging_limit_modes != CHARGING_LIMIT_OFF)
|
||||
&& (batt_info->batt_soc <= chip->lower_limit_capacity))
|
||||
|
|
@ -2812,6 +2814,11 @@ static int mmi_parse_dt(struct mmi_charger_chip *chip)
|
|||
if (rc)
|
||||
chip->factory_kill_debounce_ms = 0;
|
||||
|
||||
rc = of_property_read_u32(node, "mmi,upper-limit-en-voltage",
|
||||
&chip->upper_limit_en_mv);
|
||||
if (rc)
|
||||
chip->upper_limit_en_mv = 4000;
|
||||
|
||||
rc = of_property_read_u32(node, "mmi,upper-limit-capacity",
|
||||
&chip->upper_limit_capacity);
|
||||
if (rc)
|
||||
|
|
|
|||
Loading…
Reference in a new issue