diff options
-rw-r--r-- | zephyr/test/drivers/src/tcpci.c | 5 | ||||
-rw-r--r-- | zephyr/test/drivers/src/tcpci_test_common.c | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/zephyr/test/drivers/src/tcpci.c b/zephyr/test/drivers/src/tcpci.c index be38711307..cdc13861ab 100644 --- a/zephyr/test/drivers/src/tcpci.c +++ b/zephyr/test/drivers/src/tcpci.c @@ -295,8 +295,9 @@ static void test_generic_tcpci_mux_init(void) zassert_equal(EC_ERROR_TIMEOUT, tcpci_tcpm_mux_init(tcpci_usb_mux), NULL); - /* Set correct power status for rest of the test */ - tcpci_emul_set_reg(emul, TCPC_REG_POWER_STATUS, 0); + /* Set default power status for rest of the test */ + tcpci_emul_set_reg(emul, TCPC_REG_POWER_STATUS, + TCPC_REG_POWER_STATUS_VBUS_DET); /* Test fail on alert mask write fail */ i2c_common_emul_set_write_fail_reg(i2c_emul, TCPC_REG_ALERT_MASK); diff --git a/zephyr/test/drivers/src/tcpci_test_common.c b/zephyr/test/drivers/src/tcpci_test_common.c index 525c64085e..a2925bf3be 100644 --- a/zephyr/test/drivers/src/tcpci_test_common.c +++ b/zephyr/test/drivers/src/tcpci_test_common.c @@ -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); |