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.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);
+ }
}
}