rkfb:add interface __rk_platform_add_display_devices
authoryxj <yxj@rock-chips.com>
Tue, 22 Jan 2013 12:45:43 +0000 (20:45 +0800)
committeryxj <yxj@rock-chips.com>
Tue, 22 Jan 2013 12:51:23 +0000 (20:51 +0800)
drivers/video/rockchip/rk_fb.c
include/linux/rk_fb.h

index dbd4fe350265183b1fe72c6a5456eb1f35f5e964..77f7872007bc3de9509f11c0238fbd6db24e49bf 100644 (file)
@@ -1155,10 +1155,7 @@ int rk_fb_register(struct rk_lcdc_device_driver *dev_drv,
                fb_inf->num_fb++;       
        }
 #if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO)
-
-#if !defined(CONFIG_MACH_RK3168_DS1006H)
-    if(id == 0)
-#endif 
+    if(dev_drv->screen_ctr_info->prop == PRMRY) //show logo for primary display device
     {
            fb_inf->fb[0]->fbops->fb_open(fb_inf->fb[0],1);
            fb_inf->fb[0]->fbops->fb_set_par(fb_inf->fb[0]);
index b3e30117809e35be03ba2358d665d708527d1128..f067c9c5df96571ac92eb609b86744cb5ccc7ca3 100644 (file)
@@ -17,6 +17,7 @@
 #define __ARCH_ARM_MACH_RK30_FB_H
 
 #include <linux/fb.h>
+#include <linux/platform_device.h>
 #include<linux/completion.h>
 #include<linux/spinlock.h>
 #include<asm/atomic.h>
@@ -282,4 +283,81 @@ static int inline rk_fb_calc_fps(rk_screen *screen,u32 pixclock)
 
        return  hz;
 }
+
+static int inline __rk_platform_add_display_devices(struct platform_device *fb,
+       struct platform_device *lcdc0,struct platform_device *lcdc1,
+       struct platform_device *bl)
+{
+       struct rk29fb_info *lcdc0_screen_info = NULL;
+       struct rk29fb_info *lcdc1_screen_info = NULL;
+       struct platform_device *prmry_lcdc = NULL;
+       struct platform_device *extend_lcdc = NULL;
+       
+       if(!fb)
+       {
+               printk(KERN_ERR "warning:no rockchip fb device!\n");
+       }
+       else
+       {
+               platform_device_register(fb);
+       }
+
+       if((!lcdc0)&&(!lcdc1))
+       {
+               printk(KERN_ERR "warning:no lcdc device!\n");
+       }
+       else
+       {
+               if(lcdc0)
+               {
+                       lcdc0_screen_info = lcdc0->dev.platform_data;
+                       if(lcdc0_screen_info->prop == PRMRY)
+                       {
+                               prmry_lcdc = lcdc0;
+                               printk(KERN_INFO "lcdc0 is used as primary display device contoller!\n");
+                       }
+                       else
+                       {
+                               extend_lcdc = lcdc0;
+                               printk(KERN_INFO "lcdc0 is used as external display device contoller!\n");
+                       }
+                               
+                       
+               }
+               else
+               {
+                       printk(KERN_INFO "warning:lcdc0 not add to system!\n");
+               }
+               
+               if(lcdc1)
+               {
+                       lcdc1_screen_info = lcdc1->dev.platform_data;
+                       if(lcdc1_screen_info->prop == PRMRY)
+                       {
+                               prmry_lcdc = lcdc1;
+                               printk(KERN_INFO "lcdc1 is used as primary display device controller!\n");
+                       }
+                       else
+                       {
+                               extend_lcdc = lcdc1;
+                               printk(KERN_INFO "lcdc1 is used as external display device controller!\n");
+                       }
+                               
+                       
+               }
+               else
+               {
+                       printk(KERN_INFO "warning:lcdc1 not add to system!\n");
+               }
+       }
+
+       if(prmry_lcdc)
+               platform_device_register(prmry_lcdc);
+       if(extend_lcdc)
+               platform_device_register(extend_lcdc);
+       if(bl)
+               platform_device_register(bl);
+
+       return 0;
+}
 #endif