1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/media/i2c/adv7180.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Analog Devices ADV7180 analog video decoder family
8
9maintainers:
10  - Lars-Peter Clausen <lars@metafoo.de>
11
12description:
13  The adv7180 family devices are used to capture analog video to different
14  digital interfaces like MIPI CSI-2 or parallel video.
15
16properties:
17  compatible:
18    items:
19      - enum:
20        - adi,adv7180
21        - adi,adv7180cp
22        - adi,adv7180st
23        - adi,adv7182
24        - adi,adv7280
25        - adi,adv7280-m
26        - adi,adv7281
27        - adi,adv7281-m
28        - adi,adv7281-ma
29        - adi,adv7282
30        - adi,adv7282-m
31
32  reg:
33    maxItems: 1
34
35  powerdown-gpios:
36    maxItems: 1
37
38  port:
39    type: object
40    description:
41      A node containing a single endpoint as doucmented in
42      Documentation/devicetree/bindings/media/video-interfaces.txt
43
44  ports:
45    type: object
46    description:
47      A node containing input and output port nodes with endpoint definitions
48      as documented in
49      Documentation/devicetree/bindings/media/video-interfaces.txt
50
51additionalProperties: false
52
53required:
54  - compatible
55  - reg
56
57allOf:
58  - if:
59      properties:
60        compatible:
61          items:
62            - enum:
63              - adi,adv7180
64              - adi,adv7182
65              - adi,adv7280
66              - adi,adv7280-m
67              - adi,adv7281
68              - adi,adv7281-m
69              - adi,adv7281-ma
70              - adi,adv7282
71              - adi,adv7282-m
72    then:
73      required:
74        - port
75
76  - if:
77      properties:
78        compatible:
79          contains:
80            const: adi,adv7180cp
81    then:
82      properties:
83        ports:
84          properties:
85            '#address-cells':
86              const: 1
87            '#size-cells':
88              const: 0
89            port@3:
90              type: object
91              description: Output port
92
93          patternProperties:
94            "^port@[0-2]$":
95              type: object
96              description: Input port
97
98          required:
99            - port@3
100
101          additionalProperties: false
102
103      required:
104        - ports
105
106  - if:
107      properties:
108        compatible:
109          contains:
110            const: adi,adv7180st
111    then:
112      properties:
113        ports:
114          properties:
115            '#address-cells':
116              const: 1
117            '#size-cells':
118              const: 0
119            port@6:
120              type: object
121              description: Output port
122
123          patternProperties:
124            "^port@[0-5]$":
125              type: object
126              description: Input port
127
128          required:
129            - port@6
130
131          additionalProperties: false
132
133      required:
134        - ports
135
136examples:
137  - |
138    i2c {
139            #address-cells = <1>;
140            #size-cells = <0>;
141
142            composite-in@20 {
143                    compatible = "adi,adv7180";
144                    reg = <0x20>;
145
146                    port {
147                            adv7180: endpoint {
148                                    bus-width = <8>;
149                                    remote-endpoint = <&vin1ep>;
150                            };
151                    };
152            };
153
154    };
155
156  - |
157    i2c {
158            #address-cells = <1>;
159            #size-cells = <0>;
160
161            composite-in@20 {
162                    compatible = "adi,adv7180cp";
163                    reg = <0x20>;
164
165                    ports {
166                            #address-cells = <1>;
167                            #size-cells = <0>;
168
169                            port@0 {
170                                    reg = <0>;
171                                    adv7180_in: endpoint {
172                                            remote-endpoint = <&composite_con_in>;
173                                    };
174                            };
175
176                            port@3 {
177                                    reg = <3>;
178                                    adv7180_out: endpoint {
179                                            remote-endpoint = <&vin4_in>;
180                                    };
181                            };
182                    };
183            };
184    };
185