diff options
author | Caveh Jalali <caveh@chromium.org> | 2019-10-31 21:40:10 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-01 04:59:05 +0000 |
commit | f21ba2ec6940758e49bff5b0bd78d148a7026a53 (patch) | |
tree | 3477b12f42280ef809a8321d2ffaed96dda1d7c1 | |
parent | 26851fdbb5b1b56f4e5ad1ec9385edcaed28937a (diff) | |
download | chrome-ec-f21ba2ec6940758e49bff5b0bd78d148a7026a53.tar.gz |
usb_pd_protocol: set CC termination on PD resume
we need to set the CC termination back to their default value on PD
resume. without this, we ended up toggling between SNK_DISCONNECTED
and SNK_DISCONNECTED_DEBOUNCE when there's something plugged in.
this is a partial cherry-pick of
https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1650484
BUG=b:143330980
BRANCH=atlas
TEST="ectool pdcontrol resume 1" now works
Change-Id: I41f65b5b78eeb5316556b286f1995c8776acb746
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1894802
Reviewed-by: Caveh Jalali <caveh@google.com>
Commit-Queue: Caveh Jalali <caveh@google.com>
-rw-r--r-- | common/usb_pd_protocol.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 5a304eb5c2..fe7d481546 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -3566,6 +3566,11 @@ void pd_task(void *u) CPRINTS("TCPC p%d restart failed!", port); break; } + /* Set the CC termination and state back to default */ + tcpm_set_cc(port, + PD_ROLE_DEFAULT(port) == PD_ROLE_SOURCE ? + TYPEC_CC_RP : + TYPEC_CC_RD); set_state(port, PD_DEFAULT_STATE(port)); CPRINTS("TCPC p%d resumed!", port); #endif |