From a8d71bdb5b8d1c58c5bea1c6e034fb394a42b2c4 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Thu, 10 Sep 2015 14:05:48 -0700 Subject: pd: add option to save power in S5 When we are in sink mode and not dual-role toggling, add the option to disable the CC lines polling every 10 ms (thus waking up on the VBUS transition or the 1-minute slow polling). Signed-off-by: Vincent Palatin BRANCH=smaug BUG=chrome-os-partner:44229 TEST=on Smaug DVT, measure power consumption in S5 and wake-up time when plugging a power supply. Change-Id: Idee6581af550de01760feffe604d7bd453a625a8 Reviewed-on: https://chromium-review.googlesource.com/299022 Reviewed-by: Alec Berg Commit-Queue: Vincent Palatin Trybot-Ready: Vincent Palatin Tested-by: Vincent Palatin (cherry picked from commit d14a0045568e61a36695ffee48ed39ddc60ebb3a) Reviewed-on: https://chromium-review.googlesource.com/299023 Commit-Ready: Vincent Palatin --- common/usb_pd_protocol.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'common/usb_pd_protocol.c') diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 36da076710..70aff84204 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -1931,7 +1931,12 @@ void pd_task(void) #endif break; case PD_STATE_SNK_DISCONNECTED: +#ifdef CONFIG_USB_PD_LOW_POWER + timeout = drp_state == PD_DRP_TOGGLE_OFF ? MINUTE + : 10*MSEC; +#else timeout = 10*MSEC; +#endif tcpm_get_cc(port, &cc1, &cc2); /* Source connection monitoring */ @@ -1944,6 +1949,7 @@ void pd_task(void) PD_T_CC_DEBOUNCE; set_state(port, PD_STATE_SNK_DISCONNECTED_DEBOUNCE); + timeout = 10*MSEC; break; } -- cgit v1.2.1