mxc_adv793x driver is registered but it's init function never called to enable adv739x display driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mxc_adv793x driver is registered but it's init function never called to enable adv739x display driver

3,336 Views
ivanljubicic
Contributor III

Hi,

I am trying to use adv7391 chip for enabling mx6quad board to display tv out. But it seems that mxc_adv739x driver has problems with initializing display driver adv739x. It seems that driver adv739x is registered but not initialized. I need help because this is blocking problem on our project. Here are the messages from kernel:

[0.876410] mxc_adv739x 2-002b: adv739x_probe: rst-gpios flags(0 -> 2)
[0.881681] mxc_dispdrv_register adv739x driver registered             
[0.886302] mxc_dispdrv_register hdmi driver registered
[0.890898] mxc_dispdrv_gethandle hdmi driver gethandle
[0.894930] mxc_hdmi 20e0000.hdmi_video: Detected HDMI controller 0x13:0xa:0x
[0.901443] fbcvt: 1280x720@60: CVT Name - .921M9                     
[0.904928] mxc_dispdrv_gethandle hdmi driver found

Here is configuration of adv7391 I2C device:

adv7391: adv7391@2b {

        compatible = "fsl,mxc_adv739x";

        reg = <0x2b>;

        pinctrl-names = "default", "enable";

        pinctrl-0 = <&pinctrl_adv7391_off>;

        pinctrl-1 = <&pinctrl_adv7391>;

        rst-gpios = GP_ADV7391_RESET;

        default_ifmt = "BT656";

        ipu_id = <1>;

        disp_id = <1>;

    };

here is configuration for display:

fb_lcd: fb@2 {

        compatible = "fsl,mxc_sdc_fb";

        disp_dev = "adv739x";

        interface_pix_fmt = "BT656";

        mode_str ="BT656-NTSC";

        default_bpp = <16>;

        int_clk = <0>;

        late_init = <0>;

        status = "okay";

    };

I have looked the source of mxcfb_adv739x.c and there are printouts that should be visible in kernel messages if driver is initialized. I do not have any of this messages in kernel printout.

Please, can you tell me what I am doing wrong or it could be driver problem. If it is can I get patch that repair driver problem.

I am working with kernel version 3.14.28.

Thanks, regards, Ivan. !

Labels (4)
0 Kudos
Reply
15 Replies

2,338 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

Please try to enable the eraly printk by setting CONFIG_EARLY_PRINTK in your kernel config (make menuconfig -> Kernel Hacking -> Early printk).. That may help to see the printouts when the driver is initialized.

Which Linux version are you using?

Regards,

Alejandro

0 Kudos
Reply

2,338 Views
ivanljubicic
Contributor III

Sorry forgot to tell linux version. Jethro linux version from yocto.

Thanks, regards, Ivan.

0 Kudos
Reply

2,338 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

I am looking at our source code of L3.14.28 and I cannot find the mxcfb_adv739x.c file.

There is this one in the web vero-linux/mxcfb_adv739x.c at master · osmc/vero-linux · GitHub

If it is the same you have, the compatible property is "adi,adv7393".

Best Regards,

Alejandro

0 Kudos
Reply

2,338 Views
ivanljubicic
Contributor III

Hi,

I have tried to replace the driver/video/mxc project from vero-linux to

my version of linux /driver/video/mxc because I can not change linux

version. It compiles and runs, but still mxcfb_adv739x driver init

function is not called. I have put "adi,adv7393" to compatible property of:

adv7391: adv7391@2b {

compatible = "adi,adv7393";

reg = <0x2b>;
pinctrl-names = "default", "enable";
pinctrl-0 = <&pinctrl_adv7391_off>;
pinctrl-1 = <&pinctrl_adv7391>;
rst-gpios = GP_ADV7391_RESET;
default_ifmt = "BT656";
ipu_id = <1>;
disp_id = <1>;
};
Also I have only frame buffer fb0 and fb1, despite I have put lcd
display with disp_dev="adv739x" on frame buffer 2:
fb_lcd: fb@2 {
compatible = "fsl,mxc_sdc_fb";
disp_dev = "adv739x";
interface_pix_fmt = "BT656";
mode_str ="BT656-NTSC";
default_bpp = <16>;
int_clk = <0>;
late_init = <0>;

status = "okay";

};

As I understand quad board can have 4 frame buffers, because it has 2

IPU. I don't know why I have only two. Hdmi driver is on fb0 and it is

owrking OK. On fb1 is overlay, and there is no any more frame buffer

device. How can I get fb2 device through configuration? And initialize

it as adv739x driver?

Thanks, regards, Ivan.

0 Kudos
Reply

2,338 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

Can you share the driver source code, looking at what you have been sharing it seems that the driver is not device tree compatible.

Best Regards,

Alejandro

0 Kudos
Reply

2,338 Views
ivanljubicic
Contributor III

Hi Alejandro,

here is the driver code. I will try with new version of jethro linux

form yocto to enable driver. Thanks for assistance.

Regards, Ivan.

0 Kudos
Reply

2,338 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi Ivan,

After looking at the driver, it is a fact that it is not device tree compatible.

Best Regards,

Alejandro

0 Kudos
Reply

2,338 Views
ivanljubicic
Contributor III

Hi Alejandro,

thanks for assistance. This was also my suspicion. I will need to

reimplement this driver.

Regards, Ivan.

0 Kudos
Reply

2,338 Views
aliismail
Contributor IV

Was this driver re-implemented? If yes, do you know where I can find it?

0 Kudos
Reply

2,338 Views
ivanljubicic
Contributor III

No,

I did not reimplemented it. I used current driver with changes in u-boot

"cmd_frozen=1\0" \

"cmd_hdmi=fdt set fb_hdmi status okay;fdt set fb_hdmi mode_str

1280x720M@60; setenv bootargs $ video=mxcfb2:dev=hdmi,1280x720M@60,if=RGB24\0" \ "cmd_lcd=fdt set fb_lcd status okay; setenv bootargs $

video=mxcfb0:dev=adv739x,BT656-NTSC,if=BT656,fbpix=BGR32,bpp=32\0" \

innitrogen6x.h

and changes of clock in clk-imx6q.c

} else if (cpu_is_imx6q()) {

imx_clk_set_parent(clk[IMX6QDL_CLK_IPU1_SEL],

clk[IMX6QDL_CLK_MMDC_CH0_AXI]);

imx_clk_set_parent(clk[IMX6QDL_CLK_IPU2_SEL],

clk[IMX6QDL_CLK_MMDC_CH0_AXI]);

// DVM test

imx_clk_set_rate(clk[IMX6QDL_CLK_PLL3_PFD1_540M], 540000000);

imx_clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI1_PRE_SEL],

clk[IMX6QDL_CLK_PLL3_PFD1_540M]);

// imx_clk_set_parent(clk[IMX6QDL_CLK_IPU2_SEL],

clk[IMX6QDL_CLK_PLL3_PFD1_540M]);

// imx_clk_set_parent(clk[IMX6QDL_CLK_IPU2_SEL],

clk[IMX6QDL_CLK_PLL2_PFD2_396M]);

// imx_clk_set_rate(clk[IMX6QDL_CLK_IPU2], 200000000);

}

and changes in:

ipu_disp.c because our DISP_DAT starts at 15 bit.

#define BT656_IF_DI_MSB 15 /* For 8 bits BT656: 23 for

DISP_DAT23 ~ DISP_DAT16; 7 for DISP_DAT7 ~ DISP_DAT0 */

and dts definition:

pinctrl_adv7391: adv7391grp-1 {

fsl,pins = <

MX6QDL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK 0x10 /* Pixclk */

/* MX6QDL_PAD_DI0_PIN15__IPU1_DI0_PIN15 0x10 / / disp0

data ready = unused */

MX6QDL_PAD_DI0_PIN2__IPU1_DI0_PIN02 0x10 /* hsync */

MX6QDL_PAD_DI0_PIN3__IPU1_DI0_PIN03 0x10 /* vsync */

MX6QDL_PAD_DI0_PIN4__GPIO4_IO20 0xb0 /* contrast */

MX6QDL_PAD_DISP0_DAT8__IPU1_DISP0_DATA08 0x10

MX6QDL_PAD_DISP0_DAT9__IPU1_DISP0_DATA09 0x10

MX6QDL_PAD_DISP0_DAT10__IPU1_DISP0_DATA10 0x10

MX6QDL_PAD_DISP0_DAT11__IPU1_DISP0_DATA11 0x10

MX6QDL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12 0x10

MX6QDL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13 0x10

MX6QDL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14 0x10

MX6QDL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15 0x10

>;

};

#define GP_ADV7391_RESET <&gpio4 20 GPIO_ACTIVE_LOW>

pinctrl_adv7391_off: adv7391grp-2 {
fsl,pins = <<br /> MX6QDL_PAD_DI0_DISP_CLK__GPIO4_IO16 0x0b0b0 /* Pixclk */
MX6QDL_PAD_DI0_PIN15__GPIO4_IO17 0x0b0b0
MX6QDL_PAD_DI0_PIN2__GPIO4_IO18 0x0b0b0 /* HSYNC */
MX6QDL_PAD_DI0_PIN3__GPIO4_IO19 0x0b0b0 /* VSYNC */
MX6QDL_PAD_DI0_PIN4__GPIO4_IO20 0xb0 /* contrast */
MX6QDL_PAD_DISP0_DAT8__GPIO4_IO29 0x0b0b0
MX6QDL_PAD_DISP0_DAT9__GPIO4_IO30 0x0b0b0
MX6QDL_PAD_DISP0_DAT10__GPIO4_IO31 0x0b0b0
MX6QDL_PAD_DISP0_DAT11__GPIO5_IO05 0x0b0b0
MX6QDL_PAD_DISP0_DAT12__GPIO5_IO06 0x0b0b0
MX6QDL_PAD_DISP0_DAT13__GPIO5_IO07 0x0b0b0
MX6QDL_PAD_DISP0_DAT14__GPIO5_IO08 0x0b0b0
MX6QDL_PAD_DISP0_DAT15__GPIO5_IO09 0x0b0b0
>;
};


adv7391: adv7391@2b {
compatible = "adv,mxc_adv739x";
reg = <0x2b>;
pinctrl-names = "enable", "default";
pinctrl-0 = <&pinctrl_adv7391>;
pinctrl-1 = <&pinctrl_adv7391_off>;
rst-gpios = GP_ADV7391_RESET;
default_ifmt = "BT656";
ipu_id = <0>;
disp_id = <0>; /* dvm disp_id */

};

And with this changes I can see everything on VGA display.

Regards, Ivan.

2,338 Views
aliismail
Contributor IV

So there was no requirement for the driver to be device driver compatible? And which driver did you end up using? The one in the zip folder or the one from github? The adv739x driver in github seems to only be compatible for the adv7393.

0 Kudos
Reply

2,338 Views
nayfe
Contributor I

Hi there,

The driver in zip folder is device tree compatible, as it is a i2c driver, automatically probed regarding driver name.

Nevertheless, I needed the following patch to get it work : 

diff --git a/drivers/video/fbdev/mxc/mxc_dispdrv.c b/drivers/video/fbdev/mxc/mxc_dispdrv.c
index d8501eb..c16bafa 100644
--- a/drivers/video/fbdev/mxc/mxc_dispdrv.c
+++ b/drivers/video/fbdev/mxc/mxc_dispdrv.c
@@ -106,7 +106,7 @@ struct mxc_dispdrv_handle *mxc_dispdrv_gethandle(char *name,
}
mutex_unlock(&dispdrv_lock);

- return found ? (struct mxc_dispdrv_handle *)entry:ERR_PTR(-ENODEV);
+ return found ? (struct mxc_dispdrv_handle *)entry:ERR_PTR(-EPROBE_DEFER);
}
EXPORT_SYMBOL_GPL(mxc_dispdrv_gethandle);

Indeed, mxcfb_adv739x registers himself after mxc_dispdrv initialization, so it needs to be defered.

Best Regards,

Vincent

0 Kudos
Reply

2,338 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi Ivan,

Please keep us informed.

Best Regards,

Alejandro

0 Kudos
Reply

2,338 Views
ivanljubicic
Contributor III

Hi Alejandro,

My file is different than in github.

I have in driver:

static const struct i2c_device_id adv739x_id[] = {

{ "mxc_adv739x", 0 },

{},

};

MODULE_DEVICE_TABLE(i2c, adv739x_id);

static struct i2c_driver adv739x_i2c_driver = {

.driver = {

.name = "mxc_adv739x",

},

.probe = adv739x_probe,

.remove = adv739x_remove,

.id_table = adv739x_id,

};

So I took file from github and put instead of current driver.

I have put "adi,adv7393" in compatible property for display:

fb_lcd: fb@2 {

//compatible = "fsl,mxc_sdc_fb";

compatible = "adi,adv7393";

disp_dev = "adv739x";

interface_pix_fmt = "BT656";

mode_str ="BT656-NTSC";

default_bpp = <16>;
int_clk = <0>;
late_init = <0>;
status = "okay";
};

but driver is still not initalized. I also tried to put in I2C configuration

adv7391: adv7391@2b {
compatible = "adi,adv7393";
//compatible = "adv,mxc_adv739x";
reg = <0x2b>;
pinctrl-names = "default", "enable";
pinctrl-0 = <&pinctrl_adv7391_off>;
pinctrl-1 = <&pinctrl_adv7391>;
rst-gpios = GP_ADV7391_RESET;
default_ifmt = "BT656";
ipu_id = <1>;
disp_id = <1>;

};

also not working.

I think I will change the linux version. :smileyhappy:

Can you recommend me version where support for adv739x is working for

MX6Quad processor, sabrelite board. Will this version "vero-linux" from

github work for our board?

Thanks, regards, Ivan.

0 Kudos
Reply

2,337 Views
ivanljubicic
Contributor III

Hi Alejandro,

Early printout is already turned on and I am sending complete printout

of dmesg command. I have also added more printout to driver register

function and gethandle function. I see init is called for hdmi, but not

for adv739x driver.

fb2 frame buffer in dev is not created also, despite I have fb_lcd with

fb@2 defined in config script. I am probably doing something wrong but I

do not know what.

Thanks, regards, Ivan.

0 Kudos
Reply