lcd: tcon: set od function [2/2]
authorshaochan.liu <shaochan.liu@amlogic.com>
Fri, 12 Jul 2019 05:20:52 +0000 (13:20 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Mon, 29 Jul 2019 05:32:47 +0000 (22:32 -0700)
PD#TV-7435

Problem:
when enable od function, the left half of the screen
display is abnormal after boot

Solution:
set od function

Verify:
x301

Change-Id: Ibe4f2e7e5d9bc46c6ce880715103e2cc69d4625b
Signed-off-by: shaochan.liu <shaochan.liu@amlogic.com>
drivers/amlogic/media/vout/lcd/lcd_tcon.c
drivers/amlogic/media/vout/lcd/lcd_vout.c

index fb77059..6a3956c 100644 (file)
@@ -106,6 +106,19 @@ void lcd_tcon_reg_write(unsigned int addr, unsigned int val)
        }
 }
 
+static void lcd_tcon_od_init(unsigned char *table)
+{
+       unsigned int reg, bit, flag;
+
+       if (lcd_tcon_data->reg_core_od == REG_LCD_TCON_MAX)
+               return;
+
+       reg = lcd_tcon_data->reg_core_od;
+       bit = lcd_tcon_data->bit_od_en;
+       flag = (table[reg] >> bit) & 1;
+       lcd_tcon_od_set(flag);
+}
+
 static void lcd_tcon_od_check(unsigned char *table)
 {
        unsigned int reg, bit;
@@ -369,6 +382,7 @@ static int lcd_tcon_config(struct aml_lcd_drv_s *lcd_drv)
 #endif
 
        lcd_tcon_intr_init(lcd_drv);
+       lcd_tcon_od_init(lcd_tcon_data->reg_table);
 
        return 0;
 }
index 054605f..9a1c5dc 100644 (file)
@@ -1122,10 +1122,10 @@ static int lcd_mode_probe(struct device *dev)
                LCDERR("invalid lcd mode: %d\n", lcd_driver->lcd_mode);
                break;
        }
-       lcd_tcon_probe(lcd_driver);
        if (lcd_driver->lcd_status & LCD_STATUS_ENCL_ON)
                lcd_clk_gate_switch(1);
 
+       lcd_tcon_probe(lcd_driver);
        lcd_debug_probe();
        lcd_fops_create();