Skip to content

Commit 666832f

Browse files
committed
drm/msm/hdmi: wire in hpd_enable/hpd_disable bridge ops
The HDMI driver already has msm_hdmi_hpd_enable() and msm_hdmi_hpd_disable() functions. Wire them into the msm_hdmi_bridge_funcs, so that HPD can be enabled and disabled dynamically rather than always having HPD events generation enabled. Reviewed-by: Jessica Zhang <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent b93f19d commit 666832f

File tree

4 files changed

+10
-17
lines changed

4 files changed

+10
-17
lines changed

drivers/gpu/drm/msm/hdmi/hdmi.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
200200
goto fail;
201201
}
202202

203-
ret = msm_hdmi_hpd_enable(hdmi->bridge);
204-
if (ret < 0) {
205-
DRM_DEV_ERROR(&hdmi->pdev->dev, "failed to enable HPD: %d\n", ret);
206-
goto fail;
207-
}
208-
209203
return 0;
210204

211205
fail:
@@ -261,9 +255,6 @@ static void msm_hdmi_unbind(struct device *dev, struct device *master,
261255
struct msm_drm_private *priv = dev_get_drvdata(master);
262256

263257
if (priv->hdmi) {
264-
if (priv->hdmi->bridge)
265-
msm_hdmi_hpd_disable(priv->hdmi);
266-
267258
msm_hdmi_destroy(priv->hdmi);
268259
priv->hdmi = NULL;
269260
}

drivers/gpu/drm/msm/hdmi/hdmi.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ int msm_hdmi_bridge_init(struct hdmi *hdmi);
216216
void msm_hdmi_hpd_irq(struct drm_bridge *bridge);
217217
enum drm_connector_status msm_hdmi_bridge_detect(
218218
struct drm_bridge *bridge);
219-
int msm_hdmi_hpd_enable(struct drm_bridge *bridge);
220-
void msm_hdmi_hpd_disable(struct hdmi *hdmi);
219+
void msm_hdmi_hpd_enable(struct drm_bridge *bridge);
220+
void msm_hdmi_hpd_disable(struct drm_bridge *bridge);
221221

222222
/*
223223
* i2c adapter for ddc:

drivers/gpu/drm/msm/hdmi/hdmi_bridge.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,8 @@ static const struct drm_bridge_funcs msm_hdmi_bridge_funcs = {
459459
.atomic_post_disable = msm_hdmi_bridge_atomic_post_disable,
460460
.edid_read = msm_hdmi_bridge_edid_read,
461461
.detect = msm_hdmi_bridge_detect,
462+
.hpd_enable = msm_hdmi_hpd_enable,
463+
.hpd_disable = msm_hdmi_hpd_disable,
462464
.hdmi_tmds_char_rate_valid = msm_hdmi_bridge_tmds_char_rate_valid,
463465
.hdmi_clear_infoframe = msm_hdmi_bridge_clear_infoframe,
464466
.hdmi_write_infoframe = msm_hdmi_bridge_write_infoframe,

drivers/gpu/drm/msm/hdmi/hdmi_hpd.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static void msm_hdmi_phy_reset(struct hdmi *hdmi)
6060
}
6161
}
6262

63-
int msm_hdmi_hpd_enable(struct drm_bridge *bridge)
63+
void msm_hdmi_hpd_enable(struct drm_bridge *bridge)
6464
{
6565
struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge);
6666
struct hdmi *hdmi = hdmi_bridge->hdmi;
@@ -73,8 +73,8 @@ int msm_hdmi_hpd_enable(struct drm_bridge *bridge)
7373
gpiod_set_value_cansleep(hdmi->hpd_gpiod, 1);
7474

7575
ret = pm_runtime_resume_and_get(dev);
76-
if (ret)
77-
return ret;
76+
if (WARN_ON(ret))
77+
return;
7878

7979
mutex_lock(&hdmi->state_mutex);
8080
msm_hdmi_set_mode(hdmi, false);
@@ -102,12 +102,12 @@ int msm_hdmi_hpd_enable(struct drm_bridge *bridge)
102102
hdmi_write(hdmi, REG_HDMI_HPD_CTRL,
103103
HDMI_HPD_CTRL_ENABLE | hpd_ctrl);
104104
spin_unlock_irqrestore(&hdmi->reg_lock, flags);
105-
106-
return 0;
107105
}
108106

109-
void msm_hdmi_hpd_disable(struct hdmi *hdmi)
107+
void msm_hdmi_hpd_disable(struct drm_bridge *bridge)
110108
{
109+
struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge);
110+
struct hdmi *hdmi = hdmi_bridge->hdmi;
111111
struct device *dev = &hdmi->pdev->dev;
112112

113113
/* Disable HPD interrupt */

0 commit comments

Comments
 (0)