From: shaochan.liu Date: Tue, 21 May 2019 07:59:46 +0000 (+0800) Subject: lcd: add lcd tv driver when the panel disable in uboot [1/1] X-Git-Tag: hardkernel-4.9.236-104~1095 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3bb3943ab43d54fd973747caf159e7c863c5849c;p=platform%2Fkernel%2Flinux-amlogic.git lcd: add lcd tv driver when the panel disable in uboot [1/1] PD#SWPL-5937 Problem: need screen initialization moved from uboot to kernel Solution: 1, add lcd tv driver when the panel disable in uboot Verify: t962x2-x301 Change-Id: Ia7837db5f6581543b2a093357a264ee63dbd33a9 Signed-off-by: shaochan.liu --- diff --git a/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c b/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c index 81319ce..0ce5c0d 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c +++ b/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c @@ -44,6 +44,7 @@ static unsigned int lcd_output_vmode; static char lcd_output_name[30]; +static int lcd_init_on_flag; /* ************************************************** * * lcd mode function @@ -331,7 +332,19 @@ static int lcd_set_current_vmode(enum vmode_e mode) if (VMODE_LCD == (mode & VMODE_MODE_BIT_MASK)) { if (mode & VMODE_INIT_BIT_MASK) { lcd_clk_gate_switch(1); - } else { + } else if (lcd_init_on_flag == 0) { + lcd_init_on_flag = 1; + if ((lcd_drv->lcd_key_valid == 0) + && !(lcd_drv->lcd_status & LCD_STATUS_ENCL_ON)) { + aml_lcd_notifier_call_chain + (LCD_EVENT_POWER_ON, NULL); + lcd_if_enable_retry(lcd_drv->lcd_config); + } else if (lcd_drv->driver_change != NULL) { + mutex_lock(&lcd_vout_mutex); + ret = lcd_drv->driver_change(); + mutex_unlock(&lcd_vout_mutex); + } + } else if (lcd_init_on_flag == 1) { mutex_lock(&lcd_vout_mutex); ret = lcd_drv->driver_change(); mutex_unlock(&lcd_vout_mutex); diff --git a/drivers/amlogic/media/vout/lcd/lcd_vout.c b/drivers/amlogic/media/vout/lcd/lcd_vout.c index c5880b3..054605f 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_vout.c +++ b/drivers/amlogic/media/vout/lcd/lcd_vout.c @@ -1197,6 +1197,13 @@ static void lcd_config_probe_delayed(struct work_struct *work) lcd_driver = NULL; LCDERR("probe exit\n"); } + + if ((lcd_driver->lcd_status & LCD_STATUS_VMODE_ACTIVE) + && !(lcd_driver->lcd_status & LCD_STATUS_ENCL_ON)) { + LCDPR("%s: lcd_enable in kernel\n", __func__); + aml_lcd_notifier_call_chain(LCD_EVENT_POWER_ON, NULL); + lcd_if_enable_retry(lcd_driver->lcd_config); + } } static void lcd_config_default(void)