From 5e438e8a063f08106f3b63d63ff57b3b09e00a9d Mon Sep 17 00:00:00 2001 From: yxj Date: Tue, 22 Jan 2013 20:49:27 +0800 Subject: [PATCH] board rk30sdk,ds1006h,rk3168 tb:register display devices fb,lcdc,backlight by rk_platform_add_display_devices --- arch/arm/mach-rk30/board-rk30-sdk.c | 43 +++++++++++------- arch/arm/mach-rk30/board-rk3168-ds1006h.c | 54 +++++++++++++++-------- arch/arm/mach-rk30/board-rk3168-tb.c | 44 +++++++++++------- 3 files changed, 92 insertions(+), 49 deletions(-) diff --git a/arch/arm/mach-rk30/board-rk30-sdk.c b/arch/arm/mach-rk30/board-rk30-sdk.c index 7fe738c124bd..93161fc2dfd7 100755 --- a/arch/arm/mach-rk30/board-rk30-sdk.c +++ b/arch/arm/mach-rk30/board-rk30-sdk.c @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -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) diff --git a/arch/arm/mach-rk30/board-rk3168-ds1006h.c b/arch/arm/mach-rk30/board-rk3168-ds1006h.c index f4ab1c8649a8..7c12acb6c888 100644 --- a/arch/arm/mach-rk30/board-rk3168-ds1006h.c +++ b/arch/arm/mach-rk30/board-rk3168-ds1006h.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include @@ -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 diff --git a/arch/arm/mach-rk30/board-rk3168-tb.c b/arch/arm/mach-rk30/board-rk3168-tb.c index 2e600f51177a..bd075e1ce07a 100755 --- a/arch/arm/mach-rk30/board-rk3168-tb.c +++ b/arch/arm/mach-rk30/board-rk3168-tb.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include @@ -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 -- 2.34.1