summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/dp/dp_aux.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/msm/dp/dp_aux.c')
-rw-r--r--drivers/gpu/drm/msm/dp/dp_aux.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/drivers/gpu/drm/msm/dp/dp_aux.c b/drivers/gpu/drm/msm/dp/dp_aux.c
index e67a80d56..adbd5a367 100644
--- a/drivers/gpu/drm/msm/dp/dp_aux.c
+++ b/drivers/gpu/drm/msm/dp/dp_aux.c
@@ -4,6 +4,7 @@
*/
#include <linux/delay.h>
+#include <linux/phy/phy.h>
#include <drm/drm_print.h>
#include "dp_reg.h"
@@ -23,6 +24,8 @@ struct dp_aux_private {
struct device *dev;
struct dp_catalog *catalog;
+ struct phy *phy;
+
struct mutex mutex;
struct completion comp;
@@ -35,7 +38,6 @@ struct dp_aux_private {
bool no_send_stop;
bool initted;
bool is_edp;
- bool enable_xfers;
u32 offset;
u32 segment;
@@ -303,17 +305,6 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux,
}
/*
- * If we're using DP and an external display isn't connected then the
- * transfer won't succeed. Return right away. If we don't do this we
- * can end up with long timeouts if someone tries to access the DP AUX
- * character device when no DP device is connected.
- */
- if (!aux->is_edp && !aux->enable_xfers) {
- ret = -ENXIO;
- goto exit;
- }
-
- /*
* For eDP it's important to give a reasonably long wait here for HPD
* to be asserted. This is because the panel driver may have _just_
* turned on the panel and then tried to do an AUX transfer. The panel
@@ -348,7 +339,7 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux,
if (aux->native) {
aux->retry_cnt++;
if (!(aux->retry_cnt % MAX_AUX_RETRIES))
- dp_catalog_aux_update_cfg(aux->catalog);
+ phy_calibrate(aux->phy);
}
/* reset aux if link is in connected state */
if (dp_catalog_link_is_connected(aux->catalog))
@@ -445,21 +436,13 @@ irqreturn_t dp_aux_isr(struct drm_dp_aux *dp_aux)
return IRQ_HANDLED;
}
-void dp_aux_enable_xfers(struct drm_dp_aux *dp_aux, bool enabled)
-{
- struct dp_aux_private *aux;
-
- aux = container_of(dp_aux, struct dp_aux_private, dp_aux);
- aux->enable_xfers = enabled;
-}
-
void dp_aux_reconfig(struct drm_dp_aux *dp_aux)
{
struct dp_aux_private *aux;
aux = container_of(dp_aux, struct dp_aux_private, dp_aux);
- dp_catalog_aux_update_cfg(aux->catalog);
+ phy_calibrate(aux->phy);
dp_catalog_aux_reset(aux->catalog);
}
@@ -537,6 +520,7 @@ static int dp_wait_hpd_asserted(struct drm_dp_aux *dp_aux,
}
struct drm_dp_aux *dp_aux_get(struct device *dev, struct dp_catalog *catalog,
+ struct phy *phy,
bool is_edp)
{
struct dp_aux_private *aux;
@@ -557,6 +541,7 @@ struct drm_dp_aux *dp_aux_get(struct device *dev, struct dp_catalog *catalog,
aux->dev = dev;
aux->catalog = catalog;
+ aux->phy = phy;
aux->retry_cnt = 0;
/*