summaryrefslogtreecommitdiff
path: root/zephyr/test/drivers/default/src/integration/usbc/usb_pd_bist_shared.c
diff options
context:
space:
mode:
authorTomasz Michalec <tm@semihalf.com>2022-08-17 12:39:59 +0200
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-23 08:43:51 +0000
commit65a0a284ff509b0562272f9b8847df8b95ad96f9 (patch)
treed037433c607b9a264368a272381229a5bdb8f672 /zephyr/test/drivers/default/src/integration/usbc/usb_pd_bist_shared.c
parent368d14b56120be390059b4218ce34c8176896732 (diff)
downloadchrome-ec-65a0a284ff509b0562272f9b8847df8b95ad96f9.tar.gz
zephyr: test: Get charger emulator from named usbc node
Some tests require to get emulator of given chip type for specific USBC port, not exact emulator chosen by DT node label. To allow that, EMUL_GET_USBC_BINDING macro is introduced and used to get charger emulator across tests. BUG=None TEST=./twister -T zephyr/test/drivers BRANCH=None Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I82ce23529b489afbd7eb3dffb1c873454f555ac3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3835566 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
Diffstat (limited to 'zephyr/test/drivers/default/src/integration/usbc/usb_pd_bist_shared.c')
-rw-r--r--zephyr/test/drivers/default/src/integration/usbc/usb_pd_bist_shared.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/zephyr/test/drivers/default/src/integration/usbc/usb_pd_bist_shared.c b/zephyr/test/drivers/default/src/integration/usbc/usb_pd_bist_shared.c
index cc30537bb7..7f55f54c29 100644
--- a/zephyr/test/drivers/default/src/integration/usbc/usb_pd_bist_shared.c
+++ b/zephyr/test/drivers/default/src/integration/usbc/usb_pd_bist_shared.c
@@ -32,8 +32,7 @@ static void *usb_pd_bist_shared_setup(void)
/* Get references for the emulators */
test_fixture.tcpci_emul =
emul_get_binding(DT_LABEL(DT_NODELABEL(tcpci_emul)));
- test_fixture.charger_emul =
- emul_get_binding(DT_LABEL(DT_NODELABEL(isl923x_emul)));
+ test_fixture.charger_emul = EMUL_GET_USBC_BINDING(0, chg);
test_fixture.tcpci_ps8xxx_emul =
emul_get_binding(DT_LABEL(DT_NODELABEL(ps8xxx_emul)));