Merge tag 'efi_updates_for_v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / Documentation / ABI / testing / sysfs-class-typec
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 <heikki.krogerus@linux.intel.com>
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 <heikki.krogerus@linux.intel.com>
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 <Badhri@google.com>
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 <heikki.krogerus@linux.intel.com>
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 <heikki.krogerus@linux.intel.com>
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 <heikki.krogerus@linux.intel.com>
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 <heikki.krogerus@linux.intel.com>
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 <heikki.krogerus@linux.intel.com>
106 Description:
107                 Revision number of the supported USB Power Delivery
108                 specification, or 0 when USB Power Delivery is not supported.
109
110 What:           /sys/class/typec/<port>/usb_typec_revision
111 Date:           April 2017
112 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
113 Description:
114                 Revision number of the supported USB Type-C specification.
115
116 What:           /sys/class/typec/<port>/orientation
117 Date:           February 2020
118 Contact:        Badhri Jagan Sridharan <badhri@google.com>
119 Description:
120                 Indicates the active orientation of the Type-C connector.
121                 Valid values:
122                 - "normal": CC1 orientation
123                 - "reverse": CC2 orientation
124                 - "unknown": Orientation cannot be determined.
125
126 USB Type-C partner devices (eg. /sys/class/typec/port0-partner/)
127
128 What:           /sys/class/typec/<port>-partner/accessory_mode
129 Date:           April 2017
130 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
131 Description:
132                 Shows the Accessory Mode name when the partner is an Accessory.
133                 The Accessory Modes are defined in USB Type-C Specification.
134
135 What:           /sys/class/typec/<port>-partner/supports_usb_power_delivery
136 Date:           April 2017
137 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
138 Description:
139                 Shows if the partner supports USB Power Delivery communication:
140                 Valid values: yes, no
141
142 What:           /sys/class/typec/<port>-partner/number_of_alternate_modes
143 Date:           November 2020
144 Contact:        Prashant Malani <pmalani@chromium.org>
145 Description:
146                 Shows the number of alternate modes which are advertised by the partner
147                 during Power Delivery discovery. This file remains hidden until a value
148                 greater than or equal to 0 is set by Type C port driver.
149
150 What:           /sys/class/typec/<port>-partner/type
151 Date:           December 2020
152 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
153 Description:    USB Power Delivery Specification defines a set of product types
154                 for the partner devices. This file will show the product type of
155                 the partner if it is known. Dual-role capable partners will have
156                 both UFP and DFP product types defined, but only one that
157                 matches the current role will be active at the time. If the
158                 product type of the partner is not visible to the device driver,
159                 this file will not exist.
160
161                 When the partner product type is detected, or changed with role
162                 swap, uvevent is also raised that contains PRODUCT_TYPE=<product
163                 type> (for example PRODUCT_TYPE=hub).
164
165                 Valid values:
166
167                 UFP / device role
168                 ======================  ==========================
169                 undefined               -
170                 hub                     PDUSB Hub
171                 peripheral              PDUSB Peripheral
172                 psd                     Power Bank
173                 ama                     Alternate Mode Adapter
174                 ======================  ==========================
175
176                 DFP / host role
177                 ======================  ==========================
178                 undefined               -
179                 hub                     PDUSB Hub
180                 host                    PDUSB Host
181                 power_brick             Power Brick
182                 amc                     Alternate Mode Controller
183                 ======================  ==========================
184
185 What:           /sys/class/typec/<port>-partner>/identity/
186 Date:           April 2017
187 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
188 Description:
189                 This directory appears only if the port device driver is capable
190                 of showing the result of Discover Identity USB power delivery
191                 command. That will not always be possible even when USB power
192                 delivery is supported, for example when USB power delivery
193                 communication for the port is mostly handled in firmware. If the
194                 directory exists, it will have an attribute file for every VDO
195                 in Discover Identity command result.
196
197 USB Type-C cable devices (eg. /sys/class/typec/port0-cable/)
198
199 Note: Electronically Marked Cables will have a device also for one cable plug
200 (eg. /sys/class/typec/port0-plug0). If the cable is active and has also SOP
201 Double Prime controller (USB Power Deliver specification ch. 2.4) it will have
202 second device also for the other plug. Both plugs may have alternate modes as
203 described in USB Type-C and USB Power Delivery specifications.
204
205 What:           /sys/class/typec/<port>-cable/type
206 Date:           April 2017
207 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
208 Description:    USB Power Delivery Specification defines a set of product types
209                 for the cables. This file will show the product type of the
210                 cable if it is known. If the product type of the cable is not
211                 visible to the device driver, this file will not exist.
212
213                 When the cable product type is detected, uvevent is also raised
214                 with PRODUCT_TYPE showing the product type of the cable.
215
216                 Valid values:
217
218                 ======================  ==========================
219                 undefined               -
220                 active                  Active Cable
221                 passive                 Passive Cable
222                 ======================  ==========================
223
224 What:           /sys/class/typec/<port>-cable/plug_type
225 Date:           April 2017
226 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
227 Description:
228                 Shows type of the plug on the cable:
229
230                 - type-a - Standard A
231                 - type-b - Standard B
232                 - type-c
233                 - captive
234
235 What:           /sys/class/typec/<port>-<plug>/number_of_alternate_modes
236 Date:           November 2020
237 Contact:        Prashant Malani <pmalani@chromium.org>
238 Description:
239                 Shows the number of alternate modes which are advertised by the plug
240                 associated with a particular cable during Power Delivery discovery.
241                 This file remains hidden until a value greater than or equal to 0
242                 is set by Type C port driver.
243
244
245 USB Type-C partner/cable Power Delivery Identity objects
246
247 NOTE: The following attributes will be applicable to both
248 partner (e.g /sys/class/typec/port0-partner/) and
249 cable (e.g /sys/class/typec/port0-cable/) devices. Consequently, the example file
250 paths below are prefixed with "/sys/class/typec/<port>-{partner|cable}/" to
251 reflect this.
252
253 What:           /sys/class/typec/<port>-{partner|cable}/identity/
254 Date:           April 2017
255 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
256 Description:
257                 This directory appears only if the port device driver is capable
258                 of showing the result of Discover Identity USB power delivery
259                 command. That will not always be possible even when USB power
260                 delivery is supported, for example when USB power delivery
261                 communication for the port is mostly handled in firmware. If the
262                 directory exists, it will have an attribute file for every VDO
263                 in Discover Identity command result.
264
265 What:           /sys/class/typec/<port>-{partner|cable}/identity/id_header
266 Date:           April 2017
267 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
268 Description:
269                 ID Header VDO part of Discover Identity command result. The
270                 value will show 0 until Discover Identity command result becomes
271                 available. The value can be polled.
272
273 What:           /sys/class/typec/<port>-{partner|cable}/identity/cert_stat
274 Date:           April 2017
275 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
276 Description:
277                 Cert Stat VDO part of Discover Identity command result. The
278                 value will show 0 until Discover Identity command result becomes
279                 available. The value can be polled.
280
281 What:           /sys/class/typec/<port>-{partner|cable}/identity/product
282 Date:           April 2017
283 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
284 Description:
285                 Product VDO part of Discover Identity command result. The value
286                 will show 0 until Discover Identity command result becomes
287                 available. The value can be polled.
288
289 What:           /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo1
290 Date:           October 2020
291 Contact:        Prashant Malani <pmalani@chromium.org>
292 Description:
293                 1st Product Type VDO of Discover Identity command result.
294                 The value will show 0 until Discover Identity command result becomes
295                 available and a valid Product Type VDO is returned.
296
297 What:           /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo2
298 Date:           October 2020
299 Contact:        Prashant Malani <pmalani@chromium.org>
300 Description:
301                 2nd Product Type VDO of Discover Identity command result.
302                 The value will show 0 until Discover Identity command result becomes
303                 available and a valid Product Type VDO is returned.
304
305 What:           /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo3
306 Date:           October 2020
307 Contact:        Prashant Malani <pmalani@chromium.org>
308 Description:
309                 3rd Product Type VDO of Discover Identity command result.
310                 The value will show 0 until Discover Identity command result becomes
311                 available and a valid Product Type VDO is returned.
312
313
314 USB Type-C port alternate mode devices.
315
316 What:           /sys/class/typec/<port>/<alt mode>/supported_roles
317 Date:           April 2017
318 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
319 Description:
320                 Space separated list of the supported roles.
321
322                 Valid values: source, sink