1# Copyright 2022 The Chromium OS Authors
2# SPDX-License-Identifier: Apache-2.0
3
4description: |
5    A USB Type-C connector node represents a physical USB Type-C connector.
6    It should be a child of a USB-C interface controller or a separate node
7    when it is attached to both MUX and USB-C interface controller.
8
9    This is based on Linux, documentation:
10      https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/connector/usb-connector.yaml?h=v5.19&id=3d7cb6b04c3f3115719235cc6866b10326de34cd
11
12    Example:
13
14    USB-C connector attached to a STM32 UCPD typec port controller, which has
15    power delivery support and enables SINK.
16
17    vbus1: vbus {
18        compatible = "zephyr,usb-c-vbus-adc";
19        io-channels = <&adc2 8>;
20        output-ohms = <49900>;
21        full-ohms = <(330000 + 49900)>;
22    };
23
24    ports {
25        #address-cells = <1>;
26        #size-cells = <0>;
27        port1: usb-c-port@1 {
28            compatible = "usb-c-connector";
29            reg = <1>;
30            tcpc = <&ucpd1>;
31            vbus = <&vbus1>;
32            power-role = "sink";
33            sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)
34                         PDO_VAR(5000, 12000, 2000)>;
35            op-sink-microwatt = <10000000>;
36        };
37    };
38
39
40compatible: "usb-c-connector"
41
42include: base.yaml
43
44properties:
45  tcpc:
46    type: phandle
47    required: true
48    description: |
49        Type-C Port Controller for this port.
50
51  vbus:
52    type: phandle
53    required: true
54    description: |
55        VBUS measurement and control for this port.
56
57  ppc:
58    type: phandle
59    description: |
60        Power path controller for this port
61
62  power-role:
63    type: string
64    required: true
65    enum:
66      - "sink"
67      - "source"
68      - "dual"
69    description: |
70      The Port power role. "dual" for Dual Role Port.
71
72  try-power-role:
73    type: string
74    enum:
75      - "sink"
76      - "source"
77      - "dual"
78    description: |
79      Preferred power role.
80
81  data-role:
82    type: string
83    enum:
84      - "host"
85      - "device"
86      - "dual"
87    description: |
88      The Port data role.
89        * "host" for Downstream Facing Port (DFP)
90        * "device" for Upstream Facing Port (UFP)
91        * "dual" for Dual Role Data
92
93  typec-power-opmode:
94    type: string
95    enum:
96      - "default"
97      - "1.5A"
98      - "3.0A"
99    description: |
100      Initial Type C advertised power, determined by the Rp when
101      operating as a Source.
102      * "default" corresponds to default USB voltage and current
103        defined by the  USB 2.0 and USB 3.2 specifications.
104          * 5V@500mA for USB 2.0
105          * 5V@900mA for USB 3.2 single-lane
106          * 5V@1500mA for USB 3.2 dual-lane
107      * "1.5A" and "3.0A", 5V@1.5A and 5V@3.0A.
108
109  pd-disable:
110    type: boolean
111    description: |
112      Disables power delivery when true
113
114  source-pdos:
115    type: array
116    description: |
117      An array of source Power Data Objects (PDOs).
118      Use the following macros to define the PDOs, defined in
119      dt-bindings/usb-c/pd.h.
120        * PDO_FIXED
121        * PDO_BATT
122        * PDO_VAR
123        * PDO_PPS_APDO
124      Valid range: 1 - 7
125
126  sink-pdos:
127    type: array
128    description: |
129      An array of sink Power Data Objects (PDOs).
130      Use the following macros to define the PDOs, defined in
131      dt-bindings/usb-c/pd.h.
132        * PDO_FIXED
133        * PDO_BATT
134        * PDO_VAR
135        * PDO_PPS_APDO
136      Valid range: 1 - 7
137
138  sink-vdos:
139    type: array
140    description: |
141      An array of sink Vendor Defined Objects (VDOs).
142      Use the following macros to define the VDOs, defined in
143      dt-bindings/usb-c/pd.h.
144        * VDO_IDH
145        * VDO_CERT
146        * VDO_PRODUCT
147        * VDO_UFP
148        * VDO_DFP
149        * VDO_PCABLE
150        * VDO_ACABLE
151        * VDO_VPD
152      Valid range: 3 - 6
153
154  sink-vdos-v1:
155    type: array
156    description: |
157      An array of sink Vendor Defined Objects (VDOs).
158      Use the following macros to define the VDOs, defined in
159      dt-bindings/usb-c/pd.h.
160        * VDO_IDH
161        * VDO_CERT
162        * VDO_PRODUCT
163        * VDO_CABLE
164        * VDO_AMA
165      Valid range: 3 - 6
166
167  op-sink-microwatt:
168    type: int
169    description: |
170      Minimum power, in microwatts, needed by the sink. A Capability
171      Mismatch is sent to the Source if the power can't be met.
172