summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2018-02-22 14:50:51 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-02-26 22:07:16 -0800
commitc6f5fe6d30fa6afde1b341d5cd83542078584046 (patch)
treec4c895988e2eb3198396a2dd173d36ecd11bc8b3
parentab706d65fd9a262498654ac559011f99b1038cb3 (diff)
downloadchrome-ec-c6f5fe6d30fa6afde1b341d5cd83542078584046.tar.gz
npcx/fan: Avoid turning on disabled fans
Fan enable state is controlled in common/fan.c. This patch prevents npcx fan driver from enabling it. BUG=b:73127788 BRANCH=none TEST=Verify no 'Fan 0 stalled' is printed in S3 and S5. Verify the fan spins in S0. Change-Id: I549253a64c91d8a23bb793c3506b5daf1f7642be Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/937941 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--chip/npcx/fan.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/chip/npcx/fan.c b/chip/npcx/fan.c
index ca0980a91a..8e08e4ec58 100644
--- a/chip/npcx/fan.c
+++ b/chip/npcx/fan.c
@@ -346,8 +346,11 @@ void fan_tick_func(void)
/* Make sure rpm mode is enabled */
if (p_status->fan_mode != TACHO_FAN_RPM) {
p_status->auto_status = FAN_STATUS_STOPPED;
+ /* Why isn't this 'continue'? */
return;
}
+ if (!fan_get_enabled(ch))
+ continue;
/* Get actual rpm */
p_status->rpm_actual = mft_fan_rpm(ch);
/* Do smart fan stuff */