board rk30sdk,ds1006h,rk3168 tb:register display devices fb,lcdc,backlight by rk_pla...
authoryxj <yxj@rock-chips.com>
Tue, 22 Jan 2013 12:49:27 +0000 (20:49 +0800)
committeryxj <yxj@rock-chips.com>
Tue, 22 Jan 2013 12:51:23 +0000 (20:51 +0800)
arch/arm/mach-rk30/board-rk30-sdk.c
arch/arm/mach-rk30/board-rk3168-ds1006h.c
arch/arm/mach-rk30/board-rk3168-tb.c

index 7fe738c124bddbc0d5a197b50b4f001dc24ba916..93161fc2dfd71f79d264638c91d002dd648843b4 100755 (executable)
@@ -40,7 +40,6 @@
 #include <mach/io.h>
 #include <mach/gpio.h>
 #include <mach/iomux.h>
-#include <linux/fb.h>
 #include <linux/regulator/machine.h>
 #include <linux/rfkill-rk.h>
 #include <linux/sensor-dev.h>
@@ -1436,20 +1435,6 @@ static struct platform_device device_mt6622 = {
 #endif
 
 static struct platform_device *devices[] __initdata = {
-#ifdef CONFIG_FB_ROCKCHIP
-       &device_fb,
-#endif
-#if defined(CONFIG_LCDC0_RK30)
-       &device_lcdc0,
-#endif
-#if defined(CONFIG_LCDC1_RK30)
-       &device_lcdc1,
-#endif
-
-#ifdef CONFIG_BACKLIGHT_RK29_BL
-       &rk29_device_backlight,
-#endif
-
 #ifdef CONFIG_ION
        &device_ion,
 #endif
@@ -1496,6 +1481,33 @@ static struct platform_device *devices[] __initdata = {
 #endif
 };
 
+
+static int rk_platform_add_display_devices(void)
+{
+       struct platform_device *fb = NULL;  //fb
+       struct platform_device *lcdc0 = NULL; //lcdc0
+       struct platform_device *lcdc1 = NULL; //lcdc1
+       struct platform_device *bl = NULL; //backlight
+#ifdef CONFIG_FB_ROCKCHIP
+       fb = &device_fb;
+#endif
+
+#if defined(CONFIG_LCDC0_RK30)
+       lcdc0 = &device_lcdc0,
+#endif
+
+#if defined(CONFIG_LCDC1_RK30)
+       lcdc1 = &device_lcdc1,
+#endif
+
+#ifdef CONFIG_BACKLIGHT_RK29_BL
+       bl = &rk29_device_backlight,
+#endif
+       __rk_platform_add_display_devices(fb,lcdc0,lcdc1,bl);
+
+       return 0;
+       
+}
 // i2c
 #ifdef CONFIG_I2C0_RK30
 static struct i2c_board_info __initdata i2c0_info[] = {
@@ -1813,6 +1825,7 @@ static void __init machine_rk30_board_init(void)
        rk30_i2c_register_board_info();
        spi_register_board_info(board_spi_devices, ARRAY_SIZE(board_spi_devices));
        platform_add_devices(devices, ARRAY_SIZE(devices));
+       rk_platform_add_display_devices();
        board_usb_detect_init(RK30_PIN6_PA3);
 
 #if defined(CONFIG_WIFI_CONTROL_FUNC)
index f4ab1c8649a8bbb73ba3265470e6fff70beaac63..7c12acb6c88803d9a7990eb9b74ff4bab0302520 100644 (file)
@@ -40,7 +40,7 @@
 #include <mach/io.h>
 #include <mach/gpio.h>
 #include <mach/iomux.h>
-#include <linux/fb.h>
+#include <linux/rk_fb.h>
 #include <linux/regulator/machine.h>
 #include <linux/rfkill-rk.h>
 #include <linux/sensor-dev.h>
@@ -397,11 +397,11 @@ static int rk_fb_io_enable(void)
 
 #if defined(CONFIG_LCDC0_RK3066B)
 struct rk29fb_info lcdc0_screen_info = {
-       .prop      = PRMRY,             //primary display device
-       .io_init   = rk_fb_io_init,
-       .io_disable = rk_fb_io_disable,
-       .io_enable = rk_fb_io_enable,
-       .set_screen_info = set_lcd_info,
+       .prop      = EXTEND,            //primary display device
+       .io_init   = NULL,
+       .io_disable = NULL,
+       .io_enable = NULL,
+       .set_screen_info = NULL,
 };
 #endif
 
@@ -1041,19 +1041,6 @@ static struct platform_device device_mt6622 = {
 #endif
 
 static struct platform_device *devices[] __initdata = {
-#ifdef CONFIG_FB_ROCKCHIP
-       &device_fb,
-#endif
-#if defined(CONFIG_LCDC0_RK3066B)
-       &device_lcdc0,
-#endif
-#if defined(CONFIG_LCDC1_RK3066B)
-       &device_lcdc1,
-#endif
-
-#ifdef CONFIG_BACKLIGHT_RK29_BL
-       &rk29_device_backlight,
-#endif
 
 #ifdef CONFIG_ION
        &device_ion,
@@ -1080,6 +1067,34 @@ static struct platform_device *devices[] __initdata = {
 #endif
 };
 
+
+static int rk_platform_add_display_devices(void)
+{
+       struct platform_device *fb = NULL;  //fb
+       struct platform_device *lcdc0 = NULL; //lcdc0
+       struct platform_device *lcdc1 = NULL; //lcdc1
+       struct platform_device *bl = NULL; //backlight
+#ifdef CONFIG_FB_ROCKCHIP
+       fb = &device_fb;
+#endif
+
+#if defined(CONFIG_LCDC0_RK3066B)
+       lcdc0 = &device_lcdc0,
+#endif
+
+#if defined(CONFIG_LCDC1_RK3066B)
+       lcdc1 = &device_lcdc1,
+#endif
+
+#ifdef CONFIG_BACKLIGHT_RK29_BL
+       bl = &rk29_device_backlight,
+#endif
+       __rk_platform_add_display_devices(fb,lcdc0,lcdc1,bl);
+
+       return 0;
+       
+}
+
 // i2c
 #ifdef CONFIG_I2C0_RK30
 static struct i2c_board_info __initdata i2c0_info[] = {
@@ -1667,6 +1682,7 @@ static void __init machine_rk30_board_init(void)
        rk30_i2c_register_board_info();
        spi_register_board_info(board_spi_devices, ARRAY_SIZE(board_spi_devices));
        platform_add_devices(devices, ARRAY_SIZE(devices));
+       rk_platform_add_display_devices();
        board_usb_detect_init(RK30_PIN0_PA7);
 
 #ifdef CONFIG_WIFI_CONTROL_FUNC
index 2e600f51177a0da99df656926d4696d2cca801da..bd075e1ce07ab718f80916a99c6c6f02c1074118 100755 (executable)
@@ -40,7 +40,7 @@
 #include <mach/io.h>
 #include <mach/gpio.h>
 #include <mach/iomux.h>
-#include <linux/fb.h>
+#include <linux/rk_fb.h>
 #include <linux/regulator/machine.h>
 #include <linux/rfkill-rk.h>
 #include <linux/sensor-dev.h>
@@ -1230,20 +1230,6 @@ struct platform_device rk_device_gps = {
 
 
 static struct platform_device *devices[] __initdata = {
-#ifdef CONFIG_FB_ROCKCHIP
-       &device_fb,
-#endif
-#if defined(CONFIG_LCDC0_RK3066B) || defined(CONFIG_LCDC0_RK3188)
-       &device_lcdc0,
-#endif
-#if defined(CONFIG_LCDC1_RK3066B) || defined(CONFIG_LCDC1_RK3188)
-       &device_lcdc1,
-#endif
-
-#ifdef CONFIG_BACKLIGHT_RK29_BL
-       &rk29_device_backlight,
-#endif
-
 #ifdef CONFIG_ION
        &device_ion,
 #endif
@@ -1283,6 +1269,33 @@ static struct platform_device *devices[] __initdata = {
 
 };
 
+static int rk_platform_add_display_devices(void)
+{
+       struct platform_device *fb = NULL;  //fb
+       struct platform_device *lcdc0 = NULL; //lcdc0
+       struct platform_device *lcdc1 = NULL; //lcdc1
+       struct platform_device *bl = NULL; //backlight
+#ifdef CONFIG_FB_ROCKCHIP
+       fb = &device_fb;
+#endif
+
+#if defined(CONFIG_LCDC0_RK3066B) || defined(CONFIG_LCDC0_RK3188)
+       lcdc0 = &device_lcdc0,
+#endif
+
+#if defined(CONFIG_LCDC1_RK3066B) || defined(CONFIG_LCDC1_RK3188)
+       lcdc1 = &device_lcdc1,
+#endif
+
+#ifdef CONFIG_BACKLIGHT_RK29_BL
+       bl = &rk29_device_backlight,
+#endif
+       __rk_platform_add_display_devices(fb,lcdc0,lcdc1,bl);
+
+       return 0;
+       
+}
+
 // i2c
 #ifdef CONFIG_I2C0_RK30
 static struct i2c_board_info __initdata i2c0_info[] = {
@@ -1939,6 +1952,7 @@ static void __init machine_rk30_board_init(void)
        rk30_i2c_register_board_info();
        spi_register_board_info(board_spi_devices, ARRAY_SIZE(board_spi_devices));
        platform_add_devices(devices, ARRAY_SIZE(devices));
+       rk_platform_add_display_devices();
        board_usb_detect_init(RK30_PIN0_PA7);
 
 #ifdef CONFIG_WIFI_CONTROL_FUNC