Hello:
now i want to add one sensor with CIS interface on mipi 4 lanes.
I changed the DTS are as follows:
/*
- Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see http://www.gnu.org/licenses/.
*/
#include <dt-bindings/media/camera.h>
#include <dt-bindings/platform/t210/t210.h>
/* camera control gpio definitions */
/ {
//host1x {
// /delete-node/ vi;
// /delete-node/ i2c@546c0000;
//};
host1x {
vi {
num-channels = <6>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
itarge_cgc_vi_in0: endpoint {
status = “okay”;
csi-port = <0>;
bus-width = <4>;
remote-endpoint = <&itarge_cgc_tc358746a_out0>;
};
};
port@2 {
reg = <2>;
itarge_cgc_vi_in2: endpoint {
status = “okay”;
csi-port = <2>;
bus-width = <4>;
remote-endpoint = <&itarge_cgc_tc358746a_out2>;
};
};
port@4 {
reg = <4>;
itarge_cgc_vi_in4: endpoint {
status = “disable”;
csi-port = <4>;
bus-width = <2>;
remote-endpoint = <&itarge_cgc_tc358746a_out4>;
};
};
};
};
i2c@546c0000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "nvidia,tegra210-vii2c";
reg = <0x0 0x546C0000 0x0 0x00034000>;
iommus = <&smmu TEGRA_SWGROUP_VII2C>;
interrupts = <0 17 0x04>;
scl-gpio = <&gpio TEGRA_GPIO(S, 2) 0>;
sda-gpio = <&gpio TEGRA_GPIO(S, 3) 0>;
status = "okay";
clock-frequency = <400000>;
tc358746a@0d {
compatible = "nvidia,tc358746a";
/* I2C device address */
reg = <0x0d>;
status = "okay";
/* Physical dimensions of sensor */
physical_w = "3.674";
physical_h = "2.738";
/* Sensor Model */
sensor_model ="tc358746a";
/* Define any required hw resources needed by driver */
/* ie. clocks, io pins, power sources */
/* mclk-index indicates the index of the */
/* mclk-name with in the clock-names array */
clocks = <&tegra_car TEGRA210_CLK_ID_CLK_OUT_3>;
clock-names = "mclk";
clock-frequency = <24000000>;
mclk = "cam_mclk1";
pwdn-gpios = <&gpio TEGRA_GPIO(T, 0) 0>;
avdd-reg = "vana";
iovdd-reg = "vif";
vana-supply = <&max77620_ldo3>;
vif-supply = <&en_vdd_cam>;
/* Defines number of frames to be dropped by driver internally after applying */
/* sensor crop settings. Some sensors send corrupt frames after applying */
/* crop co-ordinates */
post_crop_frame_drop = "0";
mode0 { // OV5693_MODE_2592X1944
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "2592";
active_h = "1944";
pixel_t = "bayer_bggr";
readout_orientation = "90";
line_length = "2688";
inherent_gain = "1";
mclk_multiplier = "17.0";
pix_clk_hz = "160000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "1.816577";
max_framerate = "30";
min_exp_time = "34";
max_exp_time = "550385";
embedded_metadata_height = "0";
};
mode1 { //OV5693_MODE_2592X1458
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "2592";
active_h = "1458";
pixel_t = "bayer_bggr";
readout_orientation = "90";
line_length = "2688";
inherent_gain = "1";
mclk_multiplier = "17.0";
pix_clk_hz = "160000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "1.816577";
max_framerate = "30";
min_exp_time = "34";
max_exp_time = "550385";
embedded_metadata_height = "0";
};
mode2 { //OV5693_MODE_1280X720
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1280";
active_h = "720";
pixel_t = "bayer_bggr";
readout_orientation = "90";
line_length = "1752";
inherent_gain = "1";
mclk_multiplier = "17.0";
pix_clk_hz = "160000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "2.787078";
max_framerate = "120";
min_exp_time = "22";
max_exp_time = "358733";
embedded_metadata_height = "0";
};
// HDR Modes
mode3 { //OV5693_MODE_2592X1944_HDR
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "2592";
active_h = "1944";
pixel_t = "hdr_bggr";
readout_orientation = "90";
line_length = "3696";
inherent_gain = "1";
mclk_multiplier = "19.0";
pix_clk_hz = "176000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "1.453262";
max_framerate = "24";
min_exp_time = "42";
max_exp_time = "687981";
embedded_metadata_height = "0";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
itarge_cgc_tc358746a_out0: endpoint {
csi-port = <0>;
bus-width = <4>;
remote-endpoint = <&itarge_cgc_vi_in0>;
};
};
};
};
tc358746a@0e {
compatible = "nvidia,tc358746a";
/* I2C device address */
reg = <0x0e>;
status = "okay";
/* Physical dimensions of sensor */
physical_w = "3.674";
physical_h = "2.738";
/* Sensor Model */
sensor_model ="tc358746a";
/* Define any required hw resources needed by driver */
/* ie. clocks, io pins, power sources */
/* mclk-index indicates the index of the */
/* mclk-name with in the clock-names array */
clocks = <&tegra_car TEGRA210_CLK_ID_CLK_OUT_3>;
clock-names = "mclk";
clock-frequency = <24000000>;
mclk = "cam_mclk1";
pwdn-gpios = <&gpio TEGRA_GPIO(T, 0) 0>;
avdd-reg = "vana";
iovdd-reg = "vif";
vana-supply = <&max77620_ldo3>;
vif-supply = <&en_vdd_cam>;
/* Defines number of frames to be dropped by driver internally after applying */
/* sensor crop settings. Some sensors send corrupt frames after applying */
/* crop co-ordinates */
post_crop_frame_drop = "0";
mode0 { // OV5693_MODE_2592X1944
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "2592";
active_h = "1944";
pixel_t = "bayer_bggr";
readout_orientation = "90";
line_length = "2688";
inherent_gain = "1";
mclk_multiplier = "17.0";
pix_clk_hz = "160000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "1.816577";
max_framerate = "30";
min_exp_time = "34";
max_exp_time = "550385";
embedded_metadata_height = "0";
};
mode1 { //OV5693_MODE_2592X1458
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "2592";
active_h = "1458";
pixel_t = "bayer_bggr";
readout_orientation = "90";
line_length = "2688";
inherent_gain = "1";
mclk_multiplier = "17.0";
pix_clk_hz = "160000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "1.816577";
max_framerate = "30";
min_exp_time = "34";
max_exp_time = "550385";
embedded_metadata_height = "0";
};
mode2 { //OV5693_MODE_1280X720
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1280";
active_h = "720";
pixel_t = "bayer_bggr";
readout_orientation = "90";
line_length = "1752";
inherent_gain = "1";
mclk_multiplier = "17.0";
pix_clk_hz = "160000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "2.787078";
max_framerate = "120";
min_exp_time = "22";
max_exp_time = "358733";
embedded_metadata_height = "0";
};
// HDR Modes
mode3 { //OV5693_MODE_2592X1944_HDR
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "2592";
active_h = "1944";
pixel_t = "hdr_bggr";
readout_orientation = "90";
line_length = "3696";
inherent_gain = "1";
mclk_multiplier = "19.0";
pix_clk_hz = "176000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "1.453262";
max_framerate = "24";
min_exp_time = "42";
max_exp_time = "687981";
embedded_metadata_height = "0";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@2 {
reg = <0>;
itarge_cgc_tc358746a_out2: endpoint {
csi-port = <2>;
bus-width = <4>;
remote-endpoint = <&itarge_cgc_vi_in2>;
};
};
};
};
tc358746a@0f {
compatible = "nvidia,tc358746a";
/* I2C device address */
reg = <0x0f>;
status = "disable";
/* Physical dimensions of sensor */
physical_w = "3.674";
physical_h = "2.738";
/* Sensor Model */
sensor_model ="tc358746a";
/* Define any required hw resources needed by driver */
/* ie. clocks, io pins, power sources */
/* mclk-index indicates the index of the */
/* mclk-name with in the clock-names array */
clocks = <&tegra_car TEGRA210_CLK_ID_CLK_OUT_3>;
clock-names = "mclk";
clock-frequency = <24000000>;
mclk = "cam_mclk1";
pwdn-gpios = <&gpio TEGRA_GPIO(T, 0) 0>;
avdd-reg = "vana";
iovdd-reg = "vif";
vana-supply = <&max77620_ldo3>;
vif-supply = <&en_vdd_cam>;
/* Defines number of frames to be dropped by driver internally after applying */
/* sensor crop settings. Some sensors send corrupt frames after applying */
/* crop co-ordinates */
post_crop_frame_drop = "0";
mode0 { // OV5693_MODE_2592X1944
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "2592";
active_h = "1944";
pixel_t = "bayer_bggr";
readout_orientation = "90";
line_length = "2688";
inherent_gain = "1";
mclk_multiplier = "17.0";
pix_clk_hz = "160000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "1.816577";
max_framerate = "30";
min_exp_time = "34";
max_exp_time = "550385";
embedded_metadata_height = "0";
};
mode1 { //OV5693_MODE_2592X1458
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "2592";
active_h = "1458";
pixel_t = "bayer_bggr";
readout_orientation = "90";
line_length = "2688";
inherent_gain = "1";
mclk_multiplier = "17.0";
pix_clk_hz = "160000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "1.816577";
max_framerate = "30";
min_exp_time = "34";
max_exp_time = "550385";
embedded_metadata_height = "0";
};
mode2 { //OV5693_MODE_1280X720
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1280";
active_h = "720";
pixel_t = "bayer_bggr";
readout_orientation = "90";
line_length = "1752";
inherent_gain = "1";
mclk_multiplier = "17.0";
pix_clk_hz = "160000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "2.787078";
max_framerate = "120";
min_exp_time = "22";
max_exp_time = "358733";
embedded_metadata_height = "0";
};
// HDR Modes
mode3 { //OV5693_MODE_2592X1944_HDR
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_c";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "2592";
active_h = "1944";
pixel_t = "hdr_bggr";
readout_orientation = "90";
line_length = "3696";
inherent_gain = "1";
mclk_multiplier = "19.0";
pix_clk_hz = "176000000";
min_gain_val = "1.0";
max_gain_val = "16";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "1.453262";
max_framerate = "24";
min_exp_time = "42";
max_exp_time = "687981";
embedded_metadata_height = "0";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@4 {
reg = <0>;
itarge_cgc_tc358746a_out4: endpoint {
csi-port = <4>;
bus-width = <2>;
remote-endpoint = <&itarge_cgc_vi_in4>;
};
};
};
};
};
};
};
/* camera control gpio definitions */
/ {
tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
/**
* The general guideline for naming badge_info contains 3 parts, and is as follows,
* The first part is the camera_board_id for the module; if the module is in a FFD
* platform, then use the platform name for this part.
* The second part contains the position of the module, ex. “rear” or “front”.
* The third part contains the last 6 characters of a part number which is found
* in the module's specsheet from the vender.
*/
modules {
module0 {
badge = "itarge_cgc_mipi0";
position = "bottomleft";
orientation = "1";
drivernode0 {
pcl_id = "v4l2_sensor";
devname = "tc358746a e-000d";
proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/tc358746a@0d";
};
};
module1 {
badge = "itarge_cgc_mipi1";
position = "centerleft";
orientation = "1";
drivernode0 {
pcl_id = "v4l2_sensor";
devname = "tc358746a e-000e";
proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/tc358746a@0e";
};
};
module2 {
badge = "itarge_cgc_mipi2";
position = "centerright";
orientation = "1";
drivernode0 {
pcl_id = "v4l2_sensor";
devname = "tc358746a e-000f";
proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/tc358746a@0f";
};
};
};
};
};
but when I run camera capture,the debug is :
[ 59.872303] tegra_channel_mipi_cal 736
[ 60.066752] video4linux video0: frame start syncpt timeout!0
[ 60.072630] video4linux video0: tegra_channel_ring_buffer line 383 state is not VB2_BUF_STATE_DONE
and find in byte offset: 0x838 [1:0] has configured 3 == 4 data lanes
whtat's wrong with DTS changed ?
Thank you!