hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/usb/typec/mux/pi3usb30532.c
....@@ -73,7 +73,8 @@
7373 return ret;
7474 }
7575
76
-static int pi3usb30532_mux_set(struct typec_mux *mux, int state)
76
+static int
77
+pi3usb30532_mux_set(struct typec_mux *mux, struct typec_mux_state *state)
7778 {
7879 struct pi3usb30532 *pi = typec_mux_get_drvdata(mux);
7980 u8 new_conf;
....@@ -82,9 +83,10 @@
8283 mutex_lock(&pi->lock);
8384 new_conf = pi->conf;
8485
85
- switch (state) {
86
+ switch (state->mode) {
8687 case TYPEC_STATE_SAFE:
87
- new_conf = PI3USB30532_CONF_OPEN;
88
+ new_conf = (new_conf & PI3USB30532_CONF_SWAP) |
89
+ PI3USB30532_CONF_OPEN;
8890 break;
8991 case TYPEC_STATE_USB:
9092 new_conf = (new_conf & PI3USB30532_CONF_SWAP) |
....@@ -112,8 +114,8 @@
112114 static int pi3usb30532_probe(struct i2c_client *client)
113115 {
114116 struct device *dev = &client->dev;
115
- struct typec_switch_desc sw_desc;
116
- struct typec_mux_desc mux_desc;
117
+ struct typec_switch_desc sw_desc = { };
118
+ struct typec_mux_desc mux_desc = { };
117119 struct pi3usb30532 *pi;
118120 int ret;
119121