hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/Documentation/ABI/testing/sysfs-class-typec
....@@ -20,13 +20,13 @@
2020 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
2121 Description:
2222 The supported power roles. This attribute can be used to request
23
- power role swap on the port when the port supports USB Power
24
- Delivery. Swapping is supported as synchronous operation, so
25
- write(2) to the attribute will not return until the operation
26
- has finished. The attribute is notified about role changes so
27
- that poll(2) on the attribute wakes up. Change on the role will
28
- also generate uevent KOBJ_CHANGE. The current role is show in
29
- brackets, for example "[source] sink" when in source mode.
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.
3030
3131 Valid values: source, sink
3232
....@@ -40,10 +40,13 @@
4040 attribute will not return until the operation has finished.
4141
4242 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
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
4648 dual-role-power port)
49
+ ====== ==============================================
4750
4851 What: /sys/class/typec/<port>/vconn_source
4952 Date: April 2017
....@@ -59,6 +62,7 @@
5962 generates uevent KOBJ_CHANGE.
6063
6164 Valid values:
65
+
6266 - "no" when the port is not the VCONN Source
6367 - "yes" when the port is the VCONN Source
6468
....@@ -72,6 +76,7 @@
7276 power operation mode should show "usb_power_delivery".
7377
7478 Valid values:
79
+
7580 - default
7681 - 1.5A
7782 - 3.0A
....@@ -100,7 +105,25 @@
100105 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
101106 Description:
102107 Revision number of the supported USB Power Delivery
103
- specification, or 0 when USB Power Delivery is not supported.
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 <bleung@chromium.org>
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
104127
105128 What: /sys/class/typec/<port>/usb_typec_revision
106129 Date: April 2017
....@@ -108,6 +131,15 @@
108131 Description:
109132 Revision number of the supported USB Type-C specification.
110133
134
+What: /sys/class/typec/<port>/orientation
135
+Date: February 2020
136
+Contact: Badhri Jagan Sridharan <badhri@google.com>
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.
111143
112144 USB Type-C partner devices (eg. /sys/class/typec/port0-partner/)
113145
....@@ -125,6 +157,49 @@
125157 Shows if the partner supports USB Power Delivery communication:
126158 Valid values: yes, no
127159
160
+What: /sys/class/typec/<port>-partner/number_of_alternate_modes
161
+Date: November 2020
162
+Contact: Prashant Malani <pmalani@chromium.org>
163
+Description:
164
+ Shows the number of alternate modes which are advertised by the partner
165
+ during Power Delivery discovery. This file remains hidden until a value
166
+ greater than or equal to 0 is set by Type C port driver.
167
+
168
+What: /sys/class/typec/<port>-partner/type
169
+Date: December 2020
170
+Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
171
+Description: USB Power Delivery Specification defines a set of product types
172
+ for the partner devices. This file will show the product type of
173
+ the partner if it is known. Dual-role capable partners will have
174
+ both UFP and DFP product types defined, but only one that
175
+ matches the current role will be active at the time. If the
176
+ product type of the partner is not visible to the device driver,
177
+ this file will not exist.
178
+
179
+ When the partner product type is detected, or changed with role
180
+ swap, uvevent is also raised that contains PRODUCT_TYPE=<product
181
+ type> (for example PRODUCT_TYPE=hub).
182
+
183
+ Valid values:
184
+
185
+ UFP / device role
186
+ ====================== ==========================
187
+ undefined -
188
+ hub PDUSB Hub
189
+ peripheral PDUSB Peripheral
190
+ psd Power Bank
191
+ ama Alternate Mode Adapter
192
+ ====================== ==========================
193
+
194
+ DFP / host role
195
+ ====================== ==========================
196
+ undefined -
197
+ hub PDUSB Hub
198
+ host PDUSB Host
199
+ power_brick Power Brick
200
+ amc Alternate Mode Controller
201
+ ====================== ==========================
202
+
128203 What: /sys/class/typec/<port>-partner>/identity/
129204 Date: April 2017
130205 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
....@@ -137,31 +212,6 @@
137212 directory exists, it will have an attribute file for every VDO
138213 in Discover Identity command result.
139214
140
-What: /sys/class/typec/<port>-partner/identity/id_header
141
-Date: April 2017
142
-Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
143
-Description:
144
- ID Header VDO part of Discover Identity command result. The
145
- value will show 0 until Discover Identity command result becomes
146
- available. The value can be polled.
147
-
148
-What: /sys/class/typec/<port>-partner/identity/cert_stat
149
-Date: April 2017
150
-Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
151
-Description:
152
- Cert Stat VDO part of Discover Identity command result. The
153
- value will show 0 until Discover Identity command result becomes
154
- available. The value can be polled.
155
-
156
-What: /sys/class/typec/<port>-partner/identity/product
157
-Date: April 2017
158
-Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
159
-Description:
160
- Product VDO part of Discover Identity command result. The value
161
- will show 0 until Discover Identity command result becomes
162
- available. The value can be polled.
163
-
164
-
165215 USB Type-C cable devices (eg. /sys/class/typec/port0-cable/)
166216
167217 Note: Electronically Marked Cables will have a device also for one cable plug
....@@ -173,31 +223,64 @@
173223 What: /sys/class/typec/<port>-cable/type
174224 Date: April 2017
175225 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
176
-Description:
177
- Shows if the cable is active.
178
- Valid values: active, passive
226
+Description: USB Power Delivery Specification defines a set of product types
227
+ for the cables. This file will show the product type of the
228
+ cable if it is known. If the product type of the cable is not
229
+ visible to the device driver, this file will not exist.
230
+
231
+ When the cable product type is detected, uvevent is also raised
232
+ with PRODUCT_TYPE showing the product type of the cable.
233
+
234
+ Valid values:
235
+
236
+ ====================== ==========================
237
+ undefined -
238
+ active Active Cable
239
+ passive Passive Cable
240
+ ====================== ==========================
179241
180242 What: /sys/class/typec/<port>-cable/plug_type
181243 Date: April 2017
182244 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
183245 Description:
184246 Shows type of the plug on the cable:
247
+
185248 - type-a - Standard A
186249 - type-b - Standard B
187250 - type-c
188251 - captive
189252
190
-What: /sys/class/typec/<port>-cable/identity/
253
+What: /sys/class/typec/<port>-<plug>/number_of_alternate_modes
254
+Date: November 2020
255
+Contact: Prashant Malani <pmalani@chromium.org>
256
+Description:
257
+ Shows the number of alternate modes which are advertised by the plug
258
+ associated with a particular cable during Power Delivery discovery.
259
+ This file remains hidden until a value greater than or equal to 0
260
+ is set by Type C port driver.
261
+
262
+
263
+USB Type-C partner/cable Power Delivery Identity objects
264
+
265
+NOTE: The following attributes will be applicable to both
266
+partner (e.g /sys/class/typec/port0-partner/) and
267
+cable (e.g /sys/class/typec/port0-cable/) devices. Consequently, the example file
268
+paths below are prefixed with "/sys/class/typec/<port>-{partner|cable}/" to
269
+reflect this.
270
+
271
+What: /sys/class/typec/<port>-{partner|cable}/identity/
191272 Date: April 2017
192273 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
193274 Description:
194275 This directory appears only if the port device driver is capable
195276 of showing the result of Discover Identity USB power delivery
196277 command. That will not always be possible even when USB power
197
- delivery is supported. If the directory exists, it will have an
198
- attribute for every VDO returned by Discover Identity command.
278
+ delivery is supported, for example when USB power delivery
279
+ communication for the port is mostly handled in firmware. If the
280
+ directory exists, it will have an attribute file for every VDO
281
+ in Discover Identity command result.
199282
200
-What: /sys/class/typec/<port>-cable/identity/id_header
283
+What: /sys/class/typec/<port>-{partner|cable}/identity/id_header
201284 Date: April 2017
202285 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
203286 Description:
....@@ -205,7 +288,7 @@
205288 value will show 0 until Discover Identity command result becomes
206289 available. The value can be polled.
207290
208
-What: /sys/class/typec/<port>-cable/identity/cert_stat
291
+What: /sys/class/typec/<port>-{partner|cable}/identity/cert_stat
209292 Date: April 2017
210293 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
211294 Description:
....@@ -213,7 +296,7 @@
213296 value will show 0 until Discover Identity command result becomes
214297 available. The value can be polled.
215298
216
-What: /sys/class/typec/<port>-cable/identity/product
299
+What: /sys/class/typec/<port>-{partner|cable}/identity/product
217300 Date: April 2017
218301 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
219302 Description:
....@@ -221,6 +304,30 @@
221304 will show 0 until Discover Identity command result becomes
222305 available. The value can be polled.
223306
307
+What: /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo1
308
+Date: October 2020
309
+Contact: Prashant Malani <pmalani@chromium.org>
310
+Description:
311
+ 1st Product Type VDO of Discover Identity command result.
312
+ The value will show 0 until Discover Identity command result becomes
313
+ available and a valid Product Type VDO is returned.
314
+
315
+What: /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo2
316
+Date: October 2020
317
+Contact: Prashant Malani <pmalani@chromium.org>
318
+Description:
319
+ 2nd Product Type VDO of Discover Identity command result.
320
+ The value will show 0 until Discover Identity command result becomes
321
+ available and a valid Product Type VDO is returned.
322
+
323
+What: /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo3
324
+Date: October 2020
325
+Contact: Prashant Malani <pmalani@chromium.org>
326
+Description:
327
+ 3rd Product Type VDO of Discover Identity command result.
328
+ The value will show 0 until Discover Identity command result becomes
329
+ available and a valid Product Type VDO is returned.
330
+
224331
225332 USB Type-C port alternate mode devices.
226333