summaryrefslogtreecommitdiff
path: root/board/morphius/thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/morphius/thermal.c')
-rw-r--r--board/morphius/thermal.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/board/morphius/thermal.c b/board/morphius/thermal.c
index 449fd92d5d..329157b6ec 100644
--- a/board/morphius/thermal.c
+++ b/board/morphius/thermal.c
@@ -495,16 +495,16 @@ void board_override_fan_control(int fan, int *tmp)
void thermal_protect(void)
{
- if ((!lid_is_open()) && (!extpower_is_present())) {
- int rv1, rv2;
- int thermal_sensor1, thermal_sensor2;
+ int rv1, rv2;
+ int thermal_sensor1, thermal_sensor2;
- rv1 = temp_sensor_read(TEMP_SENSOR_5V_REGULATOR,
- &thermal_sensor1);
- rv2 = temp_sensor_read(TEMP_SENSOR_CPU,
- &thermal_sensor2);
+ rv1 = temp_sensor_read(TEMP_SENSOR_5V_REGULATOR,
+ &thermal_sensor1);
+ rv2 = temp_sensor_read(TEMP_SENSOR_CPU,
+ &thermal_sensor2);
- if (rv2 == EC_SUCCESS) {
+ if (rv2 == EC_SUCCESS) {
+ if ((!lid_is_open()) && (!extpower_is_present())) {
if (thermal_sensor2 > C_TO_K(70)) {
chipset_throttle_cpu(1);
throttle_on = 1;
@@ -513,9 +513,17 @@ void thermal_protect(void)
chipset_throttle_cpu(0);
throttle_on = 0;
}
+ } else {
+ if (throttle_on == 1) {
+ chipset_throttle_cpu(0);
+ throttle_on = 0;
+ }
}
- if (rv1 == EC_SUCCESS &&
- thermal_sensor1 > C_TO_K(51))
+ }
+
+ if (rv1 == EC_SUCCESS) {
+ if ((!lid_is_open()) && (!extpower_is_present())
+ && thermal_sensor1 > C_TO_K(51))
chipset_force_shutdown(CHIPSET_SHUTDOWN_THERMAL);
}
}