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 /board/it83xx_evb | |
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 'board/it83xx_evb')
-rw-r--r-- | board/it83xx_evb/board.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/board/it83xx_evb/board.c b/board/it83xx_evb/board.c index cd0b9ff1e4..8bc2740beb 100644 --- a/board/it83xx_evb/board.c +++ b/board/it83xx_evb/board.c @@ -106,19 +106,21 @@ const struct pwm_t pwm_channels[] = { BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); -const struct fan_t fans[] = { - {.flags = FAN_USE_RPM_MODE, - .rpm_min = 1500, - .rpm_start = 1500, - .rpm_max = 6500, - /* - * index of pwm_channels, not pwm output channel. - * pwm output channel is member "channel" of pwm_t. - */ - .ch = 0, - .pgood_gpio = -1, - .enable_gpio = -1, - }, +const struct fan_conf fan_conf_0 = { + .flags = FAN_USE_RPM_MODE, + .ch = 0, /* Use MFT id to control fan */ + .pgood_gpio = -1, + .enable_gpio = -1, +}; + +const struct fan_rpm fan_rpm_0 = { + .rpm_min = 1500, + .rpm_start = 1500, + .rpm_max = 6500, +}; + +struct fan_t fans[] = { + { .conf = &fan_conf_0, .rpm = &fan_rpm_0, }, }; BUILD_ASSERT(ARRAY_SIZE(fans) == CONFIG_FANS); |