|
|
|
@@ -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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|