summaryrefslogtreecommitdiff
path: root/driver/usb_mux/amd_fp5.c
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2022-09-17 22:21:09 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-09-19 20:00:57 +0000
commit6278fe9df729c6816eafbea2169968170ac2a714 (patch)
tree7a3719d72eaf2f9eb2a314f593c9736dcbb44a51 /driver/usb_mux/amd_fp5.c
parenta83d94399b79a91421034ee37bfc22dad05c8013 (diff)
downloadchrome-ec-6278fe9df729c6816eafbea2169968170ac2a714.tar.gz
USB Mux: Unify drivers for safe mode
When safe mode was first introduced, it was added only to drivers on the boards with virtual muxes and the mode wasn't sent to other drivers. Since safe mode is defined as an input for the mux API, ensure all drivers can handle this input. For now, set up all drivers which did not have handling to handle it the same as None, which was previously sent to them. LOW_COVERAGE_REASON=20 of the changed drivers have no emulators BRANCH=None BUG=b:234772074 TEST=make -j buildall; search for all files containing a usb_mux_driver without any reference to USB_PD_MUX_SAFE_MODE and ensure they are correct to not reference it Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ib927057bbf1638d09000bdad98bc096a6e103611 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3902611 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'driver/usb_mux/amd_fp5.c')
-rw-r--r--driver/usb_mux/amd_fp5.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/driver/usb_mux/amd_fp5.c b/driver/usb_mux/amd_fp5.c
index fc41a9c17e..ca042b0fa0 100644
--- a/driver/usb_mux/amd_fp5.c
+++ b/driver/usb_mux/amd_fp5.c
@@ -49,6 +49,10 @@ static int amd_fp5_set_mux(const struct usb_mux *me, mux_state_t mux_state,
/* This driver does not use host command ACKs */
*ack_required = false;
+ /* This driver treats safe mode as none */
+ if (mux_state == USB_PD_MUX_SAFE_MODE)
+ mux_state = USB_PD_MUX_NONE;
+
saved_mux_state[me->usb_port] = mux_state;
/*