summaryrefslogtreecommitdiff
path: root/board/npcx7_evb/board.c
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2018-03-05 09:49:40 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-03-06 09:59:21 -0800
commit7f4018c41f875c7fbdff03ee4a489753d541b0a9 (patch)
treecf8542ac7aac61530afecbc5161a660ccf335ccf /board/npcx7_evb/board.c
parent9ea3cbecb8d3fca58baf4aff8d7e97480fe25860 (diff)
downloadchrome-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/npcx7_evb/board.c')
-rw-r--r--board/npcx7_evb/board.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/board/npcx7_evb/board.c b/board/npcx7_evb/board.c
index 0a97942dbb..671671a21f 100644
--- a/board/npcx7_evb/board.c
+++ b/board/npcx7_evb/board.c
@@ -55,16 +55,21 @@ BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
/******************************************************************************/
/* Physical fans. These are logically separate from pwm_channels. */
-const struct fan_t fans[] = {
- [FAN_CH_0] = {
- .flags = FAN_USE_RPM_MODE,
- .rpm_min = 1000,
- .rpm_start = 1000,
- .rpm_max = 5200,
- .ch = 0,/* Use MFT id to control fan */
- .pgood_gpio = GPIO_PGOOD_FAN,
- .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 = GPIO_PGOOD_FAN,
+ .enable_gpio = -1,
+};
+
+const struct fan_rpm fan_rpm_0 = {
+ .rpm_min = 1000,
+ .rpm_start = 1000,
+ .rpm_max = 5200,
+};
+
+struct fan_t fans[] = {
+ [FAN_CH_0] = { .conf = &fan_conf_0, .rpm = &fan_rpm_0, },
};
BUILD_ASSERT(ARRAY_SIZE(fans) == FAN_CH_COUNT);