Add ADV7393 support on linux v2.7

HI,
@max.tx you help me last time to make the patche https://community.nxp.com/docs/DOC-100657 work on my kernel v2.7 ( toradex_4.9-1.0.x-imx branch)

Could you say if it is possible to make this patch work too : https://community.nxp.com/docs/DOC-94019

Last topic :
https://www.toradex.com/community/questions/25932/imx6q-carrier-board-design.html

Regards

hi @mazareth

Did you follow the instructions of the link you provided?
Is something not working as expected?
What are you trying to do?
What is your application?

Best regards,
Jaski

The result of video detected as NTSC on output with the patch L4.9_HDMI_Interlaced_Mode_Patch.tar.bz2 given by @max.tx configuration setenv vidargs video=mxcfb0:dev=lcd,LCD-480I60,if=RGB24,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off fbmem=32M

ADV7393 configured with table 77 i2c_register_full_write(0x17,0x02); i2c_register_full_write(0x00,0x1C); i2c_register_full_write(0x01,0x00); i2c_register_full_write(0x80,0x10); i2c_register_full_write(0x82,0xCB); i2c_register_full_write(0x87,0x80); i2c_register_full_write(0x88,0x10); i2c_register_full_write(0x8A,0x0C);

Glitch and unreadable

https://youtu.be/_tqxos6wrhY

second video with gstreamer
https://youtu.be/WKIZ-Y-KYPQ

Really happy for your answer.

I’m checking that today.

@jaski.tx 10h06 02/05/2019
Do i need :
multimedia support/ Analog TV support ?

I found the driver for ADV7393 but in I2C part. Do i have the video output here or just i2c driver?
multimedia support/I2C encoders,decoders, sensor and other helper chips/ADV7393 video encoder

@jaski.tx 11h14 02/05/2019
What is the setenv configuration for PAL/NTSC for ADV7393?
i need something like that :
setenv vidargs video=mxcfb0:dev=lcd,LCD-PAL,if=RGB24,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off fbmem=32M

@jaski.tx 16h04 02/05/2019
i found that in drivers/video/fbdev/bfin_adv7393fb.c

static struct fb_fix_screeninfo bfin_adv7393_fb_fix = {
        .id = "BFIN ADV7393",
        .smem_len = 720 * 480 * 2,
        .type = FB_TYPE_PACKED_PIXELS,
        .visual = FB_VISUAL_TRUECOLOR,
        .xpanstep = 0,
        .ypanstep = 0,
        .line_length = 720 * 2,
        .accel = FB_ACCEL_NONE
};

so i tried that but BFIN ADV7393 is not recognized
setenv vidargs video=mxcfb0:dev=lcd,BFIN ADV7393,if=RGB24,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off fbmem=32M

Really happy for your answer.

I’m checking that today.

@jaski.tx 10h06 02/05/2019 Do i need : multimedia support/ Analog TV support ?

I found the driver for ADV7393 but in I2C part. Do i have the video output here or just i2c driver? multimedia support/I2C encoders,decoders, sensor and other helper chips/ADV7393 video encoder

@jaski.tx 11h14 02/05/2019 What is the setenv configuration for PAL/NTSC for ADV7393? i need something like that : setenv vidargs video=mxcfb0:dev=lcd,LCD-PAL,if=RGB24,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off fbmem=32M

@jaski.tx 16h04 02/05/2019 i found that in drivers/video/fbdev/bfin_adv7393fb.c

static struct fb_fix_screeninfo bfin_adv7393_fb_fix = {
.id = “BFIN ADV7393”,
.smem_len = 720 * 480 * 2,
.type = FB_TYPE_PACKED_PIXELS,
.visual = FB_VISUAL_TRUECOLOR,
.xpanstep = 0,
.ypanstep = 0,
.line_length = 720 * 2,
.accel = FB_ACCEL_NONE
};

so i tried that but BFIN ADV7393 is not recognized setenv vidargs video=mxcfb0:dev=lcd,BFIN ADV7393,if=RGB24,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off fbmem=32M

hi @jaski.tx

I followed what I could:
I used the fix L3.0.35_4.1.0_GA_bt656_output_patch_2017-03-10.zip for freescale.

stopped at step 3 because patch is not provided for toradex structure…

3. How to use

-- Copy the two patch files to kernel folder.
    $ git apply ./0001-Support-BT656-and-BT1120-output-for-iMX6-ipuv3.patch
    $ git apply ./0002-Support-adv739x-TV-encoder-for-BT656-output.patch

With the previous patch L4.9_HDMI_Interlaced_Mode_Patch.tar.bz2 given by @max.tx
I have these format below, but the two with the pixel clock 27Mhz for ADV7393 is 1440x576i or 1440x480i not supported by ADV7393…

+	{
+	/* 1920x1080i @ 60 Hz , pixel clk @ 74.25MHz */
+	"LCD-1080I60", 60, 1920, 1080, 13468, 148, 88, 31, 4, 44, 10,
+	FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+	FB_VMODE_INTERLACED,
+	0,},
+	{
+	/* 1920x1080i @ 50 Hz , pixel clk @ 74.25MHz */
+	"LCD-1080I50", 50, 1920, 1080, 13468, 148, 528, 31, 4, 44, 10,
+	FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+	FB_VMODE_INTERLACED,
+	0,},
+	{
+	/* 1440x576i @ 50 Hz , pixel clk @ 27MHz */
+	"LCD-576I50", 50, 1440, 576, 37037, 138, 24, 39, 4, 126, 6,
+	0,
+	FB_VMODE_INTERLACED,
+	0,},
+	{
+	/* 720x576i @ 50 Hz , pixel clk @ 13.5MHz */
+	"LCD-PAL", 50, 720, 576, 74074, 138, 24, 39, 4, 126, 6,
+	0,
+	FB_VMODE_INTERLACED,
+	0,},
+	{
+	/* 1440x480i @ 60 Hz , pixel clk @ 27MHz */
+	"LCD-480I60", 60, 1440, 480, 37037, 114, 38, 31, 8, 124, 6,
+	0,
+	FB_VMODE_INTERLACED,
+	0,},
+	{
+	/* 720x480i @ 60 Hz , pixel clk @ 13.5MHz */
+	"LCD-NTSC", 60, 720, 480, 74074, 114, 38, 31, 8, 124, 6,
+	0,
+	FB_VMODE_INTERLACED,
+	0,},

EDIT : i wil try that
maybe 720 × 576 I 25 27 ITU-R BT.601/656 (table 1 doc ADV7393)
is the 525i of the same doc
and the same of the patch “LCD-576I50”
1440* 576i

EDIT 19/04/2019 :
I have a video detected as NTSC on output with the patch L4.9_HDMI_Interlaced_Mode_Patch.tar.bz2 given by @max.tx
configuration
setenv vidargs video=mxcfb0:dev=lcd,LCD-480I60,if=RGB565,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off fbmem=32M

ADV7393 configured with table 77
i2c_register_full_write(0x17,0x02);
i2c_register_full_write(0x00,0x1C);
i2c_register_full_write(0x01,0x00);
i2c_register_full_write(0x80,0x10);
i2c_register_full_write(0x82,0xCB);
i2c_register_full_write(0x87,0x80);
i2c_register_full_write(0x88,0x10);
i2c_register_full_write(0x8A,0x0C);

But still have a no readable output and gtiltch.

Regards

hi @mazareth

Sorry for the delayed answer.

Could you update to Bsp 2.8 and 4.9.2.3 and compile a custom kernel with adv7393 driver enabled?

Best regards,
Jaski

Could you provide your kernel config ( .config ) and the dmesg log? Thanks.