xref: /linux/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml (revision 04c319e05d0b08cc789db7abccce0fcb13dbab16)
1# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/i2c/qcom,i2c-cci.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm Camera Control Interface (CCI) I2C controller
8
9maintainers:
10  - Loic Poulain <loic.poulain@linaro.org>
11  - Robert Foss <robert.foss@linaro.org>
12
13properties:
14  compatible:
15    oneOf:
16      - enum:
17          - qcom,msm8226-cci
18          - qcom,msm8974-cci
19          - qcom,msm8996-cci
20
21      - items:
22          - enum:
23              - qcom,msm8916-cci
24          - const: qcom,msm8226-cci # CCI v1
25
26      - items:
27          - enum:
28              - qcom,sc7280-cci
29              - qcom,sc8280xp-cci
30              - qcom,sdm670-cci
31              - qcom,sdm845-cci
32              - qcom,sm6350-cci
33              - qcom,sm8250-cci
34              - qcom,sm8450-cci
35              - qcom,sm8550-cci
36              - qcom,sm8650-cci
37          - const: qcom,msm8996-cci # CCI v2
38
39  "#address-cells":
40    const: 1
41
42  "#size-cells":
43    const: 0
44
45  clocks:
46    minItems: 3
47    maxItems: 6
48
49  clock-names:
50    minItems: 3
51    maxItems: 6
52
53  interrupts:
54    maxItems: 1
55
56  power-domains:
57    maxItems: 1
58
59  reg:
60    maxItems: 1
61
62patternProperties:
63  "^i2c-bus@[01]$":
64    $ref: /schemas/i2c/i2c-controller.yaml#
65    unevaluatedProperties: false
66
67    properties:
68      reg:
69        maxItems: 1
70
71      clock-frequency:
72        default: 100000
73
74required:
75  - compatible
76  - clock-names
77  - clocks
78  - interrupts
79  - reg
80
81allOf:
82  - if:
83      properties:
84        compatible:
85          contains:
86            enum:
87              - qcom,msm8996-cci
88    then:
89      required:
90        - power-domains
91
92  - if:
93      properties:
94        compatible:
95          contains:
96            enum:
97              - qcom,msm8226-cci
98              - qcom,msm8916-cci
99    then:
100      properties:
101        i2c-bus@1: false
102
103  - if:
104      properties:
105        compatible:
106          oneOf:
107            - contains:
108                enum:
109                  - qcom,msm8974-cci
110
111            - const: qcom,msm8226-cci
112    then:
113      properties:
114        clocks:
115          maxItems: 3
116        clock-names:
117          items:
118            - const: camss_top_ahb
119            - const: cci_ahb
120            - const: cci
121
122  - if:
123      properties:
124        compatible:
125          oneOf:
126            - contains:
127                enum:
128                  - qcom,msm8916-cci
129
130            - const: qcom,msm8996-cci
131    then:
132      properties:
133        clocks:
134          minItems: 4
135          maxItems: 4
136        clock-names:
137          items:
138            - const: camss_top_ahb
139            - const: cci_ahb
140            - const: cci
141            - const: camss_ahb
142
143  - if:
144      properties:
145        compatible:
146          contains:
147            enum:
148              - qcom,sdm670-cci
149    then:
150      properties:
151        clocks:
152          minItems: 4
153          maxItems: 4
154        clock-names:
155          items:
156            - const: camnoc_axi
157            - const: soc_ahb
158            - const: cpas_ahb
159            - const: cci
160
161  - if:
162      properties:
163        compatible:
164          contains:
165            enum:
166              - qcom,sdm845-cci
167              - qcom,sm6350-cci
168    then:
169      properties:
170        clocks:
171          minItems: 6
172        clock-names:
173          items:
174            - const: camnoc_axi
175            - const: soc_ahb
176            - const: slow_ahb_src
177            - const: cpas_ahb
178            - const: cci
179            - const: cci_src
180
181  - if:
182      properties:
183        compatible:
184          contains:
185            enum:
186              - qcom,sc7280-cci
187              - qcom,sm8250-cci
188              - qcom,sm8450-cci
189    then:
190      properties:
191        clocks:
192          minItems: 5
193          maxItems: 5
194        clock-names:
195          items:
196            - const: camnoc_axi
197            - const: slow_ahb_src
198            - const: cpas_ahb
199            - const: cci
200            - const: cci_src
201
202  - if:
203      properties:
204        compatible:
205          contains:
206            enum:
207              - qcom,sc8280xp-cci
208    then:
209      properties:
210        clocks:
211          minItems: 4
212          maxItems: 4
213        clock-names:
214          items:
215            - const: camnoc_axi
216            - const: slow_ahb_src
217            - const: cpas_ahb
218            - const: cci
219
220  - if:
221      properties:
222        compatible:
223          contains:
224            enum:
225              - qcom,sm8550-cci
226              - qcom,sm8650-cci
227    then:
228      properties:
229        clocks:
230          minItems: 3
231          maxItems: 3
232        clock-names:
233          items:
234            - const: camnoc_axi
235            - const: cpas_ahb
236            - const: cci
237
238additionalProperties: false
239
240examples:
241  - |
242    #include <dt-bindings/clock/qcom,camcc-sdm845.h>
243    #include <dt-bindings/gpio/gpio.h>
244    #include <dt-bindings/interrupt-controller/arm-gic.h>
245
246    cci@ac4a000 {
247        reg = <0x0ac4a000 0x4000>;
248        compatible = "qcom,sdm845-cci", "qcom,msm8996-cci";
249        #address-cells = <1>;
250        #size-cells = <0>;
251
252        interrupts = <GIC_SPI 460 IRQ_TYPE_EDGE_RISING>;
253        power-domains = <&clock_camcc TITAN_TOP_GDSC>;
254
255        clocks = <&clock_camcc CAM_CC_CAMNOC_AXI_CLK>,
256                 <&clock_camcc CAM_CC_SOC_AHB_CLK>,
257                 <&clock_camcc CAM_CC_SLOW_AHB_CLK_SRC>,
258                 <&clock_camcc CAM_CC_CPAS_AHB_CLK>,
259                 <&clock_camcc CAM_CC_CCI_CLK>,
260                 <&clock_camcc CAM_CC_CCI_CLK_SRC>;
261        clock-names = "camnoc_axi",
262                      "soc_ahb",
263                      "slow_ahb_src",
264                      "cpas_ahb",
265                      "cci",
266                      "cci_src";
267
268        assigned-clocks = <&clock_camcc CAM_CC_CAMNOC_AXI_CLK>,
269                          <&clock_camcc CAM_CC_CCI_CLK>;
270        assigned-clock-rates = <80000000>,
271                               <37500000>;
272
273        pinctrl-names = "default", "sleep";
274        pinctrl-0 = <&cci0_default &cci1_default>;
275        pinctrl-1 = <&cci0_sleep &cci1_sleep>;
276
277        i2c-bus@0 {
278            reg = <0>;
279            clock-frequency = <1000000>;
280            #address-cells = <1>;
281            #size-cells = <0>;
282
283            camera@10 {
284                compatible = "ovti,ov8856";
285                reg = <0x10>;
286
287                reset-gpios = <&tlmm 9 GPIO_ACTIVE_LOW>;
288                pinctrl-names = "default";
289                pinctrl-0 = <&cam0_default>;
290
291                clocks = <&clock_camcc CAM_CC_MCLK0_CLK>;
292                clock-names = "xvclk";
293                clock-frequency = <19200000>;
294
295                dovdd-supply = <&vreg_lvs1a_1p8>;
296                avdd-supply = <&cam0_avdd_2v8>;
297                dvdd-supply = <&cam0_dvdd_1v2>;
298
299                port {
300                    ov8856_ep: endpoint {
301                        link-frequencies = /bits/ 64 <360000000 180000000>;
302                        data-lanes = <1 2 3 4>;
303                        remote-endpoint = <&csiphy0_ep>;
304                    };
305                };
306            };
307        };
308
309        cci_i2c1: i2c-bus@1 {
310            reg = <1>;
311            clock-frequency = <1000000>;
312            #address-cells = <1>;
313            #size-cells = <0>;
314
315            camera@60 {
316                compatible = "ovti,ov7251";
317                reg = <0x60>;
318
319                enable-gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>;
320                pinctrl-names = "default";
321                pinctrl-0 = <&cam3_default>;
322
323                clocks = <&clock_camcc CAM_CC_MCLK3_CLK>;
324                clock-names = "xclk";
325                clock-frequency = <24000000>;
326
327                vdddo-supply = <&vreg_lvs1a_1p8>;
328                vdda-supply = <&cam3_avdd_2v8>;
329
330                port {
331                    ov7251_ep: endpoint {
332                        data-lanes = <0>;
333                        link-frequencies = /bits/ 64 <240000000 319200000>;
334                        remote-endpoint = <&csiphy3_ep>;
335                    };
336                };
337            };
338        };
339    };
340