How to modify dts to support 4 x imx219 through tca9546 I2C?

  1. Now we have a Nano base plate

  2. Extended two CSI’s

  3. Four IMX 219s are controlled by TCA 9546

how to modify dts ?

Have a reference to …/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-modules/tegra186-camera-e3322-a00.dtsi

this is for TX2 , not for Nano ?

base “porg-plugin-manager/tegra210-porg-plugin-manager.dtsi” of nano dts for dual imx219, Modify the following:

		override@6 {
			target = <&cam_module0_drivernode0>;
			_overlay_ {
				status = "okay";
				pcl_id = "v4l2_sensor";
				devname = "imx219 7-0010";
				//proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10";
				proc-device-tree = "/proc/device-tree/i2c@546c0000/tca9546@70/i2c@0/rbpcv2_imx219_a@10";
			};
		};


		override@10 {
			target = <&cam_module1_drivernode0>;
			_overlay_ {
				status = "okay";
				pcl_id = "v4l2_sensor";
				devname = "imx219 8-0010";
				//proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/rbpcv2_imx219_e@10";
				proc-device-tree = "/proc/device-tree/i2c@546c0000/tca9546@70/i2c@1/rbpcv2_imx219_e@10";
			};
		};


/* gpio based i2c mux */
			override@29 {
				//target = <&{/cam_i2cmux}>;
				target = <&tca9546@70>;
				_overlay_ {
					status = "okay";
				};
			};

“kernel-dts/porg-platforms/tegra210-porg-camera-rbpcv2-dual-imx219.dtsi”
Modify the following:

//cam_i2cmux {
	i2c@546c0000 {
       tca9546@70 {
		//compatible = "i2c-mux-gpio";
		compatible = "nxp,pca9546";
		reg = <0x70>;
		#address-cells = <1>;
		#size-cells = <0>;
		//mux-gpios = <&gpio CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
		//i2c-parent = <&i2c7>;
		//status = "disabled";

		force_bus_start = <CAMERA_I2C_MUX_BUS(0)>;

“kernel-dts/porg-platforms/kernel-dts/porg-platforms/tegra210-camera-rbpcv2-dual-imx219.dtsi”
Modify the following:

//	cam_i2cmux {

    i2c@546c0000 {
       tca9546@70 {


modules {
			cam_module0: module0 {
				badge = "porg_front_RBPCV2";
				position = "front";
				orientation = "1";
				cam_module0_drivernode0: drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx219 30-0010";
					proc-device-tree = "/proc/device-tree/i2c@546c0000/tca9546@70/i2c@0/rbpcv2_imx219_a@10";
				};
				cam_module0_drivernode1: drivernode1 {
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_imx219@RBPCV2/";
				};
			};
			cam_module1: module1 {
				badge = "porg_rear_RBPCV2";
				position = "rear";
				orientation = "1";
				cam_module1_drivernode0: drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx219 31-0010";
					proc-device-tree = "/proc/device-tree/i2c@546c0000/tca9546@70/i2c@1/rbpcv2_imx219_e@10";
				};
				cam_module1_drivernode1: drivernode1 {
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_imx219@RBPCV2/";
				};
			};
		};

Is it OK to modify according to the above ??

But I made a compilation error !!

You can reference to it even it’s for TX2. Also please fixed the compile error by yourself.