From c3e5f67b390f2d915e66433f8ba7b5a99a1d3d8a Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Thu, 23 Feb 2012 17:14:47 +0100 Subject: drm/i915: use the new hdmi_force_audio enum more While fixing up a merge conflict with drm-next I've noticed that we use the same audio drm connector property also for dp and sdvo outputs. So put the new enum to some good use and convert these paths, too. The HDMI_AUDIO_ prefix is a bit a misnomer. But at least for sdvo it makes sense (and you can also connect a hdmi monitor with a dp->hdmi cable), so I've decided to stick with it. Reviewed-by: Chris Wilson Reviewed-by: Wu Fengguang Signed-Off-by: Daniel Vetter --- drivers/gpu/drm/i915/intel_dp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/drm/i915/intel_dp.c') diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 39eccf908a69..110552ff302c 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -49,7 +49,7 @@ struct intel_dp { uint32_t DP; uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE]; bool has_audio; - int force_audio; + enum hdmi_force_audio force_audio; uint32_t color_range; int dpms_mode; uint8_t link_bw; @@ -2116,8 +2116,8 @@ intel_dp_detect(struct drm_connector *connector, bool force) if (status != connector_status_connected) return status; - if (intel_dp->force_audio) { - intel_dp->has_audio = intel_dp->force_audio > 0; + if (intel_dp->force_audio != HDMI_AUDIO_AUTO) { + intel_dp->has_audio = (intel_dp->force_audio == HDMI_AUDIO_ON); } else { edid = intel_dp_get_edid(connector, &intel_dp->adapter); if (edid) { @@ -2217,10 +2217,10 @@ intel_dp_set_property(struct drm_connector *connector, intel_dp->force_audio = i; - if (i == 0) + if (i == HDMI_AUDIO_AUTO) has_audio = intel_dp_detect_audio(connector); else - has_audio = i > 0; + has_audio = (i == HDMI_AUDIO_ON); if (has_audio == intel_dp->has_audio) return 0; -- cgit v1.2.3