diff --git a/drivers/media/vout/lcd/lcd_phy/lcd_phy_t6d.c b/drivers/media/vout/lcd/lcd_phy/lcd_phy_t6d.c index 3caeb2cec..aa8e4e124 100644 --- a/drivers/media/vout/lcd/lcd_phy/lcd_phy_t6d.c +++ b/drivers/media/vout/lcd/lcd_phy/lcd_phy_t6d.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "../lcd_reg.h" #include "lcd_phy_config.h" @@ -29,6 +30,34 @@ static unsigned int chdig_reg[5] = { ANACTRL_DIF_PHY_CNTL12, }; +static unsigned int lcd_phy_get_def_odt(void) +{ + int efuse_odt = 0; + + efuse_odt = efuse_amlogic_cali_item_read(EFUSE_CALI_SUBITEM_P2P_VINLP); + if (lcd_debug_print_flag & LCD_DBG_PR_NORMAL) + LCDPR("efuse odt=%#x\n", efuse_odt); + if (efuse_odt < 0) { + efuse_odt = PHY_DEF_ODT; + LCDERR("odt uncalibrated, use odt=%#x\n", efuse_odt); + } + return (unsigned int)efuse_odt; +} + +static unsigned int lcd_phy_get_def_bias(void) +{ + int efuse_bias = 0; + + efuse_bias = efuse_amlogic_cali_item_read(EFUSE_CALI_SUBITEM_P2P_COMMON); + if (lcd_debug_print_flag & LCD_DBG_PR_NORMAL) + LCDPR("efuse bias=%#x\n", efuse_bias); + if (efuse_bias < 0) { + efuse_bias = PHY_DEF_BIAS; + LCDERR("bias uncalibrated, use bias=%#x\n", efuse_bias); + } + return (unsigned int)efuse_bias; +} + static int lcd_phy_reg_dump(struct aml_lcd_drv_s *pdrv, char *buf, int offset) { int len = 0; @@ -334,7 +363,7 @@ static struct lcd_phy_ctrl_s lcd_phy_ctrl_t6d = { struct lcd_phy_ctrl_s *lcd_phy_config_init_t6d(void) { - cali_odt = PHY_DEF_ODT; //todo - cali_bias = PHY_DEF_BIAS; //todo + cali_odt = lcd_phy_get_def_odt(); + cali_bias = lcd_phy_get_def_bias(); return &lcd_phy_ctrl_t6d; }