summaryrefslogtreecommitdiff
path: root/include/linux/usb/tcpci.h
diff options
context:
space:
mode:
authorMarco Felsch <m.felsch@pengutronix.de>2024-07-01 15:21:24 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-07-03 16:05:38 +0200
commit62ce9ef1479729b1a3f8a1b19900e28d68b3625e (patch)
tree522dcb92af281ff0b8ca38530a67ccb82dd13237 /include/linux/usb/tcpci.h
parent89b5a5a60771c60642d34019b3885d1d20934db8 (diff)
usb: typec: tcpci: add support to set connector orientation
This add the support to set the optional connector orientation bit which is part of the optional CONFIG_STANDARD_OUTPUT register 0x18 [1]. This allows system designers to connect the tcpc orientation pin directly to the 2:1 ss-mux. [1] https://www.usb.org/sites/default/files/documents/usb-port_controller_specification_rev2.0_v1.0_0.pdf Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20240701132133.3054394-1-m.felsch@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb/tcpci.h')
-rw-r--r--include/linux/usb/tcpci.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/usb/tcpci.h b/include/linux/usb/tcpci.h
index 47a86b8a4a50..0ab39b6ea205 100644
--- a/include/linux/usb/tcpci.h
+++ b/include/linux/usb/tcpci.h
@@ -47,6 +47,9 @@
#define TCPC_SINK_FAST_ROLE_SWAP BIT(0)
#define TCPC_CONFIG_STD_OUTPUT 0x18
+#define TCPC_CONFIG_STD_OUTPUT_ORIENTATION_MASK BIT(0)
+#define TCPC_CONFIG_STD_OUTPUT_ORIENTATION_NORMAL 0
+#define TCPC_CONFIG_STD_OUTPUT_ORIENTATION_FLIPPED 1
#define TCPC_TCPC_CTRL 0x19
#define TCPC_TCPC_CTRL_ORIENTATION BIT(0)
@@ -127,6 +130,7 @@
#define TCPC_DEV_CAP_2 0x26
#define TCPC_STD_INPUT_CAP 0x28
#define TCPC_STD_OUTPUT_CAP 0x29
+#define TCPC_STD_OUTPUT_CAP_ORIENTATION BIT(0)
#define TCPC_MSG_HDR_INFO 0x2e
#define TCPC_MSG_HDR_INFO_DATA_ROLE BIT(3)
@@ -209,6 +213,9 @@ struct tcpci;
* swap following Discover Identity on SOP' occurs.
* Return true when the TCPM is allowed to request a Vconn swap
* after Discovery Identity on SOP.
+ * @set_orientation:
+ * Optional; Enable setting the connector orientation
+ * CONFIG_STANDARD_OUTPUT (0x18) bit0.
*/
struct tcpci_data {
struct regmap *regmap;
@@ -216,6 +223,7 @@ struct tcpci_data {
unsigned char auto_discharge_disconnect:1;
unsigned char vbus_vsafe0v:1;
unsigned char cable_comm_capable:1;
+ unsigned char set_orientation:1;
int (*init)(struct tcpci *tcpci, struct tcpci_data *data);
int (*set_vconn)(struct tcpci *tcpci, struct tcpci_data *data,