summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2019-03-06 11:40:27 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2019-04-24 17:06:00 +0000
commitfe20fa8437396f348c78ea71bfe10936593ba1ce (patch)
tree298ef2021a9355cf13ea688ea42a3ca899d78c7b
parentf416f6095a5303befe022911eea05e96da3fce57 (diff)
downloadchrome-ec-fe20fa8437396f348c78ea71bfe10936593ba1ce.tar.gz
USB PD: Re-discover port partner when a contract was in place
When the pd_task starts up with an explicit contract previously in place, re-check the partner's identity. This will happen automatically when we EC reset into RO since pd_chipset_startup sets the flag, but for development systems jumping from RO to RW, it needs to be set as well. The flag doesn't remedy display on all dongles and monitors, but does improve behavior. This should be acceptable, since the scenario won't come up on customer systems which are locked. BUG=b:125552060 BRANCH=octopus TEST=on unlocked octopus board, plugged in powered HDMI dongle and hit refresh+power and confirmed display worked after RO->RW jump Change-Id: Idcde6f04deeb8f409a9b4d0a4b3fc924bdb644c7 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1574377 Commit-Queue: Jett Rink <jettrink@chromium.org>
-rw-r--r--common/usb_pd_protocol.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index e14e0547f4..71c85f5ecd 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -2687,6 +2687,15 @@ void pd_task(void *u)
this_state = PD_STATE_SOFT_RESET;
/*
+ * Re-discover any alternate modes we may have been
+ * using with this port partner. Note this may not work
+ * in all scenarios if the port partner was expecting an
+ * ExitMode before reset, but it does improve how often
+ * alternate modes can work after reset.
+ */
+ pd[port].flags |= PD_FLAGS_CHECK_IDENTITY;
+
+ /*
* Set the TCPC reset event such that we can set our CC
* terminations, determine polarity, and enable RX so we
* can hear back from our port partner.