usb: typec: mux: Allow multiple mux_devs per mux
authorBjorn Andersson <bjorn.andersson@linaro.org>
Fri, 22 Apr 2022 22:23:49 +0000 (15:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Apr 2022 11:47:13 +0000 (13:47 +0200)
commit71793b579ba6825d221445e3cfcd50da427b4f0e
treece6a8bb8776811efd8a71c4fee50ec71eb288bf5
parent713fd49b430c37263c6cae2c82954f4e1cbcd90d
usb: typec: mux: Allow multiple mux_devs per mux

In the Qualcomm platforms the USB/DP PHY handles muxing and orientation
switching of the SuperSpeed lines, but the SBU lines needs to be
connected and switched by external (to the SoC) hardware.

It's therefor necessary to be able to have the TypeC controller operate
multiple TypeC muxes and switches. Use the newly introduced indirection
object to handle this, to avoid having to taint the TypeC controllers
with knowledge about the downstream hardware configuration.

The max number of devs per indirection is set to 3, which account for
being able to mux/switch the USB HS, SS and SBU lines, as per defined
defined in the usb-c-connector binding. This number could be grown if
need arrises at a later point in time.

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220422222351.1297276-6-bjorn.andersson@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/mux.c