summaryrefslogtreecommitdiff
path: root/zephyr/test
diff options
context:
space:
mode:
authorTomasz Michalec <tm@semihalf.com>2021-07-27 15:06:34 +0200
committerCommit Bot <commit-bot@chromium.org>2021-07-27 20:24:15 +0000
commit1aa97a5b62acf1b3a6bad23331cae1c7e4fbea5b (patch)
treec0860f5adf89fa96252536ee7b7abc6d87419ee3 /zephyr/test
parent414b3d2b9de35f8bf53293b6244d8d58b3488239 (diff)
downloadchrome-ec-1aa97a5b62acf1b3a6bad23331cae1c7e4fbea5b.tar.gz
zephyr: drivers: set ADC value in temp_sensor test
Set correct emulated ADC value at the end of the temp_sensor test. There is task that periodically check temperature sensor value. If ADC is left in incorrect state then it will generate following error message: E: failed to read channel 0 (err -22) This message shuldn't appear after temp_sensor test suite. BUG=none BRANCH=none TEST=run zmake drivers test Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I6d0148714c82f380ec1ec3dd86bc1ecd20642ba5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3055494 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'zephyr/test')
-rw-r--r--zephyr/test/drivers/src/temp_sensor.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/zephyr/test/drivers/src/temp_sensor.c b/zephyr/test/drivers/src/temp_sensor.c
index 7cfc40b9d5..83a343e572 100644
--- a/zephyr/test/drivers/src/temp_sensor.c
+++ b/zephyr/test/drivers/src/temp_sensor.c
@@ -112,6 +112,13 @@ static void test_temp_sensor_read(void)
check_valid_temperature(adc_dev, TEMP_SENSOR_DDR_SOC);
check_valid_temperature(adc_dev, TEMP_SENSOR_FAN);
check_valid_temperature(adc_dev, TEMP_SENSOR_PP3300_REGULATOR);
+
+ /* Return correct value on all ADC channels */
+ for (chan = 0; chan < ADC_CHANNELS_NUM; chan++) {
+ zassert_ok(adc_emul_const_value_set(adc_dev, chan, 1000),
+ "channel %d adc_emul_const_value_set() failed",
+ chan);
+ }
}
void test_suite_temp_sensor(void)