From c069177ccc29b4373d5587e1dcea966aeee0a856 Mon Sep 17 00:00:00 2001 From: Keith Short Date: Thu, 27 Aug 2020 14:51:41 -0600 Subject: tcpmv2: disable receive of SOP' during VCONN swap The USB PD specification indicates that the initial VCONN source shall cease source VCONN within tVCONNSourceOff (25 ms) after receiving PS_RDY. Not all partners wait after sending PS_RDY before trying to communicate with the cable. BUG=b:163478172, b:163143427 BRANCH=none TEST=make buildall TEST=Connect 2 Volteers together and force VCONN swaps confirming the sequence completes normally. Signed-off-by: Keith Short Change-Id: I14720f033c5f6e9caed9c4fe3bfa11e5c046116e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2381030 Reviewed-by: Denis Brockus Commit-Queue: Denis Brockus --- include/usb_pd_tcpm.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h index bccea184e4..d6f89553fc 100644 --- a/include/usb_pd_tcpm.h +++ b/include/usb_pd_tcpm.h @@ -245,6 +245,19 @@ struct tcpm_drv { */ int (*set_polarity)(int port, enum tcpc_cc_polarity polarity); +#ifdef CONFIG_USB_PD_DECODE_SOP + /** + * Disable receive of SOP' and SOP'' messages. This is provided + * separately from set_vconn so that we can preemptively disable + * receipt of SOP' messages during a VCONN swap. + * + * @param port Type-C port number + * + * @return EC_SUCCESS or error + */ + int (*sop_prime_disable)(int port); +#endif + /** * Set Vconn. * -- cgit v1.2.1