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/host | |
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/host')
-rw-r--r-- | board/host/fan.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/board/host/fan.c b/board/host/fan.c index ee7b15ef12..557baaaa7d 100644 --- a/board/host/fan.c +++ b/board/host/fan.c @@ -8,17 +8,22 @@ #include "fan.h" #include "util.h" -const struct fan_t fans[] = { - {.flags = FAN_USE_RPM_MODE, - .rpm_min = 1000, - .rpm_start = 1500, - .rpm_max = 5000, - .ch = 0, - .pgood_gpio = -1, - .enable_gpio = -1, - }, +const struct fan_conf fan_conf_0 = { + .flags = FAN_USE_RPM_MODE, + .ch = 0, + .pgood_gpio = -1, + .enable_gpio = -1, +}; + +const struct fan_rpm fan_rpm_0 = { + .rpm_min = 1000, + .rpm_start = 1500, + .rpm_max = 5000, +}; + +struct fan_t fans[CONFIG_FANS] = { + { .conf = &fan_conf_0, .rpm = &fan_rpm_0, }, }; -BUILD_ASSERT(ARRAY_SIZE(fans) == CONFIG_FANS); static int mock_enabled; void fan_set_enabled(int ch, int enabled) |