From 2bd4ff7162d13ef08b6598209e8c92ad6ed9b54c Mon Sep 17 00:00:00 2001 From: "wenping.zhang" Date: Mon, 26 Dec 2016 10:04:14 +0800 Subject: [PATCH] video: rockchip: dp: fix dp connected issue which caused by hpd signal. some device will triggered hpd after dp is connected, so we don't do traning if dp lanes is not changed. Change-Id: I3e329e7d2db33138f283ad6584b966ebd0619f65 Signed-off-by: wenping.zhang --- drivers/video/rockchip/dp/rockchip_dp_core.c | 27 +++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/video/rockchip/dp/rockchip_dp_core.c b/drivers/video/rockchip/dp/rockchip_dp_core.c index 985b21e0fa30..30876540b262 100644 --- a/drivers/video/rockchip/dp/rockchip_dp_core.c +++ b/drivers/video/rockchip/dp/rockchip_dp_core.c @@ -745,21 +745,24 @@ static void cdn_dp_pd_event_wq(struct work_struct *work) * attached, that means something on the Type-C Dock/Dongle * changed, check the sink count by DPCD. If sink count became * 0, this port phy can be powered off; if the sink count does - * not change, it means the sink device status has update, - * re-training to make it work again. + * not change and dp is connected, don't do anything, because + * dp video output maybe ongoing. if dp is not connected, that + * means something is wrong, we don't do anything here, just + * output error log. */ - ret = cdn_dp_dpcd_read(dp, DP_SINK_COUNT, &sink_count, 1); - if (ret || sink_count) { - if (dp->dpms_mode == DRM_MODE_DPMS_ON) { - dev_warn(dp->dev, - "hpd interrupt is triggered when dp is already connected successfully\n"); - ret = cdn_dp_training_start(dp); - if (!ret) - cdn_dp_get_training_status(dp); - } + cdn_dp_dpcd_read(dp, DP_SINK_COUNT, &sink_count, 1); + if (sink_count) { + if (dp->hpd_status == connector_status_connected) + dev_info(dp->dev, + "hpd interrupt is triggered when dp has been already connected\n"); + else + dev_err(dp->dev, + "something is wrong, hpd is triggered before dp is connected\n"); + goto out; + } else { + new_cap_lanes = 0; } - new_cap_lanes = 0; } if (dp->hpd_status == connector_status_connected && new_cap_lanes) { -- 2.34.1