video: rockchip: dp: fix dp connected issue which caused by hpd signal.
authorwenping.zhang <wenping.zhang@rock-chips.com>
Mon, 26 Dec 2016 02:04:14 +0000 (10:04 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 26 Dec 2016 09:49:58 +0000 (17:49 +0800)
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 <wenping.zhang@rock-chips.com>
drivers/video/rockchip/dp/rockchip_dp_core.c

index 985b21e0fa302d8e8dcc17180a43257f477eae7f..30876540b262ef743e718c634ec828daecaeaef4 100644 (file)
@@ -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) {