summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/charge_state.c1
-rw-r--r--common/thermal.c1
-rw-r--r--common/x86_power.c1
-rw-r--r--include/ec_commands.h6
4 files changed, 9 insertions, 0 deletions
diff --git a/common/charge_state.c b/common/charge_state.c
index f1e99eb022..d43e5a9fa5 100644
--- a/common/charge_state.c
+++ b/common/charge_state.c
@@ -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 */
}
}
diff --git a/common/thermal.c b/common/thermal.c
index 344279c0b3..3f570be058 100644
--- a/common/thermal.c
+++ b/common/thermal.c
@@ -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;
}
diff --git a/common/x86_power.c b/common/x86_power.c
index c58617c788..28592a8383 100644
--- a/common/x86_power.c
+++ b/common/x86_power.c
@@ -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;
diff --git a/include/ec_commands.h b/include/ec_commands.h
index c94fed5c96..0b3f388289 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -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