|
| 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 | + }; |
0 commit comments