1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/display/bridge/adi,adv7511.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Analog Devices ADV7511/11W/13 HDMI Encoders
8
9maintainers:
10  - Laurent Pinchart <laurent.pinchart@ideasonboard.com>
11
12description: |
13  The ADV7511, ADV7511W and ADV7513 are HDMI audio and video
14  transmitters compatible with HDMI 1.4 and DVI 1.0. They support color
15  space conversion, S/PDIF, CEC and HDCP. The transmitter input is
16  parallel RGB or YUV data.
17
18properties:
19  compatible:
20    enum:
21      - adi,adv7511
22      - adi,adv7511w
23      - adi,adv7513
24
25  reg:
26    description: |
27      I2C slave addresses.
28
29      The ADV7511/11W/13 internal registers are split into four pages
30      exposed through different I2C addresses, creating four register
31      maps. Each map has it own I2C address and acts as a standard slave
32      device on the I2C bus. The main address is mandatory, others are
33      optional and revert to defaults if not specified.
34    minItems: 1
35    maxItems: 4
36
37  reg-names:
38    description:
39      Names of maps with programmable addresses. It can contain any map
40      needing a non-default address.
41    minItems: 1
42    items:
43      - const: main
44      - const: edid
45      - const: cec
46      - const: packet
47
48  clocks:
49    description: Reference to the CEC clock.
50    maxItems: 1
51
52  clock-names:
53    const: cec
54
55  interrupts:
56    maxItems: 1
57
58  pd-gpios:
59    description: GPIO connected to the power down signal.
60    maxItems: 1
61
62  avdd-supply:
63    description: A 1.8V supply that powers up the AVDD pin.
64
65  dvdd-supply:
66    description: A 1.8V supply that powers up the DVDD pin.
67
68  pvdd-supply:
69    description: A 1.8V supply that powers up the PVDD pin.
70
71  dvdd-3v-supply:
72    description: A 3.3V supply that powers up the DVDD_3V pin.
73
74  bgvdd-supply:
75    description: A 1.8V supply that powers up the BGVDD pin.
76
77  adi,input-depth:
78    description: Number of bits per color component at the input.
79    allOf:
80      - $ref: /schemas/types.yaml#/definitions/uint32
81      - enum: [ 8, 10, 12 ]
82
83  adi,input-colorspace:
84    description: Input color space.
85    enum: [ rgb, yuv422, yuv444 ]
86
87  adi,input-clock:
88    description: |
89      Input clock type.
90        "1x": one clock cycle per pixel
91        "2x": two clock cycles per pixel
92        "dd": one clock cycle per pixel, data driven on both edges
93    enum: [ 1x, 2x, dd ]
94
95  adi,clock-delay:
96    description:
97      Video data clock delay relative to the pixel clock, in ps
98      (-1200ps .. 1600 ps).
99    $ref: /schemas/types.yaml#/definitions/uint32
100    default: 0
101
102  adi,embedded-sync:
103    description:
104      If defined, the input uses synchronization signals embedded in the
105      data stream (similar to BT.656).
106    type: boolean
107
108  adi,input-style:
109    description:
110      Input components arrangement variant as listed in the input
111      format tables in the datasheet.
112    $ref: /schemas/types.yaml#/definitions/uint32
113    enum: [ 1, 2, 3 ]
114
115  adi,input-justification:
116    description: Input bit justification.
117    enum: [ left, evenly, right ]
118
119  ports:
120    description:
121      The ADV7511(W)/13 has two video ports and one audio port. This node
122      models their connections as documented in
123      Documentation/devicetree/bindings/media/video-interfaces.txt
124      Documentation/devicetree/bindings/graph.txt
125    type: object
126    properties:
127      port@0:
128        description: Video port for the RGB or YUV input.
129        type: object
130
131      port@1:
132        description: Video port for the HDMI output.
133        type: object
134
135      port@2:
136        description: Audio port for the HDMI output.
137        type: object
138
139# adi,input-colorspace and adi,input-clock are required except in
140# "rgb 1x" and "yuv444 1x" modes, in which case they must not be
141# specified.
142if:
143  not:
144    properties:
145      adi,input-colorspace:
146        contains:
147          enum: [ rgb, yuv444 ]
148      adi,input-clock:
149        contains:
150          const: 1x
151
152then:
153  required:
154    - adi,input-style
155    - adi,input-justification
156
157else:
158  properties:
159    adi,input-style: false
160    adi,input-justification: false
161
162
163required:
164  - compatible
165  - reg
166  - ports
167  - adi,input-depth
168  - adi,input-colorspace
169  - adi,input-clock
170  - avdd-supply
171  - dvdd-supply
172  - pvdd-supply
173  - dvdd-3v-supply
174  - bgvdd-supply
175
176additionalProperties: false
177
178examples:
179  - |
180    #include <dt-bindings/interrupt-controller/irq.h>
181
182    i2c@e6500000 {
183        #address-cells = <1>;
184        #size-cells = <0>;
185
186        reg = <0 0xe6500000>;
187
188        adv7511w: hdmi@39 {
189            compatible = "adi,adv7511w";
190            /*
191             * The EDID page will be accessible on address 0x66 on the I2C
192             * bus. All other maps continue to use their default addresses.
193             */
194            reg = <0x39>, <0x66>;
195            reg-names = "main", "edid";
196            interrupt-parent = <&gpio3>;
197            interrupts = <29 IRQ_TYPE_EDGE_FALLING>;
198            clocks = <&cec_clock>;
199            clock-names = "cec";
200            avdd-supply = <&v1v8>;
201            dvdd-supply = <&v1v8>;
202            pvdd-supply = <&v1v8>;
203            dvdd-3v-supply = <&v3v3>;
204            bgvdd-supply = <&v1v8>;
205
206            adi,input-depth = <8>;
207            adi,input-colorspace = "yuv422";
208            adi,input-clock = "1x";
209
210            adi,input-style = <3>;
211            adi,input-justification = "right";
212            ports {
213                #address-cells = <1>;
214                #size-cells = <0>;
215
216                port@0 {
217                    reg = <0>;
218                    adv7511w_in: endpoint {
219                        remote-endpoint = <&dpi_out>;
220                    };
221                };
222
223                port@1 {
224                    reg = <1>;
225                    adv7511_out: endpoint {
226                        remote-endpoint = <&hdmi_connector_in>;
227                    };
228                };
229
230                port@2 {
231                    reg = <2>;
232                    codec_endpoint: endpoint {
233                        remote-endpoint = <&i2s0_cpu_endpoint>;
234                    };
235                };
236            };
237        };
238    };
239
240...
241