]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00173962 Added HDMI enable function
authorSandor Yu <R01008@freescale.com>
Wed, 8 Feb 2012 05:45:18 +0000 (13:45 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:33:57 +0000 (08:33 +0200)
Whenever IPU clock change or gating, the HDMI PHY should reset or config again,
otherwise the HDMI PHY will not work.
It is the root cause for Ubuntu can't show GUI to HDMI device when bootup
and GPU application tutorial4_es20 no output to HDMI device.
Added enable function in mxcfb_set_par() to fix aboved two issue.

Added HDMI initialization check, only one HDMI instanse supported.

Signed-off-by: Sandor Yu <R01008@freescale.com>
drivers/video/mxc/mxc_ipuv3_fb.c
drivers/video/mxc_hdmi.c

index ba43b512e33a251e0aba815857d6e1c93ec14d71..97238d82742bbefa2bc417adef0a5051009606ee 100644 (file)
@@ -450,6 +450,15 @@ static int mxcfb_set_par(struct fb_info *fbi)
 
        ipu_enable_channel(mxc_fbi->ipu, mxc_fbi->ipu_ch);
 
+       if (mxc_fbi->dispdrv && mxc_fbi->dispdrv->drv->enable) {
+               retval = mxc_fbi->dispdrv->drv->enable(mxc_fbi->dispdrv);
+               if (retval < 0) {
+                       dev_err(fbi->device, "enable error, dispdrv:%s.\n",
+                                       mxc_fbi->dispdrv->drv->name);
+                       return -EINVAL;
+               }
+       }
+
        return retval;
 }
 
index 6572c1b8e41e51001fa5cb2f032e0b6dc0a17938..35df3d94deb6ee7955cfb7afa54e1e1aaa94d702 100644 (file)
@@ -180,6 +180,8 @@ struct mxc_hdmi {
 
 struct i2c_client *hdmi_i2c;
 
+static bool hdmi_inited;
+
 extern const struct fb_videomode mxc_cea_mode[64];
 
 #ifdef DEBUG
@@ -1693,6 +1695,19 @@ static void mxc_hdmi_cable_connected(struct mxc_hdmi *hdmi)
        dev_dbg(&hdmi->pdev->dev, "%s exit\n", __func__);
 }
 
+static int mxc_hdmi_power_on(struct mxc_dispdrv_handle *disp)
+{
+       struct mxc_hdmi *hdmi = mxc_dispdrv_getdata(disp);
+       mxc_hdmi_phy_init(hdmi);
+       return 0;
+}
+
+static void mxc_hdmi_power_off(struct mxc_dispdrv_handle *disp)
+{
+       struct mxc_hdmi *hdmi = mxc_dispdrv_getdata(disp);
+       mxc_hdmi_phy_disable(hdmi);
+}
+
 static void mxc_hdmi_cable_disconnected(struct mxc_hdmi *hdmi)
 {
        dev_dbg(&hdmi->pdev->dev, "%s\n", __func__);
@@ -2084,6 +2099,13 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp,
 
        dev_dbg(&hdmi->pdev->dev, "%s\n", __func__);
 
+       /* Check hdmi disp init once */
+       if (hdmi_inited) {
+               dev_err(&hdmi->pdev->dev,
+                               "Error only one HDMI output support now!\n");
+               return -1;
+       }
+
        if (!plat || irq < 0)
                return -ENODEV;
 
@@ -2208,6 +2230,8 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp,
 
        dev_dbg(&hdmi->pdev->dev, "%s exit\n", __func__);
 
+       hdmi_inited = true;
+
        return ret;
 
 efbclient:
@@ -2250,6 +2274,8 @@ static void mxc_hdmi_disp_deinit(struct mxc_dispdrv_handle *disp)
 
        platform_device_unregister(hdmi->pdev);
 
+       hdmi_inited = false;
+
        kfree(hdmi);
 }
 
@@ -2257,6 +2283,8 @@ static struct mxc_dispdrv_driver mxc_hdmi_drv = {
        .name   = DISPDRV_HDMI,
        .init   = mxc_hdmi_disp_init,
        .deinit = mxc_hdmi_disp_deinit,
+       .enable = mxc_hdmi_power_on,
+       .disable = mxc_hdmi_power_off,
 };
 
 static int __devinit mxc_hdmi_probe(struct platform_device *pdev)
@@ -2285,6 +2313,8 @@ static int __devinit mxc_hdmi_probe(struct platform_device *pdev)
                goto ecore;
        }
 
+       hdmi_inited = false;
+
        hdmi->disp_mxc_hdmi = mxc_dispdrv_register(&mxc_hdmi_drv);
        if (IS_ERR(hdmi->disp_mxc_hdmi)) {
                dev_err(&pdev->dev, "Failed to register dispdrv - 0x%x\n",