summaryrefslogtreecommitdiff
path: root/common/temp_sensor.c
diff options
context:
space:
mode:
authorAaron Massey <aaronmassey@google.com>2021-09-24 11:22:12 -0600
committerCommit Bot <commit-bot@chromium.org>2021-09-24 19:47:45 +0000
commit465c9dc87a353f48b969da0631c4fd2b6df32a4f (patch)
treeeae7fa5a0f92cb81af315eb7912267167ed078e1 /common/temp_sensor.c
parentfc2b67a878f6c57c02569253032fc5d09f6c581e (diff)
downloadchrome-ec-465c9dc87a353f48b969da0631c4fd2b6df32a4f.tar.gz
zephyr: drivers: thermistors are device tree nodes
Thermistor drivers now query the device tree for configuration. Thermistor tests have been updated to be parameterized on all thermistors enabled in the device tree. BRANCH=none BUG=b:184374937 TEST= 1) zmake testall 2) make runhosttests Cq-Depend: chromium:3161332 Signed-off-by: Aaron Massey <aaronmassey@chromium.org> Change-Id: Ic5330cd5c33e79e192428ca857651de9a225856e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3133812 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Aaron Massey <aaronmassey@google.com> Commit-Queue: Aaron Massey <aaronmassey@google.com>
Diffstat (limited to 'common/temp_sensor.c')
-rw-r--r--common/temp_sensor.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/temp_sensor.c b/common/temp_sensor.c
index 55101a5345..69d440a6d5 100644
--- a/common/temp_sensor.c
+++ b/common/temp_sensor.c
@@ -27,7 +27,11 @@ int temp_sensor_read(enum temp_sensor_id id, int *temp_ptr)
return EC_ERROR_INVAL;
sensor = temp_sensors + id;
+#ifdef CONFIG_ZEPHYR
+ return sensor->read(sensor, temp_ptr);
+#else
return sensor->read(sensor->idx, temp_ptr);
+#endif
}
static void update_mapped_memory(void)