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 7title: USB Connector 8 9maintainers: 10 - Rob Herring <robh@kernel.org> 11 12description: 13 A USB connector node represents a physical USB connector. It should be a child 14 of a USB interface controller or a separate node when it is attached to both 15 MUX and USB interface controller. 16 17properties: 18 compatible: 19 oneOf: 20 - enum: 21 - usb-a-connector 22 - usb-b-connector 23 - usb-c-connector 24 25 - items: 26 - const: gpio-usb-b-connector 27 - const: usb-b-connector 28 29 - items: 30 - const: samsung,usb-connector-11pin 31 - const: usb-b-connector 32 33 label: 34 description: Symbolic name for the connector. 35 36 type: 37 description: Size of the connector, should be specified in case of 38 non-fullsize 'usb-a-connector' or 'usb-b-connector' compatible 39 connectors. 40 $ref: /schemas/types.yaml#definitions/string 41 42 enum: 43 - mini 44 - micro 45 46 self-powered: 47 description: Set this property if the USB device has its own power source. 48 type: boolean 49 50 # The following are optional properties for "usb-b-connector". 51 id-gpios: 52 description: An input gpio for USB ID pin. 53 maxItems: 1 54 55 vbus-gpios: 56 description: An input gpio for USB VBus pin, used to detect presence of 57 VBUS 5V. 58 maxItems: 1 59 60 vbus-supply: 61 description: A phandle to the regulator for USB VBUS if needed when host 62 mode or dual role mode is supported. 63 Particularly, if use an output GPIO to control a VBUS regulator, should 64 model it as a regulator. See bindings/regulator/fixed-regulator.yaml 65 66 # The following are optional properties for "usb-c-connector". 67 power-role: 68 description: Determines the power role that the Type C connector will 69 support. "dual" refers to Dual Role Port (DRP). 70 $ref: /schemas/types.yaml#definitions/string 71 72 enum: 73 - source 74 - sink 75 - dual 76 77 try-power-role: 78 description: Preferred power role. 79 $ref: /schemas/types.yaml#definitions/string 80 81 enum: 82 - source 83 - sink 84 - dual 85 86 data-role: 87 description: Data role if Type C connector supports USB data. "dual" refers 88 Dual Role Device (DRD). 89 $ref: /schemas/types.yaml#definitions/string 90 91 enum: 92 - host 93 - device 94 - dual 95 96 pd-revision: 97 description: Set the maximum PD revision of Type-C controller can support, 98 the descriptors are compliant in binary-coded decimal (i.e. 2.0 is 0200H 99 and 3.1 is 0310H). 100 $ref: /schemas/types.yaml#/definitions/uint32 101 102 # The following are optional properties for "usb-c-connector" with power 103 # delivery support. 104 source-pdos: 105 description: An array of u32 with each entry providing supported power 106 source data object(PDO), the detailed bit definitions of PDO can be found 107 in "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.2 108 Source_Capabilities Message, the order of each entry(PDO) should follow 109 the PD spec chapter 6.4.1. Required for power source and power dual role. 110 User can specify the source PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() 111 defined in dt-bindings/usb/pd.h. 112 minItems: 1 113 maxItems: 7 114 $ref: /schemas/types.yaml#/definitions/uint32-array 115 116 sink-pdos: 117 description: An array of u32 with each entry providing supported power sink 118 data object(PDO), the detailed bit definitions of PDO can be found in 119 "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.3 120 Sink Capabilities Message, the order of each entry(PDO) should follow the 121 PD spec chapter 6.4.1. Required for power sink and power dual role. User 122 can specify the sink PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() defined 123 in dt-bindings/usb/pd.h. 124 minItems: 1 125 maxItems: 7 126 $ref: /schemas/types.yaml#/definitions/uint32-array 127 128 sink-vdos: 129 description: An array of u32 with each entry, a Vendor Defined Message Object (VDO), 130 providing additional information corresponding to the product, the detailed bit 131 definitions and the order of each VDO can be found in 132 "USB Power Delivery Specification Revision 3.0, Version 2.0 + ECNs 2020-12-10" 133 chapter 6.4.4.3.1 Discover Identity. User can specify the VDO array via 134 VDO_IDH/_CERT/_PRODUCT/_UFP/_DFP/_PCABLE/_ACABLE(1/2)/_VPD() defined in 135 dt-bindings/usb/pd.h. 136 minItems: 3 137 maxItems: 6 138 $ref: /schemas/types.yaml#/definitions/uint32-array 139 140 sink-vdos-v1: 141 description: An array of u32 with each entry, a Vendor Defined Message Object (VDO), 142 providing additional information corresponding to the product, the detailed bit 143 definitions and the order of each VDO can be found in 144 "USB Power Delivery Specification Revision 2.0, Version 1.3" chapter 6.4.4.3.1 Discover 145 Identity. User can specify the VDO array via VDO_IDH/_CERT/_PRODUCT/_CABLE/_AMA defined in 146 dt-bindings/usb/pd.h. 147 minItems: 3 148 maxItems: 6 149 $ref: /schemas/types.yaml#/definitions/uint32-array 150 151 op-sink-microwatt: 152 description: Sink required operating power in microwatt, if source can't 153 offer the power, Capability Mismatch is set. Required for power sink and 154 power dual role. 155 156 ports: 157 description: OF graph bindings (specified in bindings/graph.txt) that model 158 any data bus to the connector unless the bus is between parent node and 159 the connector. Since a single connector can have multiple data buses every 160 bus has an assigned OF graph port number as described below. 161 type: object 162 properties: 163 port@0: 164 type: object 165 description: High Speed (HS), present in all connectors. 166 167 port@1: 168 type: object 169 description: Super Speed (SS), present in SS capable connectors. 170 171 port@2: 172 type: object 173 description: Sideband Use (SBU), present in USB-C. This describes the 174 alternate mode connection of which SBU is a part. 175 176 required: 177 - port@0 178 179 new-source-frs-typec-current: 180 description: Initial current capability of the new source when vSafe5V 181 is applied during PD3.0 Fast Role Swap. "Table 6-14 Fixed Supply PDO - Sink" 182 of "USB Power Delivery Specification Revision 3.0, Version 1.2" provides the 183 different power levels and "6.4.1.3.1.6 Fast Role Swap USB Type-C Current" 184 provides a detailed description of the field. The sink PDO from current source 185 reflects the current source's(i.e. transmitter of the FRS signal) power 186 requirement during fr swap. The current sink (i.e. receiver of the FRS signal), 187 a.k.a new source, should check if it will be able to satisfy the current source's, 188 new sink's, requirement during frswap before enabling the frs signal reception. 189 This property refers to maximum current capability that the current sink can 190 satisfy. During FRS, VBUS voltage is at 5V, as the partners are in implicit 191 contract, hence, the power level is only a function of the current capability. 192 "1" refers to default USB power level as described by "Table 6-14 Fixed Supply PDO - Sink". 193 "2" refers to 1.5A@5V. 194 "3" refers to 3.0A@5V. 195 $ref: /schemas/types.yaml#/definitions/uint32 196 enum: [1, 2, 3] 197 198 slow-charger-loop: 199 description: Allows PMIC charger loops which are slow(i.e. cannot meet the 15ms deadline) to 200 still comply to pSnkStby i.e Maximum power that can be consumed by sink while in Sink Standby 201 state as defined in 7.4.2 Sink Electrical Parameters of USB Power Delivery Specification 202 Revision 3.0, Version 1.2. When the property is set, the port requests pSnkStby(2.5W - 203 5V@500mA) upon entering SNK_DISCOVERY(instead of 3A or the 1.5A, Rp current advertised, during 204 SNK_DISCOVERY) and the actual currrent limit after reception of PS_Ready for PD link or during 205 SNK_READY for non-pd link. 206 type: boolean 207 208dependencies: 209 sink-vdos-v1: [ 'sink-vdos' ] 210 sink-vdos: [ 'sink-vdos-v1' ] 211 212required: 213 - compatible 214 215allOf: 216 - if: 217 properties: 218 compatible: 219 contains: 220 const: gpio-usb-b-connector 221 then: 222 anyOf: 223 - required: 224 - vbus-gpios 225 - required: 226 - id-gpios 227 228 - if: 229 properties: 230 compatible: 231 contains: 232 const: samsung,usb-connector-11pin 233 then: 234 properties: 235 type: 236 const: micro 237 238additionalProperties: true 239 240examples: 241 # Micro-USB connector with HS lines routed via controller (MUIC). 242 - | 243 muic-max77843 { 244 usb_con1: connector { 245 compatible = "usb-b-connector"; 246 label = "micro-USB"; 247 type = "micro"; 248 }; 249 }; 250 251 # USB-C connector attached to CC controller (s2mm005), HS lines routed 252 # to companion PMIC (max77865), SS lines to USB3 PHY and SBU to DisplayPort. 253 # DisplayPort video lines are routed to the connector via SS mux in USB3 PHY. 254 - | 255 ccic: s2mm005 { 256 usb_con2: connector { 257 compatible = "usb-c-connector"; 258 label = "USB-C"; 259 260 ports { 261 #address-cells = <1>; 262 #size-cells = <0>; 263 264 port@0 { 265 reg = <0>; 266 usb_con_hs: endpoint { 267 remote-endpoint = <&max77865_usbc_hs>; 268 }; 269 }; 270 port@1 { 271 reg = <1>; 272 usb_con_ss: endpoint { 273 remote-endpoint = <&usbdrd_phy_ss>; 274 }; 275 }; 276 port@2 { 277 reg = <2>; 278 usb_con_sbu: endpoint { 279 remote-endpoint = <&dp_aux>; 280 }; 281 }; 282 }; 283 }; 284 }; 285 286 # USB-C connector attached to a typec port controller(ptn5110), which has 287 # power delivery support and enables drp. 288 - | 289 #include <dt-bindings/usb/pd.h> 290 typec: ptn5110 { 291 usb_con3: connector { 292 compatible = "usb-c-connector"; 293 label = "USB-C"; 294 power-role = "dual"; 295 try-power-role = "sink"; 296 source-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)>; 297 sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM) 298 PDO_VAR(5000, 12000, 2000)>; 299 op-sink-microwatt = <10000000>; 300 }; 301 }; 302 303 # USB-C connector attached to SoC and USB3 typec port controller(hd3ss3220) 304 # with SS 2:1 MUX. HS lines routed to SoC, SS lines routed to the MUX and 305 # the output of MUX is connected to the SoC. 306 - | 307 connector { 308 compatible = "usb-c-connector"; 309 label = "USB-C"; 310 data-role = "dual"; 311 312 ports { 313 #address-cells = <1>; 314 #size-cells = <0>; 315 port@0 { 316 reg = <0>; 317 hs_ep: endpoint { 318 remote-endpoint = <&usb3_hs_ep>; 319 }; 320 }; 321 port@1 { 322 reg = <1>; 323 ss_ep: endpoint { 324 remote-endpoint = <&hd3ss3220_in_ep>; 325 }; 326 }; 327 }; 328 }; 329 330 # USB connector with GPIO control lines 331 - | 332 #include <dt-bindings/gpio/gpio.h> 333 334 usb { 335 connector { 336 compatible = "gpio-usb-b-connector", "usb-b-connector"; 337 type = "micro"; 338 id-gpios = <&pio 12 GPIO_ACTIVE_HIGH>; 339 vbus-supply = <&usb_p0_vbus>; 340 }; 341 }; 342 343 # Micro-USB connector with HS lines routed via controller (MUIC) and MHL 344 # lines connected to HDMI-MHL bridge (sii8620) on Samsung Exynos5433-based 345 # mobile phone 346 - | 347 muic-max77843 { 348 usb_con4: connector { 349 compatible = "samsung,usb-connector-11pin", "usb-b-connector"; 350 label = "micro-USB"; 351 type = "micro"; 352 353 ports { 354 #address-cells = <1>; 355 #size-cells = <0>; 356 357 port@0 { 358 reg = <0>; 359 muic_to_usb: endpoint { 360 remote-endpoint = <&usb_to_muic>; 361 }; 362 }; 363 port@3 { 364 reg = <3>; 365 usb_con_mhl: endpoint { 366 remote-endpoint = <&sii8620_mhl>; 367 }; 368 }; 369 }; 370 }; 371 }; 372