From a08f3dfebadcf8e8eb6f17abb7644ebc527f987b Mon Sep 17 00:00:00 2001 From: Diana Z Date: Thu, 3 Jun 2021 16:46:23 -0600 Subject: Guybrush: Add ambient temperature sensor Add the ambient temperature sensor which is being placed on the board in version 2. Note this will return an error on version 1 boards. BRANCH=None BUG=b:188539950 TEST=make -j buildall; load on version 1 and observe temps reports 0 for ambient temperature and nothing is spewing errors Signed-off-by: Diana Z Change-Id: I5c1abffc716c758334cb923c0a34a7ec467ff565 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2938046 Reviewed-by: Rob Barnes --- baseboard/guybrush/baseboard.c | 10 ++++++++++ baseboard/guybrush/baseboard.h | 1 + 2 files changed, 11 insertions(+) diff --git a/baseboard/guybrush/baseboard.c b/baseboard/guybrush/baseboard.c index aa3a548142..69e454eef9 100644 --- a/baseboard/guybrush/baseboard.c +++ b/baseboard/guybrush/baseboard.c @@ -222,6 +222,12 @@ const struct temp_sensor_t temp_sensors[] = { .read = sb_tsi_get_val, .idx = 0, }, + [TEMP_SENSOR_AMBIENT] = { + .name = "Ambient", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = tmp112_get_val, + .idx = TMP112_AMB, + }, }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); @@ -271,6 +277,10 @@ struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT] = { .temp_fan_off = 0, .temp_fan_max = 0, }, + /* + * Note: Leave ambient entries at 0, both as it does not represent a + * hotspot and as not all boards have this sensor + */ }; BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); diff --git a/baseboard/guybrush/baseboard.h b/baseboard/guybrush/baseboard.h index 8e7d964b49..ae2e415b7e 100644 --- a/baseboard/guybrush/baseboard.h +++ b/baseboard/guybrush/baseboard.h @@ -316,6 +316,7 @@ enum temp_sensor_id { TEMP_SENSOR_CHARGER, TEMP_SENSOR_MEMORY, TEMP_SENSOR_CPU, + TEMP_SENSOR_AMBIENT, TEMP_SENSOR_COUNT }; -- cgit v1.2.1