Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1USB Type-C port devices (eg. /sys/class/typec/port0/)
2
3What: /sys/class/typec/<port>/data_role
4Date: April 2017
5Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
6Description:
7 The supported USB data roles. This attribute can be used for
8 requesting data role swapping on the port. Swapping is supported
9 as synchronous operation, so write(2) to the attribute will not
10 return until the operation has finished. The attribute is
11 notified about role changes so that poll(2) on the attribute
12 wakes up. Change on the role will also generate uevent
13 KOBJ_CHANGE on the port. The current role is show in brackets,
14 for example "[host] device" when DRP port is in host mode.
15
16 Valid values: host, device
17
18What: /sys/class/typec/<port>/power_role
19Date: April 2017
20Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
21Description:
22 The supported power roles. This attribute can be used to request
23 power role swap on the port. Swapping is supported as
24 synchronous operation, so write(2) to the attribute will not
25 return until the operation has finished. The attribute is
26 notified about role changes so that poll(2) on the attribute
27 wakes up. Change on the role will also generate uevent
28 KOBJ_CHANGE. The current role is show in brackets, for example
29 "[source] sink" when in source mode.
30
31 Valid values: source, sink
32
33What: /sys/class/typec/<port>/port_type
34Date: May 2017
35Contact: Badhri Jagan Sridharan <Badhri@google.com>
36Description:
37 Indicates the type of the port. This attribute can be used for
38 requesting a change in the port type. Port type change is
39 supported as a synchronous operation, so write(2) to the
40 attribute will not return until the operation has finished.
41
42 Valid values:
43 - source (The port will behave as source only DFP port)
44 - sink (The port will behave as sink only UFP port)
45 - dual (The port will behave as dual-role-data and
46 dual-role-power port)
47
48What: /sys/class/typec/<port>/vconn_source
49Date: April 2017
50Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
51Description:
52 Shows is the port VCONN Source. This attribute can be used to
53 request VCONN swap to change the VCONN Source during connection
54 when both the port and the partner support USB Power Delivery.
55 Swapping is supported as synchronous operation, so write(2) to
56 the attribute will not return until the operation has finished.
57 The attribute is notified about VCONN source changes so that
58 poll(2) on the attribute wakes up. Change on VCONN source also
59 generates uevent KOBJ_CHANGE.
60
61 Valid values:
62 - "no" when the port is not the VCONN Source
63 - "yes" when the port is the VCONN Source
64
65What: /sys/class/typec/<port>/power_operation_mode
66Date: April 2017
67Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
68Description:
69 Shows the current power operational mode the port is in. The
70 power operation mode means current level for VBUS. In case USB
71 Power Delivery communication is used for negotiating the levels,
72 power operation mode should show "usb_power_delivery".
73
74 Valid values:
75 - default
76 - 1.5A
77 - 3.0A
78 - usb_power_delivery
79
80What: /sys/class/typec/<port>/preferred_role
81Date: April 2017
82Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
83Description:
84 The user space can notify the driver about the preferred role.
85 It should be handled as enabling of Try.SRC or Try.SNK, as
86 defined in USB Type-C specification, in the port drivers. By
87 default the preferred role should come from the platform.
88
89 Valid values: source, sink, none (to remove preference)
90
91What: /sys/class/typec/<port>/supported_accessory_modes
92Date: April 2017
93Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
94Description:
95 Space separated list of accessory modes, defined in the USB
96 Type-C specification, the port supports.
97
98What: /sys/class/typec/<port>/usb_power_delivery_revision
99Date: April 2017
100Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
101Description:
102 Revision number of the supported USB Power Delivery
103 specification, or 0 when USB Power Delivery is not supported.
104
105What: /sys/class/typec/<port>/usb_typec_revision
106Date: April 2017
107Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
108Description:
109 Revision number of the supported USB Type-C specification.
110
111What: /sys/class/typec/<port>/orientation
112Date: February 2020
113Contact: Badhri Jagan Sridharan <badhri@google.com>
114Description:
115 Indicates the active orientation of the Type-C connector.
116 Valid values:
117 - "normal": CC1 orientation
118 - "reverse": CC2 orientation
119 - "unknown": Orientation cannot be determined.
120
121USB Type-C partner devices (eg. /sys/class/typec/port0-partner/)
122
123What: /sys/class/typec/<port>-partner/accessory_mode
124Date: April 2017
125Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
126Description:
127 Shows the Accessory Mode name when the partner is an Accessory.
128 The Accessory Modes are defined in USB Type-C Specification.
129
130What: /sys/class/typec/<port>-partner/supports_usb_power_delivery
131Date: April 2017
132Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
133Description:
134 Shows if the partner supports USB Power Delivery communication:
135 Valid values: yes, no
136
137What: /sys/class/typec/<port>-partner>/identity/
138Date: April 2017
139Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
140Description:
141 This directory appears only if the port device driver is capable
142 of showing the result of Discover Identity USB power delivery
143 command. That will not always be possible even when USB power
144 delivery is supported, for example when USB power delivery
145 communication for the port is mostly handled in firmware. If the
146 directory exists, it will have an attribute file for every VDO
147 in Discover Identity command result.
148
149What: /sys/class/typec/<port>-partner/identity/id_header
150Date: April 2017
151Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
152Description:
153 ID Header VDO part of Discover Identity command result. The
154 value will show 0 until Discover Identity command result becomes
155 available. The value can be polled.
156
157What: /sys/class/typec/<port>-partner/identity/cert_stat
158Date: April 2017
159Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
160Description:
161 Cert Stat VDO part of Discover Identity command result. The
162 value will show 0 until Discover Identity command result becomes
163 available. The value can be polled.
164
165What: /sys/class/typec/<port>-partner/identity/product
166Date: April 2017
167Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
168Description:
169 Product VDO part of Discover Identity command result. The value
170 will show 0 until Discover Identity command result becomes
171 available. The value can be polled.
172
173
174USB Type-C cable devices (eg. /sys/class/typec/port0-cable/)
175
176Note: Electronically Marked Cables will have a device also for one cable plug
177(eg. /sys/class/typec/port0-plug0). If the cable is active and has also SOP
178Double Prime controller (USB Power Deliver specification ch. 2.4) it will have
179second device also for the other plug. Both plugs may have alternate modes as
180described in USB Type-C and USB Power Delivery specifications.
181
182What: /sys/class/typec/<port>-cable/type
183Date: April 2017
184Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
185Description:
186 Shows if the cable is active.
187 Valid values: active, passive
188
189What: /sys/class/typec/<port>-cable/plug_type
190Date: April 2017
191Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
192Description:
193 Shows type of the plug on the cable:
194 - type-a - Standard A
195 - type-b - Standard B
196 - type-c
197 - captive
198
199What: /sys/class/typec/<port>-cable/identity/
200Date: April 2017
201Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
202Description:
203 This directory appears only if the port device driver is capable
204 of showing the result of Discover Identity USB power delivery
205 command. That will not always be possible even when USB power
206 delivery is supported. If the directory exists, it will have an
207 attribute for every VDO returned by Discover Identity command.
208
209What: /sys/class/typec/<port>-cable/identity/id_header
210Date: April 2017
211Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
212Description:
213 ID Header VDO part of Discover Identity command result. The
214 value will show 0 until Discover Identity command result becomes
215 available. The value can be polled.
216
217What: /sys/class/typec/<port>-cable/identity/cert_stat
218Date: April 2017
219Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
220Description:
221 Cert Stat VDO part of Discover Identity command result. The
222 value will show 0 until Discover Identity command result becomes
223 available. The value can be polled.
224
225What: /sys/class/typec/<port>-cable/identity/product
226Date: April 2017
227Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
228Description:
229 Product VDO part of Discover Identity command result. The value
230 will show 0 until Discover Identity command result becomes
231 available. The value can be polled.
232
233
234USB Type-C port alternate mode devices.
235
236What: /sys/class/typec/<port>/<alt mode>/supported_roles
237Date: April 2017
238Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
239Description:
240 Space separated list of the supported roles.
241
242 Valid values: source, sink