lcd: fix phy not set [1/1]

PD#SWPL-97537

Problem:
lcd phy lane_lock not set when lcd probed in uboot,
result in ANA_CNTL19 set to 0 when lcd1&2 probe but conflict;
By the way, correct a few typo error.

Solution:
add lcd_phy_set() to lcd_phy_probe()

Verify:
t7c

Signed-off-by: lizhi.hu <lizhi.hu@amlogic.com>
Change-Id: I0c4889be119c3c222af81e46d8f304ef11c172c2
This commit is contained in:
lizhi.hu
2022-10-20 16:32:40 +08:00
committed by Qianggui Song
parent 3ee6296968
commit 7144589547
6 changed files with 84 additions and 6 deletions
+1 -1
View File
@@ -2731,7 +2731,7 @@ u32 vlock_fsm_en_step1_func(struct stvlock_sig_sts *pvlock,
/*WRITE_VPP_REG_BITS(VPU_VLOCK_CTRL + offset_vlck, 0, 5, 1);*/
vlock_reset(pvlock, 0);
/*
* tl1 auto pll,swich clk need after
* tl1 auto pll,switch clk need after
*several frames
*/
+1 -1
View File
@@ -2178,7 +2178,7 @@ static int bl_brightness_dimming_notifier(struct notifier_block *nb,
unsigned int level;
/* If we aren't interested in this event, skip it immediately */
if (event != LCD_EVENT_BACKLIGHT_BRTNESS_DIM)
if (event != LCD_EVENT_BACKLIGHT_BRIGHTNESS_DIM)
return NOTIFY_DONE;
if (aml_bl_check_driver(bdrv))
+78
View File
@@ -26,6 +26,9 @@ static void lcd_mipi_phy_set_axg(struct aml_lcd_drv_s *pdrv, int status)
unsigned int phy_reg, phy_bit, phy_width;
unsigned int lane_cnt;
if (status == 2)
return;
if (status) {
/* HHI_MIPI_CNTL0 */
/* DIF_REF_CTL1:31-16bit, DIF_REF_CTL0:15-0bit */
@@ -78,6 +81,9 @@ static void lcd_mipi_phy_set_g12a(struct aml_lcd_drv_s *pdrv, int status)
unsigned int phy_reg, phy_bit, phy_width;
unsigned int lane_cnt;
if (status == 2)
return;
if (status) {
/* HHI_MIPI_CNTL0 */
/* DIF_REF_CTL1:31-16bit, DIF_REF_CTL0:15-0bit */
@@ -228,6 +234,9 @@ static void lcd_lvds_phy_set_tl1(struct aml_lcd_drv_s *pdrv, int status)
unsigned int data32 = 0, size;
struct lvds_config_s *lvds_conf;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -259,6 +268,9 @@ static void lcd_vbyone_phy_set_tl1(struct aml_lcd_drv_s *pdrv, int status)
unsigned int data32 = 0, size;
struct vbyone_config_s *vbyone_conf;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -299,6 +311,9 @@ static void lcd_mlvds_phy_set_tl1(struct aml_lcd_drv_s *pdrv, int status)
unsigned int data32 = 0, size, ckdi;
struct mlvds_config_s *mlvds_conf;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -331,6 +346,9 @@ static void lcd_p2p_phy_set_tl1(struct aml_lcd_drv_s *pdrv, int status)
unsigned int data32 = 0, size;
struct p2p_config_s *p2p_conf;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -465,6 +483,9 @@ static void lcd_lvds_phy_set_t5(struct aml_lcd_drv_s *pdrv, int status)
struct phy_config_s *phy = &pdrv->config.phy_cfg;
unsigned int cntl14 = 0;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -500,6 +521,9 @@ static void lcd_vbyone_phy_set_t5(struct aml_lcd_drv_s *pdrv, int status)
struct phy_config_s *phy = &pdrv->config.phy_cfg;
unsigned int cntl14 = 0;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -542,6 +566,9 @@ static void lcd_mlvds_phy_set_t5(struct aml_lcd_drv_s *pdrv, int status)
struct phy_config_s *phy = &pdrv->config.phy_cfg;
unsigned int ckdi, cntl14 = 0;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -582,6 +609,9 @@ static void lcd_p2p_phy_set_t5(struct aml_lcd_drv_s *pdrv, int status)
struct phy_config_s *phy = &pdrv->config.phy_cfg;
unsigned int cntl14 = 0;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -748,6 +778,9 @@ static void lcd_lvds_phy_set_t7(struct aml_lcd_drv_s *pdrv, int status)
return;
}
lcd_phy_ctrl->lane_lock |= flag;
if (status == 2)
goto phy_set_done;
if (lcd_debug_print_flag & LCD_DBG_PR_NORMAL) {
LCDPR("vswing_level=0x%x, preem_level=0x%x\n",
phy->vswing_level, phy->preem_level);
@@ -769,6 +802,7 @@ static void lcd_lvds_phy_set_t7(struct aml_lcd_drv_s *pdrv, int status)
lcd_ana_write(ANACTRL_DIF_PHY_CNTL21, 0);
}
phy_set_done:
if (lcd_debug_print_flag & LCD_DBG_PR_NORMAL)
LCDPR("phy lane_lock: 0x%x\n", lcd_phy_ctrl->lane_lock);
}
@@ -802,6 +836,9 @@ static void lcd_vbyone_phy_set_t7(struct aml_lcd_drv_s *pdrv, int status)
return;
}
lcd_phy_ctrl->lane_lock |= flag;
if (status == 2)
goto phy_set_done;
if (lcd_debug_print_flag & LCD_DBG_PR_NORMAL) {
LCDPR("vswing_level=0x%x, preem_level=0x%x\n",
phy->vswing_level, phy->preem_level);
@@ -823,6 +860,7 @@ static void lcd_vbyone_phy_set_t7(struct aml_lcd_drv_s *pdrv, int status)
lcd_ana_write(ANACTRL_DIF_PHY_CNTL21, 0);
}
phy_set_done:
if (lcd_debug_print_flag & LCD_DBG_PR_NORMAL)
LCDPR("phy lane_lock: 0x%x\n", lcd_phy_ctrl->lane_lock);
}
@@ -855,6 +893,8 @@ static void lcd_mipi_phy_set_t7(struct aml_lcd_drv_s *pdrv, int status)
return;
}
lcd_phy_ctrl->lane_lock |= flag;
if (status == 2)
goto phy_set_done;
data_lane0_aux = 0x022a0028;
data_lane1_aux = 0x0000ffcf;
@@ -883,6 +923,7 @@ static void lcd_mipi_phy_set_t7(struct aml_lcd_drv_s *pdrv, int status)
lcd_ana_write(ANACTRL_DIF_PHY_CNTL20, 0);
}
phy_set_done:
if (lcd_debug_print_flag & LCD_DBG_PR_NORMAL)
LCDPR("phy lane_lock: 0x%x\n", lcd_phy_ctrl->lane_lock);
}
@@ -916,6 +957,9 @@ static void lcd_edp_phy_set_t7(struct aml_lcd_drv_s *pdrv, int status)
return;
}
lcd_phy_ctrl->lane_lock |= flag;
if (status == 2)
goto phy_set_done;
if (lcd_debug_print_flag & LCD_DBG_PR_NORMAL) {
LCDPR("vswing_level=0x%x, preem_level=0x%x\n",
phy->vswing_level, phy->preem_level);
@@ -937,6 +981,7 @@ static void lcd_edp_phy_set_t7(struct aml_lcd_drv_s *pdrv, int status)
lcd_ana_write(ANACTRL_DIF_PHY_CNTL21, 0);
}
phy_set_done:
if (lcd_debug_print_flag & LCD_DBG_PR_NORMAL)
LCDPR("phy lane_lock: 0x%x\n", lcd_phy_ctrl->lane_lock);
}
@@ -953,6 +998,9 @@ static void lcd_phy_cntl_set_t3(struct phy_config_s *phy, int status, int bypass
unsigned int cntl15 = 0, cntl16 = 0;
unsigned int data = 0, chreg = 0, chctl = 0;
if (status == 2)
return;
if (!lcd_phy_ctrl)
return;
@@ -1018,6 +1066,9 @@ static void lcd_lvds_phy_set_t3(struct aml_lcd_drv_s *pdrv, int status)
struct phy_config_s *phy = &pdrv->config.phy_cfg;
unsigned int cntl14 = 0;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -1054,6 +1105,9 @@ static void lcd_vbyone_phy_set_t3(struct aml_lcd_drv_s *pdrv, int status)
struct phy_config_s *phy = &pdrv->config.phy_cfg;
unsigned int cntl14 = 0;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -1096,6 +1150,9 @@ static void lcd_mlvds_phy_set_t3(struct aml_lcd_drv_s *pdrv, int status)
struct phy_config_s *phy = &pdrv->config.phy_cfg;
unsigned int ckdi, cntl14 = 0;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -1136,6 +1193,9 @@ static void lcd_p2p_phy_set_t3(struct aml_lcd_drv_s *pdrv, int status)
struct phy_config_s *phy = &pdrv->config.phy_cfg;
unsigned int cntl14;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -1285,6 +1345,9 @@ static void lcd_lvds_phy_set_t5w(struct aml_lcd_drv_s *pdrv, int status)
struct phy_config_s *phy = &pdrv->config.phy_cfg;
unsigned int cntl14 = 0;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -1321,6 +1384,9 @@ static void lcd_vbyone_phy_set_t5w(struct aml_lcd_drv_s *pdrv, int status)
struct phy_config_s *phy = &pdrv->config.phy_cfg;
unsigned int cntl14 = 0;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -1363,6 +1429,9 @@ static void lcd_mlvds_phy_set_t5w(struct aml_lcd_drv_s *pdrv, int status)
struct phy_config_s *phy = &pdrv->config.phy_cfg;
unsigned int ckdi, cntl14 = 0;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -1403,6 +1472,9 @@ static void lcd_p2p_phy_set_t5w(struct aml_lcd_drv_s *pdrv, int status)
struct phy_config_s *phy = &pdrv->config.phy_cfg;
unsigned int cntl14 = 0;
if (status == 2)
return;
if (lcd_debug_print_flag & LCD_DBG_PR_ADV)
LCDPR("%s: %d\n", __func__, status);
@@ -1481,6 +1553,9 @@ static void lcd_p2p_phy_set_t5w(struct aml_lcd_drv_s *pdrv, int status)
static void lcd_mipi_phy_set_c3(struct aml_lcd_drv_s *pdrv, int status)
{
if (status == 2)
return;
if (status) {
lcd_ana_write(ANACTRL_MIPIDSI_CTRL0, 0xa4870008);
lcd_ana_write(ANACTRL_MIPIDSI_CTRL1, 0x0001002e);
@@ -1691,6 +1766,9 @@ int lcd_phy_probe(struct aml_lcd_drv_s *pdrv)
break;
}
if (pdrv->status & LCD_STATUS_IF_ON)
lcd_phy_set(pdrv, 2);
return 0;
}
+1 -1
View File
@@ -1690,7 +1690,7 @@ int lcd_tcon_data_multi_set(struct aml_lcd_drv_s *pdrv,
for (i = 0; i < mm_table->data_multi_cnt; i++) {
data_multi = &mm_table->data_multi[i];
/* bypass LCD_TCON_DATA_BLOCK_TYPE_BASIC_INIT for multi lut swich */
/* bypass LCD_TCON_DATA_BLOCK_TYPE_BASIC_INIT for multi lut switch */
/* bypass LCD_TCON_DATA_BLOCK_TYPE_ACC_LUT for soc gamma update */
if (data_multi->block_type == LCD_TCON_DATA_BLOCK_TYPE_BASIC_INIT)
continue;
@@ -473,7 +473,7 @@ static int per_lcd_dev_add_driver(struct peripheral_lcd_driver_s *per_lcd_drv)
else if (strcmp(per_lcd_dev_conf.name, "spi_st7789") == 0)
ret = per_lcd_dev_spi_probe(per_lcd_drv);
else
LCDPR("%s:unsopport device driver: %s(%d)\n",
LCDPR("%s:unsupport device driver: %s(%d)\n",
__func__, per_lcd_dev_conf.name, index);
if (ret) {
@@ -498,7 +498,7 @@ static void per_lcd_dev_remove_driver(struct peripheral_lcd_driver_s *per_lcd_dr
else if (strcmp(per_lcd_dev_conf.name, "spi_st7789") == 0)
ret = per_lcd_dev_spi_remove(per_lcd_drv);
else
LCDPR("%s: unsopport device driver: %s(%d)\n",
LCDPR("%s: unsupport device driver: %s(%d)\n",
__func__, per_lcd_dev_conf.name, index);
if (ret) {
@@ -77,7 +77,7 @@
/* lcd backlight brightness on/off by local dimming */
#define LCD_EVENT_BACKLIGHT_LD_SEL BIT(28)
/* lcd backlight brightness update by driver api */
#define LCD_EVENT_BACKLIGHT_BRTNESS_DIM BIT(29)
#define LCD_EVENT_BACKLIGHT_BRIGHTNESS_DIM BIT(29)
/* blocking notify */