mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 17:11:42 +00:00
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>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user