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    enum:
16      - qcom,msm8226-cci
17      - qcom,msm8916-cci
18      - qcom,msm8974-cci
19      - qcom,msm8996-cci
20      - qcom,sdm845-cci
21      - qcom,sm8250-cci
22      - qcom,sm8450-cci
23
24  "#address-cells":
25    const: 1
26
27  "#size-cells":
28    const: 0
29
30  clocks:
31    minItems: 3
32    maxItems: 6
33
34  clock-names:
35    minItems: 3
36    maxItems: 6
37
38  interrupts:
39    maxItems: 1
40
41  power-domains:
42    maxItems: 1
43
44  reg:
45    maxItems: 1
46
47patternProperties:
48  "^i2c-bus@[01]$":
49    $ref: /schemas/i2c/i2c-controller.yaml#
50    unevaluatedProperties: false
51
52    properties:
53      reg:
54        maxItems: 1
55
56      clock-frequency:
57        default: 100000
58
59required:
60  - compatible
61  - clock-names
62  - clocks
63  - interrupts
64  - reg
65
66allOf:
67  - if:
68      properties:
69        compatible:
70          contains:
71            enum:
72              - qcom,msm8996-cci
73    then:
74      required:
75        - power-domains
76
77  - if:
78      properties:
79        compatible:
80          contains:
81            enum:
82              - qcom,msm8226-cci
83              - qcom,msm8916-cci
84    then:
85      properties:
86        i2c-bus@1: false
87
88  - if:
89      properties:
90        compatible:
91          contains:
92            enum:
93              - qcom,msm8226-cci
94              - qcom,msm8974-cci
95    then:
96      properties:
97        clocks:
98          maxItems: 3
99        clock-names:
100          items:
101            - const: camss_top_ahb
102            - const: cci_ahb
103            - const: cci
104
105  - if:
106      properties:
107        compatible:
108          contains:
109            enum:
110              - qcom,msm8916-cci
111              - qcom,msm8996-cci
112    then:
113      properties:
114        clocks:
115          maxItems: 4
116        clock-names:
117          items:
118            - const: camss_top_ahb
119            - const: cci_ahb
120            - const: cci
121            - const: camss_ahb
122
123  - if:
124      properties:
125        compatible:
126          contains:
127            enum:
128              - qcom,sdm845-cci
129    then:
130      properties:
131        clocks:
132          minItems: 6
133        clock-names:
134          items:
135            - const: camnoc_axi
136            - const: soc_ahb
137            - const: slow_ahb_src
138            - const: cpas_ahb
139            - const: cci
140            - const: cci_src
141
142  - if:
143      properties:
144        compatible:
145          contains:
146            enum:
147              - qcom,sm8250-cci
148              - qcom,sm8450-cci
149    then:
150      properties:
151        clocks:
152          minItems: 5
153          maxItems: 5
154        clock-names:
155          items:
156            - const: camnoc_axi
157            - const: slow_ahb_src
158            - const: cpas_ahb
159            - const: cci
160            - const: cci_src
161
162additionalProperties: false
163
164examples:
165  - |
166    #include <dt-bindings/clock/qcom,camcc-sdm845.h>
167    #include <dt-bindings/gpio/gpio.h>
168    #include <dt-bindings/interrupt-controller/arm-gic.h>
169
170    cci@ac4a000 {
171        reg = <0x0ac4a000 0x4000>;
172        compatible = "qcom,sdm845-cci";
173        #address-cells = <1>;
174        #size-cells = <0>;
175
176        interrupts = <GIC_SPI 460 IRQ_TYPE_EDGE_RISING>;
177        power-domains = <&clock_camcc TITAN_TOP_GDSC>;
178
179        clocks = <&clock_camcc CAM_CC_CAMNOC_AXI_CLK>,
180                 <&clock_camcc CAM_CC_SOC_AHB_CLK>,
181                 <&clock_camcc CAM_CC_SLOW_AHB_CLK_SRC>,
182                 <&clock_camcc CAM_CC_CPAS_AHB_CLK>,
183                 <&clock_camcc CAM_CC_CCI_CLK>,
184                 <&clock_camcc CAM_CC_CCI_CLK_SRC>;
185        clock-names = "camnoc_axi",
186                      "soc_ahb",
187                      "slow_ahb_src",
188                      "cpas_ahb",
189                      "cci",
190                      "cci_src";
191
192        assigned-clocks = <&clock_camcc CAM_CC_CAMNOC_AXI_CLK>,
193                          <&clock_camcc CAM_CC_CCI_CLK>;
194        assigned-clock-rates = <80000000>,
195                               <37500000>;
196
197        pinctrl-names = "default", "sleep";
198        pinctrl-0 = <&cci0_default &cci1_default>;
199        pinctrl-1 = <&cci0_sleep &cci1_sleep>;
200
201        i2c-bus@0 {
202            reg = <0>;
203            clock-frequency = <1000000>;
204            #address-cells = <1>;
205            #size-cells = <0>;
206
207            camera@10 {
208                compatible = "ovti,ov8856";
209                reg = <0x10>;
210
211                reset-gpios = <&tlmm 9 GPIO_ACTIVE_LOW>;
212                pinctrl-names = "default";
213                pinctrl-0 = <&cam0_default>;
214
215                clocks = <&clock_camcc CAM_CC_MCLK0_CLK>;
216                clock-names = "xvclk";
217                clock-frequency = <19200000>;
218
219                dovdd-supply = <&vreg_lvs1a_1p8>;
220                avdd-supply = <&cam0_avdd_2v8>;
221                dvdd-supply = <&cam0_dvdd_1v2>;
222
223                port {
224                    ov8856_ep: endpoint {
225                        link-frequencies = /bits/ 64 <360000000 180000000>;
226                        data-lanes = <1 2 3 4>;
227                        remote-endpoint = <&csiphy0_ep>;
228                    };
229                };
230            };
231        };
232
233        cci_i2c1: i2c-bus@1 {
234            reg = <1>;
235            clock-frequency = <1000000>;
236            #address-cells = <1>;
237            #size-cells = <0>;
238
239            camera@60 {
240                compatible = "ovti,ov7251";
241                reg = <0x60>;
242
243                enable-gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>;
244                pinctrl-names = "default";
245                pinctrl-0 = <&cam3_default>;
246
247                clocks = <&clock_camcc CAM_CC_MCLK3_CLK>;
248                clock-names = "xclk";
249                clock-frequency = <24000000>;
250
251                vdddo-supply = <&vreg_lvs1a_1p8>;
252                vdda-supply = <&cam3_avdd_2v8>;
253
254                port {
255                    ov7251_ep: endpoint {
256                        data-lanes = <0 1>;
257                        remote-endpoint = <&csiphy3_ep>;
258                    };
259                };
260            };
261        };
262    };
263