summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/connector/usb-connector.yaml
blob: 62781518aefcf1d6e84fbd52d855cc57e4a8e808 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/connector/usb-connector.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: USB Connector

maintainers:
  - Rob Herring <robh@kernel.org>

description:
  A USB connector node represents a physical USB connector. It should be a child
  of a USB interface controller or a separate node when it is attached to both
  MUX and USB interface controller.

properties:
  compatible:
    oneOf:
      - enum:
          - usb-a-connector
          - usb-b-connector
          - usb-c-connector

      - items:
          - const: gpio-usb-b-connector
          - const: usb-b-connector

      - items:
          - const: samsung,usb-connector-11pin
          - const: usb-b-connector

  label:
    description: Symbolic name for the connector.

  type:
    description: Size of the connector, should be specified in case of
      non-fullsize 'usb-a-connector' or 'usb-b-connector' compatible
      connectors.
    $ref: /schemas/types.yaml#definitions/string

    enum:
      - mini
      - micro

  self-powered:
    description: Set this property if the USB device has its own power source.
    type: boolean

  # The following are optional properties for "usb-b-connector".
  id-gpios:
    description: An input gpio for USB ID pin.
    maxItems: 1

  vbus-gpios:
    description: An input gpio for USB VBus pin, used to detect presence of
      VBUS 5V.
    maxItems: 1

  vbus-supply:
    description: A phandle to the regulator for USB VBUS if needed when host
      mode or dual role mode is supported.
      Particularly, if use an output GPIO to control a VBUS regulator, should
      model it as a regulator. See bindings/regulator/fixed-regulator.yaml

  # The following are optional properties for "usb-c-connector".
  power-role:
    description: Determines the power role that the Type C connector will
      support. "dual" refers to Dual Role Port (DRP).
    $ref: /schemas/types.yaml#definitions/string

    enum:
      - source
      - sink
      - dual

  try-power-role:
    description: Preferred power role.
    $ref: /schemas/types.yaml#definitions/string

    enum:
      - source
      - sink
      - dual

  data-role:
    description: Data role if Type C connector supports USB data. "dual" refers
      Dual Role Device (DRD).
    $ref: /schemas/types.yaml#definitions/string

    enum:
      - host
      - device
      - dual

  # The following are optional properties for "usb-c-connector" with power
  # delivery support.
  source-pdos:
    description: An array of u32 with each entry providing supported power
      source data object(PDO), the detailed bit definitions of PDO can be found
      in "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.2
      Source_Capabilities Message, the order of each entry(PDO) should follow
      the PD spec chapter 6.4.1. Required for power source and power dual role.
      User can specify the source PDO array via PDO_FIXED/BATT/VAR/PPS_APDO()
      defined in dt-bindings/usb/pd.h.
    minItems: 1
    maxItems: 7
    $ref: /schemas/types.yaml#/definitions/uint32-array

  sink-pdos:
    description: An array of u32 with each entry providing supported power sink
      data object(PDO), the detailed bit definitions of PDO can be found in
      "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.3
      Sink Capabilities Message, the order of each entry(PDO) should follow the
      PD spec chapter 6.4.1. Required for power sink and power dual role. User
      can specify the sink PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() defined
      in dt-bindings/usb/pd.h.
    minItems: 1
    maxItems: 7
    $ref: /schemas/types.yaml#/definitions/uint32-array

  op-sink-microwatt:
    description: Sink required operating power in microwatt, if source can't
      offer the power, Capability Mismatch is set. Required for power sink and
      power dual role.

  ports:
    description: OF graph bindings (specified in bindings/graph.txt) that model
      any data bus to the connector unless the bus is between parent node and
      the connector. Since a single connector can have multiple data buses every
      bus has an assigned OF graph port number as described below.
    type: object
    properties:
      port@0:
        type: object
        description: High Speed (HS), present in all connectors.

      port@1:
        type: object
        description: Super Speed (SS), present in SS capable connectors.

      port@2:
        type: object
        description: Sideband Use (SBU), present in USB-C. This describes the
          alternate mode connection of which SBU is a part.

    required:
      - port@0

  new-source-frs-typec-current:
    description: Initial current capability of the new source when vSafe5V
      is applied during PD3.0 Fast Role Swap. "Table 6-14 Fixed Supply PDO - Sink"
      of "USB Power Delivery Specification Revision 3.0, Version 1.2" provides the
      different power levels and "6.4.1.3.1.6 Fast Role Swap USB Type-C Current"
      provides a detailed description of the field. The sink PDO from current source
      reflects the current source's(i.e. transmitter of the FRS signal) power
      requirement during fr swap. The current sink (i.e. receiver of the FRS signal),
      a.k.a new source, should check if it will be able to satisfy the current source's,
      new sink's, requirement during frswap before enabling the frs signal reception.
      This property refers to maximum current capability that the current sink can
      satisfy. During FRS, VBUS voltage is at 5V, as the partners are in implicit
      contract, hence, the power level is only a function of the current capability.
      "1" refers to default USB power level as described by "Table 6-14 Fixed Supply PDO - Sink".
      "2" refers to 1.5A@5V.
      "3" refers to 3.0A@5V.
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [1, 2, 3]

required:
  - compatible

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: gpio-usb-b-connector
    then:
      anyOf:
        - required:
            - vbus-gpios
        - required:
            - id-gpios

  - if:
      properties:
        compatible:
          contains:
            const: samsung,usb-connector-11pin
    then:
      properties:
        type:
          const: micro

additionalProperties: true

examples:
  # Micro-USB connector with HS lines routed via controller (MUIC).
  - |
    muic-max77843 {
      usb_con1: connector {
        compatible = "usb-b-connector";
        label = "micro-USB";
        type = "micro";
      };
    };

  # USB-C connector attached to CC controller (s2mm005), HS lines routed
  # to companion PMIC (max77865), SS lines to USB3 PHY and SBU to DisplayPort.
  # DisplayPort video lines are routed to the connector via SS mux in USB3 PHY.
  - |
    ccic: s2mm005 {
      usb_con2: connector {
        compatible = "usb-c-connector";
        label = "USB-C";

        ports {
          #address-cells = <1>;
          #size-cells = <0>;

          port@0 {
            reg = <0>;
            usb_con_hs: endpoint {
              remote-endpoint = <&max77865_usbc_hs>;
            };
          };
          port@1 {
            reg = <1>;
            usb_con_ss: endpoint {
              remote-endpoint = <&usbdrd_phy_ss>;
            };
          };
          port@2 {
            reg = <2>;
            usb_con_sbu: endpoint {
              remote-endpoint = <&dp_aux>;
            };
          };
        };
      };
    };

  # USB-C connector attached to a typec port controller(ptn5110), which has
  # power delivery support and enables drp.
  - |
    #include <dt-bindings/usb/pd.h>
    typec: ptn5110 {
      usb_con3: connector {
        compatible = "usb-c-connector";
        label = "USB-C";
        power-role = "dual";
        try-power-role = "sink";
        source-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)>;
        sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)
                     PDO_VAR(5000, 12000, 2000)>;
        op-sink-microwatt = <10000000>;
      };
    };

  # USB-C connector attached to SoC and USB3 typec port controller(hd3ss3220)
  # with SS 2:1 MUX. HS lines routed to SoC, SS lines routed to the MUX and
  # the output of MUX is connected to the SoC.
  - |
    connector {
        compatible = "usb-c-connector";
        label = "USB-C";
        data-role = "dual";

        ports {
                #address-cells = <1>;
                #size-cells = <0>;
                port@0 {
                        reg = <0>;
                        hs_ep: endpoint {
                                remote-endpoint = <&usb3_hs_ep>;
                        };
                };
                port@1 {
                        reg = <1>;
                        ss_ep: endpoint {
                                remote-endpoint = <&hd3ss3220_in_ep>;
                        };
                };
        };
    };

  # USB connector with GPIO control lines
  - |
    #include <dt-bindings/gpio/gpio.h>

    usb {
      connector {
        compatible = "gpio-usb-b-connector", "usb-b-connector";
        type = "micro";
        id-gpios = <&pio 12 GPIO_ACTIVE_HIGH>;
        vbus-supply = <&usb_p0_vbus>;
      };
    };

  # Micro-USB connector with HS lines routed via controller (MUIC) and MHL
  # lines connected to HDMI-MHL bridge (sii8620) on Samsung Exynos5433-based
  # mobile phone
  - |
    muic-max77843 {
      usb_con4: connector {
        compatible = "samsung,usb-connector-11pin", "usb-b-connector";
        label = "micro-USB";
        type = "micro";

        ports {
          #address-cells = <1>;
          #size-cells = <0>;

          port@0 {
            reg = <0>;
            muic_to_usb: endpoint {
              remote-endpoint = <&usb_to_muic>;
            };
          };
          port@3 {
            reg = <3>;
            usb_con_mhl: endpoint {
              remote-endpoint = <&sii8620_mhl>;
            };
          };
        };
      };
    };