2 * Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
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.
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
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/>.
18 #include <dt-bindings/media/camera.h>
19 #include <dt-bindings/platform/t210/t210.h>
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
35 imx274_vi_in0: endpoint {
38 remote-endpoint = <&imx274_out0>;
43 tc358840_vi_in0: endpoint {
46 gang-mode = <GANG_MODE_L_R>;
47 remote-endpoint = <&tc358840_out0>;
58 compatible = "nvidia,imx274";
59 /* I2C device address */
62 /* Physical dimensions of sensor */
67 sensor_model ="imx274";
69 /* Define any required hw resources needed by driver */
70 /* ie. clocks, io pins, power sources */
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";
81 * A modeX node is required to support v4l2 driver
82 * implementation with NVIDIA camera software stack
85 * Standard MIPI driving clock, typically 24MHz
88 * Number of lane channels sensor is programmed to output
90 * tegra_sinterface = "";
91 * The base tegra serial interface lanes are connected to
93 * discontinuous_clk = "";
94 * The sensor is programmed to use a discontinuous clock on MIPI lanes
96 * dpcm_enable = "true";
97 * The sensor is programmed to use a DPCM modes
99 * cil_settletime = "";
100 * MIPI lane settle time value.
101 * A "0" value attempts to autocalibrate based on mclk_multiplier
107 * Pixel active region width
110 * Pixel active region height
113 * The sensor readout pixel pattern
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
121 * Pixel line length (width) for sensor mode.
122 * This is used to calibrate features in our camera stack.
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
129 * Sensor pixel clock used for calculations like exposure and framerate
134 * inherent_gain = "";
135 * Gain obtained inherently from mode (ie. pixel binning)
137 * min_gain_val = ""; (floor to 6 decimal places)
138 * max_gain_val = ""; (floor to 6 decimal places)
139 * Gain limits for mode
141 * min_exp_time = ""; (ceil to integer)
142 * max_exp_time = ""; (ceil to integer)
143 * Exposure Time limits for mode (us)
146 * min_hdr_ratio = "";
147 * max_hdr_ratio = "";
148 * HDR Ratio limits for mode
150 * min_framerate = "";
151 * max_framerate = "";
152 * Framerate limits for mode (fps)
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.
159 mode0 { // IMX274_MODE_3840X2160@30fps
162 tegra_sinterface = "serial_a";
163 discontinuous_clk = "yes";
164 cil_settletime = "0";
168 pixel_t = "bayer_rggb";
169 readout_orientation = "90";
170 line_length = "4200";
172 mclk_multiplier = "25";
173 pix_clk_hz = "576000000";
175 min_gain_val = "1.0";
176 max_gain_val = "22.2";
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";
186 mode1 { // IMX274_MODE_3840X2160@60fps
189 tegra_sinterface = "serial_a";
190 discontinuous_clk = "yes";
191 cil_settletime = "0";
195 pixel_t = "bayer_rggb";
196 readout_orientation = "90";
197 line_length = "4200";
199 mclk_multiplier = "25";
200 pix_clk_hz = "576000000";
202 min_gain_val = "1.0";
203 max_gain_val = "22.2";
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";
213 mode2 { // IMX274_MODE_1920X1080@60fps
216 tegra_sinterface = "serial_a";
217 discontinuous_clk = "yes";
218 cil_settletime = "0";
222 pixel_t = "bayer_rggb";
223 readout_orientation = "90";
224 line_length = "4200";
226 mclk_multiplier = "25";
227 pix_clk_hz = "576000000";
229 min_gain_val = "1.0";
230 max_gain_val = "22.2";
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";
241 #address-cells = <1>;
246 imx274_out0: endpoint {
249 remote-endpoint = <&imx274_vi_in0>;
255 compatible = "toshiba,tc358840";
258 /* Physical dimensions of sensor */
259 physical_w = "4.713";
260 physical_h = "3.494";
263 sensor_model ="tc358840";
265 #address-cells = <1>;
270 tc358840_out0: endpoint {
273 remote-endpoint = <&tc358840_vi_in0>;
281 tegra-camera-platform {
282 compatible = "nvidia, tegra-camera-platform";
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.
294 badge = "imx274_front_A6V24";
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";