diff options
| -rw-r--r-- | Documentation/ABI/obsolete/sysfs-class-typec | 48 | ||||
| -rw-r--r-- | Documentation/ABI/testing/sysfs-bus-typec | 51 | ||||
| -rw-r--r-- | Documentation/ABI/testing/sysfs-class-typec | 62 | ||||
| -rw-r--r-- | Documentation/driver-api/usb/typec_bus.rst | 136 | ||||
| -rw-r--r-- | MAINTAINERS | 11 | ||||
| -rw-r--r-- | drivers/usb/typec/Makefile | 2 | ||||
| -rw-r--r-- | drivers/usb/typec/bus.c | 401 | ||||
| -rw-r--r-- | drivers/usb/typec/bus.h | 38 | ||||
| -rw-r--r-- | drivers/usb/typec/class.c | 366 | ||||
| -rw-r--r-- | include/linux/mod_devicetable.h | 15 | ||||
| -rw-r--r-- | include/linux/usb/typec.h | 14 | ||||
| -rw-r--r-- | include/linux/usb/typec_altmode.h | 160 | ||||
| -rw-r--r-- | scripts/mod/devicetable-offsets.c | 4 | ||||
| -rw-r--r-- | scripts/mod/file2alias.c | 13 |
14 files changed, 1174 insertions, 147 deletions
diff --git a/Documentation/ABI/obsolete/sysfs-class-typec b/Documentation/ABI/obsolete/sysfs-class-typec new file mode 100644 index 000000000000..32623514ee87 --- /dev/null +++ b/Documentation/ABI/obsolete/sysfs-class-typec | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | These files are deprecated and will be removed. The same files are available | ||
| 2 | under /sys/bus/typec (see Documentation/ABI/testing/sysfs-bus-typec). | ||
| 3 | |||
| 4 | What: /sys/class/typec/<port|partner|cable>/<dev>/svid | ||
| 5 | Date: April 2017 | ||
| 6 | Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com> | ||
| 7 | Description: | ||
| 8 | The SVID (Standard or Vendor ID) assigned by USB-IF for this | ||
| 9 | alternate mode. | ||
| 10 | |||
| 11 | What: /sys/class/typec/<port|partner|cable>/<dev>/mode<index>/ | ||
| 12 | Date: April 2017 | ||
| 13 | Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com> | ||
| 14 | Description: | ||
| 15 | Every supported mode will have its own directory. The name of | ||
| 16 | a mode will be "mode<index>" (for example mode1), where <index> | ||
| 17 | is the actual index to the mode VDO returned by Discover Modes | ||
| 18 | USB power delivery command. | ||
| 19 | |||
| 20 | What: /sys/class/typec/<port|partner|cable>/<dev>/mode<index>/description | ||
| 21 | Date: April 2017 | ||
| 22 | Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com> | ||
| 23 | Description: | ||
| 24 | Shows description of the mode. The description is optional for | ||
| 25 | the drivers, just like with the Billboard Devices. | ||
| 26 | |||
| 27 | What: /sys/class/typec/<port|partner|cable>/<dev>/mode<index>/vdo | ||
| 28 | Date: April 2017 | ||
| 29 | Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com> | ||
| 30 | Description: | ||
| 31 | Shows the VDO in hexadecimal returned by Discover Modes command | ||
| 32 | for this mode. | ||
| 33 | |||
| 34 | What: /sys/class/typec/<port|partner|cable>/<dev>/mode<index>/active | ||
| 35 | Date: April 2017 | ||
| 36 | Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com> | ||
| 37 | Description: | ||
| 38 | Shows if the mode is active or not. The attribute can be used | ||
| 39 | for entering/exiting the mode with partners and cable plugs, and | ||
| 40 | with the port alternate modes it can be used for disabling | ||
| 41 | support for specific alternate modes. Entering/exiting modes is | ||
| 42 | supported as synchronous operation so write(2) to the attribute | ||
| 43 | does not return until the enter/exit mode operation has | ||
| 44 | finished. The attribute is notified when the mode is | ||
| 45 | entered/exited so poll(2) on the attribute wakes up. | ||
| 46 | Entering/exiting a mode will also generate uevent KOBJ_CHANGE. | ||
| 47 | |||
| 48 | Valid values: yes, no | ||
diff --git a/Documentation/ABI/testing/sysfs-bus-typec b/Documentation/ABI/testing/sysfs-bus-typec new file mode 100644 index 000000000000..205d9c91e2e1 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-typec | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | What: /sys/bus/typec/devices/.../active | ||
| 2 | Date: July 2018 | ||
| 3 | Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com> | ||
| 4 | Description: | ||
| 5 | Shows if the mode is active or not. The attribute can be used | ||
| 6 | for entering/exiting the mode. Entering/exiting modes is | ||
| 7 | supported as synchronous operation so write(2) to the attribute | ||
| 8 | does not return until the enter/exit mode operation has | ||
| 9 | finished. The attribute is notified when the mode is | ||
| 10 | entered/exited so poll(2) on the attribute wakes up. | ||
| 11 | Entering/exiting a mode will also generate uevent KOBJ_CHANGE. | ||
| 12 | |||
| 13 | Valid values are boolean. | ||
| 14 | |||
| 15 | What: /sys/bus/typec/devices/.../description | ||
| 16 | Date: July 2018 | ||
| 17 | Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com> | ||
| 18 | Description: | ||
| 19 | Shows description of the mode. The description is optional for | ||
| 20 | the drivers, just like with the Billboard Devices. | ||
| 21 | |||
| 22 | What: /sys/bus/typec/devices/.../mode | ||
| 23 | Date: July 2018 | ||
| 24 | Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com> | ||
| 25 | Description: | ||
| 26 | The index number of the mode returned by Discover Modes USB | ||
| 27 | Power Delivery command. Depending on the alternate mode, the | ||
| 28 | mode index may be significant. | ||
| 29 | |||
| 30 | With some alternate modes (SVIDs), the mode index is assigned | ||
| 31 | for specific functionality in the specification for that | ||
| 32 | alternate mode. | ||
| 33 | |||
| 34 | With other alternate modes, the mode index values are not | ||
| 35 | assigned, and can not be therefore used for identification. When | ||
| 36 | the mode index is not assigned, identifying the alternate mode | ||
| 37 | must be done with either mode VDO or the description. | ||
| 38 | |||
| 39 | What: /sys/bus/typec/devices/.../svid | ||
| 40 | Date: July 2018 | ||
| 41 | Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com> | ||
| 42 | Description: | ||
| 43 | The Standard or Vendor ID (SVID) assigned by USB-IF for this | ||
| 44 | alternate mode. | ||
| 45 | |||
| 46 | What: /sys/bus/typec/devices/.../vdo | ||
| 47 | Date: July 2018 | ||
| 48 | Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com> | ||
| 49 | Description: | ||
| 50 | Shows the VDO in hexadecimal returned by Discover Modes command | ||
| 51 | for this mode. | ||
diff --git a/Documentation/ABI/testing/sysfs-class-typec b/Documentation/ABI/testing/sysfs-class-typec index 5be552e255e9..d7647b258c3c 100644 --- a/Documentation/ABI/testing/sysfs-class-typec +++ b/Documentation/ABI/testing/sysfs-class-typec | |||
| @@ -222,70 +222,12 @@ Description: | |||
| 222 | available. The value can be polled. | 222 | available. The value can be polled. |
| 223 | 223 | ||
| 224 | 224 | ||
| 225 | Alternate Mode devices. | 225 | USB Type-C port alternate mode devices. |
| 226 | 226 | ||
| 227 | The alternate modes will have Standard or Vendor ID (SVID) assigned by USB-IF. | 227 | What: /sys/class/typec/<port>/<alt mode>/supported_roles |
| 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 | 228 | Date: April 2017 |
| 282 | Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com> | 229 | Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com> |
| 283 | Description: | 230 | Description: |
| 284 | Space separated list of the supported roles. | 231 | Space separated list of the supported roles. |
| 285 | 232 | ||
