summaryrefslogtreecommitdiff
path: root/board/metaknight/board.c
diff options
context:
space:
mode:
authorYu-An Chen <yu-an.chen@quanta.corp-partner.google.com>2021-02-02 14:26:38 +0800
committerCommit Bot <commit-bot@chromium.org>2021-02-03 02:50:37 +0000
commit99e746d0c6fb815e9e39fc255c29058d705a4bdb (patch)
tree42de26c4ceb314b0cd6467915a82c29285fa42d9 /board/metaknight/board.c
parent30de86869c610f51ad20f462c064754f971cd41f (diff)
downloadchrome-ec-99e746d0c6fb815e9e39fc255c29058d705a4bdb.tar.gz
Metaknight: Add thermal table
Add setup_thermal for setting thermal table BUG=b:178678269 BRANCH=main TEST=thermal team verify value on AP Signed-off-by: yu-an.chen@quanta.corp-partner.google.com Change-Id: I8b55a6e8c488e3a5eee713e6d73f908def3bec00 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2666558 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/metaknight/board.c')
-rw-r--r--board/metaknight/board.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/board/metaknight/board.c b/board/metaknight/board.c
index 6d8a49bd8d..a99499695c 100644
--- a/board/metaknight/board.c
+++ b/board/metaknight/board.c
@@ -222,6 +222,40 @@ const struct temp_sensor_t temp_sensors[] = {
};
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
+const static struct ec_thermal_config thermal_a = {
+ .temp_host = {
+ [EC_TEMP_THRESH_WARN] = 0,
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(70),
+ [EC_TEMP_THRESH_HALT] = C_TO_K(85),
+ },
+ .temp_host_release = {
+ [EC_TEMP_THRESH_WARN] = 0,
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(65),
+ [EC_TEMP_THRESH_HALT] = 0,
+ },
+};
+
+const static struct ec_thermal_config thermal_b = {
+ .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,
+ },
+};
+
+struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT];
+
+static void setup_thermal(void)
+{
+ thermal_params[TEMP_SENSOR_1] = thermal_a;
+ thermal_params[TEMP_SENSOR_2] = thermal_b;
+}
+
/* Enable HDMI any time the SoC is on */
static void hdmi_enable(void)
{
@@ -670,6 +704,9 @@ void board_init(void)
} else
ccprints("LID_ACCEL is BMA253");
+ /* Initial thermal */
+ setup_thermal();
+
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);