Hello,
I am having issues interfacing a VCM driver (focuser) that is available on my camera module (IMX214).
I am using the Jetson TX2 device with an Auvidea J140 daughter board and three IMX214 camera modules that integrate the DW9714 VCM driver.
The camera sensors work fine and my goal is to interface the focuser so we can acquire quality images.
My problem is that I cannot find a proper example for the TX2 platform. I have studied the Sensor Driver Programming (v28.2) and the part where focuser properties are described is not available. I found the said information in an older document (Tegra Linux Driver Package Development Guide v27.1).
In addition, the device-tree files available in the source have confused me even more…
As an example I looked at the device tree for the E3323 camera module. Looking at the files for both Jetson TX1 and TX2 I found that they use a different approach and I am unsure as what to implement.
For example :
In the device tree for TX1 the focuser (LC898212) is assigned a port, properties and a device node.
/ {
host1x {
vi {
num-channels = <2>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
e3323_vi_in0: endpoint {
csi-port = <0>;
bus-width = <4>;
remote-endpoint = <&e3323_csi_out0>;
};
};
port@1 {
reg = <1>;
e3323_vi_in1: endpoint {
csi-port = <2>;
bus-width = <4>;
remote-endpoint = <&e3323_csi_out1>;
};
};
};
};
nvcsi {
num-channels = <1>;
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
e3323_csi_in0: endpoint@0 {
csi-port = <0>;
bus-width = <4>;
remote-endpoint = <&e3323_ov23850_out0>;
};
};
port@1 {
reg = <1>;
e3323_csi_out0: endpoint@1 {
remote-endpoint = <&e3323_vi_in0>;
};
};
};
};
};
i2c@546c0000 {
ov23850_a@10 {
compatible = "nvidia,ov23850";
reg = <0x10>;
physical_w = "7.3998";
physical_h = "5.5998";
avdd-reg = "vana";
dvdd-reg = "vdig";
iovdd-reg = "vif";
vcmvdd-reg = "vvcm";
devnode = "video0";
mode0 { // OV23850_MODE_5632X3168
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_a";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "5632";
active_h = "3168";
pixel_t = "bayer_bggr";
readout_orientation = "270";
line_length = "5922";
inherent_gain = "1";
mclk_multiplier = "25";
pix_clk_hz = "600000000";
min_gain_val = "1.0";
max_gain_val = "15.5";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "3.09135";
max_framerate = "30";
min_exp_time = "19.74";
max_exp_time = "323094";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
e3323_ov23850_out0: endpoint {
csi-port = <0>;
bus-width = <4>;
remote-endpoint = <&e3323_csi_in0>;
};
};
};
};
lc898212@72 {
compatible = "nvidia,lc898212";
reg = <0x72>;
devnode = "video2";
type = "default";
min_focus_distance = "10.0"; /* 1.0f/0.1f */
hyper_focal = "0.2"; /* 1.0f/5.0f */
focal_length = "4.73";
f_number = "2.2";
aperture = "2.2";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
e3323_lc898212_out0: endpoint {
remote-endpoint = <&e3323_vi_in2>;
};
};
};
};
};
};
tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
num_csi_lanes = <4>;
max_lane_speed = <1500000>;
min_bits_per_pixel = <10>;
vi_peak_byte_per_pixel = <2>;
vi_bw_margin_pct = <25>;
max_pixel_rate = <750000>;
isp_peak_byte_per_pixel = <5>;
isp_bw_margin_pct = <25>;
modules {
module0 {
badge = "e3323_bottom_CH06P1";
position = "bottom";
orientation = "3";
drivernode0 {
pcl_id = "v4l2_sensor";
devname = "ov23850 6-0010";
proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/ov23850_a@10";
};
drivernode1 {
pcl_id = "v4l2_focuser";
devname = "lc898212 6-0072";
proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/lc898212@72";
};
};
};
};
};
{
host1x {
i2c@546c0000 {
ov23850_a@10 {
clocks = <&tegra_car TEGRA210_CLK_CLK_OUT_3>;
clock-names = "clk_out_3";
clock-frequency = <24000000>;
mclk = "clk_out_3";
reset-gpios = <&gpio CAM0_RST_L GPIO_ACTIVE_HIGH>; pwdn-gpios = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
vana-supply = <&en_vdd_cam_hv_2v8>;
vdig-supply = <&en_vdd_cam_1v2>;
vif-supply = <&en_vdd_cam>;
vvcm-suply = <&en_vdd_vcm_2v8>;
};
lc898212_1: lc898212@72 {
vvcm-supply = <&en_vdd_vcm_2v8>;
support_mfi = "true";
};
};
};
}
Now the driver for the TX2 is as follows :
/ {
host1x {
vi@15700000 {
num-channels = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
e3323_vi_in0: endpoint {
csi-port = <0>;
bus-width = <4>;
remote-endpoint = <&e3323_csi_out0>;
};
};
};
};
nvcsi@150c0000 {
num-channels = <1>;
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
e3323_csi_in0: endpoint@0 {
csi-port = <0>;
bus-width = <4>;
remote-endpoint = <&e3323_ov23850_out0>;
};
};
port@1 {
reg = <1>;
e3323_csi_out0: endpoint@1 {
remote-endpoint = <&e3323_vi_in0>;
};
};
};
};
};
};
i2c@3180000 {
ov23850_a@10 {
compatible = "nvidia,ov23850";
reg = <0x10>;
physical_w = "7.3998";
physical_h = "5.5998";
avdd-reg = "vana";
dvdd-reg = "vdig";
iovdd-reg = "vif";
vcmvdd-reg = "vvcm";
devnode = "video0";
mode0 { // OV23850_MODE_5632X3168
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_a";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "5632";
active_h = "3168";
pixel_t = "bayer_bggr";
readout_orientation = "270";
line_length = "5922";
inherent_gain = "1";
mclk_multiplier = "25";
pix_clk_hz = "600000000";
min_gain_val = "1.0";
max_gain_val = "15.5";
min_hdr_ratio = "1";
max_hdr_ratio = "64";
min_framerate = "3.09135";
max_framerate = "30";
min_exp_time = "19.74";
max_exp_time = "323094";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
e3323_ov23850_out0: endpoint {
csi-port = <0>;
bus-width = <4>;
remote-endpoint = <&e3323_csi_in0>;
};
};
};
};
};
e3323_lens_ov23850@CH06P1 {
min_focus_distance = "10.0"; /* 1.0f/0.1f */
hyper_focal = "0.2"; /* 1.0f/5.0f */
focal_length = "4.73";
f_number = "2.2";
aperture = "2.2";
};
tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
num_csi_lanes = <4>;
max_lane_speed = <1500000>;
min_bits_per_pixel = <10>;
vi_peak_byte_per_pixel = <2>;
vi_bw_margin_pct = <25>;
max_pixel_rate = <600000>;
isp_peak_byte_per_pixel = <5>;
isp_bw_margin_pct = <25>;
modules {
module0 {
badge = "e3323_bottom_CH06P1";
position = "bottom";
orientation = "3";
drivernode0 {
pcl_id = "v4l2_sensor";
devname = "ov23850 2-0010";
proc-device-tree = "/proc/device-tree/i2c@3180000/ov23850_a@10";
};
drivernode1 {
pcl_id = "v4l2_lens";
proc-device-tree = "/proc/device-tree/e3323_lens_ov23850@CH06P1/";
};
};
};
};
};
/ {
i2c@3180000 {
ov23850_a@10 {
clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH1>,
<&tegra_car TEGRA186_CLK_PLLP_OUT0>;
clock-names = "extperiph1", "pllp_grtba";
mclk = "extperiph1";
reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>; //also for VCM_2V8 en
pwdn-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
vana-supply = <&en_vdd_cam_hv_2v8>;
vdig-supply = <&en_vdd_sys>;
vif-supply = <&en_vdd_cam>;
vvcm-suply = <&en_vdd_vcm_2v8>;
};
};
fixed-regulators {
en_vdd_sys: regulator@118 {
enable-active-high;
};
};
};
For a first glance I cannot understand how the TX2 device tree knows on which I2C it communicates with the focuser. Furthermore, it is configured as lens and not focuser (like the TX1).
One question is what CH06P1 stands for ?
And another one, where is e3323_lens_ov23850 defined ?
I based my device tree on the TX1 example whcih clearly states that it’s a focuser. Is there something similar for the TX2 ?
The device tree files can be downloaded from the following links
https://www.dropbox.com/s/gxg5go4anr2pei0/tegra186-camera-imx214-a00.dtsi?dl=0
https://www.dropbox.com/s/pjr7r7y0bl1wsti/tegra186-quill-camera-imx214-a00.dtsi?dl=0
While I got no compilation errors, the focuser device did not show up as a video device and the feedback I get from dmesg is :
tegra-vi4 1570000.vi: invalid port number 0 on /i2c@3160000/dw9714_a@0c
Can you provide any assistance as to how to develop the driver/device-tree for the TX2 or even an example of a device-tree for a camera module with a focuser ? Do you see something wrong with the device-tree files I use ?
Please do not refer me to the Sensor Driver Programming Guide as I have studied the document and as said previously, I cannot find the required information.
Here at Augmenta Agriculture we are basing our entire product line on the TX2 platform and it’s critical to be able to remedy this issue and get proper support.
Thank you in advance for your assistance.
Pavlos