From f4e9a84cb0b0e2b29dea32f8c1990db54b77faf0 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Tue, 27 Oct 2015 14:14:49 -0700 Subject: 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 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 Reviewed-by: Alec Berg Commit-Queue: Vincent Palatin --- common/usb_pd_protocol.c | 4 ++-- 1 file 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 -- cgit v1.2.1