summaryrefslogtreecommitdiff
path: root/common/usb_pd_protocol.c
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-10-27 14:20:03 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-10-30 13:09:32 -0700
commite080de3c488063773c37ac89829996edd5506a49 (patch)
tree8a99d68be177ca50ec6e18a1472dba4dfa2b6061 /common/usb_pd_protocol.c
parent49d4254bd40a81b8f37014400bf5a50e7e581e4d (diff)
downloadchrome-ec-e080de3c488063773c37ac89829996edd5506a49.tar.gz
pd: add more power improvements to PD task
Added more improvements to power consumption when using CONFIG_USB_PD_LOW_POWER. On the TCPC, when this option is defined, then decrease the PD task wake interval when we are presenting Rd, we don't have a connection, AND we haven't dual-role toggled recently. This shouldn't affect connection time because we will get an interrupt when VBUS is detected. Note: we can't use the low power task wake interval when we are connected because we need to monitor CC line for Rp change and we can't do this when we are presenting Rp because we need to quickly detect loss of Rd. BUG=chrome-os-partner:45010 BRANCH=none TEST=tested on glados. verified we connect to a charger in S0 and S5. and verified that in S5, we spend >99% of our time in deepsleep (as measured by idlestats console command). note, that when testing EC and PD must both define CONFIG_USB_PD_LOW_POWER to get maximum power improvements. Change-Id: I661110cc7021f6d17937688787ea4f5f4b82973d Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/309310 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/usb_pd_protocol.c')
-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 4cc0e0259a..fc063d24b9 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -1952,8 +1952,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 ? SECOND
+ : 10*MSEC;
#else
timeout = 10*MSEC;
#endif