diff options
author | Philip Chen <philipchen@google.com> | 2019-06-12 18:14:28 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-06-14 01:26:48 +0000 |
commit | b30ae71143782737f739690ea200ddd1516a14c4 (patch) | |
tree | 1b70889230b9448e9ca82f8d8aaddaf577cefaca /baseboard | |
parent | 6231bcc61127a4bc75d2fa2ec2e4ea58fb164207 (diff) | |
download | chrome-ec-b30ae71143782737f739690ea200ddd1516a14c4.tar.gz |
hatch: Make MST support optional for subboards
This CL cleans up the dependence on the MST support
in hatch baseboard.
Subboards can optionally define USB_PD_PORT_TCPC_MST when
MST support is needed.
BUG=b:133788856
BRANCH=none
TEST=make buildall
Change-Id: Ia83e31e68881ce419056716df4776e4be6786c45
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1657320
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r-- | baseboard/hatch/baseboard.c | 2 | ||||
-rw-r--r-- | baseboard/hatch/usb_pd_policy.c | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/baseboard/hatch/baseboard.c b/baseboard/hatch/baseboard.c index 9ca4c836a5..d76227e562 100644 --- a/baseboard/hatch/baseboard.c +++ b/baseboard/hatch/baseboard.c @@ -281,6 +281,7 @@ void board_set_charge_limit(int port, int supplier, int charge_ma, charge_mv); } +#ifdef USB_PD_PORT_TCPC_MST void baseboard_mst_enable_control(enum mst_source src, int level) { static uint32_t mst_input_levels; @@ -292,6 +293,7 @@ void baseboard_mst_enable_control(enum mst_source src, int level) gpio_set_level(GPIO_EN_MST, mst_input_levels ? 1 : 0); } +#endif /* Enable or disable input devices, based on chipset state */ #ifndef TEST_BUILD diff --git a/baseboard/hatch/usb_pd_policy.c b/baseboard/hatch/usb_pd_policy.c index 2eb1cb6f4d..5e39e50a58 100644 --- a/baseboard/hatch/usb_pd_policy.c +++ b/baseboard/hatch/usb_pd_policy.c @@ -328,8 +328,8 @@ static void svdm_dp_post_config(int port) if (!(dp_flags[port] & DP_FLAGS_HPD_HI_PENDING)) return; mux->hpd_update(port, 1, 0); -#ifdef USB_PD_PORT_TCPC - if (port == USB_PD_PORT_TCPC) +#ifdef USB_PD_PORT_TCPC_MST + if (port == USB_PD_PORT_TCPC_MST) baseboard_mst_enable_control(port, 1); #endif } @@ -347,8 +347,8 @@ static int svdm_dp_attention(int port, uint32_t *payload) return 1; } mux->hpd_update(port, lvl, irq); -#ifdef USB_PD_PORT_TCPC - if (port == USB_PD_PORT_TCPC) +#ifdef USB_PD_PORT_TCPC_MST + if (port == USB_PD_PORT_TCPC_MST) baseboard_mst_enable_control(port, lvl); #endif @@ -362,8 +362,8 @@ static void svdm_exit_dp_mode(int port) svdm_safe_dp_mode(port); mux->hpd_update(port, 0, 0); -#ifdef USB_PD_PORT_TCPC - if (port == USB_PD_PORT_TCPC) +#ifdef USB_PD_PORT_TCPC_MST + if (port == USB_PD_PORT_TCPC_MST) baseboard_mst_enable_control(port, 0); #endif } |