From 87e3daa005cfba19433b5429bfbca9b848925507 Mon Sep 17 00:00:00 2001 From: Heikki Krogerus Date: Mon, 30 Dec 2019 17:26:08 +0300 Subject: usb: typec: Give the mux drivers all the details regarding the port state Passing all the details that the alternate mode drivers provide to the mux drivers during mode changes. The mux drivers will in practice need to be able to make decisions on their own. It is not enough that they get only the requested port state. With the Thunderbolt 3 alternate mode for example the mux driver will need to consider also the capabilities of the cable before configuring the mux. Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20191230142611.24921-13-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/mux/pi3usb30532.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/usb/typec/mux/pi3usb30532.c') diff --git a/drivers/usb/typec/mux/pi3usb30532.c b/drivers/usb/typec/mux/pi3usb30532.c index 5585b109095b..46457c133d2b 100644 --- a/drivers/usb/typec/mux/pi3usb30532.c +++ b/drivers/usb/typec/mux/pi3usb30532.c @@ -73,7 +73,8 @@ static int pi3usb30532_sw_set(struct typec_switch *sw, return ret; } -static int pi3usb30532_mux_set(struct typec_mux *mux, int state) +static int +pi3usb30532_mux_set(struct typec_mux *mux, struct typec_mux_state *state) { struct pi3usb30532 *pi = typec_mux_get_drvdata(mux); u8 new_conf; @@ -82,7 +83,7 @@ static int pi3usb30532_mux_set(struct typec_mux *mux, int state) mutex_lock(&pi->lock); new_conf = pi->conf; - switch (state) { + switch (state->mode) { case TYPEC_STATE_SAFE: new_conf = (new_conf & PI3USB30532_CONF_SWAP) | PI3USB30532_CONF_OPEN; -- cgit