diff options
author | Vijay Hiremath <vijay.p.hiremath@intel.com> | 2020-01-23 07:19:06 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-28 02:35:08 +0000 |
commit | 50d60e3fe12a852ae412d9502ca22a5b72cb441b (patch) | |
tree | 3d5f925aba3d00f523812acb5238548a6e3dc4a1 /baseboard/grunt | |
parent | 43dfea03a49d46677590ac42f2fce4419835e1e7 (diff) | |
download | chrome-ec-50d60e3fe12a852ae412d9502ca22a5b72cb441b.tar.gz |
usb_mux: cleanup: Replace mux state enums with ec_command bit flag
BUG=b:145796172
BRANCH=none
TEST=make buildall -j
Change-Id: Ie4ffaf208745764262931501f0dff77b525a4e59
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2017569
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'baseboard/grunt')
-rw-r--r-- | baseboard/grunt/usb_pd_policy.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/baseboard/grunt/usb_pd_policy.c b/baseboard/grunt/usb_pd_policy.c index 9ec482c750..4edee5f232 100644 --- a/baseboard/grunt/usb_pd_policy.c +++ b/baseboard/grunt/usb_pd_policy.c @@ -80,7 +80,7 @@ int board_vbus_source_enabled(int port) /* ----------------- Vendor Defined Messages ------------------ */ #ifdef CONFIG_USB_PD_ALT_MODE_DFP -static enum typec_mux svdm_dp_mux_mode(int port) +mux_state_t svdm_dp_mux_mode(int port) { int mf_pref = PD_VDO_DPSTS_MF_PREF(dp_status[port]); int pin_mode = pd_dfp_dp_get_pin_mode(port, dp_status[port]); @@ -89,9 +89,9 @@ static enum typec_mux svdm_dp_mux_mode(int port) * supported. */ if ((pin_mode & MODE_DP_PIN_MF_MASK) && mf_pref) - return TYPEC_MUX_DOCK; + return USB_PD_MUX_DOCK; else - return TYPEC_MUX_DP; + return USB_PD_MUX_DP_ENABLED; } __override int svdm_dp_config(int port, uint32_t *payload) @@ -99,7 +99,7 @@ __override int svdm_dp_config(int port, uint32_t *payload) int opos = pd_alt_mode(port, USB_SID_DISPLAYPORT); int mf_pref = PD_VDO_DPSTS_MF_PREF(dp_status[port]); int pin_mode = pd_dfp_dp_get_pin_mode(port, dp_status[port]); - enum typec_mux mux_mode = svdm_dp_mux_mode(port); + mux_state_t mux_mode = svdm_dp_mux_mode(port); if (!pin_mode) return 0; @@ -108,13 +108,14 @@ __override int svdm_dp_config(int port, uint32_t *payload) /* * Place the USB Type-C pins that are to be re-configured to DisplayPort - * Configuration into the Safe state. For TYPEC_MUX_DOCK, the superspeed - * signals can remain connected. For TYPEC_MUX_DP, disconnect the - * superspeed signals here, before the pins are re-configured to - * DisplayPort (in svdm_dp_post_config, when we receive the config ack). + * Configuration into the Safe state. For USB_PD_MUX_DOCK, the + * superspeed signals can remain connected. For USB_PD_MUX_DP_ENABLED, + * disconnect the superspeed signals here, before the pins are + * re-configured to DisplayPort (in svdm_dp_post_config, when we receive + * the config ack). */ - if (mux_mode == TYPEC_MUX_DP) - usb_mux_set(port, TYPEC_MUX_NONE, USB_SWITCH_CONNECT, + if (mux_mode == USB_PD_MUX_DP_ENABLED) + usb_mux_set(port, USB_PD_MUX_NONE, USB_SWITCH_CONNECT, pd_get_polarity(port)); payload[0] = VDO(USB_SID_DISPLAYPORT, 1, |