diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2018-06-29 10:54:45 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-07-10 14:00:44 -0700 |
commit | aa5c6b15afe3cd8501b1658e732836e2be1d31bb (patch) | |
tree | f7a4acdae3f28b4fa071516b8340ab269983a4b9 | |
parent | 8948d52feed5514d5fbb69a20af6641f2c40a03f (diff) | |
download | chrome-ec-aa5c6b15afe3cd8501b1658e732836e2be1d31bb.tar.gz |
Nami: Enable temperature contorl by fan
This enables temperature control by a fan. When the OS is running,
the fan speed is controlled by DPTF.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=b:111195564,b:77305963,b:80174676,b:110127818
BRANCH=none
TEST=Verify fan speed is controlled as temperature goes up and system is
shut down on Sona & Vayne.
Change-Id: I2e5b19e9ede6210cbfbfc4f295ba8e17872113dc
Reviewed-on: https://chromium-review.googlesource.com/1120851
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com>
-rw-r--r-- | board/nami/board.c | 102 | ||||
-rw-r--r-- | board/nami/board.h | 1 |
2 files changed, 99 insertions, 4 deletions
diff --git a/board/nami/board.c b/board/nami/board.c index 5ffe123047..f816a6395a 100644 --- a/board/nami/board.c +++ b/board/nami/board.c @@ -309,13 +309,94 @@ uint16_t tcpc_get_alert_status(void) /* * F75303_Remote1 is near CPU, and F75303_Remote2 is near 5V power IC. */ -const struct temp_sensor_t temp_sensors[] = { +const struct temp_sensor_t temp_sensors[TEMP_SENSOR_COUNT] = { {"F75303_Remote1", TEMP_SENSOR_TYPE_CPU, f75303_get_val, F75303_IDX_REMOTE1, 4}, {"F75303_Remote2", TEMP_SENSOR_TYPE_BOARD, f75303_get_val, F75303_IDX_REMOTE2, 4}, }; -BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); + +struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT]; + +/* Nami/Vayne Remote 1, 2 */ +const static struct ec_thermal_config thermal_a = { + .temp_host = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(75), + [EC_TEMP_THRESH_HALT] = C_TO_K(80), + }, + .temp_host_release = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(65), + [EC_TEMP_THRESH_HALT] = 0, + }, + .temp_fan_off = C_TO_K(39), + .temp_fan_max = C_TO_K(50), +}; + +/* Sona Remote 1 */ +const static struct ec_thermal_config thermal_b1 = { + .temp_host = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(82), + [EC_TEMP_THRESH_HALT] = C_TO_K(89), + }, + .temp_host_release = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(72), + [EC_TEMP_THRESH_HALT] = 0, + }, + .temp_fan_off = C_TO_K(38), + .temp_fan_max = C_TO_K(58), +}; + +/* Sona Remote 2 */ +const static struct ec_thermal_config thermal_b2 = { + .temp_host = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(84), + [EC_TEMP_THRESH_HALT] = C_TO_K(91), + }, + .temp_host_release = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(74), + [EC_TEMP_THRESH_HALT] = 0, + }, + .temp_fan_off = C_TO_K(40), + .temp_fan_max = C_TO_K(60), +}; + +/* Pantheon Remote 1 */ +const static struct ec_thermal_config thermal_c1 = { + .temp_host = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(66), + [EC_TEMP_THRESH_HALT] = C_TO_K(71), + }, + .temp_host_release = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(56), + [EC_TEMP_THRESH_HALT] = 0, + }, + .temp_fan_off = C_TO_K(38), + .temp_fan_max = C_TO_K(61), +}; + +/* Pantheon Remote 2 */ +const static struct ec_thermal_config thermal_c2 = { + .temp_host = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(74), + [EC_TEMP_THRESH_HALT] = C_TO_K(79), + }, + .temp_host_release = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(64), + [EC_TEMP_THRESH_HALT] = 0, + }, + .temp_fan_off = C_TO_K(38), + .temp_fan_max = C_TO_K(61), +}; #define I2C_PMIC_READ(reg, data) \ i2c_read8(I2C_PORT_PMIC, TPS650X30_I2C_ADDR1, (reg), (data)) @@ -744,10 +825,23 @@ static void setup_motion_sensors(void) static void setup_fans(void) { - if (oem == PROJECT_SONA) + switch (oem) { + case PROJECT_SONA: fans[FAN_CH_0].rpm = &fan_rpm_1; - else if (oem == PROJECT_PANTHEON) + thermal_params[0] = thermal_b1; + thermal_params[1] = thermal_b2; + break; + case PROJECT_PANTHEON: fans[FAN_CH_0].rpm = &fan_rpm_2; + thermal_params[0] = thermal_c1; + thermal_params[1] = thermal_c2; + break; + default: + case PROJECT_NAMI: + case PROJECT_VAYNE: + thermal_params[0] = thermal_a; + thermal_params[1] = thermal_a; + } } /* diff --git a/board/nami/board.h b/board/nami/board.h index 6db7d52685..f8d6f305ee 100644 --- a/board/nami/board.h +++ b/board/nami/board.h @@ -49,6 +49,7 @@ #define CONFIG_FANS 1 #undef CONFIG_FAN_INIT_SPEED #define CONFIG_FAN_INIT_SPEED 50 +#define CONFIG_THROTTLE_AP #define CONFIG_PWM_KBLIGHT #define CONFIG_SUPPRESSED_HOST_COMMANDS \ EC_CMD_CONSOLE_SNAPSHOT, EC_CMD_CONSOLE_READ, EC_CMD_PD_GET_LOG_ENTRY, \ |