diff options
author | Abe Levkoy <alevkoy@chromium.org> | 2021-09-01 12:15:29 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-15 22:42:36 +0000 |
commit | f47bf498f741c04bdfdd6b961f4e579f34279096 (patch) | |
tree | ef18a5d94244b37c6f7316fe495e5b79e45a326e /zephyr/include | |
parent | d7884389d0c8d4c29719cf75a1efc3ca3fc02bf7 (diff) | |
download | chrome-ec-f47bf498f741c04bdfdd6b961f4e579f34279096.tar.gz |
zephyr: Test SYV682 5V_OC interrupt handling
Simulate a 5V OC condition and verify that the driver turns VBUS off.
Support status interrupt conditions and clear-on-read registers in
SYV682x emulator.
Increase line coverage of syv682x.c from 37.9% to 52.8%.
BUG=b:190519131
TEST=zmake -l DEBUG configure --test zephyr/test/drivers
BRANCH=none
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: I9c5b419057cf4ccb1531527a71760533240d1f47
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3059218
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'zephyr/include')
-rw-r--r-- | zephyr/include/emul/emul_syv682x.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/zephyr/include/emul/emul_syv682x.h b/zephyr/include/emul/emul_syv682x.h index 9fec144aa0..aa0d8840f7 100644 --- a/zephyr/include/emul/emul_syv682x.h +++ b/zephyr/include/emul/emul_syv682x.h @@ -12,6 +12,7 @@ #define __EMUL_SYV682X_H #include <drivers/i2c_emul.h> +#include <stdint.h> /* Register info copied from syv682.h */ @@ -109,6 +110,15 @@ struct i2c_emul *syv682x_emul_get(int ord); /** + * @brief Set the underlying interrupt conditions affecting the status register + * + * @param emul SYV682x emulator + * @param val A status register value corresponding to the underlying + * conditions + */ +void syv682x_emul_set_status(struct i2c_emul *emul, uint8_t val); + +/** * @brief Set value of a register of SYV682x * * @param emul SYV682x emulator |