Nothing appears in the media entity

Hi, i’m used custom board.
I’m now trying to porting and using the MAX96724, but it is not working well.
Here is my devicetree

i2c@c250000 {
		max96724@4e {
			compatible = "nvidia,max96724";
			reg = <0x4e>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;	
				port@0{
					reg = <0>;
					max96724_out0: endpoint{
						status = "okay";
						port-index = <0>;
						bus-width = <2>;
						remote-endpoint = <&max96724_csi_in0>;
					};
				};
			};
		};
	};
/*
	tegra-capture-vi {
		num-channels = <1>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;
				max96724_vi_in0: endpoint {
					status = "okay";
					port-index = <0>;
					bus-width = <2>;
					remote-endpoint = <&max96724_csi_out0>;
				};
			};
		};
	};
*/
	host1x@13e00000 {
		status = "okay";
		vi@15700000 {
			status = "okay";
			num-channels = <1>;
			ports {
				reg = <0>;
				max96724_vi_in0: endpoint {
					port-index = <2>;
					bus-width = <4>;
					remote-endpoint = <&max96724_csi_out0>;
				};
			};

		};
		nvcsi@15a00000 {
			status = "okay";
			num-channels = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						max96724_csi_in0: endpoint@0 {
							status = "okay";
							port-index = <0>;
							bus-width = <2>;
							remote-endpoint = <&max96724_out0>;
						};
					};
					port@1 {
						reg = <1>;
						max96724_csi_out0: endpoint@1 {
							remote-endpoint = <&max96724_vi_in0>;
						};
					};
				};
			};
		};
	};	
	tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";
		num_csi_lanes = <1>;
		max_lane_speed = <3000000>;
		min_bits_per_pixel = <10>;
		vi_peak_byte_per_pixel = <2>;
		vi_bw_margin_pct = <25>;
		isp_peak_byte_per_pixel = <5>;
		isp_bw_margin_pct = <25>;
		
		modules {
			module0 {
				badge = "max96724_bottom";
				position = "bottom";
				orientation = "0";
				drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "max96724";
					proc-device-tree = "/proc/device-tree/i2c@c250000/max96724@27";
				};
			};
		};
	};

And, this is the part where max96724 is registered as v4l2.

sd = &priv->subdev;
	v4l2_i2c_subdev_init(sd, client, &max96724_subdev_ops);

		sd->internal_ops = &max96724_internal_ops;
		sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
		priv->pad.flags = MEDIA_PAD_FL_SOURCE;
		sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
		ret = media_entity_pads_init(&sd->entity, 1, &priv->pad);
		if (ret < 0)
			dev_err(dev, "v4l2 media entity pads init failed\n");

	v4l2_set_subdevdata(sd, priv);

	snprintf(sd->name, sizeof(sd->name), "max96724");
	ret = v4l2_async_register_subdev_sensor_common(sd);
	if (!ret) {
		dev_err(dev, "%scamera sensor driver registered\n",sd->name);
	}

I tried “media-ctl -p -d /dev/media0”
image

Could you please give me some advice?
Thank you

Using tegra-capture-vi instead of vi@15700000

I tried your solution but, it’s not working…

Please reference to nv_imx274 for the device tree and driver to figure out the problem.

Thanks

I’m not using an image sensor, but initializing the image sensor and serdes in the deserializer.

You can just reference to the _probe() function to generate the video node.

Thanks

Is the reason it is not captured by media-ctl because of devicetree?

Device tree look fine. Suspect it could be the driver problem.

Hi Shance,
I am now making the functions in the probe similar to nv_imx274.
However, I want to set it up myself regarding register.
image
As shown in the picture above, among the various configs and options, can you know only the necessary ones?

Suppose the sensor_ops and v4l2sd_internal_ops are must have.

If you check the current imx185 example code, it appears that mclk is received from the internal crystal, so it seems to connect the camera and board through the MIPI interface.
I’m trying to use it through GMSL. Is there a reference code for this?
Also, regarding reset, it has a hardware function.
Currently, if you use that reference code, you will experience a kernel panic.

There’s max9295/max9296 but these sample only initial the max9x9x chip and configure didn’t register any media/video node in the system.
If your design don’t need mclk and any others power pin you can remove it from the driver to avoid problems.

Thanks

Hi, shane
i tried remove mclk and anyt others power pin but it’s still occured kernel panic

You should able see which line cause the panic to fix it.

Thanks

Okay, I’ll give it a try and let you know the results.

I’m still trying. but, it’s occured kernel panic.


This is my max96724 probe() function

image
image

Can you give me some advice for this situation?
Thank you.

Looks like miss something in the tc_dev structure while call the tegracam_device_register()

As a result of debugging this part, it seems that a kernel panic occurs in the camera_common_find_pixelfmt function.
Can you give me some advice on this?

What’s the pixel format report by your driver?
Suppose your driver need report the pixel format like below.

                                       mode0 {
                                                discontinuous_clk = "no";
                                                readout_orientation = [30 00];
                                                exposure_factor = "1000000";
                                                mclk_khz = "37125";
                                                phy_mode = "DPHY";
                                                default_gain = [30 00];
                                                dpcm_enable = "false";
                                                max_gain_val = "480";
                                                framerate_factor = "1000000";
                                                min_hdr_ratio = [31 00];
                                                num_lanes = [34 00];
                                                max_framerate = "30000000";
                                                min_gain_val = [30 00];
                                                pixel_phase = "rggb";
                                                mode_type = "bayer";
                                                pix_clk_hz = "74250000";
                                                step_gain_val = [33 00];
                                                cil_settletime = [30 00];
                                                default_exp_time = "33334";
                                                active_h = "1080";
                                                max_exp_time = "660000";
                                                dynamic_pixel_bit_depth = "12";
                                                active_w = "1920";
                                                min_exp_time = "30";
                                                max_hdr_ratio = [31 00];
                                                min_framerate = "1500000";
                                                mclk_multiplier = [32 00];
                                                step_exp_time = [31 00];
                                                default_framerate = "30000000";
                                                csi_pixel_bit_depth = "12";
                                                step_framerate = [31 00];
                                                inherent_gain = [31 00];
                                                embedded_metadata_height = [31 00];
                                                line_length = "2200";
                                                tegra_sinterface = "serial_a";
                                                gain_factor = "10";
                                        };

Currently I have not submitted the pixel format.
Is the mode0 format you provided required?