]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00209710 MX6 IPUv3 fb:Show display dev name property
authorLiu Ying <Ying.Liu@freescale.com>
Thu, 17 May 2012 06:56:24 +0000 (14:56 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:39 +0000 (08:34 +0200)
1) Show display device name property:
   HDMI monitor - hdmi
   DVI monitor - dvi
   VGA monitor - vga
   dumb LCD panel - lcd
   LVDS panel - ldb
   MIPI LCD panel - mipi_dsi
   TVout - tve
2) Make fsl_disp_property device attribution be static.
3) Support overlay fb fsl_disp_property and
   fsl_disp_dev_property device attributions.
4) Remove fsl_disp_property and fsl_disp_dev_property
   device attributions when removing the driver.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
drivers/video/mxc/mxc_ipuv3_fb.c

index ade31f037225c80acec526f15f4f6e76c474f1c6..2d0ec842e7df27e96bf47d944e0026104b2d3883 100644 (file)
@@ -1700,7 +1700,20 @@ static ssize_t swap_disp_chan(struct device *dev,
        console_unlock();
        return count;
 }
-DEVICE_ATTR(fsl_disp_property, 644, show_disp_chan, swap_disp_chan);
+static DEVICE_ATTR(fsl_disp_property, 644, show_disp_chan, swap_disp_chan);
+
+static ssize_t show_disp_dev(struct device *dev,
+                            struct device_attribute *attr, char *buf)
+{
+       struct fb_info *info = dev_get_drvdata(dev);
+       struct mxcfb_info *mxcfbi = (struct mxcfb_info *)info->par;
+
+       if (mxcfbi->ipu_ch == MEM_FG_SYNC)
+               return sprintf(buf, "overlay\n");
+       else
+               return sprintf(buf, "%s\n", mxcfbi->dispdrv->drv->name);
+}
+static DEVICE_ATTR(fsl_disp_dev_property, S_IRUGO, show_disp_dev, NULL);
 
 static int mxcfb_dispdrv_init(struct platform_device *pdev,
                struct fb_info *fbi)
@@ -2099,6 +2112,20 @@ static int mxcfb_probe(struct platform_device *pdev)
                }
 
                g_dp_in_use[mxcfbi->ipu_id] = true;
+
+               ret = device_create_file(mxcfbi->ovfbi->dev,
+                                        &dev_attr_fsl_disp_property);
+               if (ret)
+                       dev_err(mxcfbi->ovfbi->dev, "Error %d on creating "
+                                                   "file for disp property\n",
+                                                   ret);
+
+               ret = device_create_file(mxcfbi->ovfbi->dev,
+                                        &dev_attr_fsl_disp_dev_property);
+               if (ret)
+                       dev_err(mxcfbi->ovfbi->dev, "Error %d on creating "
+                                                   "file for disp device "
+                                                   "propety\n", ret);
        } else {
                mxcfbi->ipu_ch_irq = IPU_IRQ_DC_SYNC_EOF;
                mxcfbi->ipu_ch_nf_irq = IPU_IRQ_DC_SYNC_NFACK;
@@ -2115,7 +2142,13 @@ static int mxcfb_probe(struct platform_device *pdev)
 
        ret = device_create_file(fbi->dev, &dev_attr_fsl_disp_property);
        if (ret)
-               dev_err(&pdev->dev, "Error %d on creating file\n", ret);
+               dev_err(&pdev->dev, "Error %d on creating file for disp "
+                                   "property\n", ret);
+
+       ret = device_create_file(fbi->dev, &dev_attr_fsl_disp_dev_property);
+       if (ret)
+               dev_err(&pdev->dev, "Error %d on creating file for disp "
+                                   " device propety\n", ret);
 
 #ifdef CONFIG_LOGO
        fb_prepare_logo(fbi, 0);
@@ -2144,11 +2177,17 @@ static int mxcfb_remove(struct platform_device *pdev)
        if (!fbi)
                return 0;
 
+       device_remove_file(fbi->dev, &dev_attr_fsl_disp_dev_property);
+       device_remove_file(fbi->dev, &dev_attr_fsl_disp_property);
        mxcfb_blank(FB_BLANK_POWERDOWN, fbi);
        mxcfb_unregister(fbi);
        mxcfb_unmap_video_memory(fbi);
 
        if (mxc_fbi->ovfbi) {
+               device_remove_file(mxc_fbi->ovfbi->dev,
+                                  &dev_attr_fsl_disp_dev_property);
+               device_remove_file(mxc_fbi->ovfbi->dev,
+                                  &dev_attr_fsl_disp_property);
                mxcfb_blank(FB_BLANK_POWERDOWN, mxc_fbi->ovfbi);
                mxcfb_unsetup_overlay(fbi);
                mxcfb_unmap_video_memory(mxc_fbi->ovfbi);