summaryrefslogtreecommitdiff
path: root/board/morphius/thermal.c
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2020-08-19 17:39:39 -0600
committerCommit Bot <commit-bot@chromium.org>2020-08-20 23:41:41 +0000
commit259c0d8133e523f1f7925442c1bb7352383975dc (patch)
tree778d798cc6c3ff68c3329eef581add72e9064a89 /board/morphius/thermal.c
parent06f584a8b508e881680c222498702f5148330a3f (diff)
downloadchrome-ec-259c0d8133e523f1f7925442c1bb7352383975dc.tar.gz
Zork: Add command to print temps periodically
BUG=b:162907613 BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Iddbba7d7955f252cacf666528195bbfc7d9718e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2365633 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'board/morphius/thermal.c')
-rw-r--r--board/morphius/thermal.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/board/morphius/thermal.c b/board/morphius/thermal.c
index 36ff96e2ff..e7f976f681 100644
--- a/board/morphius/thermal.c
+++ b/board/morphius/thermal.c
@@ -480,10 +480,14 @@ int fan_table_to_rpm(int fan, int *temp)
void board_override_fan_control(int fan, int *tmp)
{
- if (chipset_in_state(CHIPSET_STATE_ON |
- CHIPSET_STATE_ANY_SUSPEND)) {
- fan_set_rpm_mode(FAN_CH(fan), 1);
- fan_set_rpm_target(FAN_CH(fan),
- fan_table_to_rpm(fan, tmp));
+ if (chipset_in_state(CHIPSET_STATE_ON | CHIPSET_STATE_ANY_SUSPEND)) {
+ int new_rpm = fan_table_to_rpm(fan, tmp);
+
+ if (new_rpm != fan_get_rpm_target(FAN_CH(fan))) {
+ cprints(CC_THERMAL, "Setting fan RPM to %d", new_rpm);
+ board_print_temps();
+ fan_set_rpm_mode(FAN_CH(fan), 1);
+ fan_set_rpm_target(FAN_CH(fan), new_rpm);
+ }
}
}