From c70658896d5a9855dc99aa22884e80ad10f6ecd4 Mon Sep 17 00:00:00 2001 From: hjc Date: Thu, 1 Aug 2013 10:09:02 +0800 Subject: [PATCH] rk3026: lcdc and lvds fix --- arch/arm/mach-rk3026/board-rk3028a-tb.c | 2 +- drivers/video/rockchip/lcdc/rk3188_lcdc.c | 4 ++-- drivers/video/rockchip/screen/lcd_b101ew05.c | 4 ++-- drivers/video/rockchip/transmitter/rk3026_lvds.c | 7 ++++--- drivers/video/rockchip/transmitter/rk3026_lvds.h | 1 + 5 files changed, 10 insertions(+), 8 deletions(-) mode change 100644 => 100755 drivers/video/rockchip/screen/lcd_b101ew05.c mode change 100644 => 100755 drivers/video/rockchip/transmitter/rk3026_lvds.c mode change 100644 => 100755 drivers/video/rockchip/transmitter/rk3026_lvds.h diff --git a/arch/arm/mach-rk3026/board-rk3028a-tb.c b/arch/arm/mach-rk3026/board-rk3028a-tb.c index 92f425688023..390a35cd8734 100755 --- a/arch/arm/mach-rk3026/board-rk3028a-tb.c +++ b/arch/arm/mach-rk3026/board-rk3028a-tb.c @@ -213,7 +213,7 @@ static int rk29_backlight_pwm_resume(void) static struct rk29_bl_info rk29_bl_info = { .pwm_id = BL_PWM, - .min_brightness=20, + .min_brightness=200, .max_brightness=255, .brightness_mode = BRIGHTNESS_MODE_CONIC, .bl_ref = PWM_EFFECT_VALUE, diff --git a/drivers/video/rockchip/lcdc/rk3188_lcdc.c b/drivers/video/rockchip/lcdc/rk3188_lcdc.c index 41548f2ebd31..7901e3e03c3b 100755 --- a/drivers/video/rockchip/lcdc/rk3188_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk3188_lcdc.c @@ -448,7 +448,7 @@ static int rk3188_lcdc_init(struct rk_lcdc_device_driver *dev_drv) } rk3188_lcdc_read_reg_defalut_cfg(lcdc_dev); - #ifdef CONFIG_ARCH_RK3188 + #if defined(CONFIG_ARCH_RK3188) if(lcdc_dev->id == 0) { #if defined(CONFIG_LCDC0_IO_18V) @@ -632,7 +632,7 @@ static int rk3188_load_screen(struct rk_lcdc_device_driver *dev_drv, bool initsc v_VASP(screen->vsync_len + screen->upper_margin)); } spin_unlock(&lcdc_dev->reg_lock); - #ifdef CONFIG_ARCH_RK3026 + #if defined(CONFIG_ARCH_RK3026) if(dev_drv->screen0->type == SCREEN_RGB) //iomux for RGB screen { iomux_set(LCDC0_DCLK); diff --git a/drivers/video/rockchip/screen/lcd_b101ew05.c b/drivers/video/rockchip/screen/lcd_b101ew05.c old mode 100644 new mode 100755 index 984a8a857657..57bed4078837 --- a/drivers/video/rockchip/screen/lcd_b101ew05.c +++ b/drivers/video/rockchip/screen/lcd_b101ew05.c @@ -5,7 +5,7 @@ #include "../transmitter/rk610_lcd.h" #endif -#if defined(CONFIG_RK610_LVDS) || defined(CONFIG_RK616_LVDS) +#if defined(CONFIG_RK610_LVDS) || defined(CONFIG_RK616_LVDS) || defined(CONFIG_RK3026_LVDS) #define SCREEN_TYPE SCREEN_LVDS #else #define SCREEN_TYPE SCREEN_RGB @@ -31,7 +31,7 @@ #define LCD_WIDTH 216 #define LCD_HEIGHT 135 /* Other */ -#if defined(CONFIG_RK610_LVDS) || defined(CONFIG_RK616_LVDS) +#if defined(CONFIG_RK610_LVDS) || defined(CONFIG_RK616_LVDS) || defined(CONFIG_RK3026_LVDS) #define DCLK_POL 1 #else #define DCLK_POL 0 diff --git a/drivers/video/rockchip/transmitter/rk3026_lvds.c b/drivers/video/rockchip/transmitter/rk3026_lvds.c old mode 100644 new mode 100755 index 7562f2ddba7b..b7f699345744 --- a/drivers/video/rockchip/transmitter/rk3026_lvds.c +++ b/drivers/video/rockchip/transmitter/rk3026_lvds.c @@ -22,6 +22,7 @@ static void rk3026_output_lvds(rk_screen *screen) { + u32 val =0; /* @@ -49,7 +50,7 @@ static void rk3026_output_lvds(rk_screen *screen) val |= (LVDS_DATA_SEL | LVDS_OUTPUT_FORMAT(3) | LVDS_CBG_PWR_EN | LVDS_PLL_PWR_EN | LVDS_OUTPUT_EN | LVDS_CBS_COL_SEL(3) | LVDS_SWING_SEL) << 16; - + val = LVDS_OUT_CONFIG; lvds_writel(val,CRU_LVDS_CON0); return; @@ -103,6 +104,7 @@ static void rk3026_output_disable(void) static int rk3026_lvds_set_param(rk_screen *screen,bool enable) { + if(OUT_ENABLE == enable){ switch(screen->type){ case SCREEN_LVDS: @@ -112,7 +114,7 @@ static int rk3026_lvds_set_param(rk_screen *screen,bool enable) rk3026_output_lvttl(screen); break; default: - printk("%s>>>>LVDS not support this screen type %d,power down LVDS\n",__func__,screen->type); + printk("%s>>>>LVDS not support this screen type %d,power down LVDS\n",__func__,screen->type); rk3026_output_disable(); break; } @@ -126,7 +128,6 @@ static int rk3026_lvds_set_param(rk_screen *screen,bool enable) static int rk3026_lvds_probe(struct platform_device *pdev) { rk_screen *screen = NULL; - screen = rk_fb_get_prmry_screen(); if(!screen) { diff --git a/drivers/video/rockchip/transmitter/rk3026_lvds.h b/drivers/video/rockchip/transmitter/rk3026_lvds.h old mode 100644 new mode 100755 index 0de11a0911e7..02c2674d7a16 --- a/drivers/video/rockchip/transmitter/rk3026_lvds.h +++ b/drivers/video/rockchip/transmitter/rk3026_lvds.h @@ -11,6 +11,7 @@ #define LVDS_INPUT_FORMAT (1<<3) #define LVDS_OUTPUT_FORMAT(x) (((x)&3)<<1) #define LVDS_DATA_SEL (1<<0) +#define LVDS_OUT_CONFIG 0xffff088a enum{ OUT_DISABLE=0, -- 2.34.1