Merge tag 'sound-fix-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
[sfrench/cifs-2.6.git] / Documentation / devicetree / bindings / media / rcar_vin.txt
1 Renesas R-Car Video Input driver (rcar_vin)
2 -------------------------------------------
3
4 The rcar_vin device provides video input capabilities for the Renesas R-Car
5 family of devices.
6
7 Each VIN instance has a single parallel input that supports RGB and YUV video,
8 with both external synchronization and BT.656 synchronization for the latter.
9 Depending on the instance the VIN input is connected to external SoC pins, or
10 on Gen3 and RZ/G2 platforms to a CSI-2 receiver.
11
12  - compatible: Must be one or more of the following
13    - "renesas,vin-r8a7743" for the R8A7743 device
14    - "renesas,vin-r8a7744" for the R8A7744 device
15    - "renesas,vin-r8a7745" for the R8A7745 device
16    - "renesas,vin-r8a774c0" for the R8A774C0 device
17    - "renesas,vin-r8a7778" for the R8A7778 device
18    - "renesas,vin-r8a7779" for the R8A7779 device
19    - "renesas,vin-r8a7790" for the R8A7790 device
20    - "renesas,vin-r8a7791" for the R8A7791 device
21    - "renesas,vin-r8a7792" for the R8A7792 device
22    - "renesas,vin-r8a7793" for the R8A7793 device
23    - "renesas,vin-r8a7794" for the R8A7794 device
24    - "renesas,vin-r8a7795" for the R8A7795 device
25    - "renesas,vin-r8a7796" for the R8A7796 device
26    - "renesas,vin-r8a77965" for the R8A77965 device
27    - "renesas,vin-r8a77970" for the R8A77970 device
28    - "renesas,vin-r8a77980" for the R8A77980 device
29    - "renesas,vin-r8a77990" for the R8A77990 device
30    - "renesas,vin-r8a77995" for the R8A77995 device
31    - "renesas,rcar-gen2-vin" for a generic R-Car Gen2 or RZ/G1 compatible
32      device.
33
34    When compatible with the generic version nodes must list the
35    SoC-specific version corresponding to the platform first
36    followed by the generic version.
37
38  - reg: the register base and size for the device registers
39  - interrupts: the interrupt for the device
40  - clocks: Reference to the parent clock
41
42 Additionally, an alias named vinX will need to be created to specify
43 which video input device this is.
44
45 The per-board settings Gen2 platforms:
46
47 - port - sub-node describing a single endpoint connected to the VIN
48   from external SoC pins as described in video-interfaces.txt[1].
49   Only the first one will be considered as each vin interface has one
50   input port.
51
52   - Optional properties for endpoint nodes:
53     - hsync-active: see [1] for description. Default is active high.
54     - vsync-active: see [1] for description. Default is active high.
55       If both HSYNC and VSYNC polarities are not specified, embedded
56       synchronization is selected.
57     - field-active-even: see [1] for description. Default is active high.
58     - bus-width: see [1] for description. The selected bus width depends on
59       the SoC type and selected input image format.
60       Valid values are: 8, 10, 12, 16, 24 and 32.
61     - data-shift: see [1] for description. Valid values are 0 and 8.
62     - data-enable-active: polarity of CLKENB signal, see [1] for
63       description. Default is active high.
64
65 The per-board settings Gen3 and RZ/G2 platforms:
66
67 Gen3 and RZ/G2 platforms can support both a single connected parallel input
68 source from external SoC pins (port@0) and/or multiple parallel input sources
69 from local SoC CSI-2 receivers (port@1) depending on SoC.
70
71 - renesas,id - ID number of the VIN, VINx in the documentation.
72 - ports
73     - port@0 - sub-node describing a single endpoint connected to the VIN
74       from external SoC pins as described in video-interfaces.txt[1].
75       Describing more than one endpoint in port@0 is invalid. Only VIN
76       instances that are connected to external pins should have port@0.
77
78       Endpoint nodes of port@0 support the optional properties listed in
79       the Gen2 per-board settings description.
80
81     - port@1 - sub-nodes describing one or more endpoints connected to
82       the VIN from local SoC CSI-2 receivers. The endpoint numbers must
83       use the following schema.
84
85         - endpoint@0 - sub-node describing the endpoint connected to CSI20
86         - endpoint@1 - sub-node describing the endpoint connected to CSI21
87         - endpoint@2 - sub-node describing the endpoint connected to CSI40
88         - endpoint@3 - sub-node describing the endpoint connected to CSI41
89
90       Endpoint nodes of port@1 do not support any optional endpoint property.
91
92 Device node example for Gen2 platforms
93 --------------------------------------
94
95         aliases {
96                 vin0 = &vin0;
97         };
98
99         vin0: vin@e6ef0000 {
100                 compatible = "renesas,vin-r8a7790", "renesas,rcar-gen2-vin";
101                 clocks = <&mstp8_clks R8A7790_CLK_VIN0>;
102                 reg = <0 0xe6ef0000 0 0x1000>;
103                 interrupts = <0 188 IRQ_TYPE_LEVEL_HIGH>;
104                 status = "disabled";
105         };
106
107 Board setup example for Gen2 platforms (vin1 composite video input)
108 -------------------------------------------------------------------
109
110 &i2c2   {
111         status = "okay";
112         pinctrl-0 = <&i2c2_pins>;
113         pinctrl-names = "default";
114
115         adv7180@20 {
116                 compatible = "adi,adv7180";
117                 reg = <0x20>;
118                 remote = <&vin1>;
119
120                 port {
121                         adv7180: endpoint {
122                                 bus-width = <8>;
123                                 remote-endpoint = <&vin1ep0>;
124                         };
125                 };
126         };
127 };
128
129 /* composite video input */
130 &vin1 {
131         pinctrl-0 = <&vin1_pins>;
132         pinctrl-names = "default";
133
134         status = "okay";
135
136         port {
137                 vin1ep0: endpoint {
138                         remote-endpoint = <&adv7180>;
139                         bus-width = <8>;
140                 };
141         };
142 };
143
144 Device node example for Gen3 platforms
145 --------------------------------------
146
147         vin0: video@e6ef0000 {
148                 compatible = "renesas,vin-r8a7795";
149                 reg = <0 0xe6ef0000 0 0x1000>;
150                 interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
151                 clocks = <&cpg CPG_MOD 811>;
152                 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
153                 resets = <&cpg 811>;
154                 renesas,id = <0>;
155
156                 ports {
157                         #address-cells = <1>;
158                         #size-cells = <0>;
159
160                         port@1 {
161                                 #address-cells = <1>;
162                                 #size-cells = <0>;
163
164                                 reg = <1>;
165
166                                 vin0csi20: endpoint@0 {
167                                         reg = <0>;
168                                         remote-endpoint= <&csi20vin0>;
169                                 };
170                                 vin0csi21: endpoint@1 {
171                                         reg = <1>;
172                                         remote-endpoint= <&csi21vin0>;
173                                 };
174                                 vin0csi40: endpoint@2 {
175                                         reg = <2>;
176                                         remote-endpoint= <&csi40vin0>;
177                                 };
178                         };
179                 };
180         };
181
182         csi20: csi2@fea80000 {
183                 compatible = "renesas,r8a7795-csi2";
184                 reg = <0 0xfea80000 0 0x10000>;
185                 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
186                 clocks = <&cpg CPG_MOD 714>;
187                 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
188                 resets = <&cpg 714>;
189
190                 ports {
191                         #address-cells = <1>;
192                         #size-cells = <0>;
193
194                         port@0 {
195                                 reg = <0>;
196                                 csi20_in: endpoint {
197                                         clock-lanes = <0>;
198                                         data-lanes = <1>;
199                                         remote-endpoint = <&adv7482_txb>;
200                                 };
201                         };
202
203                         port@1 {
204                                 #address-cells = <1>;
205                                 #size-cells = <0>;
206
207                                 reg = <1>;
208
209                                 csi20vin0: endpoint@0 {
210                                         reg = <0>;
211                                         remote-endpoint = <&vin0csi20>;
212                                 };
213                         };
214                 };
215         };
216
217 [1] video-interfaces.txt common video media interface