diff options
author | Tim Wawrzynczak <twawrzynczak@chromium.org> | 2020-01-10 10:44:54 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-10 17:58:40 +0000 |
commit | 7681e548c10740ed6007103c7ad364d7f71d4d12 (patch) | |
tree | 8eab18720ff6d5bb3094a5542bde217a0bb3898f | |
parent | 573dcb571abebb5973e7a2d4be5aebbc259e73a4 (diff) | |
download | chrome-ec-7681e548c10740ed6007103c7ad364d7f71d4d12.tar.gz |
TCPCI: Follow spec, as done in ToT.
When cherry-picking TCPCI changes (b560141a1d, "tcpci: Only drive one CC line
when attached"), these lines were missed.
BUG=b:147472779, b:147467932, b:147460975
BRANCH=firmware-hatch-12672.B only
TEST=buildall
Change-Id: I1205b21cf5235fc96c5c0299a1eed87f5de424b7
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1995453
-rw-r--r-- | driver/tcpm/tcpci.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c index 32add02f73..c9b50445e3 100644 --- a/driver/tcpm/tcpci.c +++ b/driver/tcpm/tcpci.c @@ -414,6 +414,20 @@ int tcpci_enter_low_power_mode(int port) int tcpci_tcpm_set_polarity(int port, enum tcpc_cc_polarity polarity) { + int rv; + + /* + * TCPCI sets the CC lines based on polarity. If it is set to + * no connection then both CC lines are driven, otherwise only + * one is driven. + */ + rv = tcpm_set_cc(port, tcpci_get_cached_pull(port)); + if (rv) + return rv; + + if (polarity == POLARITY_NONE) + return EC_SUCCESS; + return tcpc_update8(port, TCPC_REG_TCPC_CTRL, TCPC_REG_TCPC_CTRL_SET(1), |