From a395a7272d860ab630ebf9e9c6a04dc1311d1b4c Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Mon, 27 Feb 2012 16:58:43 -0800 Subject: [PATCH] Add APIs for thermal module to tell x86_power about overheating (implementation of APIs still todo) Signed-off-by: Randall Spangler BUG=chrome-os-partner:8242 TEST=none Change-Id: Idbd38c4e873e95382ae815e1d5b827d95396be8f --- common/x86_power.c | 16 +++++++++++++++- include/x86_power.h | 7 +++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/common/x86_power.c b/common/x86_power.c index c4c3452a5b..91473e6132 100644 --- a/common/x86_power.c +++ b/common/x86_power.c @@ -207,11 +207,25 @@ int x86_power_init(void) } /*****************************************************************************/ -int x86_power_in_S0(void) { + +int x86_power_in_S0(void) +{ return state == X86_S0; } +void x86_power_cpu_overheated(int too_hot) +{ + /* TODO: crosbug.com/p/8242 - real implementation */ +} + + +void x86_power_force_shutdown(void) +{ + /* TODO: crosbug.com/p/8242 - real implementation */ +} + + /*****************************************************************************/ /* Task function */ diff --git a/include/x86_power.h b/include/x86_power.h index 2c2ff16357..fc0d812413 100644 --- a/include/x86_power.h +++ b/include/x86_power.h @@ -20,5 +20,12 @@ void x86_power_interrupt(enum gpio_signal signal); /* Returns true if the system is in S0. */ int x86_power_in_S0(void); +/* Informs the power module that the CPU has overheated (too_hot=1) or is + * no longer too hot (too_hot=0). */ +void x86_power_cpu_overheated(int too_hot); + +/* Immediately shuts down power to the main processor and chipset. This is + * intended for use when the system is too hot or battery power is critical. */ +void x86_power_force_shutdown(void); #endif /* __CROS_EC_X86_POWER_H */