arch: arm64: boot: dts: T210 camera devnames
[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                                 /* Physical dimensions of sensor */
63                                 physical_w = "3.674";
64                                 physical_h = "2.738";
65
66                                 /* Sensor Model */
67                                 sensor_model ="imx274";
68
69                                 /* Define any required hw resources needed by driver */
70                                 /* ie. clocks, io pins, power sources */
71                                 avdd-reg = "vana";
72                                 iovdd-reg = "vif";
73                                 dvdd-reg = "vdig";
74
75                                 /* Defines number of frames to be dropped by driver internally after applying */
76                                 /* sensor crop settings. Some sensors send corrupt frames after applying */
77                                 /* crop co-ordinates */
78                                 post_crop_frame_drop = "0";
79
80                                 /**
81                                 * A modeX node is required to support v4l2 driver
82                                 * implementation with NVIDIA camera software stack
83                                 *
84                                 * mclk_khz = "";
85                                 * Standard MIPI driving clock, typically 24MHz
86                                 *
87                                 * num_lanes = "";
88                                 * Number of lane channels sensor is programmed to output
89                                 *
90                                 * tegra_sinterface = "";
91                                 * The base tegra serial interface lanes are connected to
92                                 *
93                                 * discontinuous_clk = "";
94                                 * The sensor is programmed to use a discontinuous clock on MIPI lanes
95                                 *
96                                 * dpcm_enable = "true";
97                                 * The sensor is programmed to use a DPCM modes
98                                 *
99                                 * cil_settletime = "";
100                                 * MIPI lane settle time value.
101                                 * A "0" value attempts to autocalibrate based on mclk_multiplier
102                                 *
103                                 *
104                                 *
105                                 *
106                                 * active_w = "";
107                                 * Pixel active region width
108                                 *
109                                 * active_h = "";
110                                 * Pixel active region height
111                                 *
112                                 * pixel_t = "";
113                                 * The sensor readout pixel pattern
114                                 *
115                                 * readout_orientation = "0";
116                                 * Based on camera module orientation.
117                                 * Only change readout_orientation if you specifically
118                                 * Program a different readout order for this mode
119                                 *
120                                 * line_length = "";
121                                 * Pixel line length (width) for sensor mode.
122                                 * This is used to calibrate features in our camera stack.
123                                 *
124                                 * mclk_multiplier = "";
125                                 * Multiplier to MCLK to help time hardware capture sequence
126                                 * TODO: Assign to PLL_Multiplier as well until fixed in core
127                                 *
128                                 * pix_clk_hz = "";
129                                 * Sensor pixel clock used for calculations like exposure and framerate
130                                 *
131                                 *
132                                 *
133                                 *
134                                 * inherent_gain = "";
135                                 * Gain obtained inherently from mode (ie. pixel binning)
136                                 *
137                                 * min_gain_val = ""; (floor to 6 decimal places)
138                                 * max_gain_val = ""; (floor to 6 decimal places)
139                                 * Gain limits for mode
140                                 *
141                                 * min_exp_time = ""; (ceil to integer)
142                                 * max_exp_time = ""; (ceil to integer)
143                                 * Exposure Time limits for mode (us)
144                                 *
145                                 *
146                                 * min_hdr_ratio = "";
147                                 * max_hdr_ratio = "";
148                                 * HDR Ratio limits for mode
149                                 *
150                                 * min_framerate = "";
151                                 * max_framerate = "";
152                                 * Framerate limits for mode (fps)
153                                 *
154                                 * embedded_metadata_height = "";
155                                 * Sensor embedded metadata height in units of rows.
156                                 * If sensor does not support embedded metadata value should be 0.
157                                 */
158
159                                 mode0 { // IMX274_MODE_3840X2160@30fps
160                                         mclk_khz = "24000";
161                                         num_lanes = "4";
162                                         tegra_sinterface = "serial_a";
163                                         discontinuous_clk = "yes";
164                                         cil_settletime = "0";
165
166                                         active_w = "3864";
167                                         active_h = "2160";
168                                         pixel_t = "bayer_rggb";
169                                         readout_orientation = "90";
170                                         line_length = "4200";
171                                         inherent_gain = "1";
172                                         mclk_multiplier = "25";
173                                         pix_clk_hz = "576000000";
174
175                                         min_gain_val = "1.0";
176                                         max_gain_val = "22.2";
177                                         min_hdr_ratio = "1";
178                                         max_hdr_ratio = "64";
179                                         min_framerate = "1.462526";
180                                         max_framerate = "30";
181                                         min_exp_time = "16.165";
182                                         max_exp_time = "33191";
183                                         embedded_metadata_height = "0";
184                                 };
185
186                                 mode1 { // IMX274_MODE_3840X2160@60fps
187                                         mclk_khz = "24000";
188                                         num_lanes = "4";
189                                         tegra_sinterface = "serial_a";
190                                         discontinuous_clk = "yes";
191                                         cil_settletime = "0";
192
193                                         active_w = "3864";
194                                         active_h = "2160";
195                                         pixel_t = "bayer_rggb";
196                                         readout_orientation = "90";
197                                         line_length = "4200";
198                                         inherent_gain = "1";
199                                         mclk_multiplier = "25";
200                                         pix_clk_hz = "576000000";
201
202                                         min_gain_val = "1.0";
203                                         max_gain_val = "22.2";
204                                         min_hdr_ratio = "1";
205                                         max_hdr_ratio = "64";
206                                         min_framerate = "1.462526";
207                                         max_framerate = "60";
208                                         min_exp_time = "16.165";
209                                         max_exp_time = "33191";
210                                         embedded_metadata_height = "0";
211                                 };
212
213                                 mode2 { // IMX274_MODE_1920X1080@60fps
214                                         mclk_khz = "24000";
215                                         num_lanes = "4";
216                                         tegra_sinterface = "serial_a";
217                                         discontinuous_clk = "yes";
218                                         cil_settletime = "0";
219
220                                         active_w = "1932";
221                                         active_h = "1080";
222                                         pixel_t = "bayer_rggb";
223                                         readout_orientation = "90";
224                                         line_length = "4200";
225                                         inherent_gain = "1";
226                                         mclk_multiplier = "25";
227                                         pix_clk_hz = "576000000";
228
229                                         min_gain_val = "1.0";
230                                         max_gain_val = "22.2";
231                                         min_hdr_ratio = "1";
232                                         max_hdr_ratio = "64";
233                                         min_framerate = "1.462526";
234                                         max_framerate = "60";
235                                         min_exp_time = "16.165";
236                                         max_exp_time = "33191";
237                                         embedded_metadata_height = "0";
238                                 };
239
240                                 ports {
241                                         #address-cells = <1>;
242                                         #size-cells = <0>;
243
244                                         port@0 {
245                                                 reg = <0>;
246                                                 imx274_out0: endpoint {
247                                                         csi-port = <0>;
248                                                         bus-width = <4>;
249                                                         remote-endpoint = <&imx274_vi_in0>;
250                                                 };
251                                         };
252                                 };
253                         };
254                         tc358840@1f {
255                                 compatible = "toshiba,tc358840";
256
257                                 reg = <0x1f>;
258                                 /* Physical dimensions of sensor */
259                                 physical_w = "4.713";
260                                 physical_h = "3.494";
261
262                                 /* Sensor Model */
263                                 sensor_model ="tc358840";
264                                 ports {
265                                         #address-cells = <1>;
266                                         #size-cells = <0>;
267
268                                         port@0 {
269                                                 reg = <0>;
270                                                 tc358840_out0: endpoint {
271                                                         csi-port = <2>;
272                                                         bus-width = <8>;
273                                                         remote-endpoint = <&tc358840_vi_in0>;
274                                                 };
275                                         };
276                                 };
277                         };
278                 };
279         };
280
281         tegra-camera-platform {
282                 compatible = "nvidia, tegra-camera-platform";
283
284                 /**
285                 * The general guideline for naming badge_info contains 3 parts, and is as follows,
286                 * The first part is the camera_board_id for the module; if the module is in a FFD
287                 * platform, then use the platform name for this part.
288                 * The second part contains the position of the module, ex. “rear” or “front”.
289                 * The third part contains the last 6 characters of a part number which is found
290                 * in the module's specsheet from the vender.
291                 */
292                 modules {
293                         module0 {
294                                 badge = "imx274_front_A6V24";
295                                 position = "rear";
296                                 orientation = "1";
297                                 drivernode0 {
298                                         /* Declare PCL support driver (classically known as guid)  */
299                                         pcl_id = "v4l2_sensor";
300                                         /* Driver's v4l2 device name */
301                                         devname = "imx274 6-001a";
302                                         /* Declare the device-tree hierarchy to driver instance */
303                                         proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/imx274_a@1a";
304                                 };
305                         };
306                 };
307         };
308 };