diff options
-rw-r--r-- | chip/lm4/pwm.c | 11 | ||||
-rw-r--r-- | common/thermal.c | 7 |
2 files changed, 18 insertions, 0 deletions
diff --git a/chip/lm4/pwm.c b/chip/lm4/pwm.c index 07eb7371ec..266677a017 100644 --- a/chip/lm4/pwm.c +++ b/chip/lm4/pwm.c @@ -13,6 +13,7 @@ #include "uart.h" #include "util.h" #include "task.h" +#include "thermal.h" #include "lpc.h" #include "lpc_commands.h" @@ -173,6 +174,11 @@ static int command_fan_set(int argc, char **argv) pwm_enable_fan(1); } +#ifdef CONFIG_TASK_THERMAL + /* Disable thermal engine automatic fan control. */ + thermal_toggle_auto_fan_ctrl(0); +#endif + rv = pwm_set_fan_target_rpm(rpm); if (rv == EC_SUCCESS) uart_printf("Done.\n"); @@ -208,6 +214,11 @@ static int command_fan_duty(int argc, char **argv) pwm_enable_fan(1); } +#ifdef CONFIG_TASK_THERMAL + /* Disable thermal engine automatic fan control. */ + thermal_toggle_auto_fan_ctrl(0); +#endif + /* Set the duty cycle */ LM4_FAN_FANCMD(FAN_CH_CPU) = pwm << 16; diff --git a/common/thermal.c b/common/thermal.c index 4b7341444a..b1f492e408 100644 --- a/common/thermal.c +++ b/common/thermal.c @@ -230,3 +230,10 @@ static int command_thermal_config(int argc, char **argv) return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(thermal, command_thermal_config); + + +static int command_thermal_auto_fan_ctrl(int argc, char **argv) +{ + return thermal_toggle_auto_fan_ctrl(1); +} +DECLARE_CONSOLE_COMMAND(autofan, command_thermal_auto_fan_ctrl); |