Different devname showing in dmesg

Hi. I’ve build a driver for a custom camera in the TX2, connected to the camera expansion header. I’ve flashed it, loaded the driver as module, and it is not crashing. Indeed, it successfully executes the probe() function. Anyway, in the device tree, I’ve defined the devname as “cam2000 1-0024”, and in the kernel messages (dmesg), its showing as “cam2000 2-0024”. Moreover, it is not appearing in /dev as /video0, which I think the devname discrepancy may be related to it. Why is this happening? Any idea?

The dmesg show the camera you define under i2c bus 2
BTW current should not support loadable module for camera driver. Should be support on next release.

Hi ShaneCCC,
Which release do you mean by current? I’m using JetPack 4.2.1 (R32.2). Instead of loading it as module, should I include it as builtin in the kernel? May that be the reason why it is not being shown in /dev/?

Before next release the default framework not support loadable module.
I would suggest implement it as builtin module to clarify it first.

Same result. I’ve included the driver as builtin, it gets probed with no errors, and yet it’s not shown in /dev/. When is the device included as video0? After getting probed?

Have a check below document to check your device tree.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fcamera_sensor_prog.html%23

I’ve reviewed the device tree, and seems ok for me. This is what I’m using as dtsi file, located in <hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-modules/> directory, and included in <hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-base.dts> file, commenting the plugin manager as follows (following the “Using the Main Platform Device Tree File” for device registration suggested in the sensor driver programming guide):

//#include <t18x-common-plugin-manager/tegra186-quill-camera-plugin-manager.dtsi>
#include <t18x-common-modules/tegra186-camera-cam2000-a00.dtsi>

The device tree:

#include "dt-bindings/clock/tegra186-clock.h"
#define CAM0_RST_L	TEGRA_MAIN_GPIO(R, 5)
#define CAM0_PWDN	TEGRA_MAIN_GPIO(R, 0)
/ {

	gpio@2200000 {
		camera-control-output-low {
			gpio-hog;
			output-low;
			gpios = <CAM0_RST_L 0 CAM0_PWDN 0>;
			label = "cam0-rst", "cam0-pwdn";
		};
	};

	host1x {
		vi@15700000 {
			num-channels = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					/* VI block input */
					cam2000_vi_in0: endpoint {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&cam2000_csi_out0>;
					};
				};
			};
		};

		nvcsi@150c0000 {
			num-channels = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					/* NVCSI block input */
					port@0 {
						reg = <0>;
						cam2000_csi_in0: endpoint@0 {
							port-index = <0>;
							bus-width = <4>;
							remote-endpoint = <&cam2000_out0>;
						};
					};
					/* NVCSI block output */
					port@1 {
						reg = <1>;
						cam2000_csi_out0: endpoint@1 {
							remote-endpoint = <&cam2000_vi_in0>;
						};
					};
				};
			};
		};
	};
};

/ {
	i2c@3180000 {
		cam2000_a@24 {
			compatible = "THH,cam2000";
			reg = <0x24>;
			devnode = "video0";
			physical_w = "10.85";
			physical_h = "5.76";
			avdd-reg = "vana";
			iovdd-reg = "vif";
			sensor_model ="cam2000";
			clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH1>,
					 <&tegra_car TEGRA186_CLK_PLLP_OUT0>;
			clock-names = "extperiph1", "pllp_grtba";
			mclk = "extperiph1";
			clock-frequency = <24000000>;
			reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
			pwdn-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
			vana-supply = <&en_vdd_cam_hv_2v8>;
			vif-supply = <&en_vdd_cam>;

			mode0 {
				mclk_khz = "24000";
				num_lanes = "4";
				tegra_sinterface = "serial_a";
				phy_mode = "DPHY";
				discontinuous_clk = "yes";
				dpcm_enable = "false";
				cil_settletime = "0";
				csi_pixel_bit_depth = "10";
				mode_type = "bayer";
				pixel_phase = "rggb";
				active_w = "2048";
				active_h = "1088";
				readout_orientation = "0";
				line_length = "2200";
				inherent_gain = "1";
				mclk_multiplier = "6.67";
				pix_clk_hz = "160000000";
				gain_factor = "10";
				min_gain_val = "10";
				max_gain_val = "160";
				step_gain_val = "1";
				default_gain = "10";
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				framerate_factor = "1000000";
				min_framerate = "1500000";
				max_framerate = "338000000";
				step_framerate = "1";
				default_framerate = "282000000";
				exposure_factor = "1000000";
				min_exp_time = "15";
				max_exp_time = "660000";
				step_exp_time = "1";
				default_exp_time = "2500";
				embedded_metadata_height = "1";
			};
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					cam2000_out0: endpoint {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&cam2000_csi_in0>;
					};
				};
			};
		};
	};
};

/ {
	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 = <160000>;
		isp_peak_byte_per_pixel = <5>;
		isp_bw_margin_pct = <25>;
		modules {
			module0 {
				badge = "cam2000_bottom_THH";
				position = "bottom";
				orientation = "0";
				drivernode0 {
					/* PCL support driver (classically known as guid) */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "cam2000 1-0024";
					/* Device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@3180000/cam2000_a@24";
				};
			};
		};
	};
};

Not sure if it matters, but the speed of the mipi lane is 1.2Gbps. As mentioned before, devname = “cam2000 1-0024”, but in dmesg its shown as cam2000 2-0024, which makes no sense for me

You need to change the devname t0 “cam2000 2-0024” although it may not the root cause for the video node not gen.
Have you disable the plugin manager as the doc said. Have a confirm the context of /proc/device-tree are exactly as your DTB. Also you may need to add some satus = “okay”

I’ve added some status = “okay” in the device tree, changed the devname to “cam2000 2-0024” and checked that the /proc/device-tree is exactly as my DTB.

According to the plugin manager, the includes in the main dts file are the following ones:

#include <t18x-common-platforms/tegra186-quill-common-p3310-1000-a00.dtsi>
#include <t18x-common-platforms/tegra186-quill-power-tree-p3310-1000-a00-00.dtsi>
#include <t18x-common-platforms/tegra186-quill-camera-modules.dtsi>
#include <t18x-common-modules/tegra186-display-e3320-1000-a00.dtsi>

/* comms dtsi file should be included after gpio dtsi file */
#include <t18x-common-platforms/tegra186-quill-comms.dtsi>
#include <t18x-common-plugin-manager/tegra186-quill-p3310-1000-a00-plugin-manager.dtsi>
#include <t18x-common-modules/tegra186-super-module-e2614-p2597-1000-a00.dtsi>
#include <t18x-common-plugin-manager/tegra186-quill-display-plugin-manager.dtsi>
#include <t18x-common-prod/tegra186-priv-quill-p3310-1000-a00-prod.dtsi>
//#include <t18x-common-plugin-manager/tegra186-quill-camera-plugin-manager.dtsi>
#include <t18x-common-modules/tegra186-camera-cam2000-a00.dtsi>

Still I get the same result.

Should I comment more includes?

Also comment the tegra186-quill-camera-modules.dtsi you may hit compiler error I think you can fix it.