usb: typec: Give the mux drivers all the details regarding the port state
[linux-2.6-microblaze.git] / drivers / usb / typec / mux / pi3usb30532.c
index 5585b10..46457c1 100644 (file)
@@ -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;