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