diff options
author | Jameson Thies <jthies@google.com> | 2023-05-12 17:09:36 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-05-12 23:16:19 +0000 |
commit | 98406285eb79141babdae0710cc24b9d9dde9db9 (patch) | |
tree | 77e42997055bed77ebe36b1f28cffd436d95f446 /driver/usb_mux/it5205.c | |
parent | a609efecf170b1b7cb9e393e237fe75c20fb2a90 (diff) | |
download | chrome-ec-98406285eb79141babdae0710cc24b9d9dde9db9.tar.gz |
USB Mux: Use polarity in safe mode
Currently, a handful of drivers look for the mux_state to be equal to
USB_PD_MUX_SAFE_MODE when handling safe mode. This check requires that
the polarity information be cleared before sending the mux_state to any
drivers to correctly handle the safe state. But the same mux_state is
sent to the kernel, which relies on polarity information from the EC
when setting USB-C switches.
This CL updates the retimer, tcpm and usb_mux drivers which check for
mux_state to equal USB_PD_MUX_SAFE_MODE to instead only look for the
safe mode bit to be set. This allows those drivers to function the same
way in safe mode regardless of polarity information. It also updates
usb_mux.c to preserve the polarity bit when sending mux_state to drivers
in safe_state.
LOW_COVERAGE_REASON=20 of the changed drivers have no emulators
BUG=b:279733113
TEST=make -j buildall, confirmed that no remaining drivers check for mux
state to equal USB_PD_MUX_SAFE_MODE. Checked on redrix that we are able
to drive a monitor with inverted and normal polarity after losing
Try.SRC.
Change-Id: Ifc89d0ba1da0975436f93be102fadf725a5b8566
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4527219
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Tested-by: Jameson Thies <jthies@google.com>
Commit-Queue: Jameson Thies <jthies@google.com>
Diffstat (limited to 'driver/usb_mux/it5205.c')
-rw-r--r-- | driver/usb_mux/it5205.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/driver/usb_mux/it5205.c b/driver/usb_mux/it5205.c index de3d950c86..a773a51d0e 100644 --- a/driver/usb_mux/it5205.c +++ b/driver/usb_mux/it5205.c @@ -100,7 +100,7 @@ static int it5205_set_mux(const struct usb_mux *me, mux_state_t mux_state, *ack_required = false; /* This driver treats safe mode as none */ - if (mux_state == USB_PD_MUX_SAFE_MODE) + if (mux_state & USB_PD_MUX_SAFE_MODE) mux_state = USB_PD_MUX_NONE; switch (mux_state & MUX_STATE_DP_USB_MASK) { |