summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorDenis Brockus <dbrockus@google.com>2020-05-15 11:07:05 -0600
committerCommit Bot <commit-bot@chromium.org>2020-05-19 00:43:42 +0000
commit8367dadb445d99a407f3f8e943c8971b9c3bc947 (patch)
treefdf879795240e642f650df56c1b5282d8c25f441 /driver
parent26dfe4442eb06ef1c3e60b47fbf2065c095de824 (diff)
downloadchrome-ec-8367dadb445d99a407f3f8e943c8971b9c3bc947.tar.gz
tcpci: cache rx_en on disables as well as enables
The rx_en cache was only getting set when we were enabling. This causes RX to be re-enabled at the wrong times when we should not be allowing messages BUG=none BRANCH=none TEST=verify SNK HardReset does not require partner to reset us Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I886055c1f4e030e629cbc56d756f65186eff7672 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2202563 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/tcpm/tcpci.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c
index 3ec12e9860..d45b1323c4 100644
--- a/driver/tcpm/tcpci.c
+++ b/driver/tcpm/tcpci.c
@@ -617,13 +617,15 @@ int tcpci_tcpm_set_rx_enable(int port, int enable)
{
int detect_sop_en = 0;
+#ifdef CONFIG_USB_PD_DECODE_SOP
+ /* save rx_on */
+ rx_en[port] = enable;
+#endif
+
if (enable) {
detect_sop_en = TCPC_REG_RX_DETECT_SOP_HRST_MASK;
#ifdef CONFIG_USB_PD_DECODE_SOP
- /* save rx_on */
- rx_en[port] = enable;
-
/*
* Only the VCONN Source is allowed to communicate
* with the Cable Plugs.