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 <vpalatin@chromium.org>

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 <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit d14a0045568e61a36695ffee48ed39ddc60ebb3a)
Reviewed-on: https://chromium-review.googlesource.com/299023
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Vincent Palatin
2015-09-10 14:05:48 -07:00
committed by chrome-bot
parent 8db5a8185a
commit a8d71bdb5b
3 changed files with 10 additions and 0 deletions

View File

@@ -40,6 +40,7 @@
#define CONFIG_USB_PD_INTERNAL_COMP
#define CONFIG_USB_PD_LOGGING
#define CONFIG_USB_PD_LOG_SIZE 512
#define CONFIG_USB_PD_LOW_POWER
#define CONFIG_USB_PD_PORT_COUNT 1
#define CONFIG_USB_PD_TCPC
#define CONFIG_USB_PD_TCPM_STUB

View File

@@ -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;
}

View File

@@ -1642,6 +1642,9 @@
/* The size in bytes of the FIFO used for PD events logging */
#undef CONFIG_USB_PD_LOG_SIZE
/* Save power by waking up on VBUS rather than polling CC */
#undef CONFIG_USB_PD_LOW_POWER
/* Define if USB-PD device has no way of detecting USB VBUS */
#undef CONFIG_USB_PD_NO_VBUS_DETECT