Mention branches and keyring.
[releases.git] / bindings / usb / qcom,pmic-typec.yaml
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
7 title: Qualcomm PMIC based USB Type-C block
8
9 maintainers:
10   - Bryan O'Donoghue <bryan.odonoghue@linaro.org>
11
12 description:
13   Qualcomm PMIC Type-C block
14
15 properties:
16   compatible:
17     enum:
18       - qcom,pm8150b-typec
19
20   connector:
21     type: object
22     $ref: /schemas/connector/usb-connector.yaml#
23     unevaluatedProperties: false
24
25   reg:
26     description: Type-C port and pdphy SPMI register base offsets
27     maxItems: 2
28
29   interrupts:
30     items:
31       - description: Type-C CC attach notification, VBUS error, tCCDebounce done
32       - description: Type-C VCONN powered
33       - description: Type-C CC state change
34       - description: Type-C VCONN over-current
35       - description: Type-C VBUS state change
36       - description: Type-C Attach/detach notification
37       - description: Type-C Legacy cable detect
38       - description: Type-C Try.Src Try.Snk state change
39       - description: Power Domain Signal TX - HardReset or CableReset signal TX
40       - description: Power Domain Signal RX - HardReset or CableReset signal RX
41       - description: Power Domain TX complete
42       - description: Power Domain RX complete
43       - description: Power Domain TX fail
44       - description: Power Domain TX message discard
45       - description: Power Domain RX message discard
46       - description: Power Domain Fast Role Swap event
47
48   interrupt-names:
49     items:
50       - const: or-rid-detect-change
51       - const: vpd-detect
52       - const: cc-state-change
53       - const: vconn-oc
54       - const: vbus-change
55       - const: attach-detach
56       - const: legacy-cable-detect
57       - const: try-snk-src-detect
58       - const: sig-tx
59       - const: sig-rx
60       - const: msg-tx
61       - const: msg-rx
62       - const: msg-tx-failed
63       - const: msg-tx-discarded
64       - const: msg-rx-discarded
65       - const: fr-swap
66
67   vdd-vbus-supply:
68     description: VBUS power supply.
69
70   vdd-pdphy-supply:
71     description: VDD regulator supply to the PDPHY.
72
73   port:
74     $ref: /schemas/graph.yaml#/properties/port
75     description:
76       Contains a port which produces data-role switching messages.
77
78 required:
79   - compatible
80   - reg
81   - interrupts
82   - interrupt-names
83   - vdd-vbus-supply
84   - vdd-pdphy-supply
85
86 additionalProperties: false
87
88 examples:
89   - |
90     #include <dt-bindings/interrupt-controller/arm-gic.h>
91     #include <dt-bindings/usb/pd.h>
92
93     pmic {
94         #address-cells = <1>;
95         #size-cells = <0>;
96
97         pm8150b_typec: typec@1500 {
98             compatible = "qcom,pm8150b-typec";
99             reg = <0x1500>,
100                   <0x1700>;
101
102             interrupts = <0x2 0x15 0x00 IRQ_TYPE_EDGE_RISING>,
103                          <0x2 0x15 0x01 IRQ_TYPE_EDGE_BOTH>,
104                          <0x2 0x15 0x02 IRQ_TYPE_EDGE_RISING>,
105                          <0x2 0x15 0x03 IRQ_TYPE_EDGE_BOTH>,
106                          <0x2 0x15 0x04 IRQ_TYPE_EDGE_RISING>,
107                          <0x2 0x15 0x05 IRQ_TYPE_EDGE_RISING>,
108                          <0x2 0x15 0x06 IRQ_TYPE_EDGE_BOTH>,
109                          <0x2 0x15 0x07 IRQ_TYPE_EDGE_RISING>,
110                          <0x2 0x17 0x00 IRQ_TYPE_EDGE_RISING>,
111                          <0x2 0x17 0x01 IRQ_TYPE_EDGE_RISING>,
112                          <0x2 0x17 0x02 IRQ_TYPE_EDGE_RISING>,
113                          <0x2 0x17 0x03 IRQ_TYPE_EDGE_RISING>,
114                          <0x2 0x17 0x04 IRQ_TYPE_EDGE_RISING>,
115                          <0x2 0x17 0x05 IRQ_TYPE_EDGE_RISING>,
116                          <0x2 0x17 0x06 IRQ_TYPE_EDGE_RISING>,
117                          <0x2 0x17 0x07 IRQ_TYPE_EDGE_RISING>;
118
119             interrupt-names = "or-rid-detect-change",
120                               "vpd-detect",
121                               "cc-state-change",
122                               "vconn-oc",
123                               "vbus-change",
124                               "attach-detach",
125                               "legacy-cable-detect",
126                               "try-snk-src-detect",
127                               "sig-tx",
128                               "sig-rx",
129                               "msg-tx",
130                               "msg-rx",
131                               "msg-tx-failed",
132                               "msg-tx-discarded",
133                               "msg-rx-discarded",
134                               "fr-swap";
135
136             vdd-vbus-supply = <&pm8150b_vbus>;
137             vdd-pdphy-supply = <&vreg_l2a_3p1>;
138
139             connector {
140                 compatible = "usb-c-connector";
141
142                 power-role = "source";
143                 data-role = "dual";
144                 self-powered;
145
146                 source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_DUAL_ROLE |
147                                PDO_FIXED_USB_COMM | PDO_FIXED_DATA_SWAP)>;
148
149                 ports {
150                     #address-cells = <1>;
151                     #size-cells = <0>;
152
153                     port@0 {
154                         reg = <0>;
155                         pmic_typec_mux_out: endpoint {
156                             remote-endpoint = <&usb_phy_typec_mux_in>;
157                         };
158                     };
159
160                     port@1 {
161                         reg = <1>;
162                         pmic_typec_role_switch_out: endpoint {
163                             remote-endpoint = <&usb_role_switch_in>;
164                         };
165                     };
166                 };
167             };
168         };
169     };
170
171     usb {
172         dr_mode = "otg";
173         usb-role-switch;
174         port {
175             usb_role_switch_in: endpoint {
176                 remote-endpoint = <&pmic_typec_role_switch_out>;
177             };
178         };
179     };
180
181     usb-phy {
182         orientation-switch;
183         port {
184             usb_phy_typec_mux_in: endpoint {
185                 remote-endpoint = <&pmic_typec_mux_out>;
186             };
187         };
188     };
189
190 ...