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 | |
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>
-rw-r--r-- | baseboard/volteer/baseboard.c | 43 | ||||
-rw-r--r-- | board/halvor/board.h | 2 | ||||
-rw-r--r-- | board/malefor/board.c | 43 | ||||
-rw-r--r-- | board/volteer/board.c | 43 |
4 files changed, 88 insertions, 43 deletions
diff --git a/baseboard/volteer/baseboard.c b/baseboard/volteer/baseboard.c index b24044e9ac..7358fbfa13 100644 --- a/baseboard/volteer/baseboard.c +++ b/baseboard/volteer/baseboard.c @@ -18,8 +18,6 @@ #include "driver/tcpm/tcpci.h" #include "driver/tcpm/tusb422.h" #include "driver/temp_sensor/thermistor.h" -#include "fan.h" -#include "fan_chip.h" #include "gpio.h" #include "hooks.h" #include "i2c.h" @@ -265,47 +263,6 @@ const struct pwm_t pwm_channels[] = { BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); /******************************************************************************/ -/* 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); - -/******************************************************************************/ /* Temperature sensor configuration */ const struct temp_sensor_t temp_sensors[] = { [TEMP_SENSOR_1_CHARGER] = {.name = "Charger", diff --git a/board/halvor/board.h b/board/halvor/board.h index af82faaf28..db400f300f 100644 --- a/board/halvor/board.h +++ b/board/halvor/board.h @@ -86,6 +86,8 @@ #define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL #define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L +#undef CONFIG_FANS + #ifndef __ASSEMBLER__ #include "gpio_signal.h" 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); diff --git a/board/volteer/board.c b/board/volteer/board.c index d24283fd07..525e2242f7 100644 --- a/board/volteer/board.c +++ b/board/volteer/board.c @@ -13,6 +13,8 @@ #include "driver/retimer/bb_retimer.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" @@ -82,3 +84,44 @@ __override bool board_is_tbt_usb4_port(int port) */ return port == USBC_PORT_C1; } + +/******************************************************************************/ +/* 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); |