diff options
author | Abe Levkoy <alevkoy@chromium.org> | 2020-04-28 23:49:45 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-12 01:03:10 +0000 |
commit | 38a2b2521ac066d24a7a5ba85ab17112a60abe0e (patch) | |
tree | 4df0d6a83ba229b2319baf5c3101385305601d46 /common/usbc | |
parent | ce9f19e3a7f11762773ccad77acbe90703f3b836 (diff) | |
download | chrome-ec-38a2b2521ac066d24a7a5ba85ab17112a60abe0e.tar.gz |
TCPMv2: Discover cable plug SVIDs
Enter PE_INIT_VDM_SVIDs_Request with transmit type SOP', following cable
cable-plug (SOP') identity discovery.
BUG=b:152420269,b:152419795
TEST=Attach port partner via cable; TCPM sends SOP' SVIDs Request, then
TEST=continues with enter-mode process.
BRANCH=none
Change-Id: Icaf08e0849380bd48ae1a6eec32fa22eb4ac470f
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2174467
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'common/usbc')
-rw-r--r-- | common/usbc/usb_pe_drp_sm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index d144f07ba7..1560eee817 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -1304,6 +1304,12 @@ static bool pe_attempt_port_discovery(int port) pe[port].tx_type = TCPC_TX_SOP; set_state_pe(port, PE_INIT_VDM_MODES_REQUEST); return true; + } else if (pd_get_svids_discovery(port, TCPC_TX_SOP_PRIME) + == PD_DISC_NEEDED && + pe_can_send_sop_prime(port)) { + pe[port].tx_type = TCPC_TX_SOP_PRIME; + set_state_pe(port, PE_INIT_VDM_SVIDS_REQUEST); + return true; /* * Note: determine if next VDM can be sent by taking advantage * of discovery following the VDM command enum ordering. @@ -4356,6 +4362,10 @@ static void pe_vdm_identity_request_cbl_exit(int port) && pe[port].discover_identity_timer > get_time().val) pe[port].discover_identity_timer = get_time().val + PD_T_DISCOVER_IDENTITY; + + /* Do not attempt further discovery if identity discovery failed. */ + if (pd_get_identity_discovery(port, TCPC_TX_SOP_PRIME) == PD_DISC_FAIL) + pd_set_svids_discovery(port, TCPC_TX_SOP_PRIME, PD_DISC_FAIL); } /** |