rk3066b lcdc:add one lcdc dual display support for rk610
authoryxj <yxj@rock-chips.com>
Sat, 8 Sep 2012 08:09:40 +0000 (16:09 +0800)
committeryxj <yxj@rock-chips.com>
Sat, 8 Sep 2012 09:26:51 +0000 (17:26 +0800)
drivers/video/rockchip/chips/rk31_lcdc.c

index 4a445a284d4149ee3a485f8f71d4195eda2c3802..251e749137666580a20c53e951f88419fdce32ab 100644 (file)
@@ -879,6 +879,7 @@ static int __devinit rk31_lcdc_probe (struct platform_device *pdev)
 {
        struct rk31_lcdc_device *lcdc_dev=NULL;
        rk_screen *screen;
+       rk_screen *screen1;
        struct rk29fb_info *screen_ctr_info;
        struct resource *res = NULL;
        struct resource *mem;
@@ -905,6 +906,22 @@ static int __devinit rk31_lcdc_probe (struct platform_device *pdev)
        {
                lcdc_dev->screen = screen;
        }
+       screen->lcdc_id = lcdc_dev->id;
+       screen->screen_id = 0;
+
+#if defined(CONFIG_ONE_LCDC_DUAL_OUTPUT_INF)&& defined(CONFIG_RK610_LVDS)
+       screen1 =  kzalloc(sizeof(rk_screen), GFP_KERNEL);
+       if(!screen1)
+       {
+               dev_err(&pdev->dev, ">>rk31 lcdc screen1 kmalloc fail!");
+               ret =  -ENOMEM;
+               goto err0;
+       }
+       screen1->lcdc_id = 1;
+       screen1->screen_id = 1;
+       printk("use lcdc%d and rk610 implemention dual display!\n",lcdc_dev->id);
+       
+#endif
        /****************get lcdc0 reg  *************************/
        res = platform_get_resource(pdev, IORESOURCE_MEM,0);
        if (res == NULL)
@@ -934,6 +951,9 @@ static int __devinit rk31_lcdc_probe (struct platform_device *pdev)
        printk("lcdc%d:reg_phy_base = 0x%08x,reg_vir_base:0x%p\n",pdev->id,lcdc_dev->reg_phy_base, lcdc_dev->preg);
        lcdc_dev->driver.dev=&pdev->dev;
        lcdc_dev->driver.screen0 = screen;
+#if defined(CONFIG_ONE_LCDC_DUAL_OUTPUT_INF)&& defined(CONFIG_RK610_LVDS)
+       lcdc_dev->driver.screen1 = screen1;
+#endif
        lcdc_dev->driver.cur_screen = screen;
        lcdc_dev->driver.screen_ctr_info = screen_ctr_info;
        spin_lock_init(&lcdc_dev->reg_lock);