summaryrefslogtreecommitdiff
path: root/include/linux/usb/typec.h
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2018-03-20 15:57:05 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-22 13:40:10 +0100
commitceeb162500c3480b660a47d509db7955a7913271 (patch)
treef532363ff66a205bd47aa6be9e28d9604db7159e /include/linux/usb/typec.h
parentfde0aa6c175a4d8aa19e82b86ae0f9278bc8563b (diff)
usb: typec: Separate the definitions for data and power roles
USB Type-C specification v1.2 separated the power and data roles more clearly. Dual-Role-Data term was introduced, and the meaning of DRP was changed from "Dual-Role-Port" to "Dual-Role-Power". In order to allow the port drivers to describe the capabilities of the ports more clearly according to the newest specifications, introducing separate definitions for the data roles. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb/typec.h')
-rw-r--r--include/linux/usb/typec.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h
index 2408e5c2ed91..672b39bb0adc 100644
--- a/include/linux/usb/typec.h
+++ b/include/linux/usb/typec.h
@@ -22,9 +22,15 @@ struct typec_port;
struct fwnode_handle;
enum typec_port_type {
+ TYPEC_PORT_SRC,
+ TYPEC_PORT_SNK,
+ TYPEC_PORT_DRP,
+};
+
+enum typec_port_data {
TYPEC_PORT_DFP,
TYPEC_PORT_UFP,
- TYPEC_PORT_DRP,
+ TYPEC_PORT_DRD,
};
enum typec_plug_type {
@@ -186,10 +192,11 @@ struct typec_partner_desc {
/*
* struct typec_capability - USB Type-C Port Capabilities
- * @role: DFP (Host-only), UFP (Device-only) or DRP (Dual Role)
+ * @type: Supported power role of the port
+ * @data: Supported data role of the port
* @revision: USB Type-C Specification release. Binary coded decimal
* @pd_revision: USB Power Delivery Specification revision if supported
- * @prefer_role: Initial role preference
+ * @prefer_role: Initial role preference (DRP ports).
* @accessory: Supported Accessory Modes
* @sw: Cable plug orientation switch
* @mux: Multiplexer switch for Alternate/Accessory Modes
@@ -205,6 +212,7 @@ struct typec_partner_desc {
*/
struct typec_capability {
enum typec_port_type type;
+ enum typec_port_data data;
u16 revision; /* 0120H = "1.2" */
u16 pd_revision; /* 0300H = "3.0" */
int prefer_role;