mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
charger:optimize the factory shutdown sequence
The device auto reboot after shutdown command receive in factory. The correct seq is sending shutdown command-->unplug the USB cable -->device shutdown. Optimize the shutdown sequence for factory. Change-Id: I7f66f932c782192776b36d96457548d49947bd18 Signed-off-by: Lei Chen <chenlei18@lenovo.com> Reviewed-on: https://gerrit.mot.com/2717398 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Reviewed-by: Lei Chen <chenl18@motorola.com> Tested-by: Jira Key Reviewed-by: Wei Xu <xuwei9@lenovo.com> Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
4c1747097c
commit
e081ae51ad
1 changed files with 5 additions and 1 deletions
|
|
@ -238,6 +238,7 @@ struct mmi_charger_chip {
|
|||
int max_chrg_temp;
|
||||
bool enable_charging_limit;
|
||||
bool enable_factory_poweroff;
|
||||
bool factory_syspoweroff_wait;
|
||||
bool start_factory_kill_disabled;
|
||||
int upper_limit_capacity;
|
||||
int lower_limit_capacity;
|
||||
|
|
@ -2614,7 +2615,7 @@ static int mmi_charger_reboot(struct notifier_block *nb,
|
|||
chip->force_charger_disabled = true;
|
||||
schedule_delayed_work(&chip->heartbeat_work, msecs_to_jiffies(0));
|
||||
while (chip->max_charger_rate != MMI_POWER_SUPPLY_CHARGE_RATE_NONE &&
|
||||
shutdown_triggered && !chip->empty_vbat_shutdown_triggered) {
|
||||
(shutdown_triggered || chip->factory_syspoweroff_wait) && !chip->empty_vbat_shutdown_triggered) {
|
||||
mmi_info(chip, "Wait for charger removal\n");
|
||||
msleep(100);
|
||||
}
|
||||
|
|
@ -2758,6 +2759,9 @@ static int mmi_parse_dt(struct mmi_charger_chip *chip)
|
|||
chip->enable_factory_poweroff =
|
||||
of_property_read_bool(node, "mmi,enable-factory-poweroff");
|
||||
|
||||
chip->factory_syspoweroff_wait =
|
||||
of_property_read_bool(node, "mmi,factory-syspoweroff-wait");
|
||||
|
||||
chip->start_factory_kill_disabled =
|
||||
of_property_read_bool(node, "mmi,start-factory-kill-disabled");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue