Merge tag 'gcc-plugins-v5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / Documentation / ABI / testing / sysfs-class-typec
index b7794e0..8eab41e 100644 (file)
@@ -139,6 +139,49 @@ Description:
                Shows if the partner supports USB Power Delivery communication:
                Valid values: yes, no
 
+What:          /sys/class/typec/<port>-partner/number_of_alternate_modes
+Date:          November 2020
+Contact:       Prashant Malani <pmalani@chromium.org>
+Description:
+               Shows the number of alternate modes which are advertised by the partner
+               during Power Delivery discovery. This file remains hidden until a value
+               greater than or equal to 0 is set by Type C port driver.
+
+What:          /sys/class/typec/<port>-partner/type
+Date:          December 2020
+Contact:       Heikki Krogerus <heikki.krogerus@linux.intel.com>
+Description:   USB Power Delivery Specification defines a set of product types
+               for the partner devices. This file will show the product type of
+               the partner if it is known. Dual-role capable partners will have
+               both UFP and DFP product types defined, but only one that
+               matches the current role will be active at the time. If the
+               product type of the partner is not visible to the device driver,
+               this file will not exist.
+
+               When the partner product type is detected, or changed with role
+               swap, uvevent is also raised that contains PRODUCT_TYPE=<product
+               type> (for example PRODUCT_TYPE=hub).
+
+               Valid values:
+
+               UFP / device role
+               ======================  ==========================
+               undefined               -
+               hub                     PDUSB Hub
+               peripheral              PDUSB Peripheral
+               psd                     Power Bank
+               ama                     Alternate Mode Adapter
+               ======================  ==========================
+
+               DFP / host role
+               ======================  ==========================
+               undefined               -
+               hub                     PDUSB Hub
+               host                    PDUSB Host
+               power_brick             Power Brick
+               amc                     Alternate Mode Controller
+               ======================  ==========================
+
 What:          /sys/class/typec/<port>-partner>/identity/
 Date:          April 2017
 Contact:       Heikki Krogerus <heikki.krogerus@linux.intel.com>
@@ -151,31 +194,6 @@ Description:
                directory exists, it will have an attribute file for every VDO
                in Discover Identity command result.
 
-What:          /sys/class/typec/<port>-partner/identity/id_header
-Date:          April 2017
-Contact:       Heikki Krogerus <heikki.krogerus@linux.intel.com>
-Description:
-               ID Header VDO part of Discover Identity command result. The
-               value will show 0 until Discover Identity command result becomes
-               available. The value can be polled.
-
-What:          /sys/class/typec/<port>-partner/identity/cert_stat
-Date:          April 2017
-Contact:       Heikki Krogerus <heikki.krogerus@linux.intel.com>
-Description:
-               Cert Stat VDO part of Discover Identity command result. The
-               value will show 0 until Discover Identity command result becomes
-               available. The value can be polled.
-
-What:          /sys/class/typec/<port>-partner/identity/product
-Date:          April 2017
-Contact:       Heikki Krogerus <heikki.krogerus@linux.intel.com>
-Description:
-               Product VDO part of Discover Identity command result. The value
-               will show 0 until Discover Identity command result becomes
-               available. The value can be polled.
-
-
 USB Type-C cable devices (eg. /sys/class/typec/port0-cable/)
 
 Note: Electronically Marked Cables will have a device also for one cable plug
@@ -187,9 +205,21 @@ described in USB Type-C and USB Power Delivery specifications.
 What:          /sys/class/typec/<port>-cable/type
 Date:          April 2017
 Contact:       Heikki Krogerus <heikki.krogerus@linux.intel.com>
-Description:
-               Shows if the cable is active.
-               Valid values: active, passive
+Description:   USB Power Delivery Specification defines a set of product types
+               for the cables. This file will show the product type of the
+               cable if it is known. If the product type of the cable is not
+               visible to the device driver, this file will not exist.
+
+               When the cable product type is detected, uvevent is also raised
+               with PRODUCT_TYPE showing the product type of the cable.
+
+               Valid values:
+
+               ======================  ==========================
+               undefined               -
+               active                  Active Cable
+               passive                 Passive Cable
+               ======================  ==========================
 
 What:          /sys/class/typec/<port>-cable/plug_type
 Date:          April 2017
@@ -202,17 +232,37 @@ Description:
                - type-c
                - captive
 
-What:          /sys/class/typec/<port>-cable/identity/
+What:          /sys/class/typec/<port>-<plug>/number_of_alternate_modes
+Date:          November 2020
+Contact:       Prashant Malani <pmalani@chromium.org>
+Description:
+               Shows the number of alternate modes which are advertised by the plug
+               associated with a particular cable during Power Delivery discovery.
+               This file remains hidden until a value greater than or equal to 0
+               is set by Type C port driver.
+
+
+USB Type-C partner/cable Power Delivery Identity objects
+
+NOTE: The following attributes will be applicable to both
+partner (e.g /sys/class/typec/port0-partner/) and
+cable (e.g /sys/class/typec/port0-cable/) devices. Consequently, the example file
+paths below are prefixed with "/sys/class/typec/<port>-{partner|cable}/" to
+reflect this.
+
+What:          /sys/class/typec/<port>-{partner|cable}/identity/
 Date:          April 2017
 Contact:       Heikki Krogerus <heikki.krogerus@linux.intel.com>
 Description:
                This directory appears only if the port device driver is capable
                of showing the result of Discover Identity USB power delivery
                command. That will not always be possible even when USB power
-               delivery is supported. If the directory exists, it will have an
-               attribute for every VDO returned by Discover Identity command.
+               delivery is supported, for example when USB power delivery
+               communication for the port is mostly handled in firmware. If the
+               directory exists, it will have an attribute file for every VDO
+               in Discover Identity command result.
 
-What:          /sys/class/typec/<port>-cable/identity/id_header
+What:          /sys/class/typec/<port>-{partner|cable}/identity/id_header
 Date:          April 2017
 Contact:       Heikki Krogerus <heikki.krogerus@linux.intel.com>
 Description:
@@ -220,7 +270,7 @@ Description:
                value will show 0 until Discover Identity command result becomes
                available. The value can be polled.
 
-What:          /sys/class/typec/<port>-cable/identity/cert_stat
+What:          /sys/class/typec/<port>-{partner|cable}/identity/cert_stat
 Date:          April 2017
 Contact:       Heikki Krogerus <heikki.krogerus@linux.intel.com>
 Description:
@@ -228,7 +278,7 @@ Description:
                value will show 0 until Discover Identity command result becomes
                available. The value can be polled.
 
-What:          /sys/class/typec/<port>-cable/identity/product
+What:          /sys/class/typec/<port>-{partner|cable}/identity/product
 Date:          April 2017
 Contact:       Heikki Krogerus <heikki.krogerus@linux.intel.com>
 Description:
@@ -236,6 +286,30 @@ Description:
                will show 0 until Discover Identity command result becomes
                available. The value can be polled.
 
+What:          /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo1
+Date:          October 2020
+Contact:       Prashant Malani <pmalani@chromium.org>
+Description:
+               1st Product Type VDO of Discover Identity command result.
+               The value will show 0 until Discover Identity command result becomes
+               available and a valid Product Type VDO is returned.
+
+What:          /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo2
+Date:          October 2020
+Contact:       Prashant Malani <pmalani@chromium.org>
+Description:
+               2nd Product Type VDO of Discover Identity command result.
+               The value will show 0 until Discover Identity command result becomes
+               available and a valid Product Type VDO is returned.
+
+What:          /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo3
+Date:          October 2020
+Contact:       Prashant Malani <pmalani@chromium.org>
+Description:
+               3rd Product Type VDO of Discover Identity command result.
+               The value will show 0 until Discover Identity command result becomes
+               available and a valid Product Type VDO is returned.
+
 
 USB Type-C port alternate mode devices.