sysfs-class-typec 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. USB Type-C port devices (eg. /sys/class/typec/port0/)
  2. What: /sys/class/typec/<port>/data_role
  3. Date: April 2017
  4. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  5. Description:
  6. The supported USB data roles. This attribute can be used for
  7. requesting data role swapping on the port. Swapping is supported
  8. as synchronous operation, so write(2) to the attribute will not
  9. return until the operation has finished. The attribute is
  10. notified about role changes so that poll(2) on the attribute
  11. wakes up. Change on the role will also generate uevent
  12. KOBJ_CHANGE on the port. The current role is show in brackets,
  13. for example "[host] device" when DRP port is in host mode.
  14. Valid values: host, device
  15. What: /sys/class/typec/<port>/power_role
  16. Date: April 2017
  17. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  18. Description:
  19. The supported power roles. This attribute can be used to request
  20. power role swap on the port. Swapping is supported as
  21. synchronous operation, so write(2) to the attribute will not
  22. return until the operation has finished. The attribute is
  23. notified about role changes so that poll(2) on the attribute
  24. wakes up. Change on the role will also generate uevent
  25. KOBJ_CHANGE. The current role is show in brackets, for example
  26. "[source] sink" when in source mode.
  27. Valid values: source, sink
  28. What: /sys/class/typec/<port>/port_type
  29. Date: May 2017
  30. Contact: Badhri Jagan Sridharan <Badhri@google.com>
  31. Description:
  32. Indicates the type of the port. This attribute can be used for
  33. requesting a change in the port type. Port type change is
  34. supported as a synchronous operation, so write(2) to the
  35. attribute will not return until the operation has finished.
  36. Valid values:
  37. ====== ==============================================
  38. source (The port will behave as source only DFP port)
  39. sink (The port will behave as sink only UFP port)
  40. dual (The port will behave as dual-role-data and
  41. dual-role-power port)
  42. ====== ==============================================
  43. What: /sys/class/typec/<port>/vconn_source
  44. Date: April 2017
  45. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  46. Description:
  47. Shows is the port VCONN Source. This attribute can be used to
  48. request VCONN swap to change the VCONN Source during connection
  49. when both the port and the partner support USB Power Delivery.
  50. Swapping is supported as synchronous operation, so write(2) to
  51. the attribute will not return until the operation has finished.
  52. The attribute is notified about VCONN source changes so that
  53. poll(2) on the attribute wakes up. Change on VCONN source also
  54. generates uevent KOBJ_CHANGE.
  55. Valid values:
  56. - "no" when the port is not the VCONN Source
  57. - "yes" when the port is the VCONN Source
  58. What: /sys/class/typec/<port>/power_operation_mode
  59. Date: April 2017
  60. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  61. Description:
  62. Shows the current power operational mode the port is in. The
  63. power operation mode means current level for VBUS. In case USB
  64. Power Delivery communication is used for negotiating the levels,
  65. power operation mode should show "usb_power_delivery".
  66. Valid values:
  67. - default
  68. - 1.5A
  69. - 3.0A
  70. - usb_power_delivery
  71. What: /sys/class/typec/<port>/preferred_role
  72. Date: April 2017
  73. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  74. Description:
  75. The user space can notify the driver about the preferred role.
  76. It should be handled as enabling of Try.SRC or Try.SNK, as
  77. defined in USB Type-C specification, in the port drivers. By
  78. default the preferred role should come from the platform.
  79. Valid values: source, sink, none (to remove preference)
  80. What: /sys/class/typec/<port>/supported_accessory_modes
  81. Date: April 2017
  82. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  83. Description:
  84. Space separated list of accessory modes, defined in the USB
  85. Type-C specification, the port supports.
  86. What: /sys/class/typec/<port>/usb_power_delivery_revision
  87. Date: April 2017
  88. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  89. Description:
  90. Revision number of the supported USB Power Delivery
  91. specification, or 0.0 when USB Power Delivery is not supported.
  92. Example values:
  93. - "2.0": USB Power Delivery Release 2.0
  94. - "3.0": USB Power Delivery Release 3.0
  95. - "3.1": USB Power Delivery Release 3.1
  96. What: /sys/class/typec/<port>-{partner|cable}/usb_power_delivery_revision
  97. Date: January 2021
  98. Contact: Benson Leung <bleung@chromium.org>
  99. Description:
  100. Revision number of the supported USB Power Delivery
  101. specification of the port partner or cable, or 0.0 when USB
  102. Power Delivery is not supported.
  103. Example values:
  104. - "2.0": USB Power Delivery Release 2.0
  105. - "3.0": USB Power Delivery Release 3.0
  106. - "3.1": USB Power Delivery Release 3.1
  107. What: /sys/class/typec/<port>/usb_typec_revision
  108. Date: April 2017
  109. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  110. Description:
  111. Revision number of the supported USB Type-C specification.
  112. What: /sys/class/typec/<port>/orientation
  113. Date: February 2020
  114. Contact: Badhri Jagan Sridharan <badhri@google.com>
  115. Description:
  116. Indicates the active orientation of the Type-C connector.
  117. Valid values:
  118. - "normal": CC1 orientation
  119. - "reverse": CC2 orientation
  120. - "unknown": Orientation cannot be determined.
  121. USB Type-C partner devices (eg. /sys/class/typec/port0-partner/)
  122. What: /sys/class/typec/<port>-partner/accessory_mode
  123. Date: April 2017
  124. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  125. Description:
  126. Shows the Accessory Mode name when the partner is an Accessory.
  127. The Accessory Modes are defined in USB Type-C Specification.
  128. What: /sys/class/typec/<port>-partner/supports_usb_power_delivery
  129. Date: April 2017
  130. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  131. Description:
  132. Shows if the partner supports USB Power Delivery communication:
  133. Valid values: yes, no
  134. What: /sys/class/typec/<port>-partner/number_of_alternate_modes
  135. Date: November 2020
  136. Contact: Prashant Malani <pmalani@chromium.org>
  137. Description:
  138. Shows the number of alternate modes which are advertised by the partner
  139. during Power Delivery discovery. This file remains hidden until a value
  140. greater than or equal to 0 is set by Type C port driver.
  141. What: /sys/class/typec/<port>-partner/type
  142. Date: December 2020
  143. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  144. Description: USB Power Delivery Specification defines a set of product types
  145. for the partner devices. This file will show the product type of
  146. the partner if it is known. Dual-role capable partners will have
  147. both UFP and DFP product types defined, but only one that
  148. matches the current role will be active at the time. If the
  149. product type of the partner is not visible to the device driver,
  150. this file will not exist.
  151. When the partner product type is detected, or changed with role
  152. swap, uvevent is also raised that contains PRODUCT_TYPE=<product
  153. type> (for example PRODUCT_TYPE=hub).
  154. Valid values:
  155. UFP / device role
  156. ====================== ==========================
  157. undefined -
  158. hub PDUSB Hub
  159. peripheral PDUSB Peripheral
  160. psd Power Bank
  161. ama Alternate Mode Adapter
  162. ====================== ==========================
  163. DFP / host role
  164. ====================== ==========================
  165. undefined -
  166. hub PDUSB Hub
  167. host PDUSB Host
  168. power_brick Power Brick
  169. amc Alternate Mode Controller
  170. ====================== ==========================
  171. What: /sys/class/typec/<port>-partner>/identity/
  172. Date: April 2017
  173. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  174. Description:
  175. This directory appears only if the port device driver is capable
  176. of showing the result of Discover Identity USB power delivery
  177. command. That will not always be possible even when USB power
  178. delivery is supported, for example when USB power delivery
  179. communication for the port is mostly handled in firmware. If the
  180. directory exists, it will have an attribute file for every VDO
  181. in Discover Identity command result.
  182. USB Type-C cable devices (eg. /sys/class/typec/port0-cable/)
  183. Note: Electronically Marked Cables will have a device also for one cable plug
  184. (eg. /sys/class/typec/port0-plug0). If the cable is active and has also SOP
  185. Double Prime controller (USB Power Deliver specification ch. 2.4) it will have
  186. second device also for the other plug. Both plugs may have alternate modes as
  187. described in USB Type-C and USB Power Delivery specifications.
  188. What: /sys/class/typec/<port>-cable/type
  189. Date: April 2017
  190. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  191. Description: USB Power Delivery Specification defines a set of product types
  192. for the cables. This file will show the product type of the
  193. cable if it is known. If the product type of the cable is not
  194. visible to the device driver, this file will not exist.
  195. When the cable product type is detected, uvevent is also raised
  196. with PRODUCT_TYPE showing the product type of the cable.
  197. Valid values:
  198. ====================== ==========================
  199. undefined -
  200. active Active Cable
  201. passive Passive Cable
  202. ====================== ==========================
  203. What: /sys/class/typec/<port>-cable/plug_type
  204. Date: April 2017
  205. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  206. Description:
  207. Shows type of the plug on the cable:
  208. - type-a - Standard A
  209. - type-b - Standard B
  210. - type-c
  211. - captive
  212. What: /sys/class/typec/<port>-<plug>/number_of_alternate_modes
  213. Date: November 2020
  214. Contact: Prashant Malani <pmalani@chromium.org>
  215. Description:
  216. Shows the number of alternate modes which are advertised by the plug
  217. associated with a particular cable during Power Delivery discovery.
  218. This file remains hidden until a value greater than or equal to 0
  219. is set by Type C port driver.
  220. USB Type-C partner/cable Power Delivery Identity objects
  221. NOTE: The following attributes will be applicable to both
  222. partner (e.g /sys/class/typec/port0-partner/) and
  223. cable (e.g /sys/class/typec/port0-cable/) devices. Consequently, the example file
  224. paths below are prefixed with "/sys/class/typec/<port>-{partner|cable}/" to
  225. reflect this.
  226. What: /sys/class/typec/<port>-{partner|cable}/identity/
  227. Date: April 2017
  228. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  229. Description:
  230. This directory appears only if the port device driver is capable
  231. of showing the result of Discover Identity USB power delivery
  232. command. That will not always be possible even when USB power
  233. delivery is supported, for example when USB power delivery
  234. communication for the port is mostly handled in firmware. If the
  235. directory exists, it will have an attribute file for every VDO
  236. in Discover Identity command result.
  237. What: /sys/class/typec/<port>-{partner|cable}/identity/id_header
  238. Date: April 2017
  239. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  240. Description:
  241. ID Header VDO part of Discover Identity command result. The
  242. value will show 0 until Discover Identity command result becomes
  243. available. The value can be polled.
  244. What: /sys/class/typec/<port>-{partner|cable}/identity/cert_stat
  245. Date: April 2017
  246. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  247. Description:
  248. Cert Stat VDO part of Discover Identity command result. The
  249. value will show 0 until Discover Identity command result becomes
  250. available. The value can be polled.
  251. What: /sys/class/typec/<port>-{partner|cable}/identity/product
  252. Date: April 2017
  253. Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  254. Description:
  255. Product VDO part of Discover Identity command result. The value
  256. will show 0 until Discover Identity command result becomes
  257. available. The value can be polled.
  258. What: /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo1
  259. Date: October 2020
  260. Contact: Prashant Malani <pmalani@chromium.org>
  261. Description:
  262. 1st Product Type VDO of Discover Identity command result.
  263. The value will show 0 until Discover Identity command result becomes
  264. available and a valid Product Type VDO is returned.
  265. What: /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo2
  266. Date: October 2020
  267. Contact: Prashant Malani <pmalani@chromium.org>
  268. Description:
  269. 2nd Product Type VDO of Discover Identity command result.
  270. The value will show 0 until Discover Identity command result becomes
  271. available and a valid Product Type VDO is returned.
  272. What: /sys/class/typec/<port>-{partner|cable}/identity/product_type_vdo3
  273. Date: October 2020
  274. Contact: Prashant Malani <pmalani@chromium.org>
  275. Description:
  276. 3rd Product Type VDO of Discover Identity command result.
  277. The value will show 0 until Discover Identity command result becomes
  278. available and a valid Product Type VDO is returned.
  279. USB Type-C port alternate mode devices.
  280. What: /sys/class/typec/<port>/<alt mode>/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. Valid values: source, sink