Commit 64eba0d6 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov

drm/msm/dp: remove PHY handling from dp_catalog.c

Inline dp_catalog_aux_update_cfg() and call phy_calibrate() from dp_aux
functions directly.
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: default avatarKonrad Dybcio <konrad.dybcio@linaro.org>
Tested-by: default avatarKuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: default avatarKuogee Hsieh <quic_khsieh@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/576106/
Link: https://lore.kernel.org/r/20240126-dp-power-parser-cleanup-v3-10-098d5f581dd3@linaro.org
parent b4745f74
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
*/ */
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/phy/phy.h>
#include <drm/drm_print.h> #include <drm/drm_print.h>
#include "dp_reg.h" #include "dp_reg.h"
...@@ -23,6 +24,8 @@ struct dp_aux_private { ...@@ -23,6 +24,8 @@ struct dp_aux_private {
struct device *dev; struct device *dev;
struct dp_catalog *catalog; struct dp_catalog *catalog;
struct phy *phy;
struct mutex mutex; struct mutex mutex;
struct completion comp; struct completion comp;
...@@ -336,7 +339,7 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux, ...@@ -336,7 +339,7 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux,
if (aux->native) { if (aux->native) {
aux->retry_cnt++; aux->retry_cnt++;
if (!(aux->retry_cnt % MAX_AUX_RETRIES)) 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 */ /* reset aux if link is in connected state */
if (dp_catalog_link_is_connected(aux->catalog)) if (dp_catalog_link_is_connected(aux->catalog))
...@@ -439,7 +442,7 @@ void dp_aux_reconfig(struct drm_dp_aux *dp_aux) ...@@ -439,7 +442,7 @@ void dp_aux_reconfig(struct drm_dp_aux *dp_aux)
aux = container_of(dp_aux, struct dp_aux_private, dp_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); dp_catalog_aux_reset(aux->catalog);
} }
...@@ -517,6 +520,7 @@ static int dp_wait_hpd_asserted(struct drm_dp_aux *dp_aux, ...@@ -517,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 drm_dp_aux *dp_aux_get(struct device *dev, struct dp_catalog *catalog,
struct phy *phy,
bool is_edp) bool is_edp)
{ {
struct dp_aux_private *aux; struct dp_aux_private *aux;
...@@ -537,6 +541,7 @@ struct drm_dp_aux *dp_aux_get(struct device *dev, struct dp_catalog *catalog, ...@@ -537,6 +541,7 @@ struct drm_dp_aux *dp_aux_get(struct device *dev, struct dp_catalog *catalog,
aux->dev = dev; aux->dev = dev;
aux->catalog = catalog; aux->catalog = catalog;
aux->phy = phy;
aux->retry_cnt = 0; aux->retry_cnt = 0;
/* /*
......
...@@ -17,6 +17,7 @@ void dp_aux_deinit(struct drm_dp_aux *dp_aux); ...@@ -17,6 +17,7 @@ void dp_aux_deinit(struct drm_dp_aux *dp_aux);
void dp_aux_reconfig(struct drm_dp_aux *dp_aux); void dp_aux_reconfig(struct drm_dp_aux *dp_aux);
struct drm_dp_aux *dp_aux_get(struct device *dev, struct dp_catalog *catalog, struct drm_dp_aux *dp_aux_get(struct device *dev, struct dp_catalog *catalog,
struct phy *phy,
bool is_edp); bool is_edp);
void dp_aux_put(struct drm_dp_aux *aux); void dp_aux_put(struct drm_dp_aux *aux);
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/iopoll.h> #include <linux/iopoll.h>
#include <linux/phy/phy.h>
#include <linux/phy/phy-dp.h>
#include <linux/rational.h> #include <linux/rational.h>
#include <drm/display/drm_dp_helper.h> #include <drm/display/drm_dp_helper.h>
#include <drm/drm_print.h> #include <drm/drm_print.h>
...@@ -243,16 +241,6 @@ void dp_catalog_aux_enable(struct dp_catalog *dp_catalog, bool enable) ...@@ -243,16 +241,6 @@ void dp_catalog_aux_enable(struct dp_catalog *dp_catalog, bool enable)
dp_write_aux(catalog, REG_DP_AUX_CTRL, aux_ctrl); dp_write_aux(catalog, REG_DP_AUX_CTRL, aux_ctrl);
} }
void dp_catalog_aux_update_cfg(struct dp_catalog *dp_catalog)
{
struct dp_catalog_private *catalog = container_of(dp_catalog,
struct dp_catalog_private, dp_catalog);
struct dp_io *dp_io = catalog->io;
struct phy *phy = dp_io->phy;
phy_calibrate(phy);
}
int dp_catalog_aux_wait_for_hpd_connect_state(struct dp_catalog *dp_catalog) int dp_catalog_aux_wait_for_hpd_connect_state(struct dp_catalog *dp_catalog)
{ {
u32 state; u32 state;
......
...@@ -84,7 +84,6 @@ int dp_catalog_aux_clear_trans(struct dp_catalog *dp_catalog, bool read); ...@@ -84,7 +84,6 @@ int dp_catalog_aux_clear_trans(struct dp_catalog *dp_catalog, bool read);
int dp_catalog_aux_clear_hw_interrupts(struct dp_catalog *dp_catalog); int dp_catalog_aux_clear_hw_interrupts(struct dp_catalog *dp_catalog);
void dp_catalog_aux_reset(struct dp_catalog *dp_catalog); void dp_catalog_aux_reset(struct dp_catalog *dp_catalog);
void dp_catalog_aux_enable(struct dp_catalog *dp_catalog, bool enable); void dp_catalog_aux_enable(struct dp_catalog *dp_catalog, bool enable);
void dp_catalog_aux_update_cfg(struct dp_catalog *dp_catalog);
int dp_catalog_aux_wait_for_hpd_connect_state(struct dp_catalog *dp_catalog); int dp_catalog_aux_wait_for_hpd_connect_state(struct dp_catalog *dp_catalog);
u32 dp_catalog_aux_get_irq(struct dp_catalog *dp_catalog); u32 dp_catalog_aux_get_irq(struct dp_catalog *dp_catalog);
......
...@@ -730,7 +730,9 @@ static int dp_init_sub_modules(struct dp_display_private *dp) ...@@ -730,7 +730,9 @@ static int dp_init_sub_modules(struct dp_display_private *dp)
goto error; goto error;
} }
dp->aux = dp_aux_get(dev, dp->catalog, dp->dp_display.is_edp); dp->aux = dp_aux_get(dev, dp->catalog,
dp->parser->io.phy,
dp->dp_display.is_edp);
if (IS_ERR(dp->aux)) { if (IS_ERR(dp->aux)) {
rc = PTR_ERR(dp->aux); rc = PTR_ERR(dp->aux);
DRM_ERROR("failed to initialize aux, rc = %d\n", rc); DRM_ERROR("failed to initialize aux, rc = %d\n", rc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment