rk3066b lcdc: adjust fb lcdc backlight driver load and remove order as rk30 rk2928
authoryxj <yxj@rock-chips.com>
Thu, 30 Aug 2012 03:12:30 +0000 (11:12 +0800)
committeryxj <yxj@rock-chips.com>
Thu, 30 Aug 2012 04:26:00 +0000 (12:26 +0800)
arch/arm/mach-rk30/board-rk3066b-sdk.c
drivers/video/rockchip/chips/rk31_lcdc.c

index cc892ce9011022b4ed6d152717a757000528bd08..471a61aba250a5af9090d24299b8db528910fd5d 100644 (file)
@@ -546,6 +546,60 @@ static struct platform_device device_fb = {
 };
 #endif
 
+#if defined(CONFIG_LCDC0_RK31)
+static struct resource resource_lcdc0[] = {
+       [0] = {
+               .name  = "lcdc0 reg",
+               .start = RK30_LCDC0_PHYS,
+               .end   = RK30_LCDC0_PHYS + RK30_LCDC0_SIZE - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       
+       [1] = {
+               .name  = "lcdc0 irq",
+               .start = IRQ_LCDC0,
+               .end   = IRQ_LCDC0,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device device_lcdc0 = {
+       .name             = "rk30-lcdc",
+       .id               = 0,
+       .num_resources    = ARRAY_SIZE(resource_lcdc0),
+       .resource         = resource_lcdc0,
+       .dev            = {
+               .platform_data = &lcdc0_screen_info,
+       },
+};
+#endif
+#if defined(CONFIG_LCDC1_RK31) 
+static struct resource resource_lcdc1[] = {
+       [0] = {
+               .name  = "lcdc1 reg",
+               .start = RK30_LCDC1_PHYS,
+               .end   = RK30_LCDC1_PHYS + RK30_LCDC1_SIZE - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .name  = "lcdc1 irq",
+               .start = IRQ_LCDC1,
+               .end   = IRQ_LCDC1,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device device_lcdc1 = {
+       .name             = "rk30-lcdc",
+       .id               = 1,
+       .num_resources    = ARRAY_SIZE(resource_lcdc1),
+       .resource         = resource_lcdc1,
+       .dev            = {
+               .platform_data = &lcdc1_screen_info,
+       },
+};
+#endif
+
 #ifdef CONFIG_ANDROID_TIMED_GPIO
 static struct timed_gpio timed_gpios[] = {
        {
@@ -966,12 +1020,20 @@ static struct platform_device device_rfkill_rk = {
 #endif
 
 static struct platform_device *devices[] __initdata = {
-#ifdef CONFIG_BACKLIGHT_RK29_BL
-       &rk29_device_backlight,
-#endif
 #ifdef CONFIG_FB_ROCKCHIP
        &device_fb,
 #endif
+#if defined(CONFIG_LCDC0_RK31)
+       &device_lcdc0,
+#endif
+#if defined(CONFIG_LCDC1_RK31)
+       &device_lcdc1,
+#endif
+               
+#ifdef CONFIG_BACKLIGHT_RK29_BL
+       &rk29_device_backlight,
+#endif
+
 #ifdef CONFIG_ION
        &device_ion,
 #endif
index 6fa2e3640ae429d1c5fdd7651c29ba8f1959bf13..300167faa0be5839432019adc7f4da953d272cd7 100644 (file)
@@ -981,6 +981,12 @@ static int __devexit rk31_lcdc_remove(struct platform_device *pdev)
 static void rk31_lcdc_shutdown(struct platform_device *pdev)
 {
        struct rk31_lcdc_device *lcdc_dev = platform_get_drvdata(pdev);
+       if(lcdc_dev->driver.cur_screen->standby) //standby the screen if necessary
+               lcdc_dev->driver.cur_screen->standby(1);
+       if(lcdc_dev->driver.screen_ctr_info->io_disable) //power off the screen if necessary
+               lcdc_dev->driver.screen_ctr_info->io_disable();
+       if(lcdc_dev->driver.cur_screen->sscreen_set) //turn off  lvds if necessary
+               lcdc_dev->driver.cur_screen->sscreen_set(lcdc_dev->driver.cur_screen , 0);
        rk_fb_unregister(&(lcdc_dev->driver));
        rk31_lcdc_deinit(lcdc_dev);
        /*iounmap(lcdc_dev->reg_vir_base);