summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@chromium.org>2019-02-28 11:30:00 -0700
committerCommit Bot <commit-bot@chromium.org>2019-08-18 03:26:44 +0000
commitd7863633e30529051424d27382e3539e361655f1 (patch)
tree3f66583858db6d3306296ac033366316a27afba2
parent01d8a87b39171095c8cf34ad28e27ba67aa99266 (diff)
downloadchrome-ec-d7863633e30529051424d27382e3539e361655f1.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> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1692380 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org> Tested-by: Zhuohao Lee <zhuohao@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 82141d1cf9..9c63a753da 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -2579,6 +2579,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