| .. | .. |
|---|
| 73 | 73 | return ret; |
|---|
| 74 | 74 | } |
|---|
| 75 | 75 | |
|---|
| 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) |
|---|
| 77 | 78 | { |
|---|
| 78 | 79 | struct pi3usb30532 *pi = typec_mux_get_drvdata(mux); |
|---|
| 79 | 80 | u8 new_conf; |
|---|
| .. | .. |
|---|
| 82 | 83 | mutex_lock(&pi->lock); |
|---|
| 83 | 84 | new_conf = pi->conf; |
|---|
| 84 | 85 | |
|---|
| 85 | | - switch (state) { |
|---|
| 86 | + switch (state->mode) { |
|---|
| 86 | 87 | case TYPEC_STATE_SAFE: |
|---|
| 87 | | - new_conf = PI3USB30532_CONF_OPEN; |
|---|
| 88 | + new_conf = (new_conf & PI3USB30532_CONF_SWAP) | |
|---|
| 89 | + PI3USB30532_CONF_OPEN; |
|---|
| 88 | 90 | break; |
|---|
| 89 | 91 | case TYPEC_STATE_USB: |
|---|
| 90 | 92 | new_conf = (new_conf & PI3USB30532_CONF_SWAP) | |
|---|
| .. | .. |
|---|
| 112 | 114 | static int pi3usb30532_probe(struct i2c_client *client) |
|---|
| 113 | 115 | { |
|---|
| 114 | 116 | 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 = { }; |
|---|
| 117 | 119 | struct pi3usb30532 *pi; |
|---|
| 118 | 120 | int ret; |
|---|
| 119 | 121 | |
|---|