I2c mux tca9548 for imx462

I will be able to check what you suggested next week.
meanwhile, do you think it worth to use CONFIG_DYNAMIC_DEBUG for this issue?

hello matanh,

CONFIG_DYNAMIC_DEBUG also enable the capability to enable/disable dev_dbg() from user-space.
you may give it a try, however, those prints regarding to registration has failed all using with dev_err

Here, When the IMX doesn’t loaded:

xx@xx-desktop:~$ sudo media-ctl -p -d /dev/media0
Media controller API version 5.10.104

Media device information
------------------------
driver          tegra-camrtc-ca
model           NVIDIA Tegra Video Input Device
serial
bus info
hw revision     0x3
driver version  5.10.104

Device topology
- entity 1: 13e10000.host1x:nvcsi@15a00000- (2 pads, 0 link)
            type V4L2 subdev subtype Unknown flags 0
        pad0: Sink
        pad1: Source

And here when the imx works:

xx@xx-desktop:~$ sudo media-ctl -p -d /dev/media0
Media controller API version 5.10.104

Media device information
------------------------
driver          tegra-camrtc-ca
model           NVIDIA Tegra Video Input Device
serial
bus info
hw revision     0x3
driver version  5.10.104

Device topology
- entity 1: 13e10000.host1x:nvcsi@15a00000- (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
        pad0: Sink
                <- "eimx462 8-0042":0 [ENABLED]
        pad1: Source
                -> "vi-output, eimx462 8-0042":0 [ENABLED]

- entity 4: eimx462 8-0042 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev1
        pad0: Source
                [fmt:SGBRG12_1X12/1920x1080 field:none colorspace:srgb]
                -> "13e10000.host1x:nvcsi@15a00000-":0 [ENABLED]

- entity 6: vi-output, eimx462 8-0042 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "13e10000.host1x:nvcsi@15a00000-":1 [ENABLED]

hello matanh,

it’s media-ctl to verify the port binding results.
please review Port Binding section to check the port binding for VI (video input), NvCSI, and sensor modules.

Hello again.
The device tree is already attached. (I must say that I don’t understand the ping-pong. I tried to put all the data in the firsts threads, but I keep asked about info I already give.)

The manual tree, and the examples on the kernel doesn’t match. this is the manual:

vi {
    num-channels = <1>;
        ports {
        #address-cells = <1>;
        #size-cells = <0>;
            port@0 {
                reg = <0>;
                liimx185_vi_in0: endpoint {
                port-index = <2>;
                bus-width = <4>;
                remote-endpoint = <&liimx185_csi_out0>;
            };
        };
    };
};

nvcsi {
    num-channels = <1>;
    #address-cells = <1>;
    #size-cells = <0>;
    channel@0 {
        reg = <0>;
        ports {
            #address-cells = <1>;
            #size-cells = <0>;
            port@0 {
                reg = <0>;
                liimx185_csi_in0: endpoint@0 {
                    port-index = <0>;
                    bus-width = <4>;
                    remote-endpoint = <&liimx185_imx185_out0>;
                };
            };
            port@1 {
                reg = <1>;
                liimx185_csi_out0: endpoint@1 {
                    remote-endpoint = <&liimx185_vi_in0>;
                };
            };
        };
    };
};

But in the kernel itself its: (I took the imx318 as example)

tegra-capture-vi {
		num-channels = <1>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;
				e3331_vi_in0: endpoint {
					port-index = <0>;
					bus-width = <3>;
					remote-endpoint = <&e3331_csi_out0>;
				};
			};
		};
	};

	host1x@13e00000 {
		nvcsi@15a00000 {
			num-channels = <1>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						e3331_csi_in0: endpoint@0 {
							port-index = <0>;
							bus-width = <3>;
							remote-endpoint = <&e3331_imx318_out0>;
						};
					};
					port@1 {
						reg = <1>;
						e3331_csi_out0: endpoint@1 {
							remote-endpoint = <&e3331_vi_in0>;
						};
					};
				};
			};
		};
	};

again:
vi->port@0->liimx185_vi_in0: endpoint
nvcsi->channel@0->port@0->liimx185_csi_in0: endpoint@0
_________________->port@1->liimx185_csi_out0: endpoint@1

vs

tegra-capture-vi->ports ->port@0->e3331_vi_in0: endpoint
host1x@13e00000 ->nvcsi@15a00000->channel@0 ->ports->port@0 ->e3331_csi_in0: endpoint@0
__________________________________________________________port@1->e3331_csi_out0: endpoint@1

I guess the 'kernel ’ version is correct

you’re checking wrong sources, E3331 it’s actually the camera board with IMX318 camera sensor.

The same hierarchy is in the ‘tegra194-camera-rbpcv2-imx219.dtsi’ too. and in all the other dt for cameras. the E3331 IMX318 was only one example.

the documentation just don’t fit the code

hello matanh,

as I checking the path, it’s under i2c@3180000.
is it device tree overlays to overwrite your settings? please also examine the sysnodes.
for example,
$ cat proc/device-tree/__symbols__/tca95*
/i2c@3180000/tca9546@70
/i2c@3180000/tca9548@77

 xx@xx-desktop:~$ cat proc/device-tree/__symbols__/tca95*
 cat: 'proc/device-tree/__symbols__/tca95*': No such file or directory

I guess you ment:

xx@xx-desktop:~$ cat /proc/device-tree/__symbols__/tca9548_70
/i2c@31e0000/tca9548@70xx@xx-desktop:~$

@JerryChang , any ideas?

hello matanh,

that’s something wrong with the device topology,
is it device tree overlays to overwrite your settings? please try removing all overlay files for testing, i.e. /boot/*.dtbo

@JerryChang I removed all dtbo.
that didn’t help. same behavior. the tca9548 has i2c@3/eimx462_d@42. and yet the imx462 doesn’t try to load.

when overlay is active, does it reflected on /proc/device-tree?

yes.

How can I debug the attempts, and registration of modules? specifically cameras to tegra-camera-platform?
is it possible to make tegra-camera-platform to ko module, so I will be able to upload new debug versions with debug prints?

hello matanh,

tegra-camera-platform{} it’s device tree settings, which is came from the device tree binary, i.e. tegra194-p3668-all-p3509-0000.dtb.
there’s an option to load device tree binary from file system. you may review /boot/extlinux/extlinux.conf , it’s FDT entry to load the device tree binary from file system. you may revise the extlinux.conf by adding a new boot options for loading your customize dtb, or updating the default FDT entry to point-to your customize dtb.

moreover,
please searching around, there’re some similar topics for using tca9548,
for example,
Not detecting GMSL 2 camera using i2cdetect.
Jetson TX2 TCA9548 I2C switch and TCA6408 I2C GPIO Expander.
I2C for 4 MIPI CSI cameras with custom carrier board.

about changing the device tree by changing file name in extlinux.conf. I aware and using it.
I have read and followed the threads you mentioned, the device tree I use is according to their notes. can you look at the device tree and suggest what is wrong there?

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

Sorry for the late response, have you managed to get issue resolved or still need the support? Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.