#ifdef CONFIG_AMLOGIC_LCD
#include <linux/amlogic/media/vout/lcd/lcd_notify.h>
#include <linux/amlogic/media/vout/lcd/lcd_unifykey.h>
+#include <linux/amlogic/media/vout/lcd/lcd_vout.h>
#endif
#ifdef CONFIG_AMLOGIC_BL_EXTERN
#include <linux/amlogic/media/vout/lcd/aml_bl_extern.h>
static void aml_bl_init_status_update(void)
{
+ struct aml_lcd_drv_s *lcd_drv = aml_lcd_get_driver();
+ struct lcd_config_s *pconf;
unsigned int state;
+ pconf = lcd_drv->lcd_config;
+
+ if (pconf->lcd_boot_ctrl->lcd_init_level)
+ return;
+
state = bl_vcbus_read(ENCL_VIDEO_EN);
if (state == 0) /* default disable lcd & backlight */
return;
.lcd_type = LCD_TYPE_MAX,
.lcd_bits = 0,
.advanced_flag = 0,
+ .lcd_init_level = 0,
.debug_print_flag = 0,
.debug_test_pattern = 0,
.debug_para_source = 0,
{
mutex_lock(&lcd_vout_mutex);
+ if (lcd_driver->lcd_status & LCD_STATUS_ENCL_ON) {
+ LCDPR("%s: on already\n", __func__);
+ mutex_unlock(&lcd_vout_mutex);
+ return;
+ }
+
lcd_driver->driver_init_pre();
lcd_driver->lcd_status |= LCD_STATUS_ENCL_ON;
{
mutex_lock(&lcd_vout_mutex);
+ if (!(lcd_driver->lcd_status & LCD_STATUS_ENCL_ON)) {
+ LCDPR("%s: off already\n", __func__);
+ mutex_unlock(&lcd_vout_mutex);
+ return;
+ }
lcd_driver->lcd_status &= ~LCD_STATUS_ENCL_ON;
lcd_driver->driver_disable_post();
static void lcd_power_if_on(void)
{
mutex_lock(&lcd_vout_mutex);
-
- lcd_driver->power_ctrl(1);
- lcd_driver->lcd_status |= LCD_STATUS_IF_ON;
+ if (!(lcd_driver->lcd_status & LCD_STATUS_IF_ON)) {
+ lcd_driver->power_ctrl(1);
+ lcd_driver->lcd_status |= LCD_STATUS_IF_ON;
+ }
lcd_driver->lcd_config->change_flag = 0;
-
mutex_unlock(&lcd_vout_mutex);
}
static void lcd_power_if_off(void)
{
mutex_lock(&lcd_vout_mutex);
-
- lcd_driver->lcd_status &= ~LCD_STATUS_IF_ON;
- lcd_driver->power_ctrl(0);
-
+ if (lcd_driver->lcd_status & LCD_STATUS_IF_ON) {
+ lcd_driver->lcd_status &= ~LCD_STATUS_IF_ON;
+ lcd_driver->power_ctrl(0);
+ }
mutex_unlock(&lcd_vout_mutex);
}
pconf->lcd_basic.v_active = lcd_vcbus_read(ENCL_VIDEO_VAVON_ELINE)
- lcd_vcbus_read(ENCL_VIDEO_VAVON_BLINE) + 1;
if (lcd_vcbus_read(ENCL_VIDEO_EN)) {
- lcd_driver->lcd_status = LCD_STATUS_ON;
+ if (lcd_boot_ctrl_config.lcd_init_level)
+ lcd_driver->lcd_status = LCD_STATUS_ENCL_ON;
+ else
+ lcd_driver->lcd_status = LCD_STATUS_ON;
lcd_resume_flag = 1;
} else {
lcd_driver->lcd_status = 0;
lcd_boot_ctrl_config.lcd_type = 0xf & lcd_ctrl;
lcd_boot_ctrl_config.lcd_bits = 0xf & (lcd_ctrl >> 4);
lcd_boot_ctrl_config.advanced_flag = 0xff & (lcd_ctrl >> 8);
- lcd_boot_ctrl_config.debug_print_flag = 0xf & (lcd_ctrl >> 16);
+ lcd_boot_ctrl_config.lcd_init_level = 0x1 & (lcd_ctrl >> 19);
+ lcd_boot_ctrl_config.debug_print_flag = 0xf & (lcd_ctrl >> 20);
lcd_boot_ctrl_config.debug_test_pattern = 0xf & (lcd_ctrl >> 24);
lcd_boot_ctrl_config.debug_para_source = 0x3 & (lcd_ctrl >> 28);
lcd_boot_ctrl_config.debug_lcd_mode = 0x3 & (lcd_ctrl >> 30);
unsigned char lcd_type; //bit[3:0]
unsigned char lcd_bits; //bit[7:4] bits:6 or 8
unsigned char advanced_flag; //bit[15:8]
- unsigned char debug_print_flag; //bit[19:16]
+ unsigned char lcd_init_level; //bit[19]
+ unsigned char debug_print_flag; //bit[23:20]
unsigned char debug_test_pattern; //bit[27:24]
unsigned char debug_para_source;//bit[29:28]
//0:normal, 1:dts, 2:unifykey, 3:TBD