diff --git a/board/ryu/board.h b/board/ryu/board.h index a28f147b92..ceaba64606 100644 --- a/board/ryu/board.h +++ b/board/ryu/board.h @@ -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 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; } diff --git a/include/config.h b/include/config.h index 06652c3059..5aed0aac2e 100644 --- a/include/config.h +++ b/include/config.h @@ -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