From 8d0f74ea314e98b0cfd1f1722f5615e5831375fd Mon Sep 17 00:00:00 2001 From: Eric Herrmann Date: Wed, 24 Feb 2021 13:24:02 -0800 Subject: TCPMv2: Get SNK Caps after PR_Swap in SNK startup If we support FRS, we should query the SRC sink_capabilities on entry to SNK_Ready. Currently we queue up this when we enter snk_startup, but only when it isn't due to a power role swap. Some devices will change their sink capabilities depending on what their current status is, so we should check again following a power role swap. BUG=b:181156774 TEST=make buildall TEST=Check that get_sink_capabilities message is sent following a SRC->SNK power role swap BRANCH=none Signed-off-by: Eric Herrmann Change-Id: I5f1cbe2b300e8c29bef16336bd7ddfa8f7a8b2c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2718495 Reviewed-by: Nathan Kolluru Reviewed-by: Diana Z --- common/usbc/usb_pe_drp_sm.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index 3c17a17d4d..aa0cc2dfff 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -3031,10 +3031,16 @@ static void pe_snk_startup_entry(int port) */ PE_SET_FLAG(port, PE_FLAGS_DR_SWAP_TO_DFP); PE_SET_FLAG(port, PE_FLAGS_VCONN_SWAP_TO_ON); - - /* Opportunistically request sink caps for FRS evaluation. */ - pd_dpm_request(port, DPM_REQUEST_GET_SNK_CAPS); } + + /* Request sink caps for FRS and PRS evaluation. + * + * On entry to the PE_SNK_Ready state if the Sink supports Fast Role + * Swap, then the Policy Engine Shall do the following: + * - Send a Get_Sink_Cap Message + */ + pd_dpm_request(port, DPM_REQUEST_GET_SNK_CAPS); + } static void pe_snk_startup_run(int port) -- cgit v1.2.1