ADV7393 drivers

Hi,

I try to make my ADV7393 work with apalis imx6.

I use the last realease 2.8b6 and compile a custom kernel with adv7393 driver enabled.

That add the adv7393 driver adv7393.c « i2c « media « drivers - kernel/git/torvalds/linux.git - Linux kernel source tree
But i don’t know how to use it.

I don’t need the i2c part because the imx6 i2c is not connected to ADV7393. I drive the i2c with a FPGA.
I only need the video ouput compatibility.

Regards

hi @mazareth

But i don’t know how to use it.
I don’t need the i2c part because the imx6 i2c is not connected to ADV7393. I drive the i2c with a FPGA. I only need the video ouput compatibility.

Actually you need to connect the i2c part to iMX6 and do the correct configuration. If everything is correctly done, then a v4l2 device should be created under /dev. Once the device appears, then you will be able to use this device in Linux.

In your current configuration, it is not possible to use this device.

Best regards,
Jaski

Hi @jaski.tx ,
Could you tell me which I2C is used for device exploration?

The I2C1 is connected to an FPGA and i could emulate the ADV7393.
But i don’t see any I2C access at ADV7393 address.

I think is I2C2 with DDC. I check.
EDIT 09/05/2019 : I2C2(DDC) don’t send any message on boot.
=> I2C activity is correctly detected with this command:
i2cset -y 0 0x20 255

regards

@mazareth: Which I2C did you configure in devicetree?

Sorry for my inexperience but I configure no I2C port in device tree.
my process is :
make apalis_imx6_defconfig
make nconfig
check the Multimedia support / I2C Encoders,decoders,sensor and other helper chips/ADV7393 video encoder option
finish the kernel compilation

I’m not expert in linux kernel and i don’t find documentation about this part.

hi @mazareth

You did correct to enable the driver for the kernel. Additionally you need to create a node in the devicetree as described in the Documentation/devicetree/bindings/media/i2c/adv7343.txt file.

For further Information about Device Tree Customization read the following Developer Article.

Best regards,
Jaski

hi @jaski.tx

nothing better here.

I tried to change the file nano ./arch/arm/boot/dts/imx6qdl-apalis-eval.dtsi

        /* advanten add ADV7393 */
        adv7393@2a {
                compatible = "adi,adv7393";
                reg = <0x2a>;

        };

like this example http://web.mit.edu/freebsd/head/sys/gnu/dts/arm/imx6qdl-gw54xx.dtsi

but i see no access on I2C0 on apalis boot.

Could you share the complete changed file?

I @jaski.tx
I have the ADV7393 driver installed

root@apalis-imx6:~# dmesg | grep 2a
[    0.280654] mxc_mipi_csi2 21dc000.mipi_csi: i.MX MIPI CSI2 dphy version is 0x3130302a
[    2.354070] adv7393 1-002a: chip found @ 0x54 (21a


[    2.354070] adv7393 1-002a: chip found @ 0x54 (21a0000.i2c)
[    2.374366] random: fast init done
[    2.393079] mxc_v4l2_output v4l2_out: V4L2 device registered as video16
[    2.405010] mxc_v4l2_output v4l2_out: V4L2 device registered as video17

I want to use it with gstreamer.
Could you help me or redirect me to someone?

I need to modify my dtsi again to have access to ADV7393 in V4L2

nano ./arch/arm/boot/dts/imx6qdl-apalis-eval.dtsi 


        v4l2_cap_1 { // second parallel camera
                compatible = "fsl,imx6q-v4l2-capture";
                ipu_id = <1>;
                csi_id = <1>;
                mclk_source = <0>;
                status = "okay";
        };

        v4l2_cap_2 { // mipi-csi2 camera
                compatible = "fsl,imx6q-v4l2-capture";
                ipu_id = <0>;
                csi_id = <1>;
                mclk_source = <0>;
                status = "okay";
        };
#if 0
        v4l2_out {
                compatible = "fsl,mxc_v4l2_output";
                status = "okay";
        };
#endif
/*
 * GEN1_I2C: I2C1_SDA/SCL on MXM3 209/211 (e.g. RTC on carrier
 * board)
 */
&i2c1 {
        status = "okay";

        /* advanten add ADV7393 */
        adv7393@2a {
                compatible = "adi,adv7393";
                reg = <0x2a>;
        };

HI @mazareth

Sorry for the delayed answer.
I think you need to provide the optional properties too in your devicetree as written in the Documentation.

Further, do you see a new device appearing under /dev?

hi @jaski.tx
The ADV7393 is installed according to Analog device team with this command.

But I can not use it yet.
I need to make a V4L2 bridge.

In order to register ADV7393 as a V4L2 sub-device besides defining it as an I2C device you have to bind it to a V4L2 bridge device.

I have /dev/video16 and /dev/video17

What i found in imx6qdl-apalis.dtsi :

lcd: lcd@0 {
compatible = “fsl,lcd”;
ipu_id = <0>;
disp_id = <1>;
default_ifmt = “RGB24”;
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_ipu1_lcdif>;
status = “disabled”;

in imx6qdl-apalis-eval.dtsi

v4l2_cap_0 {
compatible = “fsl,imx6q-v4l2-capture”;
ipu_id = <0>;
csi_id = <0>;
mclk_source = <0>;
status = “okay”;
};

v4l2_cap_1 { // second parallel camera
	compatible = "fsl,imx6q-v4l2-capture";
	ipu_id = <1>;
	csi_id = <1>;
	mclk_source = <0>;
	status = "okay";
};

v4l2_cap_2 { // mipi-csi2 camera
	compatible = "fsl,imx6q-v4l2-capture";
	ipu_id = <0>;
	csi_id = <1>;
	mclk_source = <0>;
	status = "okay";
};

v4l2_out {
	compatible = "fsl,mxc_v4l2_output";
	status = "okay";
};

hi @mazareth

But I can not use it yet. I need to make a V4L2 bridge.

I am not sure why you need this. Could you explain your current system? Is the adv7393 an output or input for the apalis iMX6?

Please share your kernel config and the output of dmesg | grep fb?

Thanks and best regards,
Jaski

@jaski.tx
kernel 2.8b6

with dtsi modified as explain before

with I2C for ADV7393 activated in “make nconfig” command

ADV7393 is an output apalis I2C is directly connected to ADV7393

dmesg | grep fb return

root@apalis-imx6:~# dmesg | grep fb
[    0.000000] Kernel command line: vmalloc=400M user_debug=30 ip=off root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait fec_mac=00:14:2d:4e:e8:e0 consoleblank=0 no_console_suspend=1 console=tty1 console=ttymxc0,115200n8 mxc_hdmi.only_cea=1 video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off fbmem=32M
[    0.575158] fbcvt: 1920x1080@60: CVT Name - 2.073M9
[    0.575283] mxc_sdc_fb fb@0: registered mxc display driver hdmi
[    0.590022] mxc_sdc_fb fb@0: 1920x1080 h_sync,r,l: 44,88,148  v_sync,l,u: 5,4,36 pixclock=148500000 Hz
[    0.646793] mxc_sdc_fb fb@0: 1920x1080 h_sync,r,l: 44,88,148  v_sync,l,u: 5,4,36 pixclock=148500000 Hz
[    0.729929] mxc_sdc_fb fb@1: mxcfb1 is turned off!
[    0.730086] mxc_sdc_fb fb@2: mxcfb2 is turned off!
[    0.730234] mxc_sdc_fb fb@3: mxcfb3 is turned off!
[    5.991710] systemd-journald[214]: File /var/log/journal/5209d4a699c840a6a0bec48cfb6dcad5/system.journal corrupted or uncleanly shut down, renaming and replacing.
[    9.904866] mxc_sdc_fb fb@0: 1920x1080 h_sync,r,l: 44,88,148  v_sync,l,u: 5,4,36 pixclock=148500000 Hz
[   10.018195] mxc_sdc_fb fb@0: 1920x1080 h_sync,r,l: 44,88,148  v_sync,l,u: 5,4,36 pixclock=148500000 Hz
[   10.076773] mxc_sdc_fb fb@0: 1920x1080 h_sync,r,l: 44,88,148  v_sync,l,u: 5,4,36 pixclock=148500000 Hz
[   10.137224] mxc_sdc_fb fb@0: 1920x1080 h_sync,r,l: 44,88,148  v_sync,l,u: 5,4,36 pixclock=148500000 Hz
[   10.893177] mxc_sdc_fb fb@0: 1920x1080 h_sync,r,l: 44,88,148  v_sync,l,u: 5,4,36 pixclock=148500000 Hz

For ADV7393

root@apalis-imx6:~# dmesg | grep adv7393
[    2.354165] adv7393 1-002a: chip found @ 0x54 (21a0000.i2c)
root@apalis-imx6:~# dmesg | grep v4l2
[    2.393130] mxc_v4l2_output v4l2_out: V4L2 device registered as video16
[    2.405066] mxc_v4l2_output v4l2_out: V4L2 device registered as video17

I don’t know how make gstreamer send on /dev/videoxx

7oot@apalis-imx6:~# gst-launch-1.0 videotestsrc ! imxv4l2sink device=/dev/video17
====== IMXV4L2SINK: 4.4.2 build on Apr  1 2019 14:38:50. ======
Setting pipeline to PAUSED ...
display(/dev/fb0) resolution is (1920x1080).
Pipeline is PREROLLING ...
v4l2sink need allocate 3 buffers.
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:11.363385334
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...

hi @mazareth

Thanks for the Information.

As said before, we don’t have experience with adv7393. Thus I can only give give you suggestion with the Information, I have found.

  1. Either you output the video to the display output from iMX6 where the Adv7393 is connected and use the i2c driver/commands to correctly configure adv7393 for the output settings you want.
  2. Or you can compile a custom kernel with adv7393_fb enabled and redirect the video to the new Framebuffer called adv7393_fb as discussed here.

Best regards,
Jaski

Hi @jaski.tx

Thanks for your reply,

We will still work on it for a while. Without result we will give up the project.

Regards

Hi @mazareth

Thanks for your Input. We are sorry that we cannot help you more.

Best regards,
Jaski