summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDino Li <dino.li@ite.com.tw>2016-02-17 13:37:42 +0800
committerchrome-bot <chrome-bot@chromium.org>2016-02-17 20:57:02 -0800
commit5c184565afddbec361100b198721a42bb95a7adb (patch)
tree0381f220e78da3e3e29d4fd3dce9a8fe8ad041f2
parent5a7767a20e3f654298eb1f92ace1e9d0d8a332c8 (diff)
downloadchrome-ec-5c184565afddbec361100b198721a42bb95a7adb.tar.gz
chip: it83xx: disable fan control timer if all fans are off
Before the change was made, the fan control timer keeps running even all of the fans are off. reproduce the problem: 1. fanset 3333 2. fanset 0 fan is disabled but fan control timer keeps running. Signed-off-by: Dino Li <dino.li@ite.com.tw> BRANCH=none BUG=none TEST=1. fanset 3333 2. fanset 0 both fan and timer are off. Change-Id: Id38f3a4c64bbb36e8b32baefd285dbb0bf14e47e Reviewed-on: https://chromium-review.googlesource.com/327870 Commit-Ready: Dino Li <dino.li@ite.com.tw> Tested-by: Dino Li <dino.li@ite.com.tw> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--chip/it83xx/fan.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/chip/it83xx/fan.c b/chip/it83xx/fan.c
index 8f11b29e23..4d2efc8731 100644
--- a/chip/it83xx/fan.c
+++ b/chip/it83xx/fan.c
@@ -132,9 +132,6 @@ void fan_set_enabled(int ch, int enabled)
fan_info_data[tach_ch].rpm_actual = 0;
fan_info_data[tach_ch].fan_sts = FAN_STATUS_STOPPED;
}
- /* disable timer interrupt if all fan off. */
- if (fan_all_disabled())
- ext_timer_stop(FAN_CTRL_EXT_TIMER, 1);
}
/* on/off */
@@ -144,6 +141,12 @@ void fan_set_enabled(int ch, int enabled)
}
pwm_enable(ch, enabled);
+
+ if (!enabled) {
+ /* disable timer interrupt if all fan off. */
+ if (fan_all_disabled())
+ ext_timer_stop(FAN_CTRL_EXT_TIMER, 1);
+ }
}
int fan_get_enabled(int ch)