mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 17:11:42 +00:00
Add host events for shutdown due to thermal or battery
BUG=chrome-os-partner:12353 TEST=hack the thermal monitoring and/or battery code to trigger a shutdown then see that the events get set Change-Id: I5ef2ac03cdd793ab0c50c0db518cba1ede3ea036 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/29429 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
@@ -105,6 +105,7 @@ static void poweroff_wait_ac(void)
|
||||
*/
|
||||
#ifdef CONFIG_TASK_X86POWER
|
||||
x86_power_force_shutdown();
|
||||
host_set_single_event(EC_HOST_EVENT_BATTERY_SHUTDOWN);
|
||||
#endif /* CONFIG_TASK_X86POWER */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,6 +110,7 @@ static void overheated_action(void)
|
||||
cprintf(CC_CHIPSET,
|
||||
"[%T critical temperature; shutting down]\n");
|
||||
x86_power_force_shutdown();
|
||||
host_set_single_event(EC_HOST_EVENT_THERMAL_SHUTDOWN);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -193,6 +193,7 @@ void x86_power_cpu_overheated(int too_hot)
|
||||
if (overheat_count > 3) {
|
||||
CPRINTF("[%T overheated; shutting down]\n");
|
||||
x86_power_force_shutdown();
|
||||
host_set_single_event(EC_HOST_EVENT_THERMAL_SHUTDOWN);
|
||||
}
|
||||
} else {
|
||||
overheat_count = 0;
|
||||
|
||||
@@ -217,6 +217,12 @@ enum host_event_code {
|
||||
EC_HOST_EVENT_INTERFACE_READY = 14,
|
||||
/* Keyboard recovery combo has been pressed */
|
||||
EC_HOST_EVENT_KEYBOARD_RECOVERY = 15,
|
||||
|
||||
/* Shutdown due to thermal overload */
|
||||
EC_HOST_EVENT_THERMAL_SHUTDOWN = 16,
|
||||
/* Shutdown due to battery level too low */
|
||||
EC_HOST_EVENT_BATTERY_SHUTDOWN = 17,
|
||||
|
||||
/*
|
||||
* The high bit of the event mask is not used as a host event code. If
|
||||
* it reads back as set, then the entire event mask should be
|
||||
|
||||
Reference in New Issue
Block a user