summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian J. Nemec <bnemec@chromium.org>2020-12-22 06:25:49 -0800
committerCommit Bot <commit-bot@chromium.org>2020-12-23 00:15:32 +0000
commita2721a2e518b93d6bf0041dc85be985bd211505a (patch)
treeadc3a94e0499fcdc05a884bbf582c6660c6efa95
parent6815dbc5c1ff98d53fe483f3e336cc0de6c5275d (diff)
downloadchrome-ec-a2721a2e518b93d6bf0041dc85be985bd211505a.tar.gz
USB: Remove DTS identification from USB PD polarity
We've added differentiation for DTS polarity and normal device polarity. These values were being passed to the pd[port].polarity fields. This creates problems for the usb_pd_config.h files which operate on the assumption that polarity is a boolean value of 0 or 1. In the case of ternary blocks that follow the format of: 'polarity ? A | B', if polarity is 'POLARITY_CC1_DTS = 2' we are incorrectly identifying it as flipped. Other usages like Servo_v4 which have lookup arrays like: tx_gpio[port][polarity]. In these cases, the DTS polarities point to garbage memory and generate hard-faults. BRANCH=none BUG=b:176154334 TEST=Connect to servo console and run 'cc snkdts' Validate that the servo did not hard-fault, instead loads a valid configuration. Signed-off-by: Brian Nemec <bnemec@chromium.org> Change-Id: If5ed079fee9e91dbf291e1f210762c298948ad1e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600657 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
-rw-r--r--driver/tcpm/stub.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/driver/tcpm/stub.c b/driver/tcpm/stub.c
index 399676cf5c..db2b272048 100644
--- a/driver/tcpm/stub.c
+++ b/driver/tcpm/stub.c
@@ -65,7 +65,7 @@ int tcpm_set_cc(int port, int pull)
int tcpm_set_polarity(int port, enum tcpc_cc_polarity polarity)
{
- return tcpc_set_polarity(port, polarity);
+ return tcpc_set_polarity(port, polarity_rm_dts(polarity));
}
int tcpm_set_vconn(int port, int enable)