Merge tag 'hsi-for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi
[sfrench/cifs-2.6.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 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.
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                 - 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
48 What:           /sys/class/typec/<port>/vconn_source
49 Date:           April 2017
50 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
51 Description:
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
65 What:           /sys/class/typec/<port>/power_operation_mode
66 Date:           April 2017
67 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
68 Description:
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
80 What:           /sys/class/typec/<port>/preferred_role
81 Date:           April 2017
82 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
83 Description:
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
91 What:           /sys/class/typec/<port>/supported_accessory_modes
92 Date:           April 2017
93 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
94 Description:
95                 Space separated list of accessory modes, defined in the USB
96                 Type-C specification, the port supports.
97
98 What:           /sys/class/typec/<port>/usb_power_delivery_revision
99 Date:           April 2017
100 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
101 Description:
102                 Revision number of the supported USB Power Delivery
103                 specification, or 0 when USB Power Delivery is not supported.
104
105 What:           /sys/class/typec/<port>/usb_typec_revision
106 Date:           April 2017
107 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
108 Description:
109                 Revision number of the supported USB Type-C specification.
110
111
112 USB Type-C partner devices (eg. /sys/class/typec/port0-partner/)
113
114 What:           /sys/class/typec/<port>-partner/accessory_mode
115 Date:           April 2017
116 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
117 Description:
118                 Shows the Accessory Mode name when the partner is an Accessory.
119                 The Accessory Modes are defined in USB Type-C Specification.
120
121 What:           /sys/class/typec/<port>-partner/supports_usb_power_delivery
122 Date:           April 2017
123 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
124 Description:
125                 Shows if the partner supports USB Power Delivery communication:
126                 Valid values: yes, no
127
128 What:           /sys/class/typec/<port>-partner>/identity/
129 Date:           April 2017
130 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
131 Description:
132                 This directory appears only if the port device driver is capable
133                 of showing the result of Discover Identity USB power delivery
134                 command. That will not always be possible even when USB power
135                 delivery is supported, for example when USB power delivery
136                 communication for the port is mostly handled in firmware. If the
137                 directory exists, it will have an attribute file for every VDO
138                 in Discover Identity command result.
139
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
165 USB Type-C cable devices (eg. /sys/class/typec/port0-cable/)
166
167 Note: Electronically Marked Cables will have a device also for one cable plug
168 (eg. /sys/class/typec/port0-plug0). If the cable is active and has also SOP
169 Double Prime controller (USB Power Deliver specification ch. 2.4) it will have
170 second device also for the other plug. Both plugs may have alternate modes as
171 described in USB Type-C and USB Power Delivery specifications.
172
173 What:           /sys/class/typec/<port>-cable/type
174 Date:           April 2017
175 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
176 Description:
177                 Shows if the cable is active.
178                 Valid values: active, passive
179
180 What:           /sys/class/typec/<port>-cable/plug_type
181 Date:           April 2017
182 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
183 Description:
184                 Shows type of the plug on the cable:
185                 - type-a - Standard A
186                 - type-b - Standard B
187                 - type-c
188                 - captive
189
190 What:           /sys/class/typec/<port>-cable/identity/
191 Date:           April 2017
192 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
193 Description:
194                 This directory appears only if the port device driver is capable
195                 of showing the result of Discover Identity USB power delivery
196                 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.
199
200 What:           /sys/class/typec/<port>-cable/identity/id_header
201 Date:           April 2017
202 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
203 Description:
204                 ID Header VDO part of Discover Identity command result. The
205                 value will show 0 until Discover Identity command result becomes
206                 available. The value can be polled.
207
208 What:           /sys/class/typec/<port>-cable/identity/cert_stat
209 Date:           April 2017
210 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
211 Description:
212                 Cert Stat VDO part of Discover Identity command result. The
213                 value will show 0 until Discover Identity command result becomes
214                 available. The value can be polled.
215
216 What:           /sys/class/typec/<port>-cable/identity/product
217 Date:           April 2017
218 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
219 Description:
220                 Product VDO part of Discover Identity command result. The value
221                 will show 0 until Discover Identity command result becomes
222                 available. The value can be polled.
223
224
225 Alternate Mode devices.
226
227 The alternate modes will have Standard or Vendor ID (SVID) assigned by USB-IF.
228 The ports, partners and cable plugs can have alternate modes. A supported SVID
229 will consist of a set of modes. Every SVID a port/partner/plug supports will
230 have a device created for it, and every supported mode for a supported SVID will
231 have its own directory under that device. Below <dev> refers to the device for
232 the alternate mode.
233
234 What:           /sys/class/typec/<port|partner|cable>/<dev>/svid
235 Date:           April 2017
236 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
237 Description:
238                 The SVID (Standard or Vendor ID) assigned by USB-IF for this
239                 alternate mode.
240
241 What:           /sys/class/typec/<port|partner|cable>/<dev>/mode<index>/
242 Date:           April 2017
243 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
244 Description:
245                 Every supported mode will have its own directory. The name of
246                 a mode will be "mode<index>" (for example mode1), where <index>
247                 is the actual index to the mode VDO returned by Discover Modes
248                 USB power delivery command.
249
250 What:           /sys/class/typec/<port|partner|cable>/<dev>/mode<index>/description
251 Date:           April 2017
252 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
253 Description:
254                 Shows description of the mode. The description is optional for
255                 the drivers, just like with the Billboard Devices.
256
257 What:           /sys/class/typec/<port|partner|cable>/<dev>/mode<index>/vdo
258 Date:           April 2017
259 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
260 Description:
261                 Shows the VDO in hexadecimal returned by Discover Modes command
262                 for this mode.
263
264 What:           /sys/class/typec/<port|partner|cable>/<dev>/mode<index>/active
265 Date:           April 2017
266 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
267 Description:
268                 Shows if the mode is active or not. The attribute can be used
269                 for entering/exiting the mode with partners and cable plugs, and
270                 with the port alternate modes it can be used for disabling
271                 support for specific alternate modes. Entering/exiting modes is
272                 supported as synchronous operation so write(2) to the attribute
273                 does not return until the enter/exit mode operation has
274                 finished. The attribute is notified when the mode is
275                 entered/exited so poll(2) on the attribute wakes up.
276                 Entering/exiting a mode will also generate uevent KOBJ_CHANGE.
277
278                 Valid values: yes, no
279
280 What:           /sys/class/typec/<port>/<dev>/mode<index>/supported_roles
281 Date:           April 2017
282 Contact:        Heikki Krogerus <heikki.krogerus@linux.intel.com>
283 Description:
284                 Space separated list of the supported roles.
285
286                 This attribute is available for the devices describing the
287                 alternate modes a port supports, and it will not be exposed with
288                 the devices presenting the alternate modes the partners or cable
289                 plugs support.
290
291                 Valid values: source, sink