From 3ff6d1ff038c9d4d894ea14f9244920363334e75 Mon Sep 17 00:00:00 2001 From: Diana Z Date: Tue, 13 Dec 2022 15:49:10 -0700 Subject: USB mux: Remove polarity from SAFE mode sets Currently, we don't send polarity down to drivers for NONE mode. We should do likewise for SAFE mode, which is generally the same as NONE in most applications. BRANCH=None BUG=b:260045058 TEST=on skyrim, ensure SAFE mode is set for either orientation for dongles Change-Id: I7e63804ed46d082dd8db9cee09739d62b466edb6 Signed-off-by: Diana Z Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4104563 Reviewed-by: Andrew McRae Code-Coverage: Zoss --- driver/usb_mux/usb_mux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/driver/usb_mux/usb_mux.c b/driver/usb_mux/usb_mux.c index 73c8a165bf..8029fd6fe6 100644 --- a/driver/usb_mux/usb_mux.c +++ b/driver/usb_mux/usb_mux.c @@ -515,7 +515,8 @@ static void perform_mux_set(int port, int index, mux_state_t mux_mode, return; /* Configure superspeed lanes */ - mux_state = ((mux_mode != USB_PD_MUX_NONE) && polarity) ? + mux_state = ((mux_mode != USB_PD_MUX_NONE) && + (mux_mode != USB_PD_MUX_SAFE_MODE) && polarity) ? mux_mode | USB_PD_MUX_POLARITY_INVERTED : mux_mode; -- cgit v1.2.1