summaryrefslogtreecommitdiff
path: root/fuzz
diff options
context:
space:
mode:
authorEric Herrmann <eherrmann@chromium.org>2021-03-03 12:32:59 -0800
committerCommit Bot <commit-bot@chromium.org>2021-03-04 00:35:27 +0000
commit8fffb7f40b72742551a343209a97a7a9add6a827 (patch)
tree7c98297003a29e66a730c10f109ad06a534b40be /fuzz
parent8be85441500e7b44daaeafeb138383e7ac656062 (diff)
downloadchrome-ec-8fffb7f40b72742551a343209a97a7a9add6a827.tar.gz
TCPMv1/v2: Move SOP' enabling to tcpm_set_vconn
Currently SOP' enabling is done as part of the TCPCI driver when vconn is set - however if we aren't using VCONN from the TCPC, we need to enable SOP' separately. So, instead of enabling it in the TCPCI driver, enable it in the general TCPM set VCONN function. BUG=b:181692098,b:181691263,b:173459141 TEST=Make sure cable discovery works TEST=make buildall BRANCH=None Signed-off-by: Eric Herrmann <eherrmann@chromium.org> Change-Id: Iecc06760f2b8af588c427b9565c6aa31ee719edf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2733574 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'fuzz')
-rw-r--r--fuzz/usb_pd_fuzz.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fuzz/usb_pd_fuzz.c b/fuzz/usb_pd_fuzz.c
index 89babff09b..205360015a 100644
--- a/fuzz/usb_pd_fuzz.c
+++ b/fuzz/usb_pd_fuzz.c
@@ -36,6 +36,11 @@ static int mock_tcpm_set_polarity(int port, enum tcpc_cc_polarity polarity)
return EC_SUCCESS;
}
+static __maybe_unused int mock_tcpm_sop_prime_enable(int port, bool enable)
+{
+ return EC_SUCCESS;
+}
+
static int mock_tcpm_set_vconn(int port, int enable) { return EC_SUCCESS; }
static int mock_tcpm_set_msg_header(int port,
int power_role, int data_role) { return EC_SUCCESS; }
@@ -131,6 +136,9 @@ static const struct tcpm_drv mock_tcpm_drv = {
.select_rp_value = &mock_tcpm_select_rp_value,
.set_cc = &mock_tcpm_set_cc,
.set_polarity = &mock_tcpm_set_polarity,
+#ifdef CONFIG_USB_PD_DECODE_SOP
+ .sop_prime_enable = &mock_tcpm_sop_prime_enable,
+#endif
.set_vconn = &mock_tcpm_set_vconn,
.set_msg_header = &mock_tcpm_set_msg_header,
.set_rx_enable = &mock_tcpm_set_rx_enable,