Merge tag 'drm-misc-next-fixes-2018-06-15' of git://anongit.freedesktop.org/drm/drm...
[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 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-r8a7745" for the R8A7745 device
15    - "renesas,vin-r8a7778" for the R8A7778 device
16    - "renesas,vin-r8a7779" for the R8A7779 device
17    - "renesas,vin-r8a7790" for the R8A7790 device
18    - "renesas,vin-r8a7791" for the R8A7791 device
19    - "renesas,vin-r8a7792" for the R8A7792 device
20    - "renesas,vin-r8a7793" for the R8A7793 device
21    - "renesas,vin-r8a7794" for the R8A7794 device
22    - "renesas,vin-r8a7795" for the R8A7795 device
23    - "renesas,vin-r8a7796" for the R8A7796 device
24    - "renesas,vin-r8a77970" for the R8A77970 device
25    - "renesas,rcar-gen2-vin" for a generic R-Car Gen2 or RZ/G1 compatible
26      device.
27
28    When compatible with the generic version nodes must list the
29    SoC-specific version corresponding to the platform first
30    followed by the generic version.
31
32  - reg: the register base and size for the device registers
33  - interrupts: the interrupt for the device
34  - clocks: Reference to the parent clock
35
36 Additionally, an alias named vinX will need to be created to specify
37 which video input device this is.
38
39 The per-board settings Gen2 platforms:
40  - port sub-node describing a single endpoint connected to the vin
41    as described in video-interfaces.txt[1]. Only the first one will
42    be considered as each vin interface has one input port.
43
44 The per-board settings Gen3 platforms:
45
46 Gen3 platforms can support both a single connected parallel input source
47 from external SoC pins (port0) and/or multiple parallel input sources
48 from local SoC CSI-2 receivers (port1) depending on SoC.
49
50 - renesas,id - ID number of the VIN, VINx in the documentation.
51 - ports
52     - port 0 - sub-node describing a single endpoint connected to the VIN
53       from external SoC pins described in video-interfaces.txt[1].
54       Describing more then one endpoint in port 0 is invalid. Only VIN
55       instances that are connected to external pins should have port 0.
56     - port 1 - sub-nodes describing one or more endpoints connected to
57       the VIN from local SoC CSI-2 receivers. The endpoint numbers must
58       use the following schema.
59
60         - Endpoint 0 - sub-node describing the endpoint connected to CSI20
61         - Endpoint 1 - sub-node describing the endpoint connected to CSI21
62         - Endpoint 2 - sub-node describing the endpoint connected to CSI40
63         - Endpoint 3 - sub-node describing the endpoint connected to CSI41
64
65 Device node example for Gen2 platforms
66 --------------------------------------
67
68         aliases {
69                 vin0 = &vin0;
70         };
71
72         vin0: vin@e6ef0000 {
73                 compatible = "renesas,vin-r8a7790", "renesas,rcar-gen2-vin";
74                 clocks = <&mstp8_clks R8A7790_CLK_VIN0>;
75                 reg = <0 0xe6ef0000 0 0x1000>;
76                 interrupts = <0 188 IRQ_TYPE_LEVEL_HIGH>;
77                 status = "disabled";
78         };
79
80 Board setup example for Gen2 platforms (vin1 composite video input)
81 -------------------------------------------------------------------
82
83 &i2c2   {
84         status = "okay";
85         pinctrl-0 = <&i2c2_pins>;
86         pinctrl-names = "default";
87
88         adv7180@20 {
89                 compatible = "adi,adv7180";
90                 reg = <0x20>;
91                 remote = <&vin1>;
92
93                 port {
94                         adv7180: endpoint {
95                                 bus-width = <8>;
96                                 remote-endpoint = <&vin1ep0>;
97                         };
98                 };
99         };
100 };
101
102 /* composite video input */
103 &vin1 {
104         pinctrl-0 = <&vin1_pins>;
105         pinctrl-names = "default";
106
107         status = "okay";
108
109         port {
110                 #address-cells = <1>;
111                 #size-cells = <0>;
112
113                 vin1ep0: endpoint {
114                         remote-endpoint = <&adv7180>;
115                         bus-width = <8>;
116                 };
117         };
118 };
119
120 Device node example for Gen3 platforms
121 --------------------------------------
122
123         vin0: video@e6ef0000 {
124                 compatible = "renesas,vin-r8a7795";
125                 reg = <0 0xe6ef0000 0 0x1000>;
126                 interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
127                 clocks = <&cpg CPG_MOD 811>;
128                 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
129                 resets = <&cpg 811>;
130                 renesas,id = <0>;
131
132                 ports {
133                         #address-cells = <1>;
134                         #size-cells = <0>;
135
136                         port@1 {
137                                 #address-cells = <1>;
138                                 #size-cells = <0>;
139
140                                 reg = <1>;
141
142                                 vin0csi20: endpoint@0 {
143                                         reg = <0>;
144                                         remote-endpoint= <&csi20vin0>;
145                                 };
146                                 vin0csi21: endpoint@1 {
147                                         reg = <1>;
148                                         remote-endpoint= <&csi21vin0>;
149                                 };
150                                 vin0csi40: endpoint@2 {
151                                         reg = <2>;
152                                         remote-endpoint= <&csi40vin0>;
153                                 };
154                         };
155                 };
156         };
157
158         csi20: csi2@fea80000 {
159                 compatible = "renesas,r8a7795-csi2";
160                 reg = <0 0xfea80000 0 0x10000>;
161                 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
162                 clocks = <&cpg CPG_MOD 714>;
163                 power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
164                 resets = <&cpg 714>;
165
166                 ports {
167                         #address-cells = <1>;
168                         #size-cells = <0>;
169
170                         port@0 {
171                                 reg = <0>;
172                                 csi20_in: endpoint {
173                                         clock-lanes = <0>;
174                                         data-lanes = <1>;
175                                         remote-endpoint = <&adv7482_txb>;
176                                 };
177                         };
178
179                         port@1 {
180                                 #address-cells = <1>;
181                                 #size-cells = <0>;
182
183                                 reg = <1>;
184
185                                 csi20vin0: endpoint@0 {
186                                         reg = <0>;
187                                         remote-endpoint = <&vin0csi20>;
188                                 };
189                         };
190                 };
191         };
192
193 [1] video-interfaces.txt common video media interface