diff options
author | Denis Brockus <dbrockus@google.com> | 2020-10-15 11:10:54 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-16 01:57:59 +0000 |
commit | a05e4e60626165412a03a8c43d6fbf47d829e5c1 (patch) | |
tree | 1d5f4a585eb4369db9aa2749e62d32c275fd8d38 /board/morphius | |
parent | c7d2f4d6c5fca9280ccc8899b863c9d9842188de (diff) | |
download | chrome-ec-a05e4e60626165412a03a8c43d6fbf47d829e5c1.tar.gz |
morphius: thermal is spamming when AP is off
The sensors are off when the AP is not running and the
output is based on these values that are being read
back from the sensors and spamming the console output.
BUG=b:170965136
BRANCH=zork
TEST=disconnect charger, power down OS and close the lid.
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I7925172ad42f93c7abc0377804881ae81d443027
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2476737
Tested-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Diana Z <dzigterman@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'board/morphius')
-rw-r--r-- | board/morphius/thermal.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/board/morphius/thermal.c b/board/morphius/thermal.c index 019e377aca..449fd92d5d 100644 --- a/board/morphius/thermal.c +++ b/board/morphius/thermal.c @@ -495,21 +495,27 @@ void board_override_fan_control(int fan, int *tmp) void thermal_protect(void) { - int thermal_sensor1, thermal_sensor2; - - temp_sensor_read(TEMP_SENSOR_5V_REGULATOR, &thermal_sensor1); - temp_sensor_read(TEMP_SENSOR_CPU, &thermal_sensor2); - if ((!lid_is_open()) && (!extpower_is_present())) { - if (thermal_sensor2 > C_TO_K(70)) { - chipset_throttle_cpu(1); - throttle_on = 1; - } else if (thermal_sensor2 < C_TO_K(60) && throttle_on) { - chipset_throttle_cpu(0); - throttle_on = 0; + 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); + + if (rv2 == EC_SUCCESS) { + if (thermal_sensor2 > C_TO_K(70)) { + chipset_throttle_cpu(1); + throttle_on = 1; + } else if (thermal_sensor2 < C_TO_K(60) && + throttle_on) { + chipset_throttle_cpu(0); + throttle_on = 0; + } } - - if (thermal_sensor1 > C_TO_K(51)) + if (rv1 == EC_SUCCESS && + thermal_sensor1 > C_TO_K(51)) chipset_force_shutdown(CHIPSET_SHUTDOWN_THERMAL); } } |