mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
flip_batt: optimization flip batt charger status
flip battery charge not disabled in factory mode Change-Id: Iab876cae0d36ac38f9a524cb3f8c22325307867b Signed-off-by: xuxj12 <xuxj12@motorola.com> Reviewed-on: https://gerrit.mot.com/2515025 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Reviewed-by: Yonghua Yan <yanyh2@motorola.com> Tested-by: Jira Key Reviewed-by: Jianqi Yang <yangj@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
555d409161
commit
7720276df2
1 changed files with 15 additions and 3 deletions
|
|
@ -1479,7 +1479,20 @@ static int sc760x_charger_config_charge(void *data, struct mmi_charger_cfg *conf
|
|||
|
||||
sc760x_get_state(chg->sc, &state);
|
||||
|
||||
if (config->charging_disable != chg->chg_cfg.charging_disable) {
|
||||
chg_en = sc760x_is_enabled_charging(chg->sc);
|
||||
if (chg->sc->user_chg_en >= 0 && chg_en != !!chg->sc->user_chg_en) {
|
||||
if (!!chg->sc->user_chg_en)
|
||||
rc = sc760x_enable_charger(chg->sc);
|
||||
else
|
||||
rc = sc760x_disable_charger(chg->sc);
|
||||
if (!rc) {
|
||||
cfg_changed = true;
|
||||
chg_en = !!chg->sc->user_chg_en;
|
||||
}
|
||||
}
|
||||
|
||||
if (config->charging_disable != chg->chg_cfg.charging_disable ||
|
||||
(chg_en == config->charging_disable && chg->sc->user_chg_en < 0)) {
|
||||
value = config->charging_disable;
|
||||
if (!value)
|
||||
rc = sc760x_enable_charger(chg->sc);
|
||||
|
|
@ -1488,6 +1501,7 @@ static int sc760x_charger_config_charge(void *data, struct mmi_charger_cfg *conf
|
|||
if (!rc) {
|
||||
cfg_changed = true;
|
||||
chg->chg_cfg.charging_disable = config->charging_disable;
|
||||
chg_en = !value;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1541,8 +1555,6 @@ static int sc760x_charger_config_charge(void *data, struct mmi_charger_cfg *conf
|
|||
chg->chg_cfg.charging_reset = config->charging_reset;
|
||||
}
|
||||
|
||||
chg_en = sc760x_is_enabled_charging(chg->sc);
|
||||
|
||||
if (cfg_changed) {
|
||||
cancel_delayed_work(&chg->sc->charge_monitor_work);
|
||||
schedule_delayed_work(&chg->sc->charge_monitor_work,
|
||||
|
|
|
|||
Loading…
Reference in a new issue