diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2018-03-05 09:49:40 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-03-06 09:59:21 -0800 |
commit | 7f4018c41f875c7fbdff03ee4a489753d541b0a9 (patch) | |
tree | cf8542ac7aac61530afecbc5161a660ccf335ccf /chip/it83xx/fan.c | |
parent | 9ea3cbecb8d3fca58baf4aff8d7e97480fe25860 (diff) | |
download | chrome-ec-7f4018c41f875c7fbdff03ee4a489753d541b0a9.tar.gz |
fan: Allow board to configure fans at run time
This patch splits struct fan_t into two parts: base configuration
and RPM configuration. RPMs are expected to be different from
model to model while a base configuration is most likely shared.
BUG=b:73720175
BRANCH=none
TEST=make buildall
Change-Id: Iff17573f110e07e88d097dd848cf91ee98b83176
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/949382
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'chip/it83xx/fan.c')
-rw-r--r-- | chip/it83xx/fan.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/chip/it83xx/fan.c b/chip/it83xx/fan.c index d412e14123..d8cf010695 100644 --- a/chip/it83xx/fan.c +++ b/chip/it83xx/fan.c @@ -98,7 +98,7 @@ static int fan_all_disabled(void) int fan, all_disabled = 0; for (fan = 0; fan < CONFIG_FANS; fan++) { - if (!fan_get_enabled(fans[fan].ch)) + if (!fan_get_enabled(FAN_CH(fan))) all_disabled++; } @@ -423,9 +423,9 @@ void fan_ext_timer_interrupt(void) task_clear_pending_irq(et_ctrl_regs[FAN_CTRL_EXT_TIMER].irq); for (fan = 0; fan < CONFIG_FANS; fan++) { - if (fan_get_enabled(fans[fan].ch)) { - proc_tach(fans[fan].ch); - fan_ctrl(fans[fan].ch); + if (fan_get_enabled(FAN_CH(fan))) { + proc_tach(FAN_CH(fan)); + fan_ctrl(FAN_CH(fan)); } } } @@ -437,10 +437,10 @@ static void fan_init(void) for (ch = 0; ch < CONFIG_FANS; ch++) { - rpm_re = fan_tach[pwm_channels[fans[ch].ch].channel].rpm_re; - fan_p = fan_tach[pwm_channels[fans[ch].ch].channel].fan_p; - s_duty = fan_tach[pwm_channels[fans[ch].ch].channel].s_duty; - tach_ch = tach_bind(fans[ch].ch); + rpm_re = fan_tach[pwm_channels[FAN_CH(ch)].channel].rpm_re; + fan_p = fan_tach[pwm_channels[FAN_CH(ch)].channel].fan_p; + s_duty = fan_tach[pwm_channels[FAN_CH(ch)].channel].s_duty; + tach_ch = tach_bind(FAN_CH(ch)); if (tach_ch < TACH_CH_COUNT) { |