summaryrefslogtreecommitdiff
path: root/common/usb_pd_protocol.c
diff options
context:
space:
mode:
authorYilun Lin <yllin@google.com>2018-10-01 10:06:32 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-10-01 15:38:29 -0700
commitb729f9f10151438a86779d6c939b86572c0c1cda (patch)
treed1bfb8a84cebacb283feae5877a0a3e4147fd3df /common/usb_pd_protocol.c
parentc5b582b7b7496a14e769b069ca5700d0628daa4f (diff)
downloadchrome-ec-b729f9f10151438a86779d6c939b86572c0c1cda.tar.gz
pd: Fix auto-toggle set PD_FLAGS_LPM_REQUESTED when not in LPM.
CL:1194349 sets the PD_FLAGS_LPM_REQUESTED while doing clean-up. The flag setting should be guarded by CONFIG_USB_PD_TCPC_LOW_POWER. TEST=on kukui: plug charger, unplug charger, and see tcpc auto-toggling TEST=on kukui: plug sink device, and see it is powered. BUG=b:111663127, b:116269457 BRANCH=None Change-Id: I788e439f5f82e1a3127de412606ef9f1b741e2c8 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1253366 Commit-Ready: Jett Rink <jettrink@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'common/usb_pd_protocol.c')
-rw-r--r--common/usb_pd_protocol.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index e557f254e9..e401d07b25 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -3893,7 +3893,9 @@ void pd_task(void *u)
*/
if (drp_state[port] == PD_DRP_TOGGLE_ON)
tcpm_enable_drp_toggle(port);
+#ifdef CONFIG_USB_PD_TCPC_LOW_POWER
pd[port].flags |= PD_FLAGS_LPM_REQUESTED;
+#endif
pd[port].flags |= PD_FLAGS_TCPC_DRP_TOGGLE;
timeout = -1;
}