diff options
author | Josh Tsai <josh_tsai@compal.corp-partner.google.com> | 2020-04-09 11:31:51 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-14 05:21:36 +0000 |
commit | 29bcae1e42b6e9b4d86b5ee4cb44cbbbe9995c85 (patch) | |
tree | 7af50684bb7fa5109c9c3faa00c1a7296cd67678 /board/malefor | |
parent | ee4b7135b0b474447d0c087691b84a6995c28764 (diff) | |
download | chrome-ec-29bcae1e42b6e9b4d86b5ee4cb44cbbbe9995c85.tar.gz |
Volteer/baseboard: Move fan configure to variant
This CL move fan configure from baseboard to variant.
BUG=none
BRANCH=none
TEST=make buildall
Change-Id: I5109a0b18e5e3f740db67c13cf6473ab2c926b42
Signed-off-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2142835
Reviewed-by: Ruby Lee <ruby_lee@compal.corp-partner.google.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board/malefor')
-rw-r--r-- | board/malefor/board.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/board/malefor/board.c b/board/malefor/board.c index d439533a70..82ade2013b 100644 --- a/board/malefor/board.c +++ b/board/malefor/board.c @@ -11,6 +11,8 @@ #include "driver/accelgyro_lsm6dsm.h" #include "driver/sync.h" #include "extpower.h" +#include "fan.h" +#include "fan_chip.h" #include "gpio.h" #include "hooks.h" #include "lid_switch.h" @@ -178,3 +180,44 @@ struct motion_sensor_t motion_sensors[] = { }, }; unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); + +/******************************************************************************/ +/* Physical fans. These are logically separate from pwm_channels. */ + +const struct fan_conf fan_conf_0 = { + .flags = FAN_USE_RPM_MODE, + .ch = MFT_CH_0, /* Use MFT id to control fan */ + .pgood_gpio = -1, + .enable_gpio = GPIO_EN_PP5000_FAN, +}; + +/* + * Fan specs from datasheet: + * Max speed 5900 rpm (+/- 7%), minimum duty cycle 30%. + * Minimum speed not specified by RPM. Set minimum RPM to max speed (with + * margin) x 30%. + * 5900 x 1.07 x 0.30 = 1894, round up to 1900 + */ +const struct fan_rpm fan_rpm_0 = { + .rpm_min = 1900, + .rpm_start = 1900, + .rpm_max = 5900, +}; + +const struct fan_t fans[FAN_CH_COUNT] = { + [FAN_CH_0] = { + .conf = &fan_conf_0, + .rpm = &fan_rpm_0, + }, +}; + +/******************************************************************************/ +/* MFT channels. These are logically separate from pwm_channels. */ +const struct mft_t mft_channels[] = { + [MFT_CH_0] = { + .module = NPCX_MFT_MODULE_1, + .clk_src = TCKC_LFCLK, + .pwm_id = PWM_CH_FAN, + }, +}; +BUILD_ASSERT(ARRAY_SIZE(mft_channels) == MFT_CH_COUNT); |