Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <heikki.krogerus@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Heikki Krogerus and committed by
Greg Kroah-Hartman
49cbb33d 0e3bb7d6

+8 -5
+8 -5
drivers/usb/typec/mux/pi3usb30532.c
··· 9 9 #include <linux/kernel.h> 10 10 #include <linux/module.h> 11 11 #include <linux/mutex.h> 12 - #include <linux/usb/tcpm.h> 12 + #include <linux/usb/typec_dp.h> 13 13 #include <linux/usb/typec_mux.h> 14 14 15 15 #define PI3USB30532_CONF 0x00 ··· 83 83 new_conf = pi->conf; 84 84 85 85 switch (state) { 86 - case TYPEC_MUX_NONE: 86 + case TYPEC_STATE_SAFE: 87 87 new_conf = PI3USB30532_CONF_OPEN; 88 88 break; 89 - case TYPEC_MUX_USB: 89 + case TYPEC_STATE_USB: 90 90 new_conf = (new_conf & PI3USB30532_CONF_SWAP) | 91 91 PI3USB30532_CONF_USB3; 92 92 break; 93 - case TYPEC_MUX_DP: 93 + case TYPEC_DP_STATE_C: 94 + case TYPEC_DP_STATE_E: 94 95 new_conf = (new_conf & PI3USB30532_CONF_SWAP) | 95 96 PI3USB30532_CONF_4LANE_DP; 96 97 break; 97 - case TYPEC_MUX_DOCK: 98 + case TYPEC_DP_STATE_D: 98 99 new_conf = (new_conf & PI3USB30532_CONF_SWAP) | 99 100 PI3USB30532_CONF_USB3_AND_2LANE_DP; 101 + break; 102 + default: 100 103 break; 101 104 } 102 105