summaryrefslogtreecommitdiff
path: root/zephyr/test/drivers/src/tcpci_test_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/test/drivers/src/tcpci_test_common.c')
-rw-r--r--zephyr/test/drivers/src/tcpci_test_common.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/zephyr/test/drivers/src/tcpci_test_common.c b/zephyr/test/drivers/src/tcpci_test_common.c
index 57cc35b89c..a2925bf3be 100644
--- a/zephyr/test/drivers/src/tcpci_test_common.c
+++ b/zephyr/test/drivers/src/tcpci_test_common.c
@@ -8,7 +8,7 @@
#include "common.h"
#include "emul/emul_common_i2c.h"
-#include "emul/emul_tcpci.h"
+#include "emul/tcpc/emul_tcpci.h"
#include "tcpci_test_common.h"
#include "tcpm/tcpci.h"
@@ -57,7 +57,8 @@ void test_tcpci_init(const struct emul *emul, enum usbc_port port)
TCPC_REG_ALERT_FAULT | TCPC_REG_ALERT_POWER_STATUS;
/* Set TCPCI emulator VBUS to safe0v (disconnected) */
- tcpci_emul_set_reg(emul, TCPC_REG_POWER_STATUS, 0);
+ tcpci_emul_set_reg(emul, TCPC_REG_POWER_STATUS,
+ TCPC_REG_POWER_STATUS_VBUS_DET);
/* Test init with VBUS safe0v without vSafe0V tcpc config flag */
zassert_equal(EC_SUCCESS, drv->init(port), NULL);
@@ -69,7 +70,8 @@ void test_tcpci_init(const struct emul *emul, enum usbc_port port)
/* Set TCPCI emulator VBUS to present (connected, above 4V) */
tcpci_emul_set_reg(emul, TCPC_REG_POWER_STATUS,
- TCPC_REG_POWER_STATUS_VBUS_PRES);
+ TCPC_REG_POWER_STATUS_VBUS_PRES |
+ TCPC_REG_POWER_STATUS_VBUS_DET);
/* Test init with VBUS present without vSafe0V tcpc config flag */
zassert_equal(EC_SUCCESS, drv->init(port), NULL);
@@ -92,7 +94,8 @@ void test_tcpci_init(const struct emul *emul, enum usbc_port port)
check_tcpci_reg(emul, TCPC_REG_ALERT_MASK, exp_mask);
/* Set TCPCI emulator VBUS to safe0v (disconnected) */
- tcpci_emul_set_reg(emul, TCPC_REG_POWER_STATUS, 0);
+ tcpci_emul_set_reg(emul, TCPC_REG_POWER_STATUS,
+ TCPC_REG_POWER_STATUS_VBUS_DET);
tcpci_emul_set_reg(emul, TCPC_REG_EXT_STATUS,
TCPC_REG_EXT_STATUS_SAFE0V);