dt-bindings: Fix 'unevaluatedProperties' errors in DT graph users
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / media / renesas,vin.yaml
1 # SPDX-License-Identifier: GPL-2.0-only
2 # Copyright (C) 2020 Renesas Electronics Corp.
3 %YAML 1.2
4 ---
5 $id: http://devicetree.org/schemas/media/renesas,vin.yaml#
6 $schema: http://devicetree.org/meta-schemas/core.yaml#
7
8 title: Renesas R-Car Video Input (VIN)
9
10 maintainers:
11   - Niklas Söderlund <niklas.soderlund@ragnatech.se>
12
13 description:
14   The R-Car Video Input (VIN) device provides video input capabilities for the
15   Renesas R-Car family of devices.
16
17   Each VIN instance has a single parallel input that supports RGB and YUV video,
18   with both external synchronization and BT.656 synchronization for the latter.
19   Depending on the instance the VIN input is connected to external SoC pins, or
20   on Gen3 and RZ/G2 platforms to a CSI-2 receiver.
21
22 properties:
23   compatible:
24     oneOf:
25       - items:
26           - enum:
27               - renesas,vin-r8a7742  # RZ/G1H
28               - renesas,vin-r8a7743  # RZ/G1M
29               - renesas,vin-r8a7744  # RZ/G1N
30               - renesas,vin-r8a7745  # RZ/G1E
31               - renesas,vin-r8a77470 # RZ/G1C
32               - renesas,vin-r8a7790  # R-Car H2
33               - renesas,vin-r8a7791  # R-Car M2-W
34               - renesas,vin-r8a7792  # R-Car V2H
35               - renesas,vin-r8a7793  # R-Car M2-N
36               - renesas,vin-r8a7794  # R-Car E2
37           - const: renesas,rcar-gen2-vin # Generic R-Car Gen2 or RZ/G1
38
39       - items:
40           - enum:
41               - renesas,vin-r8a774a1 # RZ/G2M
42               - renesas,vin-r8a774b1 # RZ/G2N
43               - renesas,vin-r8a774c0 # RZ/G2E
44               - renesas,vin-r8a774e1 # RZ/G2H
45               - renesas,vin-r8a7778  # R-Car M1
46               - renesas,vin-r8a7779  # R-Car H1
47               - renesas,vin-r8a7795  # R-Car H3
48               - renesas,vin-r8a7796  # R-Car M3-W
49               - renesas,vin-r8a77965 # R-Car M3-N
50               - renesas,vin-r8a77970 # R-Car V3M
51               - renesas,vin-r8a77980 # R-Car V3H
52               - renesas,vin-r8a77990 # R-Car E3
53               - renesas,vin-r8a77995 # R-Car D3
54
55   reg:
56     maxItems: 1
57
58   interrupts:
59     maxItems: 1
60
61   clocks:
62     maxItems: 1
63
64   power-domains:
65     maxItems: 1
66
67   resets:
68     maxItems: 1
69
70   #The per-board settings for Gen2 and RZ/G1 platforms:
71   port:
72     $ref: /schemas/graph.yaml#/$defs/port-base
73     unevaluatedProperties: false
74     description:
75       A node containing a parallel input
76
77     properties:
78       endpoint:
79         $ref: video-interfaces.yaml#
80         unevaluatedProperties: false
81
82         properties:
83           hsync-active:
84             description:
85               If both HSYNC and VSYNC polarities are not specified, embedded
86               synchronization is selected.
87             default: 1
88
89           vsync-active:
90             description:
91               If both HSYNC and VSYNC polarities are not specified, embedded
92               synchronization is selected.
93             default: 1
94
95           field-active-even: true
96
97           bus-width: true
98
99           data-shift: true
100
101           data-enable-active:
102             description: Polarity of CLKENB signal
103             default: 1
104
105           pclk-sample: true
106
107           data-active: true
108
109   #The per-board settings for Gen3 and RZ/G2 platforms:
110   renesas,id:
111     description: VIN channel number
112     $ref: /schemas/types.yaml#/definitions/uint32
113     minimum: 0
114     maximum: 15
115
116   ports:
117     $ref: /schemas/graph.yaml#/properties/ports
118
119     properties:
120       port@0:
121         $ref: /schemas/graph.yaml#/$defs/port-base
122         unevaluatedProperties: false
123         description:
124           Input port node, single endpoint describing a parallel input source.
125
126         properties:
127           endpoint:
128             $ref: video-interfaces.yaml#
129             unevaluatedProperties: false
130
131             properties:
132               hsync-active:
133                 description:
134                   If both HSYNC and VSYNC polarities are not specified, embedded
135                   synchronization is selected.
136                 default: 1
137
138               vsync-active:
139                 description:
140                   If both HSYNC and VSYNC polarities are not specified, embedded
141                   synchronization is selected.
142                 default: 1
143
144               field-active-even: true
145
146               bus-width: true
147
148               data-shift: true
149
150               data-enable-active:
151                 description: Polarity of CLKENB signal
152                 default: 1
153
154               pclk-sample: true
155
156               data-active: true
157
158       port@1:
159         $ref: /schemas/graph.yaml#/properties/port
160         description:
161           Input port node, multiple endpoints describing all the R-Car CSI-2
162           modules connected the VIN.
163
164         properties:
165           endpoint@0:
166             $ref: /schemas/graph.yaml#/properties/endpoint
167             description: Endpoint connected to CSI20.
168
169           endpoint@1:
170             $ref: /schemas/graph.yaml#/properties/endpoint
171             description: Endpoint connected to CSI21.
172
173           endpoint@2:
174             $ref: /schemas/graph.yaml#/properties/endpoint
175             description: Endpoint connected to CSI40.
176
177           endpoint@3:
178             $ref: /schemas/graph.yaml#/properties/endpoint
179             description: Endpoint connected to CSI41.
180
181         anyOf:
182           - required:
183               - endpoint@0
184           - required:
185               - endpoint@1
186           - required:
187               - endpoint@2
188           - required:
189               - endpoint@3
190
191 required:
192   - compatible
193   - reg
194   - interrupts
195   - clocks
196   - power-domains
197
198 allOf:
199   - if:
200       not:
201         properties:
202           compatible:
203             contains:
204               enum:
205                 - renesas,vin-r8a7778
206                 - renesas,vin-r8a7779
207     then:
208       required:
209         - resets
210
211   - if:
212       properties:
213         compatible:
214           contains:
215             enum:
216               - renesas,vin-r8a7778
217               - renesas,vin-r8a7779
218               - renesas,rcar-gen2-vin
219     then:
220       required:
221         - port
222     else:
223       required:
224         - renesas,id
225         - ports
226
227 additionalProperties: false
228
229 examples:
230   # Device node example for Gen2 platform
231   - |
232     #include <dt-bindings/clock/r8a7790-cpg-mssr.h>
233     #include <dt-bindings/interrupt-controller/arm-gic.h>
234     #include <dt-bindings/power/r8a7790-sysc.h>
235
236     vin1: vin@e6ef1000 {
237             compatible = "renesas,vin-r8a7790",
238                          "renesas,rcar-gen2-vin";
239             reg = <0xe6ef1000 0x1000>;
240             interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>;
241             clocks = <&cpg CPG_MOD 810>;
242             power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
243             resets = <&cpg 810>;
244
245             port {
246                     vin1ep0: endpoint {
247                             remote-endpoint = <&adv7180>;
248                             bus-width = <8>;
249                     };
250             };
251     };
252
253   # Device node example for Gen3 platform with only CSI-2
254   - |
255     #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
256     #include <dt-bindings/interrupt-controller/arm-gic.h>
257     #include <dt-bindings/power/r8a7795-sysc.h>
258
259     vin0: video@e6ef0000 {
260             compatible = "renesas,vin-r8a7795";
261             reg = <0xe6ef0000 0x1000>;
262             interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
263             clocks = <&cpg CPG_MOD 811>;
264             power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
265             resets = <&cpg 811>;
266             renesas,id = <0>;
267
268             ports {
269                     #address-cells = <1>;
270                     #size-cells = <0>;
271
272                     port@1 {
273                             #address-cells = <1>;
274                             #size-cells = <0>;
275
276                             reg = <1>;
277
278                             vin0csi20: endpoint@0 {
279                                     reg = <0>;
280                                     remote-endpoint= <&csi20vin0>;
281                             };
282                             vin0csi40: endpoint@2 {
283                                     reg = <2>;
284                                     remote-endpoint= <&csi40vin0>;
285                             };
286                     };
287             };
288     };
289
290   # Device node example for Gen3 platform with CSI-2 and parallel
291   - |
292     #include <dt-bindings/clock/r8a77970-cpg-mssr.h>
293     #include <dt-bindings/interrupt-controller/arm-gic.h>
294     #include <dt-bindings/power/r8a77970-sysc.h>
295
296     vin2: video@e6ef2000 {
297             compatible = "renesas,vin-r8a77970";
298             reg = <0xe6ef2000 0x1000>;
299             interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>;
300             clocks = <&cpg CPG_MOD 809>;
301             power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
302             resets = <&cpg 809>;
303             renesas,id = <2>;
304
305             ports {
306                     #address-cells = <1>;
307                     #size-cells = <0>;
308
309                     port@0 {
310                             reg = <0>;
311
312                             vin2_in: endpoint {
313                                     remote-endpoint = <&adv7612_out>;
314                                     hsync-active = <0>;
315                                     vsync-active = <0>;
316                             };
317                     };
318
319                     port@1 {
320                             #address-cells = <1>;
321                             #size-cells = <0>;
322
323                             reg = <1>;
324
325                             vin2csi40: endpoint@2 {
326                                     reg = <2>;
327                                     remote-endpoint = <&csi40vin2>;
328                             };
329                     };
330             };
331     };