summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/bridge
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2015-07-21 16:09:39 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2015-08-18 11:32:38 +0100
commitf709ec07e38a714f8a959f28b3e0388cfb1b2540 (patch)
tree2b883d56e740767ef27201cc8a5c18a82b82a7f1 /drivers/gpu/drm/bridge
parent05b1342f5014b7c100834ae179dd90d1a1da7366 (diff)
downloadop-kernel-dev-f709ec07e38a714f8a959f28b3e0388cfb1b2540.zip
op-kernel-dev-f709ec07e38a714f8a959f28b3e0388cfb1b2540.tar.gz
drm: bridge/dw_hdmi: enable audio only if sink supports audio
Only enable audio support if the sink supports audio in some form, as defined via its EDID. We discover this capability using the generic drm_detect_monitor_audio() function. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/gpu/drm/bridge')
-rw-r--r--drivers/gpu/drm/bridge/dw_hdmi.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/bridge/dw_hdmi.c b/drivers/gpu/drm/bridge/dw_hdmi.c
index fc9536b..cec5162 100644
--- a/drivers/gpu/drm/bridge/dw_hdmi.c
+++ b/drivers/gpu/drm/bridge/dw_hdmi.c
@@ -123,6 +123,7 @@ struct dw_hdmi {
struct i2c_adapter *ddc;
void __iomem *regs;
bool sink_is_hdmi;
+ bool sink_has_audio;
spinlock_t audio_lock;
struct mutex audio_mutex;
@@ -1257,13 +1258,17 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
/* HDMI Initialization Step B.3 */
dw_hdmi_enable_video_path(hdmi);
- /* not for DVI mode */
- if (hdmi->sink_is_hdmi) {
- dev_dbg(hdmi->dev, "%s HDMI mode\n", __func__);
+ if (hdmi->sink_has_audio) {
+ dev_dbg(hdmi->dev, "sink has audio support\n");
/* HDMI Initialization Step E - Configure audio */
hdmi_clk_regenerator_update_pixel_clock(hdmi);
hdmi_enable_audio_clk(hdmi);
+ }
+
+ /* not for DVI mode */
+ if (hdmi->sink_is_hdmi) {
+ dev_dbg(hdmi->dev, "%s HDMI mode\n", __func__);
/* HDMI Initialization Step F - Configure AVI InfoFrame */
hdmi_config_AVI(hdmi, mode);
@@ -1428,6 +1433,7 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
edid->width_cm, edid->height_cm);
hdmi->sink_is_hdmi = drm_detect_hdmi_monitor(edid);
+ hdmi->sink_has_audio = drm_detect_monitor_audio(edid);
drm_mode_connector_update_edid_property(connector, edid);
ret = drm_add_edid_modes(connector, edid);
kfree(edid);
OpenPOWER on IntegriCloud