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    maxItems: 4
43    items:
44      - const: main
45      - const: edid
46      - const: cec
47      - const: packet
48
49  clocks:
50    description: Reference to the CEC clock.
51    maxItems: 1
52
53  clock-names:
54    const: cec
55
56  interrupts:
57    maxItems: 1
58
59  pd-gpios:
60    description: GPIO connected to the power down signal.
61    maxItems: 1
62
63  avdd-supply:
64    description: A 1.8V supply that powers up the AVDD pin.
65
66  dvdd-supply:
67    description: A 1.8V supply that powers up the DVDD pin.
68
69  pvdd-supply:
70    description: A 1.8V supply that powers up the PVDD pin.
71
72  dvdd-3v-supply:
73    description: A 3.3V supply that powers up the DVDD_3V pin.
74
75  bgvdd-supply:
76    description: A 1.8V supply that powers up the BGVDD pin.
77
78  adi,input-depth:
79    description: Number of bits per color component at the input.
80    allOf:
81      - $ref: /schemas/types.yaml#/definitions/uint32
82      - enum: [ 8, 10, 12 ]
83
84  adi,input-colorspace:
85    description: Input color space.
86    enum: [ rgb, yuv422, yuv444 ]
87
88  adi,input-clock:
89    description: |
90      Input clock type.
91        "1x": one clock cycle per pixel
92        "2x": two clock cycles per pixel
93        "dd": one clock cycle per pixel, data driven on both edges
94    enum: [ 1x, 2x, dd ]
95
96  adi,clock-delay:
97    description:
98      Video data clock delay relative to the pixel clock, in ps
99      (-1200ps .. 1600 ps).
100    $ref: /schemas/types.yaml#/definitions/uint32
101    default: 0
102
103  adi,embedded-sync:
104    description:
105      If defined, the input uses synchronization signals embedded in the
106      data stream (similar to BT.656).
107    type: boolean
108
109  adi,input-style:
110    description:
111      Input components arrangement variant as listed in the input
112      format tables in the datasheet.
113    $ref: /schemas/types.yaml#/definitions/uint32
114    enum: [ 1, 2, 3 ]
115
116  adi,input-justification:
117    description: Input bit justification.
118    enum: [ left, evenly, right ]
119
120  ports:
121    description:
122      The ADV7511(W)/13 has two video ports and one audio port. This node
123      models their connections as documented in
124      Documentation/devicetree/bindings/media/video-interfaces.txt
125      Documentation/devicetree/bindings/graph.txt
126    type: object
127    properties:
128      port@0:
129        description: Video port for the RGB or YUV input.
130        type: object
131
132      port@1:
133        description: Video port for the HDMI output.
134        type: object
135
136      port@2:
137        description: Audio port for the HDMI output.
138        type: object
139
140# adi,input-colorspace and adi,input-clock are required except in
141# "rgb 1x" and "yuv444 1x" modes, in which case they must not be
142# specified.
143if:
144  not:
145    properties:
146      adi,input-colorspace:
147        contains:
148          enum: [ rgb, yuv444 ]
149      adi,input-clock:
150        contains:
151          const: 1x
152
153then:
154  required:
155    - adi,input-style
156    - adi,input-justification
157
158else:
159  properties:
160    adi,input-style: false
161    adi,input-justification: false
162
163
164required:
165  - compatible
166  - reg
167  - ports
168  - adi,input-depth
169  - adi,input-colorspace
170  - adi,input-clock
171  - avdd-supply
172  - dvdd-supply
173  - pvdd-supply
174  - dvdd-3v-supply
175  - bgvdd-supply
176
177additionalProperties: false
178
179examples:
180  - |
181    #include <dt-bindings/interrupt-controller/irq.h>
182
183    i2c@e6500000 {
184        #address-cells = <1>;
185        #size-cells = <0>;
186
187        reg = <0 0xe6500000>;
188
189        adv7511w: hdmi@39 {
190            compatible = "adi,adv7511w";
191            /*
192             * The EDID page will be accessible on address 0x66 on the I2C
193             * bus. All other maps continue to use their default addresses.
194             */
195            reg = <0x39>, <0x66>;
196            reg-names = "main", "edid";
197            interrupt-parent = <&gpio3>;
198            interrupts = <29 IRQ_TYPE_EDGE_FALLING>;
199            clocks = <&cec_clock>;
200            clock-names = "cec";
201            avdd-supply = <&v1v8>;
202            dvdd-supply = <&v1v8>;
203            pvdd-supply = <&v1v8>;
204            dvdd-3v-supply = <&v3v3>;
205            bgvdd-supply = <&v1v8>;
206
207            adi,input-depth = <8>;
208            adi,input-colorspace = "yuv422";
209            adi,input-clock = "1x";
210
211            adi,input-style = <3>;
212            adi,input-justification = "right";
213            ports {
214                #address-cells = <1>;
215                #size-cells = <0>;
216
217                port@0 {
218                    reg = <0>;
219                    adv7511w_in: endpoint {
220                        remote-endpoint = <&dpi_out>;
221                    };
222                };
223
224                port@1 {
225                    reg = <1>;
226                    adv7511_out: endpoint {
227                        remote-endpoint = <&hdmi_connector_in>;
228                    };
229                };
230
231                port@2 {
232                    reg = <2>;
233                    codec_endpoint: endpoint {
234                        remote-endpoint = <&i2s0_cpu_endpoint>;
235                    };
236                };
237            };
238        };
239    };
240
241...
242