mmi_charger:use orderly shutdown in factory mode

User an orderly shutdown for factory kill instead of a
kernel power off.  The orderly shutdown will attempt to
call the reboot binary from userspace first, and then
fallback to kernel power off if it fails.

Change-Id: I52bac148c92a2aaf6a3929b4c1a2709e4b3421af
Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com>
Reviewed-on: https://gerrit.mot.com/2108688
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
This commit is contained in:
zhaoxp3 2021-11-05 17:04:00 +08:00 • committed by Xiangpo Zhao
commit 80456d6e6b

View file

@ -2014,7 +2014,7 @@ static void mmi_charger_heartbeat_work(struct work_struct *work)
chip->factory_kill_armed = true;
} else if (chip->factory_kill_armed && !factory_kill_disable) {
mmi_warn(chip, "Factory kill power off\n");
kernel_power_off();
orderly_poweroff(true);
} else {
chip->factory_kill_armed = false;
}