]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/blob - arch/arm64/boot/dts/tegra210-platforms/tegra210-camera-imx274.dtsi
4a59baf928dac5db35b5bbdddd75f826a396f812
[sojka/nv-tegra/linux-3.10.git] / arch / arm64 / boot / dts / tegra210-platforms / tegra210-camera-imx274.dtsi
1 /*
2  * Copyright (c) 2015-2016, NVIDIA CORPORATION.  All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 #include <dt-bindings/media/camera.h>
19 #include <dt-bindings/platform/t210/t210.h>
20
21 #define GANG_MODE_L_R 1
22 #define GANG_MODE_T_B 2
23 #define GANG_MODE_R_L 3
24 #define GANG_MODE_B_T 4
25
26 / {
27         host1x {
28                 vi {
29                         num-channels = <2>;
30                         ports {
31                                 #address-cells = <1>;
32                                 #size-cells = <0>;
33                                 port@0 {
34                                         reg = <0>;
35                                         imx274_vi_in0: endpoint {
36                                                 csi-port = <0>;
37                                                 bus-width = <4>;
38                                                 remote-endpoint = <&imx274_out0>;
39                                         };
40                                 };
41                                 port@1 {
42                                         reg = <1>;
43                                         tc358840_vi_in0: endpoint {
44                                                 csi-port = <2>;
45                                                 bus-width = <8>;
46                                                 gang-mode = <GANG_MODE_L_R>;
47                                                 remote-endpoint = <&tc358840_out0>;
48                                         };
49                                 };
50                         };
51                 };
52
53                 i2c@546c0000 {
54                         status = "okay";
55                         #address-cells = <1>;
56                         #size-cells = <0>;
57                         imx274_a@1a {
58                                 compatible = "nvidia,imx274";
59                                 /* I2C device address */
60                                 reg = <0x1a>;
61
62                                 /* V4L2 device node location */
63                                 devnode = "video0";
64
65                                 /* Physical dimensions of sensor */
66                                 physical_w = "3.674";
67                                 physical_h = "2.738";
68
69                                 /* Sensor Model */
70                                 sensor_model ="imx274";
71
72                                 /* Define any required hw resources needed by driver */
73                                 /* ie. clocks, io pins, power sources */
74                                 avdd-reg = "vana";
75                                 iovdd-reg = "vif";
76                                 dvdd-reg = "vdig";
77
78                                 /* Defines number of frames to be dropped by driver internally after applying */
79                                 /* sensor crop settings. Some sensors send corrupt frames after applying */
80                                 /* crop co-ordinates */
81                                 post_crop_frame_drop = "0";
82
83                                 /**
84                                 * A modeX node is required to support v4l2 driver
85                                 * implementation with NVIDIA camera software stack
86                                 *
87                                 * mclk_khz = "";
88                                 * Standard MIPI driving clock, typically 24MHz
89                                 *
90                                 * num_lanes = "";
91                                 * Number of lane channels sensor is programmed to output
92                                 *
93                                 * tegra_sinterface = "";
94                                 * The base tegra serial interface lanes are connected to
95                                 *
96                                 * discontinuous_clk = "";
97                                 * The sensor is programmed to use a discontinuous clock on MIPI lanes
98                                 *
99                                 * dpcm_enable = "true";
100                                 * The sensor is programmed to use a DPCM modes
101                                 *
102                                 * cil_settletime = "";
103                                 * MIPI lane settle time value.
104                                 * A "0" value attempts to autocalibrate based on mclk_multiplier
105                                 *
106                                 *
107                                 *
108                                 *
109                                 * active_w = "";
110                                 * Pixel active region width
111                                 *
112                                 * active_h = "";
113                                 * Pixel active region height
114                                 *
115                                 * pixel_t = "";
116                                 * The sensor readout pixel pattern
117                                 *
118                                 * readout_orientation = "0";
119                                 * Based on camera module orientation.
120                                 * Only change readout_orientation if you specifically
121                                 * Program a different readout order for this mode
122                                 *
123                                 * line_length = "";
124                                 * Pixel line length (width) for sensor mode.
125                                 * This is used to calibrate features in our camera stack.
126                                 *
127                                 * mclk_multiplier = "";
128                                 * Multiplier to MCLK to help time hardware capture sequence
129                                 * TODO: Assign to PLL_Multiplier as well until fixed in core
130                                 *
131                                 * pix_clk_hz = "";
132                                 * Sensor pixel clock used for calculations like exposure and framerate
133                                 *
134                                 *
135                                 *
136                                 *
137                                 * inherent_gain = "";
138                                 * Gain obtained inherently from mode (ie. pixel binning)
139                                 *
140                                 * min_gain_val = ""; (floor to 6 decimal places)
141                                 * max_gain_val = ""; (floor to 6 decimal places)
142                                 * Gain limits for mode
143                                 *
144                                 * min_exp_time = ""; (ceil to integer)
145                                 * max_exp_time = ""; (ceil to integer)
146                                 * Exposure Time limits for mode (us)
147                                 *
148                                 *
149                                 * min_hdr_ratio = "";
150                                 * max_hdr_ratio = "";
151                                 * HDR Ratio limits for mode
152                                 *
153                                 * min_framerate = "";
154                                 * max_framerate = "";
155                                 * Framerate limits for mode (fps)
156                                 *
157                                 * embedded_metadata_height = "";
158                                 * Sensor embedded metadata height in units of rows.
159                                 * If sensor does not support embedded metadata value should be 0.
160                                 */
161
162                                 mode0 { // IMX274_MODE_3840X2160@30fps
163                                         mclk_khz = "24000";
164                                         num_lanes = "4";
165                                         tegra_sinterface = "serial_a";
166                                         discontinuous_clk = "yes";
167                                         cil_settletime = "0";
168
169                                         active_w = "3864";
170                                         active_h = "2160";
171                                         pixel_t = "bayer_rggb";
172                                         readout_orientation = "90";
173                                         line_length = "4200";
174                                         inherent_gain = "1";
175                                         mclk_multiplier = "25";
176                                         pix_clk_hz = "576000000";
177
178                                         min_gain_val = "1.0";
179                                         max_gain_val = "22.2";
180                                         min_hdr_ratio = "1";
181                                         max_hdr_ratio = "64";
182                                         min_framerate = "1.462526";
183                                         max_framerate = "30";
184                                         min_exp_time = "16.165";
185                                         max_exp_time = "33191";
186                                         embedded_metadata_height = "0";
187                                 };
188
189                                 mode1 { // IMX274_MODE_3840X2160@60fps
190                                         mclk_khz = "24000";
191                                         num_lanes = "4";
192                                         tegra_sinterface = "serial_a";
193                                         discontinuous_clk = "yes";
194                                         cil_settletime = "0";
195
196                                         active_w = "3864";
197                                         active_h = "2160";
198                                         pixel_t = "bayer_rggb";
199                                         readout_orientation = "90";
200                                         line_length = "4200";
201                                         inherent_gain = "1";
202                                         mclk_multiplier = "25";
203                                         pix_clk_hz = "576000000";
204
205                                         min_gain_val = "1.0";
206                                         max_gain_val = "22.2";
207                                         min_hdr_ratio = "1";
208                                         max_hdr_ratio = "64";
209                                         min_framerate = "1.462526";
210                                         max_framerate = "60";
211                                         min_exp_time = "16.165";
212                                         max_exp_time = "33191";
213                                         embedded_metadata_height = "0";
214                                 };
215
216                                 mode2 { // IMX274_MODE_1920X1080@60fps
217                                         mclk_khz = "24000";
218                                         num_lanes = "4";
219                                         tegra_sinterface = "serial_a";
220                                         discontinuous_clk = "yes";
221                                         cil_settletime = "0";
222
223                                         active_w = "1932";
224                                         active_h = "1080";
225                                         pixel_t = "bayer_rggb";
226                                         readout_orientation = "90";
227                                         line_length = "4200";
228                                         inherent_gain = "1";
229                                         mclk_multiplier = "25";
230                                         pix_clk_hz = "576000000";
231
232                                         min_gain_val = "1.0";
233                                         max_gain_val = "22.2";
234                                         min_hdr_ratio = "1";
235                                         max_hdr_ratio = "64";
236                                         min_framerate = "1.462526";
237                                         max_framerate = "60";
238                                         min_exp_time = "16.165";
239                                         max_exp_time = "33191";
240                                         embedded_metadata_height = "0";
241                                 };
242
243                                 ports {
244                                         #address-cells = <1>;
245                                         #size-cells = <0>;
246
247                                         port@0 {
248                                                 reg = <0>;
249                                                 imx274_out0: endpoint {
250                                                         csi-port = <0>;
251                                                         bus-width = <4>;
252                                                         remote-endpoint = <&imx274_vi_in0>;
253                                                 };
254                                         };
255                                 };
256                         };
257                         tc358840@1f {
258                                 compatible = "toshiba,tc358840";
259
260                                 reg = <0x1f>;
261                                 /* Physical dimensions of sensor */
262                                 physical_w = "4.713";
263                                 physical_h = "3.494";
264
265                                 /* Sensor Model */
266                                 sensor_model ="tc358840";
267                                 devnode ="video1";
268                                 ports {
269                                         #address-cells = <1>;
270                                         #size-cells = <0>;
271
272                                         port@0 {
273                                                 reg = <0>;
274                                                 tc358840_out0: endpoint {
275                                                         csi-port = <2>;
276                                                         bus-width = <8>;
277                                                         remote-endpoint = <&tc358840_vi_in0>;
278                                                 };
279                                         };
280                                 };
281                         };
282                 };
283         };
284
285         tegra-camera-platform {
286                 compatible = "nvidia, tegra-camera-platform";
287
288                 /**
289                 * The general guideline for naming badge_info contains 3 parts, and is as follows,
290                 * The first part is the camera_board_id for the module; if the module is in a FFD
291                 * platform, then use the platform name for this part.
292                 * The second part contains the position of the module, ex. “rear” or “front”.
293                 * The third part contains the last 6 characters of a part number which is found
294                 * in the module's specsheet from the vender.
295                 */
296                 modules {
297                         module0 {
298                                 badge = "imx274_front_A6V24";
299                                 position = "rear";
300                                 orientation = "1";
301                                 drivernode0 {
302                                         /* Declare PCL support driver (classically known as guid)  */
303                                         pcl_id = "v4l2_sensor";
304                                         /* Declare the device-tree hierarchy to driver instance */
305                                         proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/imx274_a@1a";
306                                 };
307                         };
308                 };
309         };
310 };