summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@chromium.org>2019-02-28 11:30:00 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-03-01 23:41:45 -0800
commitaef2f9d7910ce9309340993be1b22331bedc4bd8 (patch)
tree28bf7d39b937721c257b93dd7c2cfa31e5f5000d
parent5bc9bd321c07175ebfa0166df4d207428e1c276e (diff)
downloadchrome-ec-aef2f9d7910ce9309340993be1b22331bedc4bd8.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>
-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 d4f6be79b0..ee60a70381 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -2653,6 +2653,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