[PATCH v3 3/9] drm/mediatek: dp: Always return connected status for eDP in .detect()

From: AngeloGioacchino Del Regno
Date: Tue Apr 04 2023 - 06:48:22 EST


If this is an eDP panel it's not removable, hence it's always connected:
as a shortcut, always return connector_status_connected in the .detect()
callback for eDP connector, avoiding a poweron, a check for sink count
and a poweroff.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
---
drivers/gpu/drm/mediatek/mtk_dp.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
index 76ea94167531..c82dd1f0675d 100644
--- a/drivers/gpu/drm/mediatek/mtk_dp.c
+++ b/drivers/gpu/drm/mediatek/mtk_dp.c
@@ -1957,6 +1957,9 @@ static enum drm_connector_status mtk_dp_bdg_detect(struct drm_bridge *bridge)
bool enabled = mtk_dp->enabled;
u8 sink_count = 0;

+ if (mtk_dp->bridge.type == DRM_MODE_CONNECTOR_eDP)
+ return connector_status_connected;
+
if (!mtk_dp->train_info.cable_plugged_in)
return ret;

--
2.40.0