diff options
author | Vijay Hiremath <vijay.p.hiremath@intel.com> | 2019-11-22 11:42:29 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-26 20:01:22 +0000 |
commit | 3cb2b8e2be4c3526510f46ad69225b57e2b34cd0 (patch) | |
tree | cedfefa7e1feb2fbfde897258aaa550c453bf6e7 /board/elm/usb_pd_policy.c | |
parent | 3e2f184b5bb43461adc3c4ec791ef1ae34441946 (diff) | |
download | chrome-ec-3cb2b8e2be4c3526510f46ad69225b57e2b34cd0.tar.gz |
usb_mux: cleanup the usb_mux_get() function
Simplified the usb_mux_get() function and made the MUX info
prints same as in ectool.
BUG=none
BRANCH=none
TEST=make buildall -j
Change-Id: Iefb16e1dbd323afbe248b06fe9c53abc63be9a67
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1931284
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'board/elm/usb_pd_policy.c')
-rw-r--r-- | board/elm/usb_pd_policy.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/board/elm/usb_pd_policy.c b/board/elm/usb_pd_policy.c index 11e1ca2c6a..06ba8d13c2 100644 --- a/board/elm/usb_pd_policy.c +++ b/board/elm/usb_pd_policy.c @@ -215,9 +215,6 @@ static uint32_t dp_status[CONFIG_USB_PD_PORT_MAX_COUNT]; static void svdm_safe_dp_mode(int port) { - const char *dp_str, *usb_str; - enum typec_mux typec_mux_setting; - /* make DP interface safe until configure */ dp_flags[port] = 0; dp_status[port] = 0; @@ -228,9 +225,8 @@ static void svdm_safe_dp_mode(int port) * To avoid broken the SS connection, * keep the current setting if SS connection is enabled already. */ - typec_mux_setting = (usb_mux_get(port, &dp_str, &usb_str) && usb_str) ? - TYPEC_MUX_USB : TYPEC_MUX_NONE; - usb_mux_set(port, typec_mux_setting, + usb_mux_set(port, usb_mux_get(port) & USB_PD_MUX_USB_ENABLED ? + TYPEC_MUX_USB : TYPEC_MUX_NONE, USB_SWITCH_CONNECT, pd_get_polarity(port)); } |