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    $ref: /schemas/graph.yaml#/properties/port
40
41  ports: true
42
43additionalProperties: false
44
45required:
46  - compatible
47  - reg
48
49allOf:
50  - if:
51      properties:
52        compatible:
53          enum:
54            - adi,adv7180
55            - adi,adv7182
56            - adi,adv7280
57            - adi,adv7280-m
58            - adi,adv7281
59            - adi,adv7281-m
60            - adi,adv7281-ma
61            - adi,adv7282
62            - adi,adv7282-m
63    then:
64      required:
65        - port
66
67  - if:
68      properties:
69        compatible:
70          contains:
71            const: adi,adv7180cp
72    then:
73      properties:
74        ports:
75          $ref: /schemas/graph.yaml#/properties/ports
76          properties:
77            port@3:
78              $ref: /schemas/graph.yaml#/properties/port
79              description: Output port
80
81          patternProperties:
82            "^port@[0-2]$":
83              $ref: /schemas/graph.yaml#/properties/port
84              description: Input port
85
86          required:
87            - port@3
88
89      required:
90        - ports
91
92  - if:
93      properties:
94        compatible:
95          contains:
96            const: adi,adv7180st
97    then:
98      properties:
99        ports:
100          $ref: /schemas/graph.yaml#/properties/ports
101          properties:
102            port@6:
103              $ref: /schemas/graph.yaml#/properties/port
104              description: Output port
105
106          patternProperties:
107            "^port@[0-5]$":
108              $ref: /schemas/graph.yaml#/properties/port
109              description: Input port
110
111          required:
112            - port@6
113
114      required:
115        - ports
116
117examples:
118  - |
119    i2c {
120            #address-cells = <1>;
121            #size-cells = <0>;
122
123            composite-in@20 {
124                    compatible = "adi,adv7180";
125                    reg = <0x20>;
126
127                    port {
128                            adv7180: endpoint {
129                                    bus-width = <8>;
130                                    remote-endpoint = <&vin1ep>;
131                            };
132                    };
133            };
134
135    };
136
137  - |
138    i2c {
139            #address-cells = <1>;
140            #size-cells = <0>;
141
142            composite-in@20 {
143                    compatible = "adi,adv7180cp";
144                    reg = <0x20>;
145
146                    ports {
147                            #address-cells = <1>;
148                            #size-cells = <0>;
149
150                            port@0 {
151                                    reg = <0>;
152                                    adv7180_in: endpoint {
153                                            remote-endpoint = <&composite_con_in>;
154                                    };
155                            };
156
157                            port@3 {
158                                    reg = <3>;
159                                    adv7180_out: endpoint {
160                                            remote-endpoint = <&vin4_in>;
161                                    };
162                            };
163                    };
164            };
165    };
166