driver: media: tegra: Update tegra camera_common
[linux-3.10.git] / arch / arm64 / boot / dts / tegra210-platforms / tegra210-camera-e3326-a00.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 / {
22         host1x {
23                 vi {
24                         num-channels = <1>;
25                         ports {
26                                 #address-cells = <1>;
27                                 #size-cells = <0>;
28                                 port@0 {
29                                         reg = <0>;
30                                         e3326_vi_in0: endpoint {
31                                                 csi-port = <2>;
32                                                 bus-width = <2>;
33                                                 remote-endpoint = <&e3326_ov5693_out0>;
34                                         };
35                                 };
36                         };
37                 };
38
39                 i2c@546c0000 {
40                         status = "okay";
41                         #address-cells = <1>;
42                         #size-cells = <0>;
43                         ov5693_c@36 {
44                                 compatible = "nvidia,ov5693";
45                                 /* I2C device address */
46                                 reg = <0x36>;
47
48                                 /* V4L2 device node location */
49                                 devnode = "video0";
50
51                                 /* Physical dimensions of sensor */
52                                 physical_w = "3.674";
53                                 physical_h = "2.738";
54
55                                 /* Sensor Model */
56                                 sensor_model ="ov5693";
57
58                                 /* Define any required hw resources needed by driver */
59                                 /* ie. clocks, io pins, power sources */
60                                 avdd-reg = "vana";
61                                 iovdd-reg = "vif";
62
63                                 /* Defines number of frames to be dropped by driver internally after applying */
64                                 /* sensor crop settings. Some sensors send corrupt frames after applying */
65                                 /* crop co-ordinates */
66                                 post_crop_frame_drop = "0";
67
68                                 /**
69                                 * A modeX node is required to support v4l2 driver
70                                 * implementation with NVIDIA camera software stack
71                                 *
72                                 * mclk_khz = "";
73                                 * Standard MIPI driving clock, typically 24MHz
74                                 *
75                                 * num_lanes = "";
76                                 * Number of lane channels sensor is programmed to output
77                                 *
78                                 * tegra_sinterface = "";
79                                 * The base tegra serial interface lanes are connected to
80                                 *
81                                 * discontinuous_clk = "";
82                                 * The sensor is programmed to use a discontinuous clock on MIPI lanes
83                                 *
84                                 * dpcm_enable = "true";
85                                 * The sensor is programmed to use a DPCM modes
86                                 *
87                                 * cil_settletime = "";
88                                 * MIPI lane settle time value.
89                                 * A "0" value attempts to autocalibrate based on mclk_multiplier
90                                 *
91                                 *
92                                 *
93                                 *
94                                 * active_w = "";
95                                 * Pixel active region width
96                                 *
97                                 * active_h = "";
98                                 * Pixel active region height
99                                 *
100                                 * pixel_t = "";
101                                 * The sensor readout pixel pattern
102                                 * For eg - 10 bit bayer having 'bggr' pixel pattern has value "bayer_bggr"
103                                 *          12 bit bayer having 'bggr' pixel pattern has value "bayer_bggr12"
104                                 *          14 bit bayer having 'bggr' pixel pattern has value "bayer_bggr14"
105                                 *
106                                 * readout_orientation = "0";
107                                 * Based on camera module orientation.
108                                 * Only change readout_orientation if you specifically
109                                 * Program a different readout order for this mode
110                                 *
111                                 * line_length = "";
112                                 * Pixel line length (width) for sensor mode.
113                                 * This is used to calibrate features in our camera stack.
114                                 *
115                                 * mclk_multiplier = "";
116                                 * Multiplier to MCLK to help time hardware capture sequence
117                                 * TODO: Assign to PLL_Multiplier as well until fixed in core
118                                 *
119                                 * pix_clk_hz = "";
120                                 * Sensor pixel clock used for calculations like exposure and framerate
121                                 *
122                                 *
123                                 *
124                                 *
125                                 * inherent_gain = "";
126                                 * Gain obtained inherently from mode (ie. pixel binning)
127                                 *
128                                 * min_gain_val = ""; (floor to 6 decimal places)
129                                 * max_gain_val = ""; (floor to 6 decimal places)
130                                 * Gain limits for mode
131                                 *
132                                 * min_exp_time = ""; (ceil to integer)
133                                 * max_exp_time = ""; (ceil to integer)
134                                 * Exposure Time limits for mode (us)
135                                 *
136                                 *
137                                 * min_hdr_ratio = "";
138                                 * max_hdr_ratio = "";
139                                 * HDR Ratio limits for mode
140                                 *
141                                 * min_framerate = "";
142                                 * max_framerate = "";
143                                 * Framerate limits for mode (fps)
144                                 *
145                                 * embedded_metadata_height = "";
146                                 * Sensor embedded metadata height in units of rows.
147                                 * If sensor does not support embedded metadata value should be 0.
148                                 */
149                                 mode0 { // OV5693_MODE_2592X1944
150                                         mclk_khz = "24000";
151                                         num_lanes = "2";
152                                         tegra_sinterface = "serial_c";
153                                         discontinuous_clk = "no";
154                                         dpcm_enable = "false";
155                                         cil_settletime = "0";
156
157                                         active_w = "2592";
158                                         active_h = "1944";
159                                         pixel_t = "bayer_bggr";
160                                         readout_orientation = "180";
161                                         line_length = "2688";
162                                         inherent_gain = "1";
163                                         mclk_multiplier = "17.0";
164                                         pix_clk_hz = "160000000";
165
166                                         min_gain_val = "1.0";
167                                         max_gain_val = "16";
168                                         min_hdr_ratio = "1";
169                                         max_hdr_ratio = "64";
170                                         min_framerate = "1.816577";
171                                         max_framerate = "30";
172                                         min_exp_time = "34";
173                                         max_exp_time = "550385";
174                                         embedded_metadata_height = "0";
175                                 };
176
177                                 mode1 { //OV5693_MODE_2592X1458
178                                         mclk_khz = "24000";
179                                         num_lanes = "2";
180                                         tegra_sinterface = "serial_c";
181                                         discontinuous_clk = "no";
182                                         dpcm_enable = "false";
183                                         cil_settletime = "0";
184
185                                         active_w = "2592";
186                                         active_h = "1458";
187                                         pixel_t = "bayer_bggr";
188                                         readout_orientation = "180";
189                                         line_length = "2688";
190                                         inherent_gain = "1";
191                                         mclk_multiplier = "17.0";
192                                         pix_clk_hz = "160000000";
193
194                                         min_gain_val = "1.0";
195                                         max_gain_val = "16";
196                                         min_hdr_ratio = "1";
197                                         max_hdr_ratio = "64";
198                                         min_framerate = "1.816577";
199                                         max_framerate = "30";
200                                         min_exp_time = "34";
201                                         max_exp_time = "550385";
202                                         embedded_metadata_height = "0";
203                                 };
204
205                                 mode2 { //OV5693_MODE_1280X720
206                                         mclk_khz = "24000";
207                                         num_lanes = "2";
208                                         tegra_sinterface = "serial_c";
209                                         discontinuous_clk = "no";
210                                         dpcm_enable = "false";
211                                         cil_settletime = "0";
212
213                                         active_w = "1280";
214                                         active_h = "720";
215                                         pixel_t = "bayer_bggr";
216                                         readout_orientation = "180";
217                                         line_length = "1752";
218                                         inherent_gain = "1";
219                                         mclk_multiplier = "17.0";
220                                         pix_clk_hz = "160000000";
221
222                                         min_gain_val = "1.0";
223                                         max_gain_val = "16";
224                                         min_hdr_ratio = "1";
225                                         max_hdr_ratio = "64";
226                                         min_framerate = "2.787078";
227                                         max_framerate = "120";
228                                         min_exp_time = "22";
229                                         max_exp_time = "358733";
230                                         embedded_metadata_height = "0";
231                                 };
232
233                                 ports {
234                                         #address-cells = <1>;
235                                         #size-cells = <0>;
236
237                                         port@0 {
238                                                 reg = <0>;
239                                                 e3326_ov5693_out0: endpoint {
240                                                         csi-port = <2>;
241                                                         bus-width = <2>;
242                                                         remote-endpoint = <&e3326_vi_in0>;
243                                                 };
244                                         };
245                                 };
246                         };
247
248                 };
249         };
250
251         tegra-camera-platform {
252                 compatible = "nvidia, tegra-camera-platform";
253
254                 /**
255                 * The general guideline for naming badge_info contains 3 parts, and is as follows,
256                 * The first part is the camera_board_id for the module; if the module is in a FFD
257                 * platform, then use the platform name for this part.
258                 * The second part contains the position of the module, ex. “rear” or “front”.
259                 * The third part contains the last 6 characters of a part number which is found
260                 * in the module's specsheet from the vender.
261                 */
262                 modules {
263                         module0 {
264                                 badge = "e3326_front_P5V27C";
265                                 position = "rear";
266                                 orientation = "1";
267                                 drivernode0 {
268                                         /* Declare PCL support driver (classically known as guid)  */
269                                         pcl_id = "v4l2_sensor";
270                                         /* Declare the device-tree hierarchy to driver instance */
271                                         proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/ov5693_c@36";
272                                 };
273                                 drivernode1 {
274                                         /* Declare PCL support driver (classically known as guid)  */
275                                         pcl_id = "v4l2_focuser_stub";
276                                 };
277                         };
278                 };
279         };
280 };