Commit 391c96ff authored by Sankeerth Billakanti's avatar Sankeerth Billakanti Committed by Dmitry Baryshkov

drm/msm/dp: Support only IRQ_HPD and REPLUG interrupts for eDP

The panel-edp enables the eDP panel power during probe, get_modes
and pre-enable. The eDP connect and disconnect interrupts for the eDP/DP
controller are directly dependent on panel power. As eDP display can be
assumed as always connected, the controller driver can skip the eDP
connect and disconnect interrupts. Any disruption in the link status
will be indicated via the IRQ_HPD interrupts.

So, the eDP controller driver can just enable the IRQ_HPD and replug
interrupts. The DP controller driver still needs to enable all the
interrupts.
Signed-off-by: default avatarSankeerth Billakanti <quic_sbillaka@quicinc.com>
Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
Patchwork: https://patchwork.freedesktop.org/patch/483310/
Link: https://lore.kernel.org/r/1650887072-16652-3-git-send-email-quic_sbillaka@quicinc.comSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
parent f5d01644
...@@ -589,10 +589,6 @@ void dp_catalog_ctrl_hpd_config(struct dp_catalog *dp_catalog) ...@@ -589,10 +589,6 @@ void dp_catalog_ctrl_hpd_config(struct dp_catalog *dp_catalog)
u32 reftimer = dp_read_aux(catalog, REG_DP_DP_HPD_REFTIMER); u32 reftimer = dp_read_aux(catalog, REG_DP_DP_HPD_REFTIMER);
/* enable HPD plug and unplug interrupts */
dp_catalog_hpd_config_intr(dp_catalog,
DP_DP_HPD_PLUG_INT_MASK | DP_DP_HPD_UNPLUG_INT_MASK, true);
/* Configure REFTIMER and enable it */ /* Configure REFTIMER and enable it */
reftimer |= DP_DP_HPD_REFTIMER_ENABLE; reftimer |= DP_DP_HPD_REFTIMER_ENABLE;
dp_write_aux(catalog, REG_DP_DP_HPD_REFTIMER, reftimer); dp_write_aux(catalog, REG_DP_DP_HPD_REFTIMER, reftimer);
...@@ -619,13 +615,21 @@ u32 dp_catalog_hpd_get_intr_status(struct dp_catalog *dp_catalog) ...@@ -619,13 +615,21 @@ u32 dp_catalog_hpd_get_intr_status(struct dp_catalog *dp_catalog)
{ {
struct dp_catalog_private *catalog = container_of(dp_catalog, struct dp_catalog_private *catalog = container_of(dp_catalog,
struct dp_catalog_private, dp_catalog); struct dp_catalog_private, dp_catalog);
int isr = 0; int isr, mask;
isr = dp_read_aux(catalog, REG_DP_DP_HPD_INT_STATUS); isr = dp_read_aux(catalog, REG_DP_DP_HPD_INT_STATUS);
dp_write_aux(catalog, REG_DP_DP_HPD_INT_ACK, dp_write_aux(catalog, REG_DP_DP_HPD_INT_ACK,
(isr & DP_DP_HPD_INT_MASK)); (isr & DP_DP_HPD_INT_MASK));
mask = dp_read_aux(catalog, REG_DP_DP_HPD_INT_MASK);
return isr; /*
* We only want to return interrupts that are unmasked to the caller.
* However, the interrupt status field also contains other
* informational bits about the HPD state status, so we only mask
* out the part of the register that tells us about which interrupts
* are pending.
*/
return isr & (mask | ~DP_DP_HPD_INT_MASK);
} }
int dp_catalog_ctrl_get_interrupt(struct dp_catalog *dp_catalog) int dp_catalog_ctrl_get_interrupt(struct dp_catalog *dp_catalog)
......
...@@ -685,6 +685,7 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data) ...@@ -685,6 +685,7 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data)
dp_display_handle_plugged_change(&dp->dp_display, false); dp_display_handle_plugged_change(&dp->dp_display, false);
/* enable HDP plug interrupt to prepare for next plugin */ /* enable HDP plug interrupt to prepare for next plugin */
if (!dp->dp_display.is_edp)
dp_catalog_hpd_config_intr(dp->catalog, DP_DP_HPD_PLUG_INT_MASK, true); dp_catalog_hpd_config_intr(dp->catalog, DP_DP_HPD_PLUG_INT_MASK, true);
drm_dbg_dp(dp->drm_dev, "After, type=%d hpd_state=%d\n", drm_dbg_dp(dp->drm_dev, "After, type=%d hpd_state=%d\n",
...@@ -1071,6 +1072,13 @@ static void dp_display_config_hpd(struct dp_display_private *dp) ...@@ -1071,6 +1072,13 @@ static void dp_display_config_hpd(struct dp_display_private *dp)
dp_display_host_init(dp); dp_display_host_init(dp);
dp_catalog_ctrl_hpd_config(dp->catalog); dp_catalog_ctrl_hpd_config(dp->catalog);
/* Enable plug and unplug interrupts only for external DisplayPort */
if (!dp->dp_display.is_edp)
dp_catalog_hpd_config_intr(dp->catalog,
DP_DP_HPD_PLUG_INT_MASK |
DP_DP_HPD_UNPLUG_INT_MASK,
true);
/* Enable interrupt first time /* Enable interrupt first time
* we are leaving dp clocks on during disconnect * we are leaving dp clocks on during disconnect
* and never disable interrupt * and never disable interrupt
...@@ -1355,6 +1363,12 @@ static int dp_pm_resume(struct device *dev) ...@@ -1355,6 +1363,12 @@ static int dp_pm_resume(struct device *dev)
dp_catalog_ctrl_hpd_config(dp->catalog); dp_catalog_ctrl_hpd_config(dp->catalog);
if (!dp->dp_display.is_edp)
dp_catalog_hpd_config_intr(dp->catalog,
DP_DP_HPD_PLUG_INT_MASK |
DP_DP_HPD_UNPLUG_INT_MASK,
true);
if (dp_catalog_link_is_connected(dp->catalog)) { if (dp_catalog_link_is_connected(dp->catalog)) {
/* /*
* set sink to normal operation mode -- D0 * set sink to normal operation mode -- D0
...@@ -1639,6 +1653,9 @@ void dp_bridge_enable(struct drm_bridge *drm_bridge) ...@@ -1639,6 +1653,9 @@ void dp_bridge_enable(struct drm_bridge *drm_bridge)
return; return;
} }
if (dp->is_edp)
dp_hpd_plug_handle(dp_display, 0);
mutex_lock(&dp_display->event_mutex); mutex_lock(&dp_display->event_mutex);
state = dp_display->hpd_state; state = dp_display->hpd_state;
...@@ -1707,6 +1724,9 @@ void dp_bridge_post_disable(struct drm_bridge *drm_bridge) ...@@ -1707,6 +1724,9 @@ void dp_bridge_post_disable(struct drm_bridge *drm_bridge)
dp_display = container_of(dp, struct dp_display_private, dp_display); dp_display = container_of(dp, struct dp_display_private, dp_display);
if (dp->is_edp)
dp_hpd_unplug_handle(dp_display, 0);
mutex_lock(&dp_display->event_mutex); mutex_lock(&dp_display->event_mutex);
state = dp_display->hpd_state; state = dp_display->hpd_state;
......
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