[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201030232324.11170-1-khsieh@codeaurora.org>
Date: Fri, 30 Oct 2020 16:23:24 -0700
From: Kuogee Hsieh <khsieh@...eaurora.org>
To: robdclark@...il.com, sean@...rly.run, swboyd@...omium.org
Cc: tanmay@...eaurora.org, abhinavk@...eaurora.org,
aravindh@...eaurora.org, khsieh@...eaurora.org,
rnayak@...eaurora.org, airlied@...ux.ie, daniel@...ll.ch,
linux-arm-msm@...r.kernel.org, dri-devel@...ts.freedesktop.org,
freedreno@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [PATCH] drm/msm/dp: promote irq_hpd handle to handle link trainign correctly
Some dongles, such as Apple, required link training done at irq_hpd
request instead of plugin request. This patch promote irq_hpd hanlder
to handle link training and setup hpd_state correctly.
Signed-off-by: Kuogee Hsieh <khsieh@...eaurora.org>
---
drivers/gpu/drm/msm/dp/dp_display.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index 13b66266cd69..55627530957c 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -469,7 +469,9 @@ static int dp_display_handle_irq_hpd(struct dp_display_private *dp)
static int dp_display_usbpd_attention_cb(struct device *dev)
{
int rc = 0;
+ u32 sink_request;
struct dp_display_private *dp;
+ struct dp_usbpd *hpd;
if (!dev) {
DRM_ERROR("invalid dev\n");
@@ -483,10 +485,24 @@ static int dp_display_usbpd_attention_cb(struct device *dev)
return -ENODEV;
}
+ hpd = dp->usbpd;
+
/* check for any test request issued by sink */
rc = dp_link_process_request(dp->link);
- if (!rc)
- dp_display_handle_irq_hpd(dp);
+ if (!rc) {
+ sink_request = dp->link->sink_request;
+ if (sink_request & DS_PORT_STATUS_CHANGED) {
+ dp->hpd_state = ST_CONNECT_PENDING;
+ hpd->hpd_high = 1;
+ }
+
+ rc = dp_display_handle_irq_hpd(dp);
+
+ if (rc && sink_request & DS_PORT_STATUS_CHANGED) {
+ hpd->hpd_high = 0;
+ dp->hpd_state = ST_DISCONNECTED;
+ }
+ }
return rc;
}
base-commit: 0e162b10644605428cd2596c12f8ed410cf9d2d9
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Powered by blists - more mailing lists