Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4634

Interfacing (DSI, CSI, I2C, etc.) • Video-Mux - Media Pad Link Problem

$
0
0
Hey,

I am currently working on multiplexing two MIPI sensors on the CSI1 port of a CM4. On the hardware side I am using a Diodes PI3WVR626 for the CSI signals and a TI TS3A24159 for the I2C signals.

Since I am using custom sensors I did come up with the following device tree overlay, based on the camera-mux-2port-overlay.dts. For better readability I omitted a few minor details.

Code:

/{compatible = "brcm,bcm2835";fragment@0 {target = <&soc>;__overlay__ {            i2cmux {                compatible = "i2c-mux-gpio";                #address-cells = <1>;                #size-cells = <0>;                mux-gpios = <&gpio_0x21 1 0>;                i2c-parent = <&i2c1>;                                i2c@0 {                    reg = <0>;                    #address-cells = <1>;                    #size-cells = <0>;                                        [...]                                        ar0830_CSI1: ar0830_CSI1@36 {                        compatible = "onsemi,ar0830";                        reg = <0x36>;                        status = "okay";                        [...]                        port {                            ar0830_CSI1_0_ep: endpoint {                                remote-endpoint = <&mux_in0>;                                clock-lanes = <0>;                                data-lanes = <1 2>;                                clock-noncontinuous;                                link-frequencies =                                    /bits/ 64 <594000000>;                            };                        };                    };                };                i2c@1 {                    reg = <1>;                    #address-cells = <1>;                    #size-cells = <0>;                                        [...]                                        imx568_CSI1: imx568_CSI1@1a {                        compatible = "sony,imx568";                        reg = <0x1a>;                        status = "okay";                        [...]                        port {                            imx568_CSI1_1_ep: endpoint {                                remote-endpoint = <&mux_in1>;                                clock-lanes = <0>;                                data-lanes = <1 2>;                                clock-noncontinuous;                                link-frequencies =                                    /bits/ 64 <594000000>;                            };                        };                    };                                    };            };};    };    fragment@1 {target = <&csi1>;__overlay__ {status = "okay";port {csi1_ep: endpoint {remote-endpoint = <&mux_out>;clock-lanes = <0>;data-lanes = <1 2>;clock-noncontinuous;};};};};fragment@2 {target = <&i2c1>;__overlay__ {pinctrl-0 = <&i2c1_gpio44>;};};        fragment@3 {target-path="/";__overlay__ {mux: mux-controller {compatible = "gpio-mux";#mux-control-cells = <0>;mux-gpios = <&gpio_0x21 2 0>;};video-mux {compatible = "video-mux";mux-controls = <&mux>;#address-cells = <1>;#size-cells = <0>;port@0 {reg = <0>;mux_in0: endpoint {                        remote-endpoint = <&ar0830_CSI1_0_ep>;                        clock-lanes = <0>;                        data-lanes = <1 2>;                        clock-noncontinuous;};};port@1 {reg = <1>;mux_in1: endpoint {                        remote-endpoint = <&imx568_CSI1_1_ep>;                        clock-lanes = <0>;                        data-lanes = <1 2>;                        clock-noncontinuous;};};port@2 {reg = <2>;mux_out: endpoint {remote-endpoint = <&csi1_ep>;clock-lanes = <0>;                        data-lanes = <1 2>;                        clock-noncontinuous;};};};};};        fragment@4 {target = <&gpio>;__overlay__ {mipi_sw_oe_hog {gpio-hog;gpios = <&gpio_0x21 3 0>;output-high;};};};        [...]    };
This basically works well. Everything is initialized correctly and detected trough the Media Controller API:

Code:

root@unknown:~# media-ctl -pMedia controller API version 5.4.83Media device information------------------------driver          unicammodel           unicamserialbus info        platform:fe801000.csihw revision     0x0driver version  5.4.83Device topology- entity 1: video-mux (3 pads, 2 links)            type V4L2 subdev subtype Unknown flags 0            device node name /dev/v4l-subdev0        pad0: Sink                [fmt:Y8_1X8/1x1 field:none]                -> "unicam-image":0 [ENABLED,IMMUTABLE]        pad1: Sink                [fmt:Y8_1X8/1x1 field:none]                -> "unicam-embedded":0 [ENABLED,IMMUTABLE]        pad2: Source                [fmt:Y8_1X8/1x1 field:none]- entity 5: AR0830 (2 pads, 0 link)            type V4L2 subdev subtype Sensor flags 0            device node name /dev/v4l-subdev1        pad0: Source                [fmt:SGBRG8_1X8/3840x2160 field:none colorspace:raw xfer:none ycbcr:601 quantization:full-range]        pad1: Source                [fmt:unknown/16384x2 field:none]- entity 8: IMX568 (2 pads, 0 link)            type V4L2 subdev subtype Sensor flags 0            device node name /dev/v4l-subdev2        pad0: Source                [fmt:Y8_1X8/2472x2064 field:none colorspace:raw xfer:none ycbcr:601 quantization:full-range                 crop.bounds:(0,0)/2472x2064                 crop:(0,0)/2472x2064]        pad1: Source                [fmt:unknown/16384x1 field:none                 crop.bounds:(0,0)/2472x2064                 crop:(0,0)/2472x2064]- entity 11: unicam-image (1 pad, 1 link)             type Node subtype V4L flags 1             device node name /dev/video0        pad0: Sink                <- "video-mux":0 [ENABLED,IMMUTABLE]- entity 17: unicam-embedded (1 pad, 1 link)             type Node subtype V4L flags 0             device node name /dev/video1        pad0: Sink                <- "video-mux":1 [ENABLED,IMMUTABLE]
However, somehow the links got messed up. The unicams sinks are linked to the video-mux sinks and since they are immutable I am not able to change them.
Can somebody help me to fix the links or tell me how to change them/set them correctly? I am bit lost.

Thank you!

Statistics: Posted by marcp — Wed Jan 15, 2025 1:51 pm — Replies 0 — Views 21



Viewing all articles
Browse latest Browse all 4634

Trending Articles