summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Herrmann <eherrmann@chromium.org>2021-02-24 13:24:02 -0800
committerCommit Bot <commit-bot@chromium.org>2021-02-25 00:58:21 +0000
commit8d0f74ea314e98b0cfd1f1722f5615e5831375fd (patch)
tree652bd75a9fd6c2716c27cf558e91aa2e2ce4566e
parent7c09def584ff3bccbd5916b02f7ff7da234be13c (diff)
downloadchrome-ec-8d0f74ea314e98b0cfd1f1722f5615e5831375fd.tar.gz
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 <eherrmann@chromium.org> Change-Id: I5f1cbe2b300e8c29bef16336bd7ddfa8f7a8b2c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2718495 Reviewed-by: Nathan Kolluru <nkolluru@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r--common/usbc/usb_pe_drp_sm.c12
1 files 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)