Skip to content

Commit 49cbb33

Browse files
Heikki Krogerusgregkh
authored andcommitted
usb: typec: pi3usb30532: Start using generic state values
Instead of the tcpm specific mux states, using the generic USB Type-C connector state values, and with DisplayPort using connector states defined for the DisplayPort Alt Mode. Signed-off-by: Heikki Krogerus <[email protected]> Tested-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0e3bb7d commit 49cbb33

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/usb/typec/mux/pi3usb30532.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <linux/kernel.h>
1010
#include <linux/module.h>
1111
#include <linux/mutex.h>
12-
#include <linux/usb/tcpm.h>
12+
#include <linux/usb/typec_dp.h>
1313
#include <linux/usb/typec_mux.h>
1414

1515
#define PI3USB30532_CONF 0x00
@@ -83,21 +83,24 @@ static int pi3usb30532_mux_set(struct typec_mux *mux, int state)
8383
new_conf = pi->conf;
8484

8585
switch (state) {
86-
case TYPEC_MUX_NONE:
86+
case TYPEC_STATE_SAFE:
8787
new_conf = PI3USB30532_CONF_OPEN;
8888
break;
89-
case TYPEC_MUX_USB:
89+
case TYPEC_STATE_USB:
9090
new_conf = (new_conf & PI3USB30532_CONF_SWAP) |
9191
PI3USB30532_CONF_USB3;
9292
break;
93-
case TYPEC_MUX_DP:
93+
case TYPEC_DP_STATE_C:
94+
case TYPEC_DP_STATE_E:
9495
new_conf = (new_conf & PI3USB30532_CONF_SWAP) |
9596
PI3USB30532_CONF_4LANE_DP;
9697
break;
97-
case TYPEC_MUX_DOCK:
98+
case TYPEC_DP_STATE_D:
9899
new_conf = (new_conf & PI3USB30532_CONF_SWAP) |
99100
PI3USB30532_CONF_USB3_AND_2LANE_DP;
100101
break;
102+
default:
103+
break;
101104
}
102105

103106
ret = pi3usb30532_set_conf(pi, new_conf);

0 commit comments

Comments
 (0)