rk2928 fb: adjust fb lcdc backlight driver load and remove order
authoryxj <yxj@rock-chips.com>
Thu, 30 Aug 2012 02:11:47 +0000 (10:11 +0800)
committeryxj <yxj@rock-chips.com>
Thu, 30 Aug 2012 04:26:00 +0000 (12:26 +0800)
load: fb-->lcdc-->backlight
remove backlight-->lcdc-->fb

arch/arm/mach-rk2928/board-rk2928-a720.c
arch/arm/mach-rk2928/board-rk2928-sdk.c
arch/arm/mach-rk2928/devices.c
drivers/video/rockchip/chips/rk2928_lcdc.c

index 821866e2f02bc3d0964e2dc09248cef933819374..4ab211558542d0539dc72304d0b860e442a76171 100755 (executable)
@@ -239,6 +239,35 @@ static struct platform_device device_fb = {
 };
 #endif
 
+//LCDC
+#ifdef CONFIG_LCDC_RK2928
+static struct resource resource_lcdc[] = {
+       [0] = {
+               .name  = "lcdc reg",
+               .start = RK2928_LCDC_PHYS,
+               .end   = RK2928_LCDC_PHYS + RK2928_LCDC_SIZE - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       
+       [1] = {
+               .name  = "lcdc irq",
+               .start = IRQ_LCDC,
+               .end   = IRQ_LCDC,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device device_lcdc = {
+       .name             = "rk2928-lcdc",
+       .id               = 0,
+       .num_resources    = ARRAY_SIZE(resource_lcdc),
+       .resource         = resource_lcdc,
+       .dev            = {
+               .platform_data = &lcdc_screen_info,
+       },
+};
+#endif
+
 #ifdef CONFIG_ION
 #define ION_RESERVE_SIZE        (80 * SZ_1M)
 static struct ion_platform_data rk30_ion_pdata = {
@@ -461,12 +490,15 @@ static struct platform_device device_acodec = {
 #endif
 
 static struct platform_device *devices[] __initdata = {
-#ifdef CONFIG_BACKLIGHT_RK29_BL
-       &rk29_device_backlight,
-#endif
 #ifdef CONFIG_FB_ROCKCHIP
        &device_fb,
 #endif
+#ifdef CONFIG_LCDC_RK2928
+       &device_lcdc,
+#endif
+#ifdef CONFIG_BACKLIGHT_RK29_BL
+       &rk29_device_backlight,
+#endif
 #ifdef CONFIG_ION
        &device_ion,
 #endif
index 0e743011f20f8b5c51a3b2bc4aa8da0d3c6b70fd..90dd117d379d30e10c396245487b778944074d36 100755 (executable)
@@ -356,6 +356,35 @@ static struct platform_device device_fb = {
 };
 #endif
 
+//LCDC
+#ifdef CONFIG_LCDC_RK2928
+static struct resource resource_lcdc[] = {
+       [0] = {
+               .name  = "lcdc reg",
+               .start = RK2928_LCDC_PHYS,
+               .end   = RK2928_LCDC_PHYS + RK2928_LCDC_SIZE - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       
+       [1] = {
+               .name  = "lcdc irq",
+               .start = IRQ_LCDC,
+               .end   = IRQ_LCDC,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device device_lcdc = {
+       .name             = "rk2928-lcdc",
+       .id               = 0,
+       .num_resources    = ARRAY_SIZE(resource_lcdc),
+       .resource         = resource_lcdc,
+       .dev            = {
+               .platform_data = &lcdc_screen_info,
+       },
+};
+#endif
+
 #ifdef CONFIG_ION
 #define ION_RESERVE_SIZE        (80 * SZ_1M)
 static struct ion_platform_data rk30_ion_pdata = {
@@ -659,12 +688,15 @@ static struct platform_device device_acodec = {
 #endif
 
 static struct platform_device *devices[] __initdata = {
-#ifdef CONFIG_BACKLIGHT_RK29_BL
-       &rk29_device_backlight,
-#endif
 #ifdef CONFIG_FB_ROCKCHIP
        &device_fb,
 #endif
+#ifdef CONFIG_LCDC_RK2928
+       &device_lcdc,
+#endif
+#ifdef CONFIG_BACKLIGHT_RK29_BL
+       &rk29_device_backlight,
+#endif
 #ifdef CONFIG_ION
        &device_ion,
 #endif
index 225266270ecaa6d43f6fb80079e78528c2b72fba..f6c2717d37face8f5ffaa6f426c4f797232f2b6e 100755 (executable)
@@ -203,37 +203,6 @@ static void __init rk2928_init_uart(void)
 #endif
 }
 
-
-//LCDC
-#ifdef CONFIG_LCDC_RK2928
-extern struct rk29fb_info lcdc_screen_info;
-static struct resource resource_lcdc[] = {
-       [0] = {
-               .name  = "lcdc reg",
-               .start = RK2928_LCDC_PHYS,
-               .end   = RK2928_LCDC_PHYS + RK2928_LCDC_SIZE - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       
-       [1] = {
-               .name  = "lcdc irq",
-               .start = IRQ_LCDC,
-               .end   = IRQ_LCDC,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device device_lcdc = {
-       .name             = "rk2928-lcdc",
-       .id               = 0,
-       .num_resources    = ARRAY_SIZE(resource_lcdc),
-       .resource         = resource_lcdc,
-       .dev            = {
-               .platform_data = &lcdc_screen_info,
-       },
-};
-#endif
-
 // i2c
 #ifdef CONFIG_I2C_RK30
 #ifdef CONFIG_I2C0_CONTROLLER_RK29
@@ -893,9 +862,6 @@ static int __init rk2928_init_devices(void)
 #ifdef CONFIG_RGA_RK30
        platform_device_register(&device_rga);
 #endif
-#ifdef CONFIG_LCDC_RK2928
-       platform_device_register(&device_lcdc);
-#endif
 #ifdef CONFIG_USB20_OTG
        platform_device_register(&device_usb20_otg);
 #endif
index cb1bf46b895c8624e7dc13e694708faad918ce9c..45c780617987ae8c101fed3c64569aa7080939b6 100755 (executable)
@@ -1065,6 +1065,12 @@ static int __devexit rk2928_lcdc_remove(struct platform_device *pdev)
 static void rk2928_lcdc_shutdown(struct platform_device *pdev)
 {
        struct rk2928_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
+               lcdc_dev->driver.cur_screen->sscreen_set(lcdc_dev->driver.cur_screen , 0);
        rk_fb_unregister(&(lcdc_dev->driver));
        rk2928_lcdc_deinit(lcdc_dev);
        /*iounmap(lcdc_dev->reg_vir_base);