0001 USB Type-C port devices (eg. /sys/class/typec/port0/)
0002
0003 What: /sys/class/typec/<port>/data_role
0004 Date: April 2017
0005 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0006 Description:
0007 The supported USB data roles. This attribute can be used for
0008 requesting data role swapping on the port. Swapping is supported
0009 as synchronous operation, so write(2) to the attribute will not
0010 return until the operation has finished. The attribute is
0011 notified about role changes so that poll(2) on the attribute
0012 wakes up. Change on the role will also generate uevent
0013 KOBJ_CHANGE on the port. The current role is show in brackets,
0014 for example "[host] device" when DRP port is in host mode.
0015
0016 Valid values: host, device
0017
0018 What: /sys/class/typec/<port>/power_role
0019 Date: April 2017
0020 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0021 Description:
0022 The supported power roles. This attribute can be used to request
0023 power role swap on the port. Swapping is supported as
0024 synchronous operation, so write(2) to the attribute will not
0025 return until the operation has finished. The attribute is
0026 notified about role changes so that poll(2) on the attribute
0027 wakes up. Change on the role will also generate uevent
0028 KOBJ_CHANGE. The current role is show in brackets, for example
0029 "[source] sink" when in source mode.
0030
0031 Valid values: source, sink
0032
0033 What: /sys/class/typec/<port>/port_type
0034 Date: May 2017
0035 Contact: Badhri Jagan Sridharan <Badhri@google.com>
0036 Description:
0037 Indicates the type of the port. This attribute can be used for
0038 requesting a change in the port type. Port type change is
0039 supported as a synchronous operation, so write(2) to the
0040 attribute will not return until the operation has finished.
0041
0042 Valid values:
0043
0044 ====== ==============================================
0045 source (The port will behave as source only DFP port)
0046 sink (The port will behave as sink only UFP port)
0047 dual (The port will behave as dual-role-data and
0048 dual-role-power port)
0049 ====== ==============================================
0050
0051 What: /sys/class/typec/<port>/vconn_source
0052 Date: April 2017
0053 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0054 Description:
0055 Shows is the port VCONN Source. This attribute can be used to
0056 request VCONN swap to change the VCONN Source during connection
0057 when both the port and the partner support USB Power Delivery.
0058 Swapping is supported as synchronous operation, so write(2) to
0059 the attribute will not return until the operation has finished.
0060 The attribute is notified about VCONN source changes so that
0061 poll(2) on the attribute wakes up. Change on VCONN source also
0062 generates uevent KOBJ_CHANGE.
0063
0064 Valid values:
0065
0066 - "no" when the port is not the VCONN Source
0067 - "yes" when the port is the VCONN Source
0068
0069 What: /sys/class/typec/<port>/power_operation_mode
0070 Date: April 2017
0071 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0072 Description:
0073 Shows the current power operational mode the port is in. The
0074 power operation mode means current level for VBUS. In case USB
0075 Power Delivery communication is used for negotiating the levels,
0076 power operation mode should show "usb_power_delivery".
0077
0078 Valid values:
0079
0080 - default
0081 - 1.5A
0082 - 3.0A
0083 - usb_power_delivery
0084
0085 What: /sys/class/typec/<port>/preferred_role
0086 Date: April 2017
0087 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0088 Description:
0089 The user space can notify the driver about the preferred role.
0090 It should be handled as enabling of Try.SRC or Try.SNK, as
0091 defined in USB Type-C specification, in the port drivers. By
0092 default the preferred role should come from the platform.
0093
0094 Valid values: source, sink, none (to remove preference)
0095
0096 What: /sys/class/typec/<port>/supported_accessory_modes
0097 Date: April 2017
0098 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0099 Description:
0100 Space separated list of accessory modes, defined in the USB
0101 Type-C specification, the port supports.
0102
0103 What: /sys/class/typec/<port>/usb_power_delivery_revision
0104 Date: April 2017
0105 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0106 Description:
0107 Revision number of the supported USB Power Delivery
0108 specification, or 0.0 when USB Power Delivery is not supported.
0109
0110 Example values:
0111 - "2.0": USB Power Delivery Release 2.0
0112 - "3.0": USB Power Delivery Release 3.0
0113 - "3.1": USB Power Delivery Release 3.1
0114
0115 What: /sys/class/typec/<port>-{partner|cable}/usb_power_delivery_revision
0116 Date: January 2021
0117 Contact: Benson Leung <bleung@chromium.org>
0118 Description:
0119 Revision number of the supported USB Power Delivery
0120 specification of the port partner or cable, or 0.0 when USB
0121 Power Delivery is not supported.
0122
0123 Example values:
0124 - "2.0": USB Power Delivery Release 2.0
0125 - "3.0": USB Power Delivery Release 3.0
0126 - "3.1": USB Power Delivery Release 3.1
0127
0128 What: /sys/class/typec/<port>/usb_typec_revision
0129 Date: April 2017
0130 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0131 Description:
0132 Revision number of the supported USB Type-C specification.
0133
0134 What: /sys/class/typec/<port>/orientation
0135 Date: February 2020
0136 Contact: Badhri Jagan Sridharan <badhri@google.com>
0137 Description:
0138 Indicates the active orientation of the Type-C connector.
0139 Valid values:
0140 - "normal": CC1 orientation
0141 - "reverse": CC2 orientation
0142 - "unknown": Orientation cannot be determined.
0143
0144 What: /sys/class/typec/<port>/select_usb_power_delivery
0145 Date: May 2022
0146 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0147 Description:
0148 Lists the USB Power Delivery Capabilities that the port can
0149 advertise to the partner. The currently used capabilities are in
0150 brackets. Selection happens by writing to the file.
0151
0152 USB Type-C partner devices (eg. /sys/class/typec/port0-partner/)
0153
0154 What: /sys/class/typec/<port>-partner/accessory_mode
0155 Date: April 2017
0156 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0157 Description:
0158 Shows the Accessory Mode name when the partner is an Accessory.
0159 The Accessory Modes are defined in USB Type-C Specification.
0160
0161 What: /sys/class/typec/<port>-partner/supports_usb_power_delivery
0162 Date: April 2017
0163 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0164 Description:
0165 Shows if the partner supports USB Power Delivery communication:
0166 Valid values: yes, no
0167
0168 What: /sys/class/typec/<port>-partner/number_of_alternate_modes
0169 Date: November 2020
0170 Contact: Prashant Malani <pmalani@chromium.org>
0171 Description:
0172 Shows the number of alternate modes which are advertised by the partner
0173 during Power Delivery discovery. This file remains hidden until a value
0174 greater than or equal to 0 is set by Type C port driver.
0175
0176 What: /sys/class/typec/<port>-partner/type
0177 Date: December 2020
0178 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0179 Description: USB Power Delivery Specification defines a set of product types
0180 for the partner devices. This file will show the product type of
0181 the partner if it is known. Dual-role capable partners will have
0182 both UFP and DFP product types defined, but only one that
0183 matches the current role will be active at the time. If the
0184 product type of the partner is not visible to the device driver,
0185 this file will not exist.
0186
0187 When the partner product type is detected, or changed with role
0188 swap, uvevent is also raised that contains PRODUCT_TYPE=<product
0189 type> (for example PRODUCT_TYPE=hub).
0190
0191 Valid values:
0192
0193 UFP / device role
0194 ====================== ==========================
0195 undefined -
0196 hub PDUSB Hub
0197 peripheral PDUSB Peripheral
0198 psd Power Bank
0199 ama Alternate Mode Adapter
0200 ====================== ==========================
0201
0202 DFP / host role
0203 ====================== ==========================
0204 undefined -
0205 hub PDUSB Hub
0206 host PDUSB Host
0207 power_brick Power Brick
0208 amc Alternate Mode Controller
0209 ====================== ==========================
0210
0211 What: /sys/class/typec/<port>-partner/identity/
0212 Date: April 2017
0213 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0214 Description:
0215 This directory appears only if the port device driver is capable
0216 of showing the result of Discover Identity USB power delivery
0217 command. That will not always be possible even when USB power
0218 delivery is supported, for example when USB power delivery
0219 communication for the port is mostly handled in firmware. If the
0220 directory exists, it will have an attribute file for every VDO
0221 in Discover Identity command result.
0222
0223 USB Type-C cable devices (eg. /sys/class/typec/port0-cable/)
0224
0225 Note: Electronically Marked Cables will have a device also for one cable plug
0226 (eg. /sys/class/typec/port0-plug0). If the cable is active and has also SOP
0227 Double Prime controller (USB Power Deliver specification ch. 2.4) it will have
0228 second device also for the other plug. Both plugs may have alternate modes as
0229 described in USB Type-C and USB Power Delivery specifications.
0230
0231 What: /sys/class/typec/<port>-cable/type
0232 Date: April 2017
0233 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0234 Description: USB Power Delivery Specification defines a set of product types
0235 for the cables. This file will show the product type of the
0236 cable if it is known. If the product type of the cable is not
0237 visible to the device driver, this file will not exist.
0238
0239 When the cable product type is detected, uvevent is also raised
0240 with PRODUCT_TYPE showing the product type of the cable.
0241
0242 Valid values:
0243
0244 ====================== ==========================
0245 undefined -
0246 active Active Cable
0247 passive Passive Cable
0248 ====================== ==========================
0249
0250 What: /sys/class/typec/<port>-cable/plug_type
0251 Date: April 2017
0252 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0253 Description:
0254 Shows type of the plug on the cable:
0255
0256 - type-a - Standard A
0257 - type-b - Standard B
0258 - type-c
0259 - captive
0260
0261 What: /sys/class/typec/<port>-<plug>/number_of_alternate_modes
0262 Date: November 2020
0263 Contact: Prashant Malani <pmalani@chromium.org>
0264 Description:
0265 Shows the number of alternate modes which are advertised by the plug
0266 associated with a particular cable during Power Delivery discovery.
0267 This file remains hidden until a value greater than or equal to 0
0268 is set by Type C port driver.
0269
0270
0271 USB Type-C partner/cable Power Delivery Identity objects
0272
0273 NOTE: The following attributes will be applicable to both
0274 partner (e.g /sys/class/typec/port0-partner/) and
0275 cable (e.g /sys/class/typec/port0-cable/) devices. Consequently, the example file
0276 paths below are prefixed with "/sys/class/typec/<port>-{partner|cable}/" to
0277 reflect this.
0278
0279 What: /sys/class/typec/<port>-{partner|cable}/identity/
0280 Date: April 2017
0281 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0282 Description:
0283 This directory appears only if the port device driver is capable
0284 of showing the result of Discover Identity USB power delivery
0285 command. That will not always be possible even when USB power
0286 delivery is supported, for example when USB power delivery
0287 communication for the port is mostly handled in firmware. If the
0288 directory exists, it will have an attribute file for every VDO
0289 in Discover Identity command result.
0290
0291 What: /sys/class/typec/<port>-{partner|cable}/identity/id_header
0292 Date: April 2017
0293 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0294 Description:
0295 ID Header VDO part of Discover Identity command result. The
0296 value will show 0 until Discover Identity command result becomes
0297 available. The value can be polled.
0298
0299 What: /sys/class/typec/<port>-{partner|cable}/identity/cert_stat
0300 Date: April 2017
0301 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0302 Description:
0303 Cert Stat VDO part of Discover Identity command result. The
0304 value will show 0 until Discover Identity command result becomes
0305 available. The value can be polled.
0306
0307 What: /sys/class/typec/<port>-{partner|cable}/identity/product
0308 Date: April 2017
0309 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0310 Description:
0311 Product VDO part of Discover Identity command result. The value
0312 will show 0 until Discover Identity command result becomes
0313 available. The value can be polled.
0314
0315 What: /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo1
0316 Date: October 2020
0317 Contact: Prashant Malani <pmalani@chromium.org>
0318 Description:
0319 1st Product Type VDO of Discover Identity command result.
0320 The value will show 0 until Discover Identity command result becomes
0321 available and a valid Product Type VDO is returned.
0322
0323 What: /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo2
0324 Date: October 2020
0325 Contact: Prashant Malani <pmalani@chromium.org>
0326 Description:
0327 2nd Product Type VDO of Discover Identity command result.
0328 The value will show 0 until Discover Identity command result becomes
0329 available and a valid Product Type VDO is returned.
0330
0331 What: /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo3
0332 Date: October 2020
0333 Contact: Prashant Malani <pmalani@chromium.org>
0334 Description:
0335 3rd Product Type VDO of Discover Identity command result.
0336 The value will show 0 until Discover Identity command result becomes
0337 available and a valid Product Type VDO is returned.
0338
0339
0340 USB Type-C port alternate mode devices.
0341
0342 What: /sys/class/typec/<port>/<alt mode>/supported_roles
0343 Date: April 2017
0344 Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
0345 Description:
0346 Space separated list of the supported roles.
0347
0348 Valid values: source, sink