diff options
author | Vic Yang <victoryang@chromium.org> | 2012-02-29 15:27:30 -0800 |
---|---|---|
committer | Vic Yang <victoryang@chromium.org> | 2012-02-29 16:26:26 -0800 |
commit | 5cd0f292e9c769264c5fa1f0fe262c910a9194ec (patch) | |
tree | 67f1443d76e8151a0413223cc1e6ab463e6041ba | |
parent | 42a9405d112864f15ffd6df96bebcb293d656dc6 (diff) | |
download | chrome-ec-5cd0f292e9c769264c5fa1f0fe262c910a9194ec.tar.gz |
Console command for thermal engine fan control.
Add console command 'autofan' to turn on automatic fan speed control.
Also modify 'fanset' to disable automatic control before setting fan
speed.
Signed-off-by: Vic Yang <victoryang@chromium.org>
BUG=chrome-os-partner:8250
TEST=Manual test
Change-Id: I2db85ce2e754bba21567b2c92e4476049d517627
-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); |