summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-06-03 16:46:23 -0600
committerCommit Bot <commit-bot@chromium.org>2021-06-07 23:41:28 +0000
commita08f3dfebadcf8e8eb6f17abb7644ebc527f987b (patch)
tree205572a4786e75da016ac5bb04ae5a7d5e05d17e
parentf83aa8e75eba5a7a71f32a9ef0c7c25bb6efcae9 (diff)
downloadchrome-ec-a08f3dfebadcf8e8eb6f17abb7644ebc527f987b.tar.gz
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 <dzigterman@chromium.org> Change-Id: I5c1abffc716c758334cb923c0a34a7ec467ff565 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2938046 Reviewed-by: Rob Barnes <robbarnes@google.com>
-rw-r--r--baseboard/guybrush/baseboard.c10
-rw-r--r--baseboard/guybrush/baseboard.h1
2 files changed, 11 insertions, 0 deletions
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
};