diff options
author | Wai-Hong Tam <waihong@google.com> | 2022-08-18 14:43:37 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-08-19 23:53:26 +0000 |
commit | 9f012dc430157b6aaf20af3cd51c371bd8131976 (patch) | |
tree | dbca31205d600adeaee381c7db6c7ef8a784c5a2 /common | |
parent | 3199d3a3aeb1807d8699df8931f6ebb35567e034 (diff) | |
download | chrome-ec-9f012dc430157b6aaf20af3cd51c371bd8131976.tar.gz |
zephyr: test: Add I2C passthru protect host command test cases
Add the test cases for I2C passthru protect. They cover the subcommands:
status, enable, and enable_tcpc. They covers the error cases.
BRANCH=None
BUG=b:236131905
TEST=./twister -s zephyr/test/drivers/drivers.default
Change-Id: I16fe91880265204376477aac60ca8b2ed456c7bf
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3840659
Reviewed-by: Yuval Peress <peress@google.com>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/i2c_controller.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/i2c_controller.c b/common/i2c_controller.c index e04eec6a6c..ee72caa1ef 100644 --- a/common/i2c_controller.c +++ b/common/i2c_controller.c @@ -1358,6 +1358,11 @@ static enum ec_status i2c_command_passthru(struct host_cmd_handler_args *args) } DECLARE_HOST_COMMAND(EC_CMD_I2C_PASSTHRU, i2c_command_passthru, EC_VER_MASK(0)); +__test_only void i2c_passthru_protect_reset(void) +{ + memset(port_protected, 0, sizeof(port_protected)); +} + static void i2c_passthru_protect_port(uint32_t port) { if (port < ARRAY_SIZE(port_protected)) |