rk3188:fix rk610 hdmi and one lcdc dual screen
authoryzq <yzq@rock-chips.com>
Thu, 24 Jan 2013 14:15:54 +0000 (22:15 +0800)
committerwuhao <wuhao@wuhao@rock-chips.com>
Thu, 24 Jan 2013 14:15:54 +0000 (22:15 +0800)
drivers/mfd/rk610-core.c
drivers/video/rockchip/lcdc/rk3188_lcdc.c
drivers/video/rockchip/rk_fb.c

index 68184a72511b5932d6beed7d1544bfa76c69fd91..f9011f89e70953c570dbbead973ec113531a333a 100755 (executable)
@@ -239,7 +239,7 @@ static int rk610_control_probe(struct i2c_client *client,
                clk_set_rate(iis_clk, 11289600);
                #if defined(CONFIG_ARCH_RK29)
                rk29_mux_api_set(GPIO2D0_I2S0CLK_MIIRXCLKIN_NAME, GPIO2H_I2S0_CLK);
-               #elif defined(CONFIG_ARCH_RK3066B)
+               #elif defined(CONFIG_ARCH_RK3066B)||defined(CONFIG_ARCH_RK3188)
                iomux_set(I2S0_CLK);
                #elif defined(CONFIG_ARCH_RK30)
                 rk30_mux_api_set(GPIO0B0_I2S8CHCLK_NAME, GPIO0B_I2S_8CH_CLK);
index 3382df8d15c12a72b908234dd8f87116108ce1eb..ef19db69ed53fcdb2e8ad0b908be4f1d8e03d9af 100644 (file)
@@ -1151,6 +1151,7 @@ static int __devinit rk3188_lcdc_probe(struct platform_device *pdev)
        struct rk3188_lcdc_device *lcdc_dev = NULL;
        struct device *dev = &pdev->dev;
        rk_screen *screen;
+       rk_screen *screen1;
        struct rk29fb_info *screen_ctr_info;
        struct resource *res = NULL;
        struct resource *mem = NULL;
@@ -1165,19 +1166,38 @@ static int __devinit rk3188_lcdc_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, lcdc_dev);
        lcdc_dev->id = pdev->id;
        screen_ctr_info = (struct rk29fb_info * )pdev->dev.platform_data;
+       screen =  kzalloc(sizeof(rk_screen), GFP_KERNEL);
        if(!screen_ctr_info)
        {
                dev_err(dev, "no platform data specified for screen control info!\n");
                ret = -EINVAL;
                goto err0;
        }
-       screen =  kzalloc(sizeof(rk_screen), GFP_KERNEL);
        if(!screen)
        {
                dev_err(&pdev->dev, "rk screen kmalloc fail!");
                ret = -ENOMEM;
                goto err0;
        }
+       else
+       {
+               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, ">>rk3066b 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
        
        res = platform_get_resource(pdev, IORESOURCE_MEM,0);
        if (res == NULL)
@@ -1215,6 +1235,9 @@ static int __devinit rk3188_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->regs);
        lcdc_dev->driver.dev = 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;
        
index 2b8297d948f4f5913f79af6e18365a3f9958bd64..d2427e9702b64d1c1bdb75b56971b0e0d50474c7 100644 (file)
@@ -811,6 +811,8 @@ int rk_fb_switch_screen(rk_screen *screen ,int enable ,int lcdc_id)
                {
                        printk(KERN_WARNING "%s>>only one lcdc,dual display no supported!",__func__);
                }
+       #elif defined(CONFIG_ONE_LCDC_DUAL_OUTPUT_INF)
+               info->fbops->fb_pan_display(hdmi_var,info);
        #endif 
 
 #if defined(CONFIG_NO_DUAL_DISP)  //close backlight for device whic do not support dual display