gpio: rcar: Fix runtime PM imbalance on error
[linux/fpc-iii.git] / Documentation / devicetree / bindings / media / renesas,vin.yaml
blob1ec947b4781f966b5212a0ad74b7e9c486e8c732
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#
8 title: Renesas R-Car Video Input (VIN)
10 maintainers:
11   - Niklas Söderlund <niklas.soderlund@ragnatech.se>
13 description:
14   The R-Car Video Input (VIN) device provides video input capabilities for the
15   Renesas R-Car family of devices.
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.
22 properties:
23   compatible:
24     oneOf:
25       - items:
26           - enum:
27               - renesas,vin-r8a7743  # RZ/G1M
28               - renesas,vin-r8a7744  # RZ/G1N
29               - renesas,vin-r8a7745  # RZ/G1E
30               - renesas,vin-r8a77470 # RZ/G1C
31               - renesas,vin-r8a7790  # R-Car H2
32               - renesas,vin-r8a7791  # R-Car M2-W
33               - renesas,vin-r8a7792  # R-Car V2H
34               - renesas,vin-r8a7793  # R-Car M2-N
35               - renesas,vin-r8a7794  # R-Car E2
36           - const: renesas,rcar-gen2-vin # Generic R-Car Gen2 or RZ/G1
38       - items:
39           - enum:
40               - renesas,vin-r8a774a1 # RZ/G2M
41               - renesas,vin-r8a774b1 # RZ/G2N
42               - renesas,vin-r8a774c0 # RZ/G2E
43               - renesas,vin-r8a7778  # R-Car M1
44               - renesas,vin-r8a7779  # R-Car H1
45               - renesas,vin-r8a7795  # R-Car H3
46               - renesas,vin-r8a7796  # R-Car M3-W
47               - renesas,vin-r8a77965 # R-Car M3-N
48               - renesas,vin-r8a77970 # R-Car V3M
49               - renesas,vin-r8a77980 # R-Car V3H
50               - renesas,vin-r8a77990 # R-Car E3
51               - renesas,vin-r8a77995 # R-Car D3
53   reg:
54     maxItems: 1
56   interrupts:
57     maxItems: 1
59   clocks:
60     maxItems: 1
62   power-domains:
63     maxItems: 1
65   resets:
66     maxItems: 1
68   #The per-board settings for Gen2 and RZ/G1 platforms:
69   port:
70     type: object
71     description:
72       A node containing a parallel input with a single endpoint definitions as
73       documented in
74       Documentation/devicetree/bindings/media/video-interfaces.txt
76     properties:
77       endpoint:
78         type: object
80         properties:
81           hsync-active:
82             description:
83               If both HSYNC and VSYNC polarities are not specified, embedded
84               synchronization is selected.
85             default: 1
87           vsync-active:
88             description:
89               If both HSYNC and VSYNC polarities are not specified, embedded
90               synchronization is selected.
91             default: 1
93           field-active-even: true
95           bus-width: true
97           data-shift: true
99           data-enable-active:
100             description: Polarity of CLKENB signal
101             default: 1
103           pclk-sample: true
105           data-active: true
107           remote-endpoint: true
109         required:
110           - remote-endpoint
112         additionalProperties: false
114     additionalProperties: false
116   #The per-board settings for Gen3 and RZ/G2 platforms:
117   renesas,id:
118     description: VIN channel number
119     allOf:
120       - $ref: /schemas/types.yaml#/definitions/uint32
121       - minimum: 0
122       - maximum: 15
124   ports:
125     type: object
126     description:
127       A node containing input nodes with endpoint definitions as documented in
128       Documentation/devicetree/bindings/media/video-interfaces.txt
130     properties:
131       port@0:
132         type: object
133         description:
134           Input port node, single endpoint describing a parallel input source.
136         properties:
137           reg:
138             const: 0
140           endpoint:
141             type: object
143             properties:
144               hsync-active:
145                 description:
146                   If both HSYNC and VSYNC polarities are not specified, embedded
147                   synchronization is selected.
148                 default: 1
150               vsync-active:
151                 description:
152                   If both HSYNC and VSYNC polarities are not specified, embedded
153                   synchronization is selected.
154                 default: 1
156               field-active-even: true
158               bus-width: true
160               data-shift: true
162               data-enable-active:
163                 description: Polarity of CLKENB signal
164                 default: 1
166               pclk-sample: true
168               data-active: true
170               remote-endpoint: true
172             required:
173               - remote-endpoint
175             additionalProperties: false
177         required:
178           - endpoint
180         additionalProperties: false
182       port@1:
183         type: object
184         description:
185           Input port node, multiple endpoints describing all the R-Car CSI-2
186           modules connected the VIN.
188         properties:
189           '#address-cells':
190             const: 1
192           '#size-cells':
193             const: 0
195           reg:
196             const: 1
198           endpoint@0:
199             type: object
200             description: Endpoint connected to CSI20.
202             properties:
203               reg:
204                 const: 0
206               remote-endpoint: true
208             required:
209               - reg
210               - remote-endpoint
212             additionalProperties: false
214           endpoint@1:
215             type: object
216             description: Endpoint connected to CSI21.
218             properties:
219               reg:
220                 const: 1
222               remote-endpoint: true
224             required:
225               - reg
226               - remote-endpoint
228             additionalProperties: false
230           endpoint@2:
231             type: object
232             description: Endpoint connected to CSI40.
234             properties:
235               reg:
236                 const: 2
238               remote-endpoint: true
240             required:
241               - reg
242               - remote-endpoint
244             additionalProperties: false
246           endpoint@3:
247             type: object
248             description: Endpoint connected to CSI41.
250             properties:
251               reg:
252                 const: 3
254               remote-endpoint: true
256             required:
257               - reg
258               - remote-endpoint
260             additionalProperties: false
262         anyOf:
263           - required:
264             - endpoint@0
265           - required:
266             - endpoint@1
267           - required:
268             - endpoint@2
269           - required:
270             - endpoint@3
272         additionalProperties: false
274 required:
275   - compatible
276   - reg
277   - interrupts
278   - clocks
279   - power-domains
280   - resets
283   properties:
284     compatible:
285       contains:
286         enum:
287           - renesas,vin-r8a7778
288           - renesas,vin-r8a7779
289           - renesas,rcar-gen2-vin
290 then:
291   required:
292     - port
293 else:
294   required:
295     - renesas,id
296     - ports
298 additionalProperties: false
300 examples:
301   # Device node example for Gen2 platform
302   - |
303     #include <dt-bindings/clock/r8a7790-cpg-mssr.h>
304     #include <dt-bindings/interrupt-controller/arm-gic.h>
305     #include <dt-bindings/power/r8a7790-sysc.h>
307     vin1: vin@e6ef1000 {
308             compatible = "renesas,vin-r8a7790",
309                          "renesas,rcar-gen2-vin";
310             reg = <0 0xe6ef1000 0 0x1000>;
311             interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>;
312             clocks = <&cpg CPG_MOD 810>;
313             power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
314             resets = <&cpg 810>;
316             port {
317                     vin1ep0: endpoint {
318                             remote-endpoint = <&adv7180>;
319                             bus-width = <8>;
320                     };
321             };
322     };
324   # Device node example for Gen3 platform with only CSI-2
325   - |
326     #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
327     #include <dt-bindings/interrupt-controller/arm-gic.h>
328     #include <dt-bindings/power/r8a7795-sysc.h>
330     vin0: video@e6ef0000 {
331             compatible = "renesas,vin-r8a7795";
332             reg = <0 0xe6ef0000 0 0x1000>;
333             interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
334             clocks = <&cpg CPG_MOD 811>;
335             power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
336             resets = <&cpg 811>;
337             renesas,id = <0>;
339             ports {
340                     #address-cells = <1>;
341                     #size-cells = <0>;
343                     port@1 {
344                             #address-cells = <1>;
345                             #size-cells = <0>;
347                             reg = <1>;
349                             vin0csi20: endpoint@0 {
350                                     reg = <0>;
351                                     remote-endpoint= <&csi20vin0>;
352                             };
353                             vin0csi40: endpoint@2 {
354                                     reg = <2>;
355                                     remote-endpoint= <&csi40vin0>;
356                             };
357                     };
358             };
359     };
361   # Device node example for Gen3 platform with CSI-2 and parallel
362   - |
363     #include <dt-bindings/clock/r8a77970-cpg-mssr.h>
364     #include <dt-bindings/interrupt-controller/arm-gic.h>
365     #include <dt-bindings/power/r8a77970-sysc.h>
367     vin2: video@e6ef2000 {
368             compatible = "renesas,vin-r8a77970";
369             reg = <0 0xe6ef2000 0 0x1000>;
370             interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>;
371             clocks = <&cpg CPG_MOD 809>;
372             power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
373             resets = <&cpg 809>;
374             renesas,id = <2>;
376             ports {
377                     #address-cells = <1>;
378                     #size-cells = <0>;
380                     port@0 {
381                             reg = <0>;
383                             vin2_in: endpoint {
384                                     remote-endpoint = <&adv7612_out>;
385                                     hsync-active = <0>;
386                                     vsync-active = <0>;
387                             };
388                     };
390                     port@1 {
391                             #address-cells = <1>;
392                             #size-cells = <0>;
394                             reg = <1>;
396                             vin2csi40: endpoint@2 {
397                                     reg = <2>;
398                                     remote-endpoint = <&csi40vin2>;
399                             };
400                     };
401             };
402     };