Debian Codegraph @

Documentation/ABI/testing/sysfs-class-typec

raw
1 USB Type-C port devices (eg. /sys/class/typec/port0/)
2
3 What: /sys/class/typec/<port>/data_role
4 Date: April 2017
5 Contact: Heikki Krogerus <[email protected]>
6 Description:
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
18 What: /sys/class/typec/<port>/power_role
19 Date: April 2017
20 Contact: Heikki Krogerus <[email protected]>
21 Description:
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
33 What: /sys/class/typec/<port>/port_type
34 Date: May 2017
35 Contact: Badhri Jagan Sridharan <[email protected]>
36 Description:
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
44 ====== ==============================================
45 source (The port will behave as source only DFP port)
46 sink (The port will behave as sink only UFP port)
47 dual (The port will behave as dual-role-data and
48 dual-role-power port)
49 ====== ==============================================
50
51 What: /sys/class/typec/<port>/vconn_source
52 Date: April 2017
53 Contact: Heikki Krogerus <[email protected]>
54 Description:
55 Shows is the port VCONN Source. This attribute can be used to
56 request VCONN swap to change the VCONN Source during connection
57 when both the port and the partner support USB Power Delivery.
58 Swapping is supported as synchronous operation, so write(2) to
59 the attribute will not return until the operation has finished.
60 The attribute is notified about VCONN source changes so that
61 poll(2) on the attribute wakes up. Change on VCONN source also
62 generates uevent KOBJ_CHANGE.
63
64 Valid values:
65
66 - "no" when the port is not the VCONN Source
67 - "yes" when the port is the VCONN Source
68
69 What: /sys/class/typec/<port>/power_operation_mode
70 Date: April 2017
71 Contact: Heikki Krogerus <[email protected]>
72 Description:
73 Shows the current power operational mode the port is in. The
74 power operation mode means current level for VBUS. In case USB
75 Power Delivery communication is used for negotiating the levels,
76 power operation mode should show "usb_power_delivery".
77
78 Valid values:
79
80 - default
81 - 1.5A
82 - 3.0A
83 - usb_power_delivery
84
85 What: /sys/class/typec/<port>/preferred_role
86 Date: April 2017
87 Contact: Heikki Krogerus <[email protected]>
88 Description:
89 The user space can notify the driver about the preferred role.
90 It should be handled as enabling of Try.SRC or Try.SNK, as
91 defined in USB Type-C specification, in the port drivers. By
92 default the preferred role should come from the platform.
93
94 Valid values: source, sink, none (to remove preference)
95
96 What: /sys/class/typec/<port>/supported_accessory_modes
97 Date: April 2017
98 Contact: Heikki Krogerus <[email protected]>
99 Description:
100 Space separated list of accessory modes, defined in the USB
101 Type-C specification, the port supports.
102
103 What: /sys/class/typec/<port>/usb_power_delivery_revision
104 Date: April 2017
105 Contact: Heikki Krogerus <[email protected]>
106 Description:
107 Revision number of the supported USB Power Delivery
108 specification, or 0.0 when USB Power Delivery is not supported.
109
110 Example values:
111 - "2.0": USB Power Delivery Release 2.0
112 - "3.0": USB Power Delivery Release 3.0
113 - "3.1": USB Power Delivery Release 3.1
114
115 What: /sys/class/typec/<port>-{partner|cable}/usb_power_delivery_revision
116 Date: January 2021
117 Contact: Benson Leung <[email protected]>
118 Description:
119 Revision number of the supported USB Power Delivery
120 specification of the port partner or cable, or 0.0 when USB
121 Power Delivery is not supported.
122
123 Example values:
124 - "2.0": USB Power Delivery Release 2.0
125 - "3.0": USB Power Delivery Release 3.0
126 - "3.1": USB Power Delivery Release 3.1
127
128 What: /sys/class/typec/<port>/usb_typec_revision
129 Date: April 2017
130 Contact: Heikki Krogerus <[email protected]>
131 Description:
132 Revision number of the supported USB Type-C specification.
133
134 What: /sys/class/typec/<port>/orientation
135 Date: February 2020
136 Contact: Badhri Jagan Sridharan <[email protected]>
137 Description:
138 Indicates the active orientation of the Type-C connector.
139 Valid values:
140 - "normal": CC1 orientation
141 - "reverse": CC2 orientation
142 - "unknown": Orientation cannot be determined.
143
144 What: /sys/class/typec/<port>/select_usb_power_delivery
145 Date: May 2022
146 Contact: Heikki Krogerus <[email protected]>
147 Description:
148 Lists the USB Power Delivery Capabilities that the port can
149 advertise to the partner. The currently used capabilities are in
150 brackets. Selection happens by writing to the file.
151
152 What: /sys/class/typec/<port>/usb_capability
153 Date: November 2024
154 Contact: Heikki Krogerus <[email protected]>
155 Description: Lists the supported USB Modes. The default USB mode that is used
156 next time with the Enter_USB Message is in brackets. The default
157 mode can be changed by writing to the file when supported by the
158 driver.
159
160 Valid values:
161 - usb2 (USB 2.0)
162 - usb3 (USB 3.2)
163 - usb4 (USB4)
164
165 What: /sys/class/typec/<port>/<alt-mode>/priority
166 Date: July 2025
167 Contact: Andrei Kuchynski <[email protected]>
168 Description:
169 Displays and allows setting the priority for a specific alternate mode.
170 The priority is an integer in the range 0-255. A lower numerical value
171 indicates a higher priority (0 is the highest).
172 If the new value is already in use by another mode, the priority of the
173 conflicting mode and any subsequent modes will be incremented until they
174 are all unique.
175
176 USB Type-C partner devices (eg. /sys/class/typec/port0-partner/)
177
178 What: /sys/class/typec/<port>-partner/accessory_mode
179 Date: April 2017
180 Contact: Heikki Krogerus <[email protected]>
181 Description:
182 Shows the Accessory Mode name when the partner is an Accessory.
183 The Accessory Modes are defined in USB Type-C Specification.
184
185 What: /sys/class/typec/<port>-partner/supports_usb_power_delivery
186 Date: April 2017
187 Contact: Heikki Krogerus <[email protected]>
188 Description:
189 Shows if the partner supports USB Power Delivery communication:
190 Valid values: yes, no
191
192 What: /sys/class/typec/<port>-partner/number_of_alternate_modes
193 Date: November 2020
194 Contact: Prashant Malani <[email protected]>
195 Description:
196 Shows the number of alternate modes which are advertised by the partner
197 during Power Delivery discovery. This file remains hidden until a value
198 greater than or equal to 0 is set by Type C port driver.
199
200 What: /sys/class/typec/<port>-partner/type
201 Date: December 2020
202 Contact: Heikki Krogerus <[email protected]>
203 Description: USB Power Delivery Specification defines a set of product types
204 for the partner devices. This file will show the product type of
205 the partner if it is known. Dual-role capable partners will have
206 both UFP and DFP product types defined, but only one that
207 matches the current role will be active at the time. If the
208 product type of the partner is not visible to the device driver,
209 this file will not exist.
210
211 When the partner product type is detected, or changed with role
212 swap, uvevent is also raised that contains PRODUCT_TYPE=<product
213 type> (for example PRODUCT_TYPE=hub).
214
215 Valid values:
216
217 UFP / device role
218 ====================== ==========================
219 undefined -
220 hub PDUSB Hub
221 peripheral PDUSB Peripheral
222 psd Power Bank
223 ama Alternate Mode Adapter
224 ====================== ==========================
225
226 DFP / host role
227 ====================== ==========================
228 undefined -
229 hub PDUSB Hub
230 host PDUSB Host
231 power_brick Power Brick
232 amc Alternate Mode Controller
233 ====================== ==========================
234
235 What: /sys/class/typec/<port>-partner/identity/
236 Date: April 2017
237 Contact: Heikki Krogerus <[email protected]>
238 Description:
239 This directory appears only if the port device driver is capable
240 of showing the result of Discover Identity USB power delivery
241 command. That will not always be possible even when USB power
242 delivery is supported, for example when USB power delivery
243 communication for the port is mostly handled in firmware. If the
244 directory exists, it will have an attribute file for every VDO
245 in Discover Identity command result.
246
247 What: /sys/class/typec/<port>-partner/usb_mode
248 Date: November 2024
249 Contact: Heikki Krogerus <[email protected]>
250 Description: The USB Modes that the partner device supports. The active mode
251 is displayed in brackets. The active USB mode can be changed by
252 writing to this file when the port driver is able to send Data
253 Reset Message to the partner. That requires USB Power Delivery
254 contract between the partner and the port.
255
256 Valid values:
257 - usb2 (USB 2.0)
258 - usb3 (USB 3.2)
259 - usb4 (USB4)
260
261 USB Type-C cable devices (eg. /sys/class/typec/port0-cable/)
262
263 Note: Electronically Marked Cables will have a device also for one cable plug
264 (eg. /sys/class/typec/port0-plug0). If the cable is active and has also SOP
265 Double Prime controller (USB Power Deliver specification ch. 2.4) it will have
266 second device also for the other plug. Both plugs may have alternate modes as
267 described in USB Type-C and USB Power Delivery specifications.
268
269 What: /sys/class/typec/<port>-cable/type
270 Date: April 2017
271 Contact: Heikki Krogerus <[email protected]>
272 Description: USB Power Delivery Specification defines a set of product types
273 for the cables. This file will show the product type of the
274 cable if it is known. If the product type of the cable is not
275 visible to the device driver, this file will not exist.
276
277 When the cable product type is detected, uvevent is also raised
278 with PRODUCT_TYPE showing the product type of the cable.
279
280 Valid values:
281
282 ====================== ==========================
283 undefined -
284 active Active Cable
285 passive Passive Cable
286 ====================== ==========================
287
288 What: /sys/class/typec/<port>-cable/plug_type
289 Date: April 2017
290 Contact: Heikki Krogerus <[email protected]>
291 Description:
292 Shows type of the plug on the cable:
293
294 - type-a - Standard A
295 - type-b - Standard B
296 - type-c
297 - captive
298
299 What: /sys/class/typec/<port>-<plug>/number_of_alternate_modes
300 Date: November 2020
301 Contact: Prashant Malani <[email protected]>
302 Description:
303 Shows the number of alternate modes which are advertised by the plug
304 associated with a particular cable during Power Delivery discovery.
305 This file remains hidden until a value greater than or equal to 0
306 is set by Type C port driver.
307
308
309 USB Type-C partner/cable Power Delivery Identity objects
310
311 NOTE: The following attributes will be applicable to both
312 partner (e.g /sys/class/typec/port0-partner/) and
313 cable (e.g /sys/class/typec/port0-cable/) devices. Consequently, the example file
314 paths below are prefixed with "/sys/class/typec/<port>-{partner|cable}/" to
315 reflect this.
316
317 What: /sys/class/typec/<port>-{partner|cable}/identity/
318 Date: April 2017
319 Contact: Heikki Krogerus <[email protected]>
320 Description:
321 This directory appears only if the port device driver is capable
322 of showing the result of Discover Identity USB power delivery
323 command. That will not always be possible even when USB power
324 delivery is supported, for example when USB power delivery
325 communication for the port is mostly handled in firmware. If the
326 directory exists, it will have an attribute file for every VDO
327 in Discover Identity command result.
328
329 What: /sys/class/typec/<port>-{partner|cable}/identity/id_header
330 Date: April 2017
331 Contact: Heikki Krogerus <[email protected]>
332 Description:
333 ID Header VDO part of Discover Identity command result. The
334 value will show 0 until Discover Identity command result becomes
335 available. The value can be polled.
336
337 What: /sys/class/typec/<port>-{partner|cable}/identity/cert_stat
338 Date: April 2017
339 Contact: Heikki Krogerus <[email protected]>
340 Description:
341 Cert Stat VDO part of Discover Identity command result. The
342 value will show 0 until Discover Identity command result becomes
343 available. The value can be polled.
344
345 What: /sys/class/typec/<port>-{partner|cable}/identity/product
346 Date: April 2017
347 Contact: Heikki Krogerus <[email protected]>
348 Description:
349 Product VDO part of Discover Identity command result. The value
350 will show 0 until Discover Identity command result becomes
351 available. The value can be polled.
352
353 What: /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo1
354 Date: October 2020
355 Contact: Prashant Malani <[email protected]>
356 Description:
357 1st Product Type VDO of Discover Identity command result.
358 The value will show 0 until Discover Identity command result becomes
359 available and a valid Product Type VDO is returned.
360
361 What: /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo2
362 Date: October 2020
363 Contact: Prashant Malani <[email protected]>
364 Description:
365 2nd Product Type VDO of Discover Identity command result.
366 The value will show 0 until Discover Identity command result becomes
367 available and a valid Product Type VDO is returned.
368
369 What: /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo3
370 Date: October 2020
371 Contact: Prashant Malani <[email protected]>
372 Description:
373 3rd Product Type VDO of Discover Identity command result.
374 The value will show 0 until Discover Identity command result becomes
375 available and a valid Product Type VDO is returned.
376
377
378 USB Type-C port alternate mode devices.
379
380 What: /sys/class/typec/<port>/<alt mode>/supported_roles
381 Date: April 2017
382 Contact: Heikki Krogerus <[email protected]>
383 Description:
384 Space separated list of the supported roles.
385
386 Valid values: source, sink