diff options
author | Vijay Hiremath <vijay.p.hiremath@intel.com> | 2020-02-10 16:40:33 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-12 20:05:29 +0000 |
commit | e34464e92cc0d13e1fc4a7647897bf534be52444 (patch) | |
tree | f2180d32ae821c1fbbcd711829941f8a5c353e47 /common | |
parent | 50b268bc67c1c73d81eafaa46dc7cab75c335e41 (diff) | |
download | chrome-ec-e34464e92cc0d13e1fc4a7647897bf534be52444.tar.gz |
TCPMv1/v2: Move pd_usb_billboard_deferred() to common file
BUG=b:148528713
BRANCH=none
TEST=make buildall -j
Change-Id: I92e7ed06a610126ff80ec91047962e3e9ba2cde1
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2051215
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/usb_common.c | 19 | ||||
-rw-r--r-- | common/usb_pd_policy.c | 17 | ||||
-rw-r--r-- | common/usbc/usb_pe_drp_sm.c | 18 |
3 files changed, 19 insertions, 35 deletions
diff --git a/common/usb_common.c b/common/usb_common.c index ff6d170a41..e5255fc339 100644 --- a/common/usb_common.c +++ b/common/usb_common.c @@ -19,6 +19,7 @@ #include "host_command.h" #include "system.h" #include "task.h" +#include "usb_api.h" #include "usb_common.h" #include "usb_mux.h" #include "usb_pd.h" @@ -773,3 +774,21 @@ __overridable bool vboot_allow_usb_pd(void) { return false; } + +/* VDM utility functions */ +static void pd_usb_billboard_deferred(void) +{ + if (IS_ENABLED(CONFIG_USB_PD_ALT_MODE) && + !IS_ENABLED(CONFIG_USB_PD_ALT_MODE_DFP) && + !IS_ENABLED(CONFIG_USB_PD_SIMPLE_DFP) && + IS_ENABLED(CONFIG_USB_BOS)) { + /* + * TODO(tbroch) + * 1. Will we have multiple type-C port UFPs + * 2. Will there be other modes applicable to DFPs besides DP + */ + if (!pd_alt_mode(0, USB_SID_DISPLAYPORT)) + usb_connect(); + } +} +DECLARE_DEFERRED(pd_usb_billboard_deferred); diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c index a9beba9f1b..e2e6ed3b42 100644 --- a/common/usb_pd_policy.c +++ b/common/usb_pd_policy.c @@ -1183,23 +1183,6 @@ int pd_svdm(int port, int cnt, uint32_t *payload, uint32_t **rpayload, #endif /* CONFIG_USB_PD_ALT_MODE */ -static void pd_usb_billboard_deferred(void) -{ -#if defined(CONFIG_USB_PD_ALT_MODE) && !defined(CONFIG_USB_PD_ALT_MODE_DFP) \ - && !defined(CONFIG_USB_PD_SIMPLE_DFP) && defined(CONFIG_USB_BOS) - - /* - * TODO(tbroch) - * 1. Will we have multiple type-C port UFPs - * 2. Will there be other modes applicable to DFPs besides DP - */ - if (!pd_alt_mode(0, USB_SID_DISPLAYPORT)) - usb_connect(); - -#endif -} -DECLARE_DEFERRED(pd_usb_billboard_deferred); - #define FW_RW_END (CONFIG_EC_WRITABLE_STORAGE_OFF + \ CONFIG_RW_STORAGE_OFF + CONFIG_RW_SIZE) diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index d45cdb0915..01b27e21b6 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -4567,24 +4567,6 @@ void pd_set_vbus_discharge(int port, int enable) mutex_unlock(&discharge_lock[port]); } -/* VDM utility functions */ -static void pd_usb_billboard_deferred(void) -{ -#if defined(CONFIG_USB_PD_ALT_MODE) && !defined(CONFIG_USB_PD_ALT_MODE_DFP) \ - && !defined(CONFIG_USB_PD_SIMPLE_DFP) && defined(CONFIG_USB_BOS) - - /* - * TODO(tbroch) - * 1. Will we have multiple type-C port UFPs - * 2. Will there be other modes applicable to DFPs besides DP - */ - if (!pd_alt_mode(0, USB_SID_DISPLAYPORT)) - usb_connect(); - -#endif -} -DECLARE_DEFERRED(pd_usb_billboard_deferred); - void pd_dfp_pe_init(int port) { memset(&pe[port].am_policy, 0, sizeof(struct pd_policy)); |