Merge tag 'for-linus-5.10b-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / 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 or a separate node when it is attached to both
15   MUX and USB interface controller.
16
17 properties:
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   # The following are optional properties for "usb-c-connector" with power
97   # delivery support.
98   source-pdos:
99     description: An array of u32 with each entry providing supported power
100       source data object(PDO), the detailed bit definitions of PDO can be found
101       in "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.2
102       Source_Capabilities Message, the order of each entry(PDO) should follow
103       the PD spec chapter 6.4.1. Required for power source and power dual role.
104       User can specify the source PDO array via PDO_FIXED/BATT/VAR/PPS_APDO()
105       defined in dt-bindings/usb/pd.h.
106     minItems: 1
107     maxItems: 7
108     $ref: /schemas/types.yaml#/definitions/uint32-array
109
110   sink-pdos:
111     description: An array of u32 with each entry providing supported power sink
112       data object(PDO), the detailed bit definitions of PDO can be found in
113       "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.3
114       Sink Capabilities Message, the order of each entry(PDO) should follow the
115       PD spec chapter 6.4.1. Required for power sink and power dual role. User
116       can specify the sink PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() defined
117       in dt-bindings/usb/pd.h.
118     minItems: 1
119     maxItems: 7
120     $ref: /schemas/types.yaml#/definitions/uint32-array
121
122   op-sink-microwatt:
123     description: Sink required operating power in microwatt, if source can't
124       offer the power, Capability Mismatch is set. Required for power sink and
125       power dual role.
126
127   ports:
128     description: OF graph bindings (specified in bindings/graph.txt) that model
129       any data bus to the connector unless the bus is between parent node and
130       the connector. Since a single connector can have multiple data buses every
131       bus has an assigned OF graph port number as described below.
132     type: object
133     properties:
134       port@0:
135         type: object
136         description: High Speed (HS), present in all connectors.
137
138       port@1:
139         type: object
140         description: Super Speed (SS), present in SS capable connectors.
141
142       port@2:
143         type: object
144         description: Sideband Use (SBU), present in USB-C. This describes the
145           alternate mode connection of which SBU is a part.
146
147     required:
148       - port@0
149
150 required:
151   - compatible
152
153 allOf:
154   - if:
155       properties:
156         compatible:
157           contains:
158             const: gpio-usb-b-connector
159     then:
160       anyOf:
161         - required:
162             - vbus-gpios
163         - required:
164             - id-gpios
165
166   - if:
167       properties:
168         compatible:
169           contains:
170             const: samsung,usb-connector-11pin
171     then:
172       properties:
173         type:
174           const: micro
175
176 additionalProperties: true
177
178 examples:
179   # Micro-USB connector with HS lines routed via controller (MUIC).
180   - |
181     muic-max77843 {
182       usb_con1: connector {
183         compatible = "usb-b-connector";
184         label = "micro-USB";
185         type = "micro";
186       };
187     };
188
189   # USB-C connector attached to CC controller (s2mm005), HS lines routed
190   # to companion PMIC (max77865), SS lines to USB3 PHY and SBU to DisplayPort.
191   # DisplayPort video lines are routed to the connector via SS mux in USB3 PHY.
192   - |
193     ccic: s2mm005 {
194       usb_con2: connector {
195         compatible = "usb-c-connector";
196         label = "USB-C";
197
198         ports {
199           #address-cells = <1>;
200           #size-cells = <0>;
201
202           port@0 {
203             reg = <0>;
204             usb_con_hs: endpoint {
205               remote-endpoint = <&max77865_usbc_hs>;
206             };
207           };
208           port@1 {
209             reg = <1>;
210             usb_con_ss: endpoint {
211               remote-endpoint = <&usbdrd_phy_ss>;
212             };
213           };
214           port@2 {
215             reg = <2>;
216             usb_con_sbu: endpoint {
217               remote-endpoint = <&dp_aux>;
218             };
219           };
220         };
221       };
222     };
223
224   # USB-C connector attached to a typec port controller(ptn5110), which has
225   # power delivery support and enables drp.
226   - |
227     #include <dt-bindings/usb/pd.h>
228     typec: ptn5110 {
229       usb_con3: connector {
230         compatible = "usb-c-connector";
231         label = "USB-C";
232         power-role = "dual";
233         try-power-role = "sink";
234         source-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)>;
235         sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)
236                      PDO_VAR(5000, 12000, 2000)>;
237         op-sink-microwatt = <10000000>;
238       };
239     };
240
241   # USB-C connector attached to SoC and USB3 typec port controller(hd3ss3220)
242   # with SS 2:1 MUX. HS lines routed to SoC, SS lines routed to the MUX and
243   # the output of MUX is connected to the SoC.
244   - |
245     connector {
246         compatible = "usb-c-connector";
247         label = "USB-C";
248         data-role = "dual";
249
250         ports {
251                 #address-cells = <1>;
252                 #size-cells = <0>;
253                 port@0 {
254                         reg = <0>;
255                         hs_ep: endpoint {
256                                 remote-endpoint = <&usb3_hs_ep>;
257                         };
258                 };
259                 port@1 {
260                         reg = <1>;
261                         ss_ep: endpoint {
262                                 remote-endpoint = <&hd3ss3220_in_ep>;
263                         };
264                 };
265         };
266     };
267
268   # USB connector with GPIO control lines
269   - |
270     #include <dt-bindings/gpio/gpio.h>
271
272     usb {
273       connector {
274         compatible = "gpio-usb-b-connector", "usb-b-connector";
275         type = "micro";
276         id-gpios = <&pio 12 GPIO_ACTIVE_HIGH>;
277         vbus-supply = <&usb_p0_vbus>;
278       };
279     };
280
281   # Micro-USB connector with HS lines routed via controller (MUIC) and MHL
282   # lines connected to HDMI-MHL bridge (sii8620) on Samsung Exynos5433-based
283   # mobile phone
284   - |
285     muic-max77843 {
286       usb_con4: connector {
287         compatible = "samsung,usb-connector-11pin", "usb-b-connector";
288         label = "micro-USB";
289         type = "micro";
290
291         ports {
292           #address-cells = <1>;
293           #size-cells = <0>;
294
295           port@0 {
296             reg = <0>;
297             muic_to_usb: endpoint {
298               remote-endpoint = <&usb_to_muic>;
299             };
300           };
301           port@3 {
302             reg = <3>;
303             usb_con_mhl: endpoint {
304               remote-endpoint = <&sii8620_mhl>;
305             };
306           };
307         };
308       };
309     };