From 4488c476a173378cff485353f666652be3946962 Mon Sep 17 00:00:00 2001 From: Abe Levkoy Date: Fri, 30 Sep 2022 16:18:09 -0600 Subject: TCPM: Restrict Google alt mode to TCPMv1 TCPMv2 does not support entering Google alt mode, so restrict the code that supports composing Google VDMs to TCPMv1. BUG=b:250015035 TEST=Attach hoho to voxel; observe no Google alt mode traffic BRANCH=none LOW_COVERAGE_REASONE=TCPMv1 is deprecated. Signed-off-by: Abe Levkoy Change-Id: I463c396ed9f1da913eb54d519aa7acd4b64e4bda Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3931182 Reviewed-by: Diana Z --- common/usb_pd_alt_mode_dfp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/usb_pd_alt_mode_dfp.c b/common/usb_pd_alt_mode_dfp.c index 45a47ed9a5..dc8543c920 100644 --- a/common/usb_pd_alt_mode_dfp.c +++ b/common/usb_pd_alt_mode_dfp.c @@ -1041,6 +1041,7 @@ __overridable void svdm_exit_dp_mode(int port) #endif } +#ifdef CONFIG_USB_PD_TCPMV1 __overridable int svdm_enter_gfu_mode(int port, uint32_t mode_caps) { /* Always enter GFU mode */ @@ -1070,6 +1071,7 @@ __overridable int svdm_gfu_attention(int port, uint32_t *payload) { return 0; } +#endif /* CONFIG_USB_PD_TCPMV1 */ #ifdef CONFIG_USB_PD_TBT_COMPAT_MODE __overridable int svdm_tbt_compat_enter_mode(int port, uint32_t mode_caps) @@ -1111,7 +1113,7 @@ const struct svdm_amode_fx supported_modes[] = { .attention = &svdm_dp_attention, .exit = &svdm_exit_dp_mode, }, - +#ifdef CONFIG_USB_PD_TCPMV1 { .svid = USB_VID_GOOGLE, .enter = &svdm_enter_gfu_mode, @@ -1120,6 +1122,7 @@ const struct svdm_amode_fx supported_modes[] = { .attention = &svdm_gfu_attention, .exit = &svdm_exit_gfu_mode, }, +#endif /* CONFIG_USB_PD_TCPMV1 */ #ifdef CONFIG_USB_PD_TBT_COMPAT_MODE { .svid = USB_VID_INTEL, -- cgit v1.2.1