1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/usb/qcom,pmic-typec.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm PMIC based USB Type-C block
8
9maintainers:
10  - Bryan O'Donoghue <[email protected]>
11
12description:
13  Qualcomm PMIC Type-C block
14
15properties:
16  compatible:
17    oneOf:
18      - enum:
19          - qcom,pmi632-typec
20          - qcom,pm8150b-typec
21      - items:
22          - enum:
23              - qcom,pm6150-typec
24              - qcom,pm7250b-typec
25          - const: qcom,pm8150b-typec
26      - items:
27          - enum:
28              - qcom,pm4125-typec
29          - const: qcom,pmi632-typec
30
31
32  connector:
33    type: object
34    $ref: /schemas/connector/usb-connector.yaml#
35    unevaluatedProperties: false
36
37  reg:
38    description: Type-C port and pdphy SPMI register base offsets
39    minItems: 1
40    maxItems: 2
41
42  interrupts:
43    minItems: 8
44    items:
45      - description: Type-C CC attach notification, VBUS error, tCCDebounce done
46      - description: Type-C VCONN powered
47      - description: Type-C CC state change
48      - description: Type-C VCONN over-current
49      - description: Type-C VBUS state change
50      - description: Type-C Attach/detach notification
51      - description: Type-C Legacy cable detect
52      - description: Type-C Try.Src Try.Snk state change
53      - description: Power Domain Signal TX - HardReset or CableReset signal TX
54      - description: Power Domain Signal RX - HardReset or CableReset signal RX
55      - description: Power Domain TX complete
56      - description: Power Domain RX complete
57      - description: Power Domain TX fail
58      - description: Power Domain TX message discard
59      - description: Power Domain RX message discard
60      - description: Power Domain Fast Role Swap event
61
62  interrupt-names:
63    minItems: 8
64    items:
65      - const: or-rid-detect-change
66      - const: vpd-detect
67      - const: cc-state-change
68      - const: vconn-oc
69      - const: vbus-change
70      - const: attach-detach
71      - const: legacy-cable-detect
72      - const: try-snk-src-detect
73      - const: sig-tx
74      - const: sig-rx
75      - const: msg-tx
76      - const: msg-rx
77      - const: msg-tx-failed
78      - const: msg-tx-discarded
79      - const: msg-rx-discarded
80      - const: fr-swap
81
82  vdd-vbus-supply:
83    description: VBUS power supply.
84
85  vdd-pdphy-supply:
86    description: VDD regulator supply to the PDPHY.
87
88  port:
89    $ref: /schemas/graph.yaml#/properties/port
90    description:
91      Contains a port which produces data-role switching messages.
92
93required:
94  - compatible
95  - reg
96  - interrupts
97  - interrupt-names
98  - vdd-vbus-supply
99
100allOf:
101  - if:
102      properties:
103        compatible:
104          contains:
105            enum:
106              - qcom,pmi632-typec
107    then:
108      properties:
109        reg:
110          maxItems: 1
111        interrupts:
112          maxItems: 8
113        interrupt-names:
114          maxItems: 8
115        vdd-pdphy-supply: false
116    else:
117      properties:
118        reg:
119          maxItems: 2
120        interrupts:
121          minItems: 16
122        interrupt-names:
123          maxItems: 16
124      required:
125        - vdd-pdphy-supply
126
127additionalProperties: false
128
129examples:
130  - |
131    #include <dt-bindings/interrupt-controller/arm-gic.h>
132    #include <dt-bindings/usb/pd.h>
133
134    pmic {
135        #address-cells = <1>;
136        #size-cells = <0>;
137
138        pm8150b_typec: typec@1500 {
139            compatible = "qcom,pm8150b-typec";
140            reg = <0x1500>,
141                  <0x1700>;
142
143            interrupts = <0x2 0x15 0x00 IRQ_TYPE_EDGE_RISING>,
144                         <0x2 0x15 0x01 IRQ_TYPE_EDGE_BOTH>,
145                         <0x2 0x15 0x02 IRQ_TYPE_EDGE_RISING>,
146                         <0x2 0x15 0x03 IRQ_TYPE_EDGE_BOTH>,
147                         <0x2 0x15 0x04 IRQ_TYPE_EDGE_RISING>,
148                         <0x2 0x15 0x05 IRQ_TYPE_EDGE_RISING>,
149                         <0x2 0x15 0x06 IRQ_TYPE_EDGE_BOTH>,
150                         <0x2 0x15 0x07 IRQ_TYPE_EDGE_RISING>,
151                         <0x2 0x17 0x00 IRQ_TYPE_EDGE_RISING>,
152                         <0x2 0x17 0x01 IRQ_TYPE_EDGE_RISING>,
153                         <0x2 0x17 0x02 IRQ_TYPE_EDGE_RISING>,
154                         <0x2 0x17 0x03 IRQ_TYPE_EDGE_RISING>,
155                         <0x2 0x17 0x04 IRQ_TYPE_EDGE_RISING>,
156                         <0x2 0x17 0x05 IRQ_TYPE_EDGE_RISING>,
157                         <0x2 0x17 0x06 IRQ_TYPE_EDGE_RISING>,
158                         <0x2 0x17 0x07 IRQ_TYPE_EDGE_RISING>;
159
160            interrupt-names = "or-rid-detect-change",
161                              "vpd-detect",
162                              "cc-state-change",
163                              "vconn-oc",
164                              "vbus-change",
165                              "attach-detach",
166                              "legacy-cable-detect",
167                              "try-snk-src-detect",
168                              "sig-tx",
169                              "sig-rx",
170                              "msg-tx",
171                              "msg-rx",
172                              "msg-tx-failed",
173                              "msg-tx-discarded",
174                              "msg-rx-discarded",
175                              "fr-swap";
176
177            vdd-vbus-supply = <&pm8150b_vbus>;
178            vdd-pdphy-supply = <&vreg_l2a_3p1>;
179
180            connector {
181                compatible = "usb-c-connector";
182
183                power-role = "source";
184                data-role = "dual";
185                self-powered;
186
187                source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_DUAL_ROLE |
188                               PDO_FIXED_USB_COMM | PDO_FIXED_DATA_SWAP)>;
189
190                ports {
191                    #address-cells = <1>;
192                    #size-cells = <0>;
193
194                    port@0 {
195                        reg = <0>;
196                        pmic_typec_hs_in: endpoint {
197                            remote-endpoint = <&usb_hs_out>;
198                        };
199                    };
200
201                    port@1 {
202                        reg = <1>;
203                        pmic_typec_ss_in: endpoint {
204                            remote-endpoint = <&usb_phy_typec_ss_out>;
205                        };
206                    };
207
208                    port@2 {
209                        reg = <2>;
210                        pmic_typec_sbu: endpoint {
211                            remote-endpoint = <&usb_mux_sbu>;
212                        };
213                    };
214                };
215            };
216        };
217    };
218
219    usb {
220        dr_mode = "otg";
221        usb-role-switch;
222        port {
223            usb_hs_out: endpoint {
224                remote-endpoint = <&pmic_typec_hs_in>;
225            };
226        };
227    };
228
229    usb-phy {
230        orientation-switch;
231        port {
232            usb_phy_typec_ss_out: endpoint {
233                remote-endpoint = <&pmic_typec_ss_in>;
234            };
235        };
236    };
237
238    usb-mux {
239        orientation-switch;
240        mode-switch;
241
242        port {
243            usb_mux_sbu: endpoint {
244                remote-endpoint = <&pmic_typec_sbu>;
245            };
246        };
247    };
248
249...
250