MLK-14283: mxsfb: fix clock definitions for lcdif
authorRobert Chiras <robert.chiras@nxp.com>
Mon, 27 Feb 2017 13:19:50 +0000 (15:19 +0200)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
The mxsfb framebuffer driver uses three clock definitions, but only two
are defined in DTS for imx7s (also used by imx7d); because of this,
driver fails in probe. Since iMX7D uses only one clock, add the third clock
and make two of them dummy.
Also, add additional error messages for better identification of a
failing probe.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
arch/arm/boot/dts/imx7s.dtsi
drivers/video/fbdev/mxsfb.c

index 3462f0a..59061fb 100644 (file)
                                reg = <0x30730000 0x10000>;
                                interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
                                clocks = <&clks IMX7D_LCDIF_PIXEL_ROOT_CLK>,
-                                       <&clks IMX7D_LCDIF_PIXEL_ROOT_CLK>;
-                               clock-names = "pix", "axi";
+                                       <&clks IMX7D_CLK_DUMMY>,
+                                       <&clks IMX7D_CLK_DUMMY>;
+                               clock-names = "pix", "axi", "disp_axi";
                                status = "disabled";
                        };
                };
index 14f649f..55cb7d9 100644 (file)
@@ -2264,6 +2264,7 @@ static int mxsfb_probe(struct platform_device *pdev)
        if (IS_ERR(host->clk_axi)) {
                host->clk_axi = NULL;
                ret = PTR_ERR(host->clk_axi);
+               dev_err(&pdev->dev, "Failed to get axi clock: %d\n", ret);
                goto fb_release;
        }
 
@@ -2271,6 +2272,7 @@ static int mxsfb_probe(struct platform_device *pdev)
        if (IS_ERR(host->clk_disp_axi)) {
                host->clk_disp_axi = NULL;
                ret = PTR_ERR(host->clk_disp_axi);
+               dev_err(&pdev->dev, "Failed to get disp_axi clock: %d\n", ret);
                goto fb_release;
        }
 
@@ -2282,6 +2284,7 @@ static int mxsfb_probe(struct platform_device *pdev)
                                               GFP_KERNEL);
        if (!fb_info->pseudo_palette) {
                ret = -ENOMEM;
+               dev_err(&pdev->dev, "Failed to allocate pseudo_palette memory\n");
                goto fb_release;
        }
 
@@ -2290,8 +2293,10 @@ static int mxsfb_probe(struct platform_device *pdev)
        pm_runtime_enable(&host->pdev->dev);
 
        ret = mxsfb_init_fbinfo(host);
-       if (ret != 0)
+       if (ret != 0) {
+               dev_err(&pdev->dev, "Failed to initialize fbinfo: %d\n", ret);
                goto fb_pm_runtime_disable;
+       }
 
        ret = mxsfb_dispdrv_init(pdev, fb_info);
        if (ret != 0) {