summaryrefslogtreecommitdiff
path: root/test/usb_typec_drp_acc_trysrc.c
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2020-03-31 13:44:28 -0600
committerJett Rink <jettrink@chromium.org>2020-04-03 17:06:28 +0000
commit736db12af829d826f0a1247b6a787fcc56d2b060 (patch)
tree044e90f6837e797f9f495cf005bfb1a4b35d1df7 /test/usb_typec_drp_acc_trysrc.c
parenta08de50a749ab4ec09ad2b7b32b1605f49d8a5c6 (diff)
downloadchrome-ec-736db12af829d826f0a1247b6a787fcc56d2b060.tar.gz
tcpmv2: move function from TC layer to PE
- Move pd_ function that belong in PE layer to PE layer. Remove the extra pe_ layer. - Remove unnecessary PE and Vconn ifdef guards in TC layer - Remove unused print_dev_info function - Move host commands in TC layer to host command file - Move RW hash stuff from TC to PE, since this only has to do with VDO (Which is a PE layer thing) - Removed dependency for tc_drp test on usbc_fake as we don't really need it anymore once we don't pull in the PRL and PE layers anymore (based on previously landed CLs) BRANCH=none BUG=b:153071799 TEST=everything still builds and passes tests Change-Id: Id1d1efa291c3525f57bc26af9fddda6ddace1b58 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2132871
Diffstat (limited to 'test/usb_typec_drp_acc_trysrc.c')
-rw-r--r--test/usb_typec_drp_acc_trysrc.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/test/usb_typec_drp_acc_trysrc.c b/test/usb_typec_drp_acc_trysrc.c
index 6957cb6093..5711334a1b 100644
--- a/test/usb_typec_drp_acc_trysrc.c
+++ b/test/usb_typec_drp_acc_trysrc.c
@@ -17,6 +17,29 @@
#define PORT0 0
+/* TODO(b/153071799): Move these pd_* and pe_* function into mock */
+__overridable void pd_request_power_swap(int port)
+{}
+
+uint8_t pd_get_src_cap_cnt(int port)
+{
+ return 0;
+}
+
+const uint32_t * const pd_get_src_caps(int port)
+{
+ return NULL;
+}
+
+void pd_set_src_caps(int port, int cnt, uint32_t *src_caps)
+{
+}
+
+__overridable void pe_invalidate_explicit_contract(int port)
+{
+}
+/* End pd_ mock section */
+
/* Install Mock TCPC and MUX drivers */
const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
{
@@ -81,9 +104,11 @@ __maybe_unused static int test_mux_con_dis_as_snk(void)
/* This wait will go through AttachWait.SNK to Attached.SNK */
task_wait_event(5 * SECOND);
- /* We are in Attached.SNK now */
- TEST_EQ(mock_usb_mux.state, USB_PD_MUX_USB_ENABLED, "%d");
- TEST_EQ(mock_usb_mux.num_set_calls, 1, "%d");
+ /*
+ * We are in Attached.SNK now, but the port partner isn't data capable
+ * so we should not connect the USB data mux.
+ */
+ TEST_EQ(mock_usb_mux.state, USB_PD_MUX_NONE, "%d");
mock_tcpc.cc1 = TYPEC_CC_VOLT_OPEN;
mock_tcpc.cc2 = TYPEC_CC_VOLT_OPEN;