summaryrefslogtreecommitdiff
path: root/zephyr/test
diff options
context:
space:
mode:
authorKornel Dulęba <korneld@google.com>2023-03-13 09:29:22 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-15 09:19:37 +0000
commit1fb66a343d42b8829823d3d3ae6bc4ccd390ff41 (patch)
tree126ac4f0f989ceb9630438993b407f83b22ec722 /zephyr/test
parentcfe834c45efaf97632abc49102852c4c3575b380 (diff)
downloadchrome-ec-1fb66a343d42b8829823d3d3ae6bc4ccd390ff41.tar.gz
skyrim: Validate usb port number in ppc_config
On skyrim only port0 is supported in current limiter logic. Add a check to verify that. Update the test accordingly BUG=b:267205976 TEST=./twister -i -T zephyr/test/skyrim BRANCH=none Change-Id: I04d5cd68ff99b72b0fa4884cbb3b09849f61407e Signed-off-by: Kornel Dulęba <korneld@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4334556 Reviewed-by: Robert Zieba <robertzieba@google.com>
Diffstat (limited to 'zephyr/test')
-rw-r--r--zephyr/test/skyrim/tests/common/src/ppc_config.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/zephyr/test/skyrim/tests/common/src/ppc_config.c b/zephyr/test/skyrim/tests/common/src/ppc_config.c
index 0721e9c313..ca759fa66a 100644
--- a/zephyr/test/skyrim/tests/common/src/ppc_config.c
+++ b/zephyr/test/skyrim/tests/common/src/ppc_config.c
@@ -42,6 +42,10 @@ ZTEST(ppc_config, board_aoz1380_set_vbus_source_current_limit)
rv = board_aoz1380_set_vbus_source_current_limit(0, TYPEC_RP_1A5);
zassert_equal(rv, EC_SUCCESS);
zassert_equal(gpio_emul_output_get(gpio->port, gpio->pin), 0);
+
+ /* Only port0 is supported. */
+ rv = board_aoz1380_set_vbus_source_current_limit(1, TYPEC_RP_1A5);
+ zassert_equal(rv, EC_ERROR_INVAL);
}
ZTEST(ppc_config, ppc_interrupt)