summaryrefslogtreecommitdiff
path: root/chip/lm4/pwm.c
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2012-02-29 15:27:30 -0800
committerVic Yang <victoryang@chromium.org>2012-02-29 16:26:26 -0800
commit5cd0f292e9c769264c5fa1f0fe262c910a9194ec (patch)
tree67f1443d76e8151a0413223cc1e6ab463e6041ba /chip/lm4/pwm.c
parent42a9405d112864f15ffd6df96bebcb293d656dc6 (diff)
downloadchrome-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
Diffstat (limited to 'chip/lm4/pwm.c')
-rw-r--r--chip/lm4/pwm.c11
1 files changed, 11 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;