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/adv7604.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Analog Devices ADV7604/10/11/12 video decoder with HDMI receiver
8
9maintainers:
10  - Hans Verkuil <hverkuil-cisco@xs4all.nl>
11
12description:
13  The ADV7604 and ADV7610/11/12 are multiformat video decoders with
14  an integrated HDMI receiver. The ADV7604 has four multiplexed HDMI inputs
15  and one analog input, and the ADV7610/11 have one HDMI input and no analog
16  input. The ADV7612 is similar to the ADV7610/11 but has 2 HDMI inputs.
17
18  These device tree bindings support the ADV7610/11/12 only at the moment.
19
20properties:
21  compatible:
22    items:
23      - enum:
24          - adi,adv7610
25          - adi,adv7611
26          - adi,adv7612
27
28  reg:
29    minItems: 1
30    maxItems: 13
31
32  reg-names:
33    minItems: 1
34    items:
35      - const: main
36      - enum: [ avlink, cec, infoframe, esdp, dpp, afe, rep, edid, hdmi, test, cp, vdp ]
37      - enum: [ avlink, cec, infoframe, esdp, dpp, afe, rep, edid, hdmi, test, cp, vdp ]
38      - enum: [ avlink, cec, infoframe, esdp, dpp, afe, rep, edid, hdmi, test, cp, vdp ]
39      - enum: [ avlink, cec, infoframe, esdp, dpp, afe, rep, edid, hdmi, test, cp, vdp ]
40      - enum: [ avlink, cec, infoframe, esdp, dpp, afe, rep, edid, hdmi, test, cp, vdp ]
41      - enum: [ avlink, cec, infoframe, esdp, dpp, afe, rep, edid, hdmi, test, cp, vdp ]
42      - enum: [ avlink, cec, infoframe, esdp, dpp, afe, rep, edid, hdmi, test, cp, vdp ]
43      - enum: [ avlink, cec, infoframe, esdp, dpp, afe, rep, edid, hdmi, test, cp, vdp ]
44      - enum: [ avlink, cec, infoframe, esdp, dpp, afe, rep, edid, hdmi, test, cp, vdp ]
45      - enum: [ avlink, cec, infoframe, esdp, dpp, afe, rep, edid, hdmi, test, cp, vdp ]
46      - enum: [ avlink, cec, infoframe, esdp, dpp, afe, rep, edid, hdmi, test, cp, vdp ]
47      - enum: [ avlink, cec, infoframe, esdp, dpp, afe, rep, edid, hdmi, test, cp, vdp ]
48
49  interrupts:
50    maxItems: 1
51
52  reset-gpios:
53    maxItems: 1
54
55  hpd-gpios:
56    minItems: 1
57    description:
58      References to the GPIOs that control the HDMI hot-plug detection pins,
59      one per HDMI input. The active flag indicates the GPIO level that
60      enables hot-plug detection.
61
62  default-input:
63    maxItems: 1
64    description:
65      Select which input is selected after reset.
66
67  ports: true
68
69required:
70  - compatible
71  - reg
72  - ports
73
74additionalProperties: false
75
76allOf:
77  - if:
78      properties:
79        compatible:
80          contains:
81            const: adi,adv7611
82    then:
83      properties:
84        ports:
85          $ref: /schemas/graph.yaml#/properties/ports
86          properties:
87            port@0:
88              $ref: /schemas/graph.yaml#/properties/port
89              description: Input port
90
91            port@1:
92              $ref: /schemas/graph.yaml#/properties/port
93              description: Output port
94
95          required:
96            - port@1
97
98  - if:
99      properties:
100        compatible:
101          contains:
102            const: adi,adv7612
103    then:
104      properties:
105        ports:
106          $ref: /schemas/graph.yaml#/properties/ports
107          properties:
108            port@2:
109              $ref: /schemas/graph.yaml#/properties/port
110              description: Output port
111
112          patternProperties:
113            "^port@[0-1]$":
114              $ref: /schemas/graph.yaml#/properties/port
115              description: Input port
116
117          required:
118            - port@2
119
120examples:
121  - |
122    #include <dt-bindings/gpio/gpio.h>
123
124    i2c {
125            #address-cells = <1>;
126            #size-cells = <0>;
127
128            hdmi_receiver@4c {
129                    compatible = "adi,adv7611";
130                    /*
131                     * The edid page will be accessible @ 0x66 on the I2C bus. All
132                     * other maps will retain their default addresses.
133                     */
134                    reg = <0x4c>, <0x66>;
135                    reg-names = "main", "edid";
136
137                    reset-gpios = <&ioexp 0 GPIO_ACTIVE_LOW>;
138                    hpd-gpios = <&ioexp 2 GPIO_ACTIVE_HIGH>;
139                    default-input = <0>;
140
141                    ports {
142                            #address-cells = <1>;
143                            #size-cells = <0>;
144
145                            port@0 {
146                                    reg = <0>;
147                            };
148
149                            port@1 {
150                                    reg = <1>;
151                                    hdmi_in: endpoint {
152                                            remote-endpoint = <&ccdc_in>;
153                                    };
154                            };
155                    };
156
157
158            };
159    };
160