Commit 49cbb33d authored by Heikki Krogerus's avatar Heikki Krogerus Committed by Greg Kroah-Hartman

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: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0e3bb7d6
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/usb/tcpm.h> #include <linux/usb/typec_dp.h>
#include <linux/usb/typec_mux.h> #include <linux/usb/typec_mux.h>
#define PI3USB30532_CONF 0x00 #define PI3USB30532_CONF 0x00
...@@ -83,21 +83,24 @@ static int pi3usb30532_mux_set(struct typec_mux *mux, int state) ...@@ -83,21 +83,24 @@ static int pi3usb30532_mux_set(struct typec_mux *mux, int state)
new_conf = pi->conf; new_conf = pi->conf;
switch (state) { switch (state) {
case TYPEC_MUX_NONE: case TYPEC_STATE_SAFE:
new_conf = PI3USB30532_CONF_OPEN; new_conf = PI3USB30532_CONF_OPEN;
break; break;
case TYPEC_MUX_USB: case TYPEC_STATE_USB:
new_conf = (new_conf & PI3USB30532_CONF_SWAP) | new_conf = (new_conf & PI3USB30532_CONF_SWAP) |
PI3USB30532_CONF_USB3; PI3USB30532_CONF_USB3;
break; break;
case TYPEC_MUX_DP: case TYPEC_DP_STATE_C:
case TYPEC_DP_STATE_E:
new_conf = (new_conf & PI3USB30532_CONF_SWAP) | new_conf = (new_conf & PI3USB30532_CONF_SWAP) |
PI3USB30532_CONF_4LANE_DP; PI3USB30532_CONF_4LANE_DP;
break; break;
case TYPEC_MUX_DOCK: case TYPEC_DP_STATE_D:
new_conf = (new_conf & PI3USB30532_CONF_SWAP) | new_conf = (new_conf & PI3USB30532_CONF_SWAP) |
PI3USB30532_CONF_USB3_AND_2LANE_DP; PI3USB30532_CONF_USB3_AND_2LANE_DP;
break; break;
default:
break;
} }
ret = pi3usb30532_set_conf(pi, new_conf); ret = pi3usb30532_set_conf(pi, new_conf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment