summaryrefslogtreecommitdiff
path: root/driver/usb_mux/amd_fp5.c
diff options
context:
space:
mode:
authorDenis Brockus <dbrockus@chromium.org>2020-01-16 11:29:41 -0700
committerCommit Bot <commit-bot@chromium.org>2020-01-23 22:43:12 +0000
commit21945692c2c1bb464fdc51a7b003ee630b72bdb1 (patch)
treed324ff38f7192c2a1884f1044e2ab6c484ef6bad /driver/usb_mux/amd_fp5.c
parent495f0f2d2f170f9763a11cfe2630f8d3bec9c17e (diff)
downloadchrome-ec-21945692c2c1bb464fdc51a7b003ee630b72bdb1.tar.gz
zork: PS8802/PS8818 dynamic detection cleanup
Changed the method for detection to a non-destructive mechanism so it could be called from any of the interfaces. Added in switching to direct calling the detected driver once the hardware has been determined. The 8802 is the main mux when it is present and the fp5 mux should only select the lanes to send. Flip should not be sent to the FP5. It is a specialized form of a secondary MUX and currently being placed in as a retimer. In the future the retimers will all become MUXes and they will chain... just not today. BUG=b:147428570 BRANCH=none TEST=verify USB-C1 device with AP running Change-Id: I6b0eedd1dfcc91c3114f8dc481f5ca2841eb9e85 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2014311 Reviewed-by: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'driver/usb_mux/amd_fp5.c')
-rw-r--r--driver/usb_mux/amd_fp5.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/driver/usb_mux/amd_fp5.c b/driver/usb_mux/amd_fp5.c
index a912d03365..a2c9ad68fb 100644
--- a/driver/usb_mux/amd_fp5.c
+++ b/driver/usb_mux/amd_fp5.c
@@ -112,6 +112,17 @@ static int amd_fp5_get_mux(int port, mux_state_t *mux_state)
return EC_SUCCESS;
}
+/*
+ * The FP5 MUX can look like a retimer or a MUX. So create both tables
+ * and use them as needed, until retimers become a type of MUX and
+ * then we will only need one of these tables.
+ *
+ * TODO(b:147593660) Cleanup of retimers as muxes in a more
+ * generalized mechanism
+ */
+const struct usb_retimer_driver amd_fp5_usb_retimer = {
+ .set = amd_fp5_set_mux,
+};
const struct usb_mux_driver amd_fp5_usb_mux_driver = {
.init = amd_fp5_init,
.set = amd_fp5_set_mux,