diff --git a/src/soc/mediatek/common/display.c b/src/soc/mediatek/common/display.c index 417a764499..c805c6d664 100644 --- a/src/soc/mediatek/common/display.c +++ b/src/soc/mediatek/common/display.c @@ -90,7 +90,6 @@ int mtk_display_init(void) process_panel_quirks(&mtk_edp, panel); if (panel->disp_path == DISP_PATH_EDP) { - mdelay(200); if (mtk_edp_init(&mtk_edp, &edid) < 0) { printk(BIOS_ERR, "%s: Failed to initialize eDP\n", __func__); return -1; diff --git a/src/soc/mediatek/common/dp/dptx_common.c b/src/soc/mediatek/common/dp/dptx_common.c index 9c6cdcba4d..342f742a2c 100644 --- a/src/soc/mediatek/common/dp/dptx_common.c +++ b/src/soc/mediatek/common/dp/dptx_common.c @@ -549,10 +549,11 @@ int mtk_edp_init(struct mtk_dp *mtk_dp, struct edid *edid) dptx_init_variable(mtk_dp); dptx_init_port(mtk_dp); - if (!dptx_hal_hpd_high(mtk_dp)) { + if (!wait_ms(HPD_WAIT_TIMEOUT_MS, dptx_hal_hpd_high(mtk_dp))) { printk(BIOS_ERR, "HPD is low\n"); return -1; } + mdelay(WAIT_AUX_READY_TIME_MS); dptx_check_sinkcap(mtk_dp); diff --git a/src/soc/mediatek/common/dp/include/soc/dptx_common.h b/src/soc/mediatek/common/dp/include/soc/dptx_common.h index b65948fbad..8a42a63996 100644 --- a/src/soc/mediatek/common/dp/include/soc/dptx_common.h +++ b/src/soc/mediatek/common/dp/include/soc/dptx_common.h @@ -69,6 +69,9 @@ #define MAX_LANECOUNT 4 +#define HPD_WAIT_TIMEOUT_MS 200 +#define WAIT_AUX_READY_TIME_MS 1 + enum { DP_LANECOUNT_1 = 0x1, DP_LANECOUNT_2 = 0x2,