lcd: t6d support phy efuse calibration [2/2]

PD#SWPL-180254

Problem:
lcd phy efuse calibration

Solution:
t6d phy support odt/bias calibration

Verify:
T6D BR301

Change-Id: Idf622ef207b67b7351391f735faa378c33f8c1a2
Signed-off-by: huijie.huang <huijie.huang@amlogic.com>
This commit is contained in:
huijie.huang
2024-09-04 10:49:33 +08:00
committed by gerrit autosubmit
parent bc6e434c55
commit 7513dda04c
+31 -2
View File
@@ -11,6 +11,7 @@
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/amlogic/media/vout/lcd/lcd_vout.h>
#include <linux/amlogic/efuse.h>
#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;
}