summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@chromium.org>2019-02-28 11:30:00 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2019-03-02 18:02:05 +0000
commit6d766c5f591755cdd90c0d910a3ffe1e37871d0e (patch)
tree5825c1fa2d52092c12afaebec90c715c749303ce
parent31a616837c4f30da50e03e49d56fa2b1f2adff70 (diff)
downloadchrome-ec-6d766c5f591755cdd90c0d910a3ffe1e37871d0e.tar.gz
common/usb_pd_protocol: Set port in LPM at the start of init
During initialization, PD ports are not marked as in Low Power Mode. This causes other tasks not to wait before the TCPC is initialized leading to invalid state information. Set the ports as in Low Power Mode at the start of initialization, so that other tasks wait until the TCPC is initialized and ready. BUG=chromium:934332, b:124131293 BRANCH=octopus TEST=Ensure that the system boots to ChromeOS. Ensure that the device detects the USB stick attached to servo v4 at recovery mode with or without the power pass through and boots from it. Change-Id: Id4963fc0540ab092bb5be20cada64fe34a9272de Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://chromium-review.googlesource.com/1492531 Commit-Ready: Karthikeyan Ramasubramanian <kramasub@chromium.org> Tested-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> (cherry picked from commit aef2f9d7910ce9309340993be1b22331bedc4bd8) Reviewed-on: https://chromium-review.googlesource.com/c/1497913 Reviewed-by: Justin TerAvest <teravest@chromium.org> Commit-Queue: Justin TerAvest <teravest@chromium.org> Tested-by: Justin TerAvest <teravest@chromium.org> Trybot-Ready: Justin TerAvest <teravest@chromium.org>
-rw-r--r--common/usb_pd_protocol.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 6923fd5733..a4ed713499 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -2613,6 +2613,14 @@ void pd_task(void *u)
int snk_cap_count = 0;
int evt;
+#ifdef CONFIG_USB_PD_TCPC_LOW_POWER
+ /*
+ * Set the ports in Low Power Mode so that other tasks wait until
+ * TCPC is initialized and ready.
+ */
+ pd[port].flags |= PD_FLAGS_LPM_ENGAGED;
+#endif
+
#ifdef CONFIG_COMMON_RUNTIME
pd_init_tasks();
#endif