summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2015-10-27 14:14:49 -0700
committerChromeOS bot <3su6n15k.default@developer.gserviceaccount.com>2015-10-28 19:10:16 +0000
commitf4e9a84cb0b0e2b29dea32f8c1990db54b77faf0 (patch)
tree2ad899e5ff24bf5a6715fc9eb099cebfb2d11e47
parent659d826b4efcd391eced3d4dda319d502d028457 (diff)
downloadchrome-ec-f4e9a84cb0b0e2b29dea32f8c1990db54b77faf0.tar.gz
pd: fix PD polling in S5
Fix the condition to decide the CC polling delay in the USB PD state machine. In S3, 'drp_state' is PD_DRP_TOGGLE_OFF (ie we do not toggle but still provide power to sink/UFP), while in S5 'drp_state' is PD_DRP_FORCE_SINK (never behaves as a source). We need to do slow polling in both of those cases. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=smaug BUG=none TEST=measure power consumption in S5 on Ryu. Change-Id: I4654a30f62d660e5a20ff27dca917f615e891996 Reviewed-on: https://chromium-review.googlesource.com/309604 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--common/usb_pd_protocol.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index d02bed0ffa..4c4ad4b40d 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -1860,8 +1860,8 @@ void pd_task(void)
break;
case PD_STATE_SNK_DISCONNECTED:
#ifdef CONFIG_USB_PD_LOW_POWER
- timeout = drp_state == PD_DRP_TOGGLE_OFF ? MINUTE
- : 10*MSEC;
+ timeout = drp_state != PD_DRP_TOGGLE_ON ? MINUTE
+ : 10*MSEC;
#else
timeout = 10*MSEC;
#endif