Custom camera module with vcm and eeprom

Hello All,

I’m developing custom camera module.

it has vcm and eeprom.

Reference Camera device driver doesn’t include vcm.

So how to make device driver for VCM and EEPROM.

thanks,

hello jpchae,

  1. you would like to add focus, right?
    Argus disable auto focus algorithm by default,
    we can support manual focus if sending focus position based-on the analysis done by the Argus provided sharpness map.

  2. may I know what’s the usage of your EEPROM, is it using as a look-up-table for focuser moving to its position?

1 Like

hello JerrChang,

  1. you would like to add focus, right?
    Argus disable auto focus algorithm by default,
    we can support manual focus if sending focus position based-on the analysis done by the Argus provided sharpness map.

→ Does that mean you don’t need to use vcm?
please let me know how to use the manual focus?

  1. may I know what’s the usage of your EEPROM, is it using as a look-up-table for focuser moving to its position?

→ It was provided by the camera module, so I figured out that I had to set it up.
If necessary, it would be good to save the focus position information.

thanks,

hello jpchae,

it’s Argus API can be used to set manual focus position, for example, FocuserPosition.
however, you’ll still need to have implementation in the kernel side to add driver supports.

hello JerryChang,

I have question about making VCM driver in jetson TX2.
Refering to lc898212 driver, I have made my VCM driver and device tree to register v4l2 sub-device.
device probing was registered. I checked video0 in dev folder.

Execution failed when executing the gst-launch command as shown below.

livsmed@livsmed-desktop:~/Documents$ gst-launch-1.0 nvarguscamerasrc sensor-id=0 aelock=1 ee-mode=1 ee-strength=0 tnr-strength=0 tnr-mode=1  exposurecompensation=1 ! 'video/x-raw(memory:NVMM), width=4624, height=3472, framerate=18/1, format=NV12' ! nvvidconv flip-method=0 ! xvimagesink -e
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Error generated. /media/snchen/project/project/32.5/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:688 No cameras available

(gst-launch-1.0:9051): GStreamer-CRITICAL **: 11:13:24.616: gst_mini_object_set_qdata: assertion 'object != NULL' failed
Got EOS from element "pipeline0".
Execution ended after 0:00:00.044520837
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

I think there’s a problem with device tree.
I attached device tree below.
please Could you help me review device tree?

 / {
	host1x {
		vi@15700000 {
			num-channels = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx686_vi_in0: endpoint {
						port-index = <4>;
						bus-width = <4>;
						remote-endpoint = <&imx686_csi_out0>;
					};
				};

				port@1 {

					reg = <1>;
					imx686_vi_in1: endpoint {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&imx686_dw9800w_out0>;
					};
				};


			};
		};

		nvcsi@150c0000 {
			num-channels = <1>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						imx686_csi_in0: endpoint@0 {
							port-index = <4>;
							bus-width = <4>;
							remote-endpoint = <&imx686_imx686_out0>;
						};
					};

					port@1 {
						reg = <1>;
						imx686_csi_out0: endpoint@1 {
							remote-endpoint = <&imx686_vi_in0>;
						};
					};

				};
			};

		};
	};

	i2c@3180000 {

//
		dw9800w@0c {
			compatible = "nvidia,dw9800w";
			reg = <0x0c>;



		////	vvcm-supply = <&en_vdd_vcm_2v8>;
			///support_mfi = "true";

			// physical camera layer interface tags 
			devnode = "video1";
			//
			// Type specifies the control features supported by
			// the focuser driver.
			// default type means only position control setting
			// supported by the focuser
			//
			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>;
					imx686_dw9800w_out0: endpoint {
					//	port-index = <0>;
					//	bus-width = <4>;
						remote-endpoint = <&imx686_vi_in1>;
					};
				};
			};

		};
//			
		imx686_e@10 {
			compatible = "nvidia,imx686";

			reg = <0x10>;

			/* Physical dimensions of sensor */
			physical_w = "8.638";
			physical_h = "6.460";

			sensor_model ="imx686";

			/* Define any required hw resources needed by driver */
			/* ie. clocks, io pins, power sources */
			avdd-reg = "vana";
			iovdd-reg = "vif";
			dvdd-reg = "vdig";



			mode0 {/*mode imx686_MODE_4624x3472_CROP_18FPS*/
				mclk_khz = "24000";
				num_lanes = "4";
				tegra_sinterface = "serial_e";
				phy_mode = "DPHY";
	
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";

				/*dynamic_pixel_bit_depth = "12";*/
				csi_pixel_bit_depth = "10";
				mode_type = "bayer";
				pixel_phase = "rggb";

				active_w = "4624";  
				active_h = "3472";  
				readout_orientation = "0";
				line_length = "13856"; 
				inherent_gain = "1";
				mclk_multiplier = "37.5";
				pix_clk_hz = "900000000";

				gain_factor = "1000000";
				min_gain_val = "1000000"; /* dB */
				max_gain_val = "36000000"; /* dB */
				step_gain_val = "1"; /* 0.3 */
				default_gain = "1000000";
				min_hdr_ratio = "";
				max_hdr_ratio = "";
				framerate_factor = "1000000";
				min_framerate = "4000000";
				max_framerate = "18000000";
				step_framerate = "1";
				default_framerate = "18000000";
				exposure_factor = "1000000";
				min_exp_time = "34"; /* us, 2 lines*/
				max_exp_time = "550385"; /* us */
				step_exp_time = "1";
				default_exp_time = "55555";/* us */
				embedded_metadata_height = "2";
			};


			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx686_imx686_out0: endpoint {
						port-index = <4>;
						bus-width = <4>;
						remote-endpoint = <&imx686_csi_in0>;
					};
				};
			};
		};		

			

	};


};

/ {

	tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";

		num_csi_lanes = <4>;
		max_lane_speed = <2500000>;
		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 {
				status = "okay";
				badge = "imx686_rear";
				position = "rear";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "imx686 2-0010";
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@3180000/imx686_e@10";
				};
//
				drivernode1 {
					// Declare PCL support driver (classically known as guid)  
					pcl_id = "v4l2_focuser";
					// Driver v4l2 device name 
					devname = "dw9800w 2-000c";
					// Declare the device-tree hierarchy to driver instance 
					proc-device-tree = "/proc/device-tree/i2c@3180000/dw9800w@c";
				};
//
			};

		};
	};
};

is it possible to adjust focus in Jetson multi-media api ?

Hi jpchae,

Please help to open a new topic if it’s still an issue to support.

Thanks