From 5fe330861e9263872cdcd7c51a81355e718f72a8 Mon Sep 17 00:00:00 2001 From: Evoke Zhang Date: Fri, 8 Jun 2018 16:25:21 +0800 Subject: [PATCH] lcd: add screen black support before backlight on [2/2] PD#167706: lcd: add screen black support before backlight on Change-Id: I5fd1eb644ae96dac279a00740d8488d4c14870cf Signed-off-by: Evoke Zhang --- drivers/amlogic/media/vout/lcd/lcd_common.h | 1 + drivers/amlogic/media/vout/lcd/lcd_debug.c | 27 +++++++++++----------- .../amlogic/media/vout/lcd/lcd_tablet/lcd_drv.c | 1 + drivers/amlogic/media/vout/lcd/lcd_tv/lcd_drv.c | 1 + 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/amlogic/media/vout/lcd/lcd_common.h b/drivers/amlogic/media/vout/lcd/lcd_common.h index 4140c7b..fad4a3d 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_common.h +++ b/drivers/amlogic/media/vout/lcd/lcd_common.h @@ -95,6 +95,7 @@ extern void lcd_venc_change(struct lcd_config_s *pconf); extern void lcd_if_enable_retry(struct lcd_config_s *pconf); /* lcd debug */ +extern void lcd_mute_setting(unsigned char flag); extern int lcd_class_creat(void); extern int lcd_class_remove(void); diff --git a/drivers/amlogic/media/vout/lcd/lcd_debug.c b/drivers/amlogic/media/vout/lcd/lcd_debug.c index 98cd778..bc2c481 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_debug.c +++ b/drivers/amlogic/media/vout/lcd/lcd_debug.c @@ -1019,7 +1019,7 @@ static void lcd_debug_test(unsigned int num) LCDPR("disable test pattern\n"); } -static void lcd_mute_setting(unsigned char flag) +void lcd_mute_setting(unsigned char flag) { LCDPR("set lcd mute: %d\n", flag); if (flag) { @@ -1052,19 +1052,18 @@ static void lcd_screen_restore(void) h_active = lcd_drv->lcd_config->lcd_basic.h_active; video_on_pixel = lcd_drv->lcd_config->lcd_timing.video_on_pixel; - if (num >= 0) { - lcd_vcbus_write(ENCL_VIDEO_RGBIN_CTRL, lcd_enc_tst[num][6]); - lcd_vcbus_write(ENCL_TST_MDSEL, lcd_enc_tst[num][0]); - lcd_vcbus_write(ENCL_TST_Y, lcd_enc_tst[num][1]); - lcd_vcbus_write(ENCL_TST_CB, lcd_enc_tst[num][2]); - lcd_vcbus_write(ENCL_TST_CR, lcd_enc_tst[num][3]); - lcd_vcbus_write(ENCL_TST_CLRBAR_STRT, video_on_pixel); - lcd_vcbus_write(ENCL_TST_CLRBAR_WIDTH, (h_active / 9)); - lcd_vcbus_write(ENCL_TST_EN, lcd_enc_tst[num][4]); - lcd_vcbus_setb(ENCL_VIDEO_MODE_ADV, lcd_enc_tst[num][5], 3, 1); - if (num > 0) - LCDPR("show test pattern: %s\n", lcd_enc_tst_str[num]); - } + + lcd_vcbus_write(ENCL_VIDEO_RGBIN_CTRL, lcd_enc_tst[num][6]); + lcd_vcbus_write(ENCL_TST_MDSEL, lcd_enc_tst[num][0]); + lcd_vcbus_write(ENCL_TST_Y, lcd_enc_tst[num][1]); + lcd_vcbus_write(ENCL_TST_CB, lcd_enc_tst[num][2]); + lcd_vcbus_write(ENCL_TST_CR, lcd_enc_tst[num][3]); + lcd_vcbus_write(ENCL_TST_CLRBAR_STRT, video_on_pixel); + lcd_vcbus_write(ENCL_TST_CLRBAR_WIDTH, (h_active / 9)); + lcd_vcbus_write(ENCL_TST_EN, lcd_enc_tst[num][4]); + lcd_vcbus_setb(ENCL_VIDEO_MODE_ADV, lcd_enc_tst[num][5], 3, 1); + if (num > 0) + LCDPR("show test pattern: %s\n", lcd_enc_tst_str[num]); } static void lcd_screen_black(void) diff --git a/drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_drv.c b/drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_drv.c index 4a735a2..3dfad10 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_drv.c +++ b/drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_drv.c @@ -913,6 +913,7 @@ void lcd_tablet_driver_init_pre(void) lcd_clk_set(pconf); lcd_venc_set(pconf); lcd_encl_tcon_set(pconf); + lcd_mute_setting(1); lcd_vcbus_write(VENC_INTCTRL, 0x200); diff --git a/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_drv.c b/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_drv.c index 2da4b90..f4c976b 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_drv.c +++ b/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_drv.c @@ -1264,6 +1264,7 @@ void lcd_tv_driver_init_pre(void) lcd_clk_set(pconf); lcd_venc_set(pconf); lcd_encl_tcon_set(pconf); + lcd_mute_setting(1); lcd_vcbus_write(VENC_INTCTRL, 0x200); -- 2.7.4