Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: Convert usb-connector to YAML format.

Convert the usb-connector.txt bindings file to YAML format. This allows
it to be used in dt_bindings_check verification. This patch was
born out of a patch series for the addition of a Type C connector
class port driver[1].

An attempt has been made to maintain the same documentation text and
example structure as was in the .txt file, but wherever needed
modifications have been made to satisfy dt_bindings_check.

Also, update all references to usb-connector.txt to now use
usb-connector.yaml.

[1]: https://lkml.org/lkml/2020/2/19/1232

Signed-off-by: Prashant Malani <pmalani@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Prashant Malani and committed by
Rob Herring
431a30b7 e329f87d

+216 -145
+1 -1
Documentation/devicetree/bindings/connector/samsung,usb-connector-11pin.txt
··· 19 19 0: High Speed (HS), 20 20 3: Mobile High-Definition Link (MHL), specific to 11-pin Samsung micro-USB. 21 21 22 - [1]: bindings/connector/usb-connector.txt 22 + [1]: bindings/connector/usb-connector.yaml 23 23 24 24 Example 25 25 -------
-135
Documentation/devicetree/bindings/connector/usb-connector.txt
··· 1 - USB Connector 2 - ============= 3 - 4 - A USB connector node represents a physical USB connector. It should be 5 - a child of a USB interface controller. 6 - 7 - Required properties: 8 - - compatible: describes type of the connector, must be one of: 9 - "usb-a-connector", 10 - "usb-b-connector", 11 - "usb-c-connector". 12 - 13 - Optional properties: 14 - - label: symbolic name for the connector, 15 - - type: size of the connector, should be specified in case of USB-A, USB-B 16 - non-fullsize connectors: "mini", "micro". 17 - - self-powered: Set this property if the usb device that has its own power 18 - source. 19 - 20 - Optional properties for usb-b-connector: 21 - - id-gpios: an input gpio for USB ID pin. 22 - - vbus-gpios: an input gpio for USB VBUS pin, used to detect presence of 23 - VBUS 5V. 24 - see gpio/gpio.txt. 25 - - vbus-supply: a phandle to the regulator for USB VBUS if needed when host 26 - mode or dual role mode is supported. 27 - Particularly, if use an output GPIO to control a VBUS regulator, should 28 - model it as a regulator. 29 - see regulator/fixed-regulator.yaml 30 - - pinctrl-names : a pinctrl state named "default" is optional 31 - - pinctrl-0 : pin control group 32 - see pinctrl/pinctrl-bindings.txt 33 - 34 - Optional properties for usb-c-connector: 35 - - power-role: should be one of "source", "sink" or "dual"(DRP) if typec 36 - connector has power support. 37 - - try-power-role: preferred power role if "dual"(DRP) can support Try.SNK 38 - or Try.SRC, should be "sink" for Try.SNK or "source" for Try.SRC. 39 - - data-role: should be one of "host", "device", "dual"(DRD) if typec 40 - connector supports USB data. 41 - 42 - Required properties for usb-c-connector with power delivery support: 43 - - source-pdos: An array of u32 with each entry providing supported power 44 - source data object(PDO), the detailed bit definitions of PDO can be found 45 - in "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.2 46 - Source_Capabilities Message, the order of each entry(PDO) should follow 47 - the PD spec chapter 6.4.1. Required for power source and power dual role. 48 - User can specify the source PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() 49 - defined in dt-bindings/usb/pd.h. 50 - - sink-pdos: An array of u32 with each entry providing supported power 51 - sink data object(PDO), the detailed bit definitions of PDO can be found 52 - in "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.3 53 - Sink Capabilities Message, the order of each entry(PDO) should follow 54 - the PD spec chapter 6.4.1. Required for power sink and power dual role. 55 - User can specify the sink PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() defined 56 - in dt-bindings/usb/pd.h. 57 - - op-sink-microwatt: Sink required operating power in microwatt, if source 58 - can't offer the power, Capability Mismatch is set. Required for power 59 - sink and power dual role. 60 - 61 - Required nodes: 62 - - any data bus to the connector should be modeled using the OF graph bindings 63 - specified in bindings/graph.txt, unless the bus is between parent node and 64 - the connector. Since single connector can have multiple data buses every bus 65 - has assigned OF graph port number as follows: 66 - 0: High Speed (HS), present in all connectors, 67 - 1: Super Speed (SS), present in SS capable connectors, 68 - 2: Sideband use (SBU), present in USB-C. 69 - 70 - Examples 71 - -------- 72 - 73 - 1. Micro-USB connector with HS lines routed via controller (MUIC): 74 - 75 - muic-max77843@66 { 76 - ... 77 - usb_con: connector { 78 - compatible = "usb-b-connector"; 79 - label = "micro-USB"; 80 - type = "micro"; 81 - }; 82 - }; 83 - 84 - 2. USB-C connector attached to CC controller (s2mm005), HS lines routed 85 - to companion PMIC (max77865), SS lines to USB3 PHY and SBU to DisplayPort. 86 - DisplayPort video lines are routed to the connector via SS mux in USB3 PHY. 87 - 88 - ccic: s2mm005@33 { 89 - ... 90 - usb_con: connector { 91 - compatible = "usb-c-connector"; 92 - label = "USB-C"; 93 - 94 - ports { 95 - #address-cells = <1>; 96 - #size-cells = <0>; 97 - 98 - port@0 { 99 - reg = <0>; 100 - usb_con_hs: endpoint { 101 - remote-endpoint = <&max77865_usbc_hs>; 102 - }; 103 - }; 104 - port@1 { 105 - reg = <1>; 106 - usb_con_ss: endpoint { 107 - remote-endpoint = <&usbdrd_phy_ss>; 108 - }; 109 - }; 110 - port@2 { 111 - reg = <2>; 112 - usb_con_sbu: endpoint { 113 - remote-endpoint = <&dp_aux>; 114 - }; 115 - }; 116 - }; 117 - }; 118 - }; 119 - 120 - 3. USB-C connector attached to a typec port controller(ptn5110), which has 121 - power delivery support and enables drp. 122 - 123 - typec: ptn5110@50 { 124 - ... 125 - usb_con: connector { 126 - compatible = "usb-c-connector"; 127 - label = "USB-C"; 128 - power-role = "dual"; 129 - try-power-role = "sink"; 130 - source-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)>; 131 - sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM) 132 - PDO_VAR(5000, 12000, 2000)>; 133 - op-sink-microwatt = <10000000>; 134 - }; 135 - };
+206
Documentation/devicetree/bindings/connector/usb-connector.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/connector/usb-connector.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: USB Connector 8 + 9 + maintainers: 10 + - Rob Herring <robh@kernel.org> 11 + 12 + description: 13 + A USB connector node represents a physical USB connector. It should be a child 14 + of a USB interface controller. 15 + 16 + properties: 17 + compatible: 18 + enum: 19 + - usb-a-connector 20 + - usb-b-connector 21 + - usb-c-connector 22 + 23 + label: 24 + description: Symbolic name for the connector. 25 + 26 + type: 27 + description: Size of the connector, should be specified in case of 28 + non-fullsize 'usb-a-connector' or 'usb-b-connector' compatible 29 + connectors. 30 + allOf: 31 + - $ref: /schemas/types.yaml#definitions/string 32 + enum: 33 + - mini 34 + - micro 35 + 36 + self-powered: 37 + description: Set this property if the USB device has its own power source. 38 + type: boolean 39 + 40 + # The following are optional properties for "usb-b-connector". 41 + id-gpios: 42 + description: An input gpio for USB ID pin. 43 + maxItems: 1 44 + 45 + vbus-gpios: 46 + description: An input gpio for USB VBus pin, used to detect presence of 47 + VBUS 5V. 48 + maxItems: 1 49 + 50 + vbus-supply: 51 + description: A phandle to the regulator for USB VBUS if needed when host 52 + mode or dual role mode is supported. 53 + Particularly, if use an output GPIO to control a VBUS regulator, should 54 + model it as a regulator. See bindings/regulator/fixed-regulator.yaml 55 + 56 + # The following are optional properties for "usb-c-connector". 57 + power-role: 58 + description: Determines the power role that the Type C connector will 59 + support. "dual" refers to Dual Role Port (DRP). 60 + allOf: 61 + - $ref: /schemas/types.yaml#definitions/string 62 + enum: 63 + - source 64 + - sink 65 + - dual 66 + 67 + try-power-role: 68 + description: Preferred power role. 69 + allOf: 70 + - $ref: /schemas/types.yaml#definitions/string 71 + enum: 72 + - source 73 + - sink 74 + - dual 75 + 76 + data-role: 77 + description: Data role if Type C connector supports USB data. "dual" refers 78 + Dual Role Device (DRD). 79 + allOf: 80 + - $ref: /schemas/types.yaml#definitions/string 81 + enum: 82 + - host 83 + - device 84 + - dual 85 + 86 + # The following are optional properties for "usb-c-connector" with power 87 + # delivery support. 88 + source-pdos: 89 + description: An array of u32 with each entry providing supported power 90 + source data object(PDO), the detailed bit definitions of PDO can be found 91 + in "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.2 92 + Source_Capabilities Message, the order of each entry(PDO) should follow 93 + the PD spec chapter 6.4.1. Required for power source and power dual role. 94 + User can specify the source PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() 95 + defined in dt-bindings/usb/pd.h. 96 + minItems: 1 97 + maxItems: 7 98 + allOf: 99 + - $ref: /schemas/types.yaml#/definitions/uint32-array 100 + 101 + sink-pdos: 102 + description: An array of u32 with each entry providing supported power sink 103 + data object(PDO), the detailed bit definitions of PDO can be found in 104 + "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.3 105 + Sink Capabilities Message, the order of each entry(PDO) should follow the 106 + PD spec chapter 6.4.1. Required for power sink and power dual role. User 107 + can specify the sink PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() defined 108 + in dt-bindings/usb/pd.h. 109 + minItems: 1 110 + maxItems: 7 111 + allOf: 112 + - $ref: /schemas/types.yaml#/definitions/uint32-array 113 + 114 + op-sink-microwatt: 115 + description: Sink required operating power in microwatt, if source can't 116 + offer the power, Capability Mismatch is set. Required for power sink and 117 + power dual role. 118 + 119 + ports: 120 + description: OF graph bindings (specified in bindings/graph.txt) that model 121 + any data bus to the connector unless the bus is between parent node and 122 + the connector. Since a single connector can have multiple data buses every 123 + bus has an assigned OF graph port number as described below. 124 + type: object 125 + properties: 126 + port@0: 127 + type: object 128 + description: High Speed (HS), present in all connectors. 129 + 130 + port@1: 131 + type: object 132 + description: Super Speed (SS), present in SS capable connectors. 133 + 134 + port@2: 135 + type: object 136 + description: Sideband Use (SBU), present in USB-C. This describes the 137 + alternate mode connection of which SBU is a part. 138 + 139 + required: 140 + - port@0 141 + 142 + required: 143 + - compatible 144 + 145 + examples: 146 + # Micro-USB connector with HS lines routed via controller (MUIC). 147 + - |+ 148 + muic-max77843 { 149 + usb_con1: connector { 150 + compatible = "usb-b-connector"; 151 + label = "micro-USB"; 152 + type = "micro"; 153 + }; 154 + }; 155 + 156 + # USB-C connector attached to CC controller (s2mm005), HS lines routed 157 + # to companion PMIC (max77865), SS lines to USB3 PHY and SBU to DisplayPort. 158 + # DisplayPort video lines are routed to the connector via SS mux in USB3 PHY. 159 + - |+ 160 + ccic: s2mm005 { 161 + usb_con2: connector { 162 + compatible = "usb-c-connector"; 163 + label = "USB-C"; 164 + 165 + ports { 166 + #address-cells = <1>; 167 + #size-cells = <0>; 168 + 169 + port@0 { 170 + reg = <0>; 171 + usb_con_hs: endpoint { 172 + remote-endpoint = <&max77865_usbc_hs>; 173 + }; 174 + }; 175 + port@1 { 176 + reg = <1>; 177 + usb_con_ss: endpoint { 178 + remote-endpoint = <&usbdrd_phy_ss>; 179 + }; 180 + }; 181 + port@2 { 182 + reg = <2>; 183 + usb_con_sbu: endpoint { 184 + remote-endpoint = <&dp_aux>; 185 + }; 186 + }; 187 + }; 188 + }; 189 + }; 190 + 191 + # USB-C connector attached to a typec port controller(ptn5110), which has 192 + # power delivery support and enables drp. 193 + - |+ 194 + #include <dt-bindings/usb/pd.h> 195 + typec: ptn5110 { 196 + usb_con3: connector { 197 + compatible = "usb-c-connector"; 198 + label = "USB-C"; 199 + power-role = "dual"; 200 + try-power-role = "sink"; 201 + source-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)>; 202 + sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM) 203 + PDO_VAR(5000, 12000, 2000)>; 204 + op-sink-microwatt = <10000000>; 205 + }; 206 + };
+1 -1
Documentation/devicetree/bindings/usb/fcs,fusb302.txt
··· 9 9 - connector : The "usb-c-connector" attached to the FUSB302 IC. The bindings 10 10 of the connector node are specified in: 11 11 12 - Documentation/devicetree/bindings/connector/usb-connector.txt 12 + Documentation/devicetree/bindings/connector/usb-connector.yaml 13 13 14 14 15 15 Example:
+1 -1
Documentation/devicetree/bindings/usb/generic.txt
··· 34 34 - usb-role-switch: boolean, indicates that the device is capable of assigning 35 35 the USB data role (USB host or USB device) for a given 36 36 USB connector, such as Type-C, Type-B(micro). 37 - see connector/usb-connector.txt. 37 + see connector/usb-connector.yaml. 38 38 39 39 This is an attribute to a USB controller such as: 40 40
+1 -1
Documentation/devicetree/bindings/usb/mediatek,mtu3.txt
··· 34 34 dual-role mode. 35 35 it's considered valid for compatibility reasons, not allowed for 36 36 new bindings, and put into a usb-connector node. 37 - see connector/usb-connector.txt. 37 + see connector/usb-connector.yaml. 38 38 - pinctrl-names : a pinctrl state named "default" is optional, and need be 39 39 defined if auto drd switch is enabled, that means the property dr_mode 40 40 is set as "otg", and meanwhile the property "mediatek,enable-manual-drd"
+1 -1
Documentation/devicetree/bindings/usb/mediatek,musb.txt
··· 23 23 MTCMOS 24 24 25 25 Required child nodes: 26 - usb connector node as defined in bindings/connector/usb-connector.txt 26 + usb connector node as defined in bindings/connector/usb-connector.yaml 27 27 Optional properties: 28 28 - id-gpios : input GPIO for USB ID pin. 29 29 - vbus-gpios : input GPIO for USB VBUS pin.
+1 -1
Documentation/devicetree/bindings/usb/richtek,rt1711h.txt
··· 9 9 Required sub-node: 10 10 - connector: The "usb-c-connector" attached to the tcpci chip, the bindings 11 11 of connector node are specified in 12 - Documentation/devicetree/bindings/connector/usb-connector.txt 12 + Documentation/devicetree/bindings/connector/usb-connector.yaml 13 13 14 14 Example : 15 15 rt1711h@4e {
+1 -1
Documentation/devicetree/bindings/usb/ti,hd3ss3220.txt
··· 9 9 - connector: The "usb-c-connector" attached to the hd3ss3220 chip. The 10 10 bindings of the connector node are specified in: 11 11 12 - Documentation/devicetree/bindings/connector/usb-connector.txt 12 + Documentation/devicetree/bindings/connector/usb-connector.yaml 13 13 14 14 Example: 15 15 hd3ss3220@47 {
+1 -1
Documentation/devicetree/bindings/usb/typec-tcpci.txt
··· 13 13 Required sub-node: 14 14 - connector: The "usb-c-connector" attached to the tcpci chip, the bindings 15 15 of connector node are specified in 16 - Documentation/devicetree/bindings/connector/usb-connector.txt 16 + Documentation/devicetree/bindings/connector/usb-connector.yaml 17 17 18 18 Example: 19 19
+2 -2
Documentation/devicetree/bindings/usb/usb-conn-gpio.txt
··· 8 8 - compatible : should include "gpio-usb-b-connector" and "usb-b-connector". 9 9 - id-gpios, vbus-gpios : input gpios, either one of them must be present, 10 10 and both can be present as well. 11 - see connector/usb-connector.txt 11 + see connector/usb-connector.yaml 12 12 13 13 Optional properties: 14 14 - vbus-supply : can be present if needed when supports dual role mode. 15 - see connector/usb-connector.txt 15 + see connector/usb-connector.yaml 16 16 17 17 - Sub-nodes: 18 18 - port : can be present.