Hello,
I have finish developed my camera driver for 24.1 kernel version. Now I want to update to 24.2.1 for getting more performance on deep learning and using NVIDIA multimedia APIs.
After spent time on L4T R24.2 Documentation I got to port driver to new kernel.
I added one dtsi file for my camera modules.
This is my dtsi:
/*
* Copyright (c) 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; version 2 of the License.
*
* 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.
*
*/
#include <dt-bindings/media/camera.h>
#include <dt-bindings/platform/t210/t210.h>
#define CAM0_RST_L TEGRA_GPIO(S, 4)
#define CAM0_PWDN TEGRA_GPIO(S, 7)
#define CAM1_RST_L TEGRA_GPIO(S, 5)
#define CAM1_PWDN TEGRA_GPIO(T, 0)
/ {
/* set camera gpio direction to output */
gpio: gpio@6000d000 {
camera-control {
gpio-output-low = <
CAM0_RST_L
CAM0_PWDN
CAM1_RST_L
CAM1_PWDN
>;
};
};
/* all cameras are disabled by default */
host1x {
vi_base: vi {
num-channels = <2>;
ports {
#address-cells = <1>;
#size-cells = <0>;
vi_port0: port@0 { /*CSI A*/
status = "okay";
reg = <0>;
vi_in0: endpoint {
status = "okay";
csi-port = <0x0>;
bus-width = <4>;
remote-endpoint = <&imx135_out0>;
clock-lanes = <0>;
data-lanes = <1 2 3 4>;
};
};
vi_port1: port@1 { /*CSI C*/
status = "okay";
vi_in1: endpoint {
status = "okay";
csi-port = <0x2>;
bus-width = <4>;
remote-endpoint = <&ar0261_out0>;
clock-lanes = <0>;
data-lanes = <1 2 3 4>;
};
};
};
vi_port2: port@2 {
status = "disabled";
vi_in2: endpoint {
status = "disabled";
};
};
vi_port3: port@3 {
status = "disabled";
vi_in3: endpoint {
status = "disabled";
};
};
vi_port4: port@4 {
status = "disabled";
vi_in4: endpoint {
status = "disabled";
};
};
vi_port5: port@5 {
status = "disabled";
vi_in5: endpoint {
status = "disabled";
};
};
};
};
i2c@546c0000 {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
imx135_a@0E {
compatible = "imx135_v4l2";
reg = <0x0E>;
sensor_model ="imx135";
avdd-reg = "vana";
iovdd-reg = "vif";
devnode = "video0";
post_crop_frame_drop = "0";
mclk = "cam_mclk1";
vana-supply = <&en_vdd_cam_hv_2v8>;
vif-supply = <&en_vdd_cam>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
imx135_out0: endpoint {
csi-port = <0>;
bus-width = <4>;
remote-endpoint = <&vi_in0>;
};
};
};
};
ar0261_a@0F {
compatible = "ar0261_v4l2";
reg = <0x0F>;
sensor_model ="ar0261";
avdd-reg = "vana";
iovdd-reg = "vif";
devnode = "video1";
post_crop_frame_drop = "0";
mclk = "cam_mclk1";
vana-supply = <&en_vdd_cam_hv_2v8>;
vif-supply = <&en_vdd_cam>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
ar0261_out0: endpoint {
csi-port = <2>;
bus-width = <4>;
remote-endpoint = <&vi_in0>;
};
};
};
};
};
tcp: tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
modules {
cam_module0: module0 {
badge = "imx135";
position = "left";
orientation = "1";
status = "okay";
drivernode0 {
pcl_id = "v4l2_sensor";
devname = "imx135 6-0036";
proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/imx135_a@0E";
status = "okay";
};
cam_module0_drivernode1: drivernode1 {
status = "okay";
pcl_id = "v4l2_focuser_stub";
proc-device-tree = "";
};
};
cam_module1: module1 {
badge = "ar0261";
position = "right";
orientation = "1";
status = "okay";
drivernode0 {
pcl_id = "v4l2_sensor";
devname = "ar0261 6-0036";
proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/ar0261_a@0E";
status = "okay";
};
cam_module1_drivernode1: drivernode1 {
status = "okay";
pcl_id = "v4l2_focuser_stub";
proc-device-tree = "";
};
};
};
};
};
I also enabled these configs :
CONFIG_SOC_CAMERA=y
CONFIG_SOC_CAMERA_PLATFORM=y
CONFIG_SOC_CAMERA_AR0261=y
CONFIG_SOC_CAMERA_IMX135=y
And I modified imx135_v4l2.c and ar0261_v4l2.c as my 2 camera drivers. Finally, I rebuild, update new kernel and dtbs for my device. The log result is below
[ 4.379423] vi vi: vi_probe: ++
[ 4.391393] vi vi: initialized
[ 4.391883] vi vi: parsing node /host1x/vi
[ 4.391889] vi vi: handling endpoint /host1x/vi/ports/port@0/endpoint
[ 4.391958] vi vi: handling endpoint /host1x/vi/ports/port@1/endpoint
[ 4.391993] vi vi: parsing node /i2c@546c0000/imx135_a@0E
[ 4.391998] vi vi: handling endpoint /i2c@546c0000/imx135_a@0E/ports/port@0/endpoint
[ 4.392019] vi vi: parsing node /i2c@546c0000/ar0261_a@0F
[ 4.392024] vi vi: handling endpoint /i2c@546c0000/ar0261_a@0F/ports/port@0/endpoint
It look like my camera drivers (imx135_v4l2 and ar0261_v4l2) are not probed. As L4T R24.2 Documentation , we should modify board file arch/arm64/mach-tegra/board-t210ref-camera.c but I think we no need and this document is out of date because we done everything in device tree.
Please help me to continue.
Thanks