From 8df483bf594d6251005a88de211078e2a445a55d Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Fri, 21 Feb 2014 11:07:16 -0800 Subject: [PATCH] Host command to set fan RPM enables fan Previously, it would only set the fan RPM, but not actually enable the fan so it can spin at the requested speed. Compare with setting fan duty cycle, which always enabled the fan. BUG=chrome-os-partner:23803 BRANCH=samus TEST=with fans off, 'ectool pwmsetfanrpm 1000' should spin both fans, and the ec 'faninfo' command should show both fans enabled. Change-Id: I37d7fb05309944ab6f98333e2cf3b38ea2dd38e9 Signed-off-by: Randall Spangler Reviewed-on: https://chromium-review.googlesource.com/187386 Reviewed-by: Sameer Nanda --- common/fan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/fan.c b/common/fan.c index d61eba67d9..a51450bbfd 100644 --- a/common/fan.c +++ b/common/fan.c @@ -313,6 +313,9 @@ static int hc_pwm_set_fan_target_rpm(struct host_cmd_handler_args *args) /* TODO(crosbug.com/p/23803) */ for (fan = 0; fan < CONFIG_FANS; fan++) { + /* Always enable the fan */ + set_enabled(fan, 1); + set_thermal_control_enabled(fan, 0); fan_set_rpm_mode(fans[fan].ch, 1); fan_set_rpm_target(fans[fan].ch, p->rpm);