AnsweredAssumed Answered

ADV7511 / ADV7513 DRM driver with imx7d not probing

Question asked by dh29 on Mar 13, 2018
Latest reply on Mar 19, 2018 by larsc

I have a new h/w design using an ADV7513 (but I'll refer to it as ADV7511) interfaced to an imx7d via its LCD interface (parallel RGB).

 

On boot the ADV7511 is not being probed. It is configured to I2C addr 0x39. Other devices on the same I2C bus are probed OK. There is no I2C address conflict. I have enabled I2C debugging and looking in the boot logs there is no attempt to access address I2C address 0x39 during boot.

 

I am using the DRM driver (drivers/gpu/drm/i2c/adv7511.c), which is compiled as a loadable module adv7511.ko.

 

Once linux boots I have a file for /sys/bus/I2C/devices/3-0039 (which seems correct as I am using I2C4 [bus 3]) and 'name' shows as adv7511. Seems my device tree is OK? (see below).

 

I know that the h/w is physically OK. Once booted I use utility I2CSET 3 0x39 0x41 0x10 to manually enable the ADV7511's output, and hey-presto it starts working. Obviously this is without the adv7511 driver.

 

I can manually load the driver, modprobe adv7511, and the driver is probed and loads adv7511 (lsmod) with a drm_kms_helper. I have placed some 'printk()' in the adv7511_probe() function and it completes without errors. After I have manually loaded the driver if I connect a display (DVI), I get an 'encoder not ready' error from the driver (adv7511_irq_process() , adv7511->encoder == 0).

 

Relevant sections of my device tree are as follows:

/ {

   connectors {

      hdmi0: connector@0 {

         compatible = "hdmi-connector";

         label = "hdmi";

         type = "a";

 

         port {

            hdmi_connector_in: endpoint {

               remote-endpoint = <&adv7511_out>;

            };

         };

      };

   };

};

 

&i2c4 {

   clock-frequency = <100000>;

   pinctrl-names = "default";

   pinctrl-0 = <&pinctrl_i2c4>;

   status = "okay";

 

   tca6424_sb_22: tca6424_sb_22@22 {

      compatible = "ti,tca6424";

      gpio-controller;

      #gpio-cells = <2>;

      reg = <0x22>;

   };

 

   tca6424_sb_23: tca6424_sb_23@23 {

      compatible = "ti,tca6424";

      gpio-controller;

      #gpio-cells = <2>;

      reg = <0x23>;

   };

 

adv7511@39 {
   compatible = "adi,adv7511";

   reg = <0x39>, <0x3f>;

   interrupt-parent = <&gpio3>;
      interrupts = <19 IRQ_TYPE_EDGE_FALLING>;

      adi,input-depth = <8>;
      adi,input-colorspace = "rgb";
      adi,input-clock = "1x";

      ports {
         #address-cells = <1>;
         #size-cells = <0>;

 

         port@0 {
            reg = <0>;
            adv7511_in: endpoint {
               remote-endpoint = <&lcd_out>;
            };
         };

 

         port@1 {
            reg = <1>;
            adv7511_out: endpoint {
               remote-endpoint = <&hdmi_connector_in>;
            };
         };
      };
   };
};

 

&lcdif {

   pinctrl-names = "default";

   pinctrl-0 = <&pinctrl_lcdif_dat &pinctrl_lcdif_ctrl>;

   display = <&display0>;

   status = "okay";

 

   display0: disp {

      bits-per-pixel = <24>;

      bus-width = <24>;

      display-timings {

         native-mode = <&timing0>;

         timing0: lcd {

            clock-frequency = <29580000>;

            hactive = <800>;

            vactive = <480>;

            hfront-porch = <16>;

            hback-porch = <1>;

            hsync-len = <80>;

            vback-porch = <13>;

            vfront-porch = <16>;

            vsync-len = <16>;

            hsync-active = <0>;

            vsync-active = <0>;

            de-active = <1>;

            pixelclk-active = <0>;

         };

 

         timing1: dvi {

            /* 1024x768p60 */

            clock-frequency = <65000000>;

            hactive = <1024>;

            vactive = <768>;

            hback-porch = <220>;

            hfront-porch = <40>;

            vback-porch = <21>;

            vfront-porch = <7>;

            hsync-len = <60>;

            vsync-len = <10>;

            hsync-active = <0>;

            vsync-active = <0>;

            de-active = <1>;

            pixelclk-active = <0>;

         };

      };

 

      port {

         lcd_out: endpoint {

            remote-endpoint = <&adv7511_in>;

         };

      };

   };
};

 

Any ideas on where I am going wrong? I am clearly missing something!

Outcomes