SOC_CAMERA driver in L4T R24.1

You should use NULL, otherwise you have add consumer-device after the vdig.

devm_regulator_get(NULL, "vdig");


regulator-consumer-supply = "vdig";
regulator-consumer-device = "0-004C";  i2c bus 0 slave addres 0x4c

Hi ShaneCCC,

If I use NULL as the first approach. It stuck here 30s and reset

[    3.696070] Unable to handle kernel NULL pointer dereference at virtual address 00000240
[    3.696073] pgd = ffffffc00007d000
[    3.696080] [00000240] *pgd=000000017fc05003, *pmd=000000017fc06003, *pte=00e0000050041407
[    3.696085] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[    3.696088] Enter nvdumper_crash_setup_regs
[    3.696098] nvdumper: all registers are saved.
[    3.696100] nvdumper: all registers are saved.
[    3.777123] nvdumper: all registers are saved.
[    3.782759] nvdumper: all registers are saved.
[    3.782815] hub 2-0:1.0: 4 ports detected
[    3.793478] Modules linked in:
[    3.797658] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.10.96 #23
[    3.804915] task: ffffffc0ffe36b80 ti: ffffffc0ffe38000 task.ti: ffffffc0ffe38000
[    3.814847] PC is at _raw_spin_lock_irqsave+0x28/0x64
[    3.821205] LR is at _raw_spin_lock_irqsave+0x24/0x64
[    3.827503] pc : [<ffffffc000b461d8>] lr : [<ffffffc000b461d4>] pstate: 80000185
[    3.837414] sp : ffffffc0ffe3bba0
[    3.841975] x29: ffffffc0ffe3bba0 x28: 0000000000000000 
[    3.848573] x27: 0000000000000000 x26: 0000000000000000 
[    3.855171] x25: 0000000000000000 x24: 0000000000000000 
[    3.861750] x23: 0000000000000000 x22: ffffffc0fcbb5618 
[    3.868286] x21: 0000000000000000 x20: 0000000000000100

Otherwise if I use the second

c2 {
         regulator-consumer-supply = "vdig";
         regulator-consumer-device = "6-010C";
};
isx017_power_get
regulator_get() failed for (6-0010,vdig), -19
isx017_v4l2 6-0010: Failed to get regulator vdig

May I didn’t use correct I2C address?

Thanks

You should use 6-0010 instead of 6-010C. And should be the regulator_get(NULL, “vdig”) instead of devm_regulator_get();

Hi ShaneCCC,

If I use regulator_get(NULL, “vdig”) errors gone however some camera functions (isx017_s_power, isx017_s_fmt, …) that should be run but never run. And when I tried /dev/video0 with any v4l2 tools, nothing work.

If I change I2C address to 6-010C, I still get this error

isx017_power_get
regulator_get() failed for (6-0010,vdig), -19
isx017_v4l2 6-0010: Failed to get regulator vdig

How can we know I2C address exactly?
Thanks

This isx017_v4l2 6-0010 log show the i2c client address.
Make sure this regulator control a necessary power for you sensor, if not you can wave it.
You can probe the signal to confirm the NULL use case can control the power. If yes the failed should not cause the regulator get.

Hi ShaneCCC,

I tried to touch my finger to camera and see that it’s hot as working in previous kernel so I think power is OK now. But maybe something still not work.

Thanks

Check the log and make the v4l2-ctl/v4l2-compliance test pass first.

Hi ShaneCCC,

After some modification, I have same issue with RiteshPanchal. I run this command then nothing output and can not stop:

v4l2-ctl --list-formats

I have one question, is there any people success making YUV sensor work well on 24.2.1 kernel version?

Hi ShaneCCC,

I figure out the reason and I can capture image now with this command :

v4l2-ctl -d /dev/video0 -w --verbose --set-fmt-video=width=1280,height=720,pixelformat=UYVY --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test.yuv

I also share my modification here for other uyvy sensor developer. Almost driver source is same with @RiteshPanchal, only change a little on “power_get” function, it should have these lines:

mclk_name = "default_mclk"; //To me it's "default_mclk", maybe need to change in other side
pw->mclk = devm_clk_get(&priv->i2c_client->dev, mclk_name);
if (IS_ERR(pw->mclk)) {
	dev_err(&priv->i2c_client->dev,
	"unable to get clock %s\n", mclk_name);
	return PTR_ERR(pw->mclk);
}

However I still have some errors with VIDIOC_S_FMT as below

ubuntu@tegra-ubuntu:~$     v4l2-compliance -d /dev/video0
Driver Info:
	Driver name   : tegra-video
	Card type     : vi-output-0, isx017 6-0010
	Bus info      : platform:vi:0
	Driver version: 3.10.96
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
	test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
	test second video open: OK
	test VIDIOC_QUERYCAP: OK
	test VIDIOC_G/S_PRIORITY: OK

Debug ioctls:
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
	test VIDIOC_G/S/ENUMINPUT: OK
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
	test VIDIOC_G/S_EDID: OK (Not Supported)

Test input 0:

	Control ioctls:
		test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
		test VIDIOC_QUERYCTRL: OK
		test VIDIOC_G/S_CTRL: OK
		test VIDIOC_G/S/TRY_EXT_CTRLS: OK
		test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
		test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
		Standard Controls: 1 Private Controls: 1

	Format ioctls:
		test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
		test VIDIOC_G/S_PARM: OK (Not Supported)
		test VIDIOC_G_FBUF: OK (Not Supported)
		test VIDIOC_G_FMT: OK
		fail: v4l2-test-formats.cpp(662): Video Capture is valid, but no TRY_FMT was implemented
		test VIDIOC_TRY_FMT: FAIL
		warn: v4l2-test-formats.cpp(933): S_FMT cannot handle an invalid pixelformat.
		warn: v4l2-test-formats.cpp(934): This may or may not be a problem. For more information see:
		warn: v4l2-test-formats.cpp(935): http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html
		fail: v4l2-test-formats.cpp(947): S_FMT cannot handle an invalid format
		test VIDIOC_S_FMT: FAIL
		test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
		test Cropping: OK (Not Supported)
		test Composing: OK (Not Supported)
		fail: v4l2-test-formats.cpp(1406): doioctl(node, VIDIOC_S_FMT, &fmt)
		fail: v4l2-test-formats.cpp(1503): doioctl(node, VIDIOC_S_FMT, &fmt)
		test Scaling: FAIL

	Codec ioctls:
		test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
		test VIDIOC_G_ENC_INDEX: OK (Not Supported)
		test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

	Buffer ioctls:
		test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
		test VIDIOC_EXPBUF: OK

Test input 0:

Total: 42, Succeeded: 39, Failed: 3, Warnings: 3

Hi
You may need to add your format to below check list in the “camera_common_try_fmt()” locate kernel/drivers/media/platform/tegra/camera/camera_common.c

camera_common_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf)

	if (mf->code != V4L2_MBUS_FMT_SRGGB8_1X8 &&
		mf->code != V4L2_MBUS_FMT_SRGGB10_1X10) {
		mf->code = V4L2_MBUS_FMT_SRGGB10_1X10;
		err = -EINVAL;
	}

Hi ShaneCCC,

After adding, warning disappear but fail still here :D.

static const struct camera_common_colorfmt camera_common_color_fmts[] = {
	{
		V4L2_MBUS_FMT_SRGGB12_1X12,
		V4L2_COLORSPACE_SRGB,
		V4L2_PIX_FMT_SRGGB12,
	},
	{
		V4L2_MBUS_FMT_SRGGB10_1X10,
		V4L2_COLORSPACE_SRGB,
		V4L2_PIX_FMT_SRGGB10,
	},
	{
		V4L2_MBUS_FMT_SRGGB8_1X8,
		V4L2_COLORSPACE_SRGB,
		V4L2_PIX_FMT_SRGGB8,
	},
	{
		V4L2_MBUS_FMT_UYVY8_2X8,
		V4L2_COLORSPACE_JPEG,
		V4L2_PIX_FMT_UYVY,
	},
};
if (mf->code == V4L2_MBUS_FMT_SRGGB8_1X8 || mf->code == V4L2_MBUS_FMT_SRGGB10_1X10) {
	mf->field = V4L2_FIELD_NONE;
	mf->colorspace = V4L2_COLORSPACE_SRGB;
} else if (mf->code == V4L2_MBUS_FMT_UYVY8_2X8) {
	mf->field = V4L2_FIELD_NONE;
	mf->colorspace = V4L2_COLORSPACE_JPEG;
} else {
	mf->code = V4L2_MBUS_FMT_SRGGB10_1X10;
	mf->field = V4L2_FIELD_NONE;
	mf->colorspace = V4L2_COLORSPACE_SRGB;
	err = -EINVAL;
}
ubuntu@tegra-ubuntu:~$ v4l2-compliance -d /dev/video0
Driver Info:
	Driver name   : tegra-video
	Card type     : vi-output-0, isx017 6-0010
	Bus info      : platform:vi:0
	Driver version: 3.10.96
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
	test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
	test second video open: OK
	test VIDIOC_QUERYCAP: OK
	test VIDIOC_G/S_PRIORITY: OK

Debug ioctls:
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
	test VIDIOC_G/S/ENUMINPUT: OK
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
	test VIDIOC_G/S_EDID: OK (Not Supported)

Test input 0:

	Control ioctls:
		test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
		test VIDIOC_QUERYCTRL: OK
		test VIDIOC_G/S_CTRL: OK
		test VIDIOC_G/S/TRY_EXT_CTRLS: OK
		test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
		test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
		Standard Controls: 1 Private Controls: 1

	Format ioctls:
		test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
		test VIDIOC_G/S_PARM: OK (Not Supported)
		test VIDIOC_G_FBUF: OK (Not Supported)
		fail: v4l2-test-formats.cpp(329): pixelformat != V4L2_PIX_FMT_JPEG && colorspace == V4L2_COLORSPACE_JPEG
		fail: v4l2-test-formats.cpp(432): testColorspace(pix.pixelformat, pix.colorspace, pix.ycbcr_enc, pix.quantization)
		test VIDIOC_G_FMT: FAIL
		test VIDIOC_TRY_FMT: OK (Not Supported)
		test VIDIOC_S_FMT: OK (Not Supported)
		test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
		test Cropping: OK (Not Supported)
		test Composing: OK (Not Supported)
		fail: v4l2-test-formats.cpp(1406): doioctl(node, VIDIOC_S_FMT, &fmt)
		fail: v4l2-test-formats.cpp(1503): doioctl(node, VIDIOC_S_FMT, &fmt)
		test Scaling: FAIL

	Codec ioctls:
		test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
		test VIDIOC_G_ENC_INDEX: OK (Not Supported)
		test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

	Buffer ioctls:
		test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
		fail: v4l2-test-buffers.cpp(571): q.has_expbuf(node)
		test VIDIOC_EXPBUF: FAIL

Test input 0:


Total: 42, Succeeded: 39, Failed: 3, Warnings: 0

Why is JPEG should be SRGB?

} else if (mf->code == V4L2_MBUS_FMT_UYVY8_2X8) {
	mf->field = V4L2_FIELD_NONE;
	mf->colorspace = V4L2_COLORSPACE_JPEG;
} else {

If SRGB

{
	V4L2_MBUS_FMT_UYVY8_2X8,
	V4L2_COLORSPACE_SRGB,
	V4L2_PIX_FMT_UYVY,
},
if (mf->code == V4L2_MBUS_FMT_SRGGB8_1X8 || mf->code == V4L2_MBUS_FMT_SRGGB10_1X10) {
		mf->field = V4L2_FIELD_NONE;
		mf->colorspace = V4L2_COLORSPACE_SRGB;
	} else if (mf->code == V4L2_MBUS_FMT_UYVY8_2X8) {
		mf->field = V4L2_FIELD_NONE;
		mf->colorspace = V4L2_COLORSPACE_SRGB;
	} else {
		mf->code = V4L2_MBUS_FMT_SRGGB10_1X10;
		mf->field = V4L2_FIELD_NONE;
		mf->colorspace = V4L2_COLORSPACE_SRGB;
		err = -EINVAL;
	}

Nothing change

ubuntu@tegra-ubuntu:~$ v4l2-compliance -d /dev/video0
Driver Info:
	Driver name   : tegra-video
	Card type     : vi-output-0, isx017 6-0010
	Bus info      : platform:vi:0
	Driver version: 3.10.96
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
	test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
	test second video open: OK
	test VIDIOC_QUERYCAP: OK
	test VIDIOC_G/S_PRIORITY: OK

Debug ioctls:
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
	test VIDIOC_G/S/ENUMINPUT: OK
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
	test VIDIOC_G/S_EDID: OK (Not Supported)

Test input 0:

	Control ioctls:
		test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
		test VIDIOC_QUERYCTRL: OK
		test VIDIOC_G/S_CTRL: OK
		test VIDIOC_G/S/TRY_EXT_CTRLS: OK
		test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
		test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
		Standard Controls: 1 Private Controls: 1

	Format ioctls:
		test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
		test VIDIOC_G/S_PARM: OK (Not Supported)
		test VIDIOC_G_FBUF: OK (Not Supported)
		test VIDIOC_G_FMT: OK
		fail: v4l2-test-formats.cpp(662): Video Capture is valid, but no TRY_FMT was implemented
		test VIDIOC_TRY_FMT: FAIL
		warn: v4l2-test-formats.cpp(933): S_FMT cannot handle an invalid pixelformat.
		warn: v4l2-test-formats.cpp(934): This may or may not be a problem. For more information see:
		warn: v4l2-test-formats.cpp(935): http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html
		fail: v4l2-test-formats.cpp(947): S_FMT cannot handle an invalid format
		test VIDIOC_S_FMT: FAIL
		test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
		test Cropping: OK (Not Supported)
		test Composing: OK (Not Supported)
		fail: v4l2-test-formats.cpp(1406): doioctl(node, VIDIOC_S_FMT, &fmt)
		fail: v4l2-test-formats.cpp(1503): doioctl(node, VIDIOC_S_FMT, &fmt)
		test Scaling: FAIL

	Codec ioctls:
		test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
		test VIDIOC_G_ENC_INDEX: OK (Not Supported)
		test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

	Buffer ioctls:
		test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
		test VIDIOC_EXPBUF: OK

Test input 0:


Total: 42, Succeeded: 39, Failed: 3, Warnings: 3

Hi forever
You may need to put more log to figure out it.

Hi ShaneCCC,

After checking with v4l2 capture code, camera work well. However I have 2 cameras, each has its own driver.
I already defined video0 and video1 in device tree. But maybe something wrong with media layer link.
If I enable only isx017 (left camera/ /dev/video0) in device tree it work well. If I enable both, only /dev/video0 work but now /dev/video0 is right camera.
What should I change above code for second camera driver ?

#if defined(CONFIG_MEDIA_CONTROLLER)
	priv->pad.flags = MEDIA_PAD_FL_SOURCE;
	priv->subdev->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
	priv->subdev->entity.ops = &isx017_media_ops;
	err = media_entity_init(&priv->subdev->entity, 1, &priv->pad, 0);
	pr_info("[ISX017]: [vunguyen] Media Controller.\n");
	if (err < 0) {
		dev_err(&client->dev, "unable to init media entity\n");
		pr_info("[ISX017]: [vunguyen] unable to init media entity.\n");
		return err;
	}
#endif

My device tree

/* all cameras are disabled by default */
	host1x {
		vi {
			num-channels = <2>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 { /*CSI A*/
					status = "okay";
					reg = <0>;
					vi_in0: endpoint {
						status = "okay";
						csi-port = <0x0>;
						bus-width = <4>;
						remote-endpoint = <&isx017_out0>;
						clock-lanes = <0>;
						data-lanes = <1 2 3 4>;
					};
				};
				port@1 { /*CSI C*/
					status = "okay";
					reg = <0>;
					vi_in1: endpoint {
						status = "okay";
						csi-port = <0x2>;
						bus-width = <4>;
						remote-endpoint = <&mv9351_out0>;
						clock-lanes = <0>;
						data-lanes = <1 2 3 4>;
					};
				};
				port@2 {
					status = "disabled";
					reg = <0>;
				};
				port@3 {
					status = "disabled";
					reg = <0>;
				};
				port@4 {
					status = "disabled";
					reg = <0>;
				};
				port@5 {
					status = "disabled";
					reg = <0>;
				};
			};
		};
		i2c@546c0000 {
			status = "okay";
			#address-cells = <1>;
			#size-cells = <0>;
			ov5693_c@36 {
				status = "disabled";
			};
			isx017_6@10 {
				compatible = "nvidia,isx017_v4l2";
				reg = <0x10>;
				sensor_model ="isx017";
				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>;
						isx017_out0: endpoint {
							csi-port = <0>;
							bus-width = <4>;
							remote-endpoint = <&vi_in0>;
						};
					};
				};
			};
			mv9351_6@28 {
				compatible = "nvidia,mv9351_v4l2";
				reg = <0x28>;
				sensor_model ="mv9351";
				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>;
						mv9351_out0: endpoint {
							csi-port = <2>;
							bus-width = <4>;
							remote-endpoint = <&vi_in1>;
						};
					};
				};
			};					
		};
	};

	tcp: tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";
		modules {
			module0 {
				badge = "isx017";
				position = "rear";
				orientation = "1";
				status = "okay";
				drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "isx017 6-0010";
					proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/isx017_6@10";
					status = "okay";
				};
				drivernode1 {
					status = "okay";
					pcl_id = "v4l2_focuser_stub";
				};
			};	
			module1 {
				badge = "mv9351";
				position = "rear";
				orientation = "front";
				status = "okay";
				drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "mv9351 6-0028";
					proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/mv9351_6@28";
					status = "okay";
				};
				drivernode1 {
					status = "okay";
					pcl_id = "v4l2_focuser_stub";
				};
			};		
		};
	};
};

Thanks

There’s some error with your DT declaration. You need to change the position to front and orientation to 1

module1 {
				badge = "mv9351";
				position = "rear";
				orientation = "front";
				status = "okay";
				drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "mv9351 6-0028";
					proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/mv9351_6@28";
					status = "okay";
				};

Hi,

Sorry about my mistake. However after changing it still same.
Test result with v4l2 utils

v4l2-ctl --list-formats -d /dev/video0
[  161.226489] [vunguyen] isx017_power_on
ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type [  161.231746] [vunguyen] isx017_power_off
       : Video Capture
	Pixel Format: 'RGGB'
	Name        : RGRG.. GBGB..

	Index       : 1
	Type        : Video Capture
	Pixel Format: 'RG10'
	Name        : RGRG.. GBGB..

	Index       : 2
	Type        : Video Capture
	Pixel Format: 'RG12'
	Name        : RGRG.. GBGB..

	Index       : 3
	Type        : Video Capture
	Pixel Format: 'UYVY'
	Name        : YUV 4:2:2

	Index       : 4
	Type        : Video Capture
	Pixel Format: 'UYVY'
	Name        : YUV 4:2:2

	Index       : 5
	Type        : Video Capture
	Pixel Format: 'YUYV'
	Name        : YUV 4:2:2
v4l2-ctl --list-formats -d /dev/video1 
ioctl: VIDIOC_ENUM_FMT

Log

[    9.774401] vi vi: vi_probe: ++
[    9.782728] vi vi: initialized
[    9.788523] vi vi: parsing node /host1x/vi
[    9.794914] vi vi: handling endpoint /host1x/vi/ports/port@0/endpoint
[    9.803751] vi vi: handling endpoint /host1x/vi/ports/port@1/endpoint
[    9.812545] vi vi: parsing node /host1x/i2c@546c0000/isx017_6@10
[    9.820875] vi vi: handling endpoint /host1x/i2c@546c0000/isx017_6@10/ports/port@0/endpoint
[    9.831637] vi vi: parsing node /host1x/i2c@546c0000/mv9351_6@28
[    9.840041] vi vi: handling endpoint /host1x/i2c@546c0000/mv9351_6@28/ports/port@0/endpoint
[    9.850894] vi vi: subdev mv9351 6-0028 bound
[    9.857719] vi vi: subdev isx017 6-0010 bound
[    9.864517] vi vi: notify complete, all subdevs registered
[    9.872457] vi vi: creating links for entity isx017 6-0010
[    9.880430] vi vi: processing endpoint /host1x/i2c@546c0000/isx017_6@10/ports/port@0/endpoint
[    9.891568] vi vi: skipping channel port /host1x/i2c@546c0000/isx017_6@10:0
[    9.901165] vi vi: creating links for entity mv9351 6-0028
[    9.909297] vi vi: processing endpoint /host1x/i2c@546c0000/mv9351_6@28/ports/port@0/endpoint
[    9.920601] vi vi: skipping channel port /host1x/i2c@546c0000/mv9351_6@28:0
[    9.930349] vi vi: creating links for channels
[    9.937595] vi vi: processing endpoint /host1x/vi/ports/port@0/endpoint
[    9.947094] vi vi: creating link for channel vi-output-2
[    9.955298] vi vi: creating isx017 6-0010:0 -> vi-output-2:0 link
[    9.964320] vi vi: processing endpoint /host1x/vi/ports/port@1/endpoint
[    9.973939] vi vi: creating link for channel vi-output-2, isx017 6-0010
[    9.983579] vi vi: creating mv9351 6-0028:0 -> vi-output-2, isx017 6-0010:0 link

What’s showed by v4l2-ctl --list-devices ?

The device tree You may need to check this driver implementation.

Hi,

ubuntu@tegra-ubuntu:~$ v4l2-ctl --list-devices 
[ 1377.197838] [vunguyen] isx017_power_on
[ 1377.201630] [vunguyen] isx017_power_off
VIDIOC_QUERYCAP: failed: Inappropriate i[ 1377.206687] [vunguyen] isx017_power_on
octl for device
VIDIOC_QUERYCAP[ 1377.213421] [vunguyen] isx017_power_off
: failed: Inappropriate ioctl for device
vi-output-2, isx017 6-0010, isx (platform:vi:2):
	/dev/video0

vi-output-255 (platform:vi:255):
	/dev/video1
	/dev/v4l-subdev1
	/dev/v4l-subdev0

ubuntu@tegra-ubuntu:~$

I already implemented driver for the second camera and I can see some log from this driver. So I think driver is probed. Maybe something wrong make overlap.

Hi ShaneCCC,

Thank for your very good support. Now I can capture 2 cameras with v4l2. May I need your help on NVIDIA multimedia APIs. Because I want to shorten conversion time from UYVY to RGB, now I use openCV library and it take about 40ms/frame (1280x720) so I think it will be faster with NVIDIA multimedia APIs.

I have just tried to build argus and its samples, compile got no error. Then, I tried to run one simple app like argus_oneshot. It raised many errors as below

Failed to get camera devices
(Argus) Error EndOfFile: Unexpected error in reading socket (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 212)
(Argus) Error EndOfFile: Receive worker failure, notifying 1 waiting threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 287)
(Argus) Error InvalidState: Argus client is exiting with 1 outstanding client threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 304)
(Argus) Error EndOfFile: Receiving thread terminated with error (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadWrapper(), line 315)
(Argus) Error EndOfFile: Client thread received an error from socket (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 147)
(Argus) Error EndOfFile:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 101)

Do you think what should I do for making my camera driver be compatible to NVIDIA multimedia APIs.

Thanks
Vu Nguyen