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  reset-gpios:
39    maxItems: 1
40
41  port:
42    $ref: /schemas/graph.yaml#/$defs/port-base
43    unevaluatedProperties: false
44
45    properties:
46      endpoint:
47        $ref: /schemas/media/video-interfaces.yaml#
48        unevaluatedProperties: false
49
50  ports: true
51
52additionalProperties: false
53
54required:
55  - compatible
56  - reg
57
58allOf:
59  - if:
60      properties:
61        compatible:
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          $ref: /schemas/graph.yaml#/properties/ports
85          properties:
86            port@3:
87              $ref: /schemas/graph.yaml#/properties/port
88              description: Output port
89
90          patternProperties:
91            "^port@[0-2]$":
92              $ref: /schemas/graph.yaml#/properties/port
93              description: Input port
94
95          required:
96            - port@3
97
98      required:
99        - ports
100
101  - if:
102      properties:
103        compatible:
104          contains:
105            const: adi,adv7180st
106    then:
107      properties:
108        ports:
109          $ref: /schemas/graph.yaml#/properties/ports
110          properties:
111            port@6:
112              $ref: /schemas/graph.yaml#/properties/port
113              description: Output port
114
115          patternProperties:
116            "^port@[0-5]$":
117              $ref: /schemas/graph.yaml#/properties/port
118              description: Input port
119
120          required:
121            - port@6
122
123      required:
124        - ports
125
126examples:
127  - |
128    i2c {
129            #address-cells = <1>;
130            #size-cells = <0>;
131
132            composite-in@20 {
133                    compatible = "adi,adv7180";
134                    reg = <0x20>;
135
136                    port {
137                            adv7180: endpoint {
138                                    bus-width = <8>;
139                                    remote-endpoint = <&vin1ep>;
140                            };
141                    };
142            };
143
144    };
145
146  - |
147    i2c {
148            #address-cells = <1>;
149            #size-cells = <0>;
150
151            composite-in@20 {
152                    compatible = "adi,adv7180cp";
153                    reg = <0x20>;
154
155                    ports {
156                            #address-cells = <1>;
157                            #size-cells = <0>;
158
159                            port@0 {
160                                    reg = <0>;
161                                    adv7180_in: endpoint {
162                                            remote-endpoint = <&composite_con_in>;
163                                    };
164                            };
165
166                            port@3 {
167                                    reg = <3>;
168                                    adv7180_out: endpoint {
169                                            remote-endpoint = <&vin4_in>;
170                                    };
171                            };
172                    };
173            };
174    };
175