diff options
author | Jani Nikula <jani.nikula@intel.com> | 2014-10-27 10:26:50 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-11-04 17:22:12 -0500 |
commit | 69bfe1a9b4dffca482c6cd7f1e218f24a1128dcc (patch) | |
tree | eda68ee0ef08ccc4e3e73fcc69ea33d0de6267f0 /drivers/gpu/drm/i915/intel_ddi.c | |
parent | 2aa0de39fa071129fdd952a0d99828db8434d88f (diff) |
drm/i915: introduce intel_audio_codec_{enable, disable}
Introduce functions to enable/disable the audio codec, incorporating the
ELD setup within enable. The disable is initially limited to HSW,
covering exactly what was done previously.
The only functional difference is that ELD valid is no longer set if
there is no connector with ELD, which should be the right thing to do
anyway. Otherwise the sequence remains the same, with warts and all, in
preparation for applying more sanity.
v2: add kernel doc.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ddi.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ddi.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index 56e7cb1ddc75..b182b9b80461 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c | |||
@@ -1186,12 +1186,10 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder) | |||
1186 | struct drm_encoder *encoder = &intel_encoder->base; | 1186 | struct drm_encoder *encoder = &intel_encoder->base; |
1187 | struct drm_crtc *crtc = encoder->crtc; | 1187 | struct drm_crtc *crtc = encoder->crtc; |
1188 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 1188 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
1189 | int pipe = intel_crtc->pipe; | ||
1190 | struct drm_device *dev = encoder->dev; | 1189 | struct drm_device *dev = encoder->dev; |
1191 | struct drm_i915_private *dev_priv = dev->dev_private; | 1190 | struct drm_i915_private *dev_priv = dev->dev_private; |
1192 | enum port port = intel_ddi_get_encoder_port(intel_encoder); | 1191 | enum port port = intel_ddi_get_encoder_port(intel_encoder); |
1193 | int type = intel_encoder->type; | 1192 | int type = intel_encoder->type; |
1194 | uint32_t tmp; | ||
1195 | 1193 | ||
1196 | if (type == INTEL_OUTPUT_HDMI) { | 1194 | if (type == INTEL_OUTPUT_HDMI) { |
1197 | struct intel_digital_port *intel_dig_port = | 1195 | struct intel_digital_port *intel_dig_port = |
@@ -1216,11 +1214,7 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder) | |||
1216 | 1214 | ||
1217 | if (intel_crtc->config.has_audio) { | 1215 | if (intel_crtc->config.has_audio) { |
1218 | intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO); | 1216 | intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO); |
1219 | intel_write_eld(intel_encoder); | 1217 | intel_audio_codec_enable(intel_encoder); |
1220 | |||
1221 | tmp = I915_READ(HSW_AUD_PIN_ELD_CP_VLD); | ||
1222 | tmp |= ((AUDIO_OUTPUT_ENABLE_A | AUDIO_ELD_VALID_A) << (pipe * 4)); | ||
1223 | I915_WRITE(HSW_AUD_PIN_ELD_CP_VLD, tmp); | ||
1224 | } | 1218 | } |
1225 | } | 1219 | } |
1226 | 1220 | ||
@@ -1229,19 +1223,12 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder) | |||
1229 | struct drm_encoder *encoder = &intel_encoder->base; | 1223 | struct drm_encoder *encoder = &intel_encoder->base; |
1230 | struct drm_crtc *crtc = encoder->crtc; | 1224 | struct drm_crtc *crtc = encoder->crtc; |
1231 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 1225 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
1232 | int pipe = intel_crtc->pipe; | ||
1233 | int type = intel_encoder->type; | 1226 | int type = intel_encoder->type; |
1234 | struct drm_device *dev = encoder->dev; | 1227 | struct drm_device *dev = encoder->dev; |
1235 | struct drm_i915_private *dev_priv = dev->dev_private; | 1228 | struct drm_i915_private *dev_priv = dev->dev_private; |
1236 | uint32_t tmp; | ||
1237 | 1229 | ||
1238 | /* We can't touch HSW_AUD_PIN_ELD_CP_VLD uncionditionally because this | ||
1239 | * register is part of the power well on Haswell. */ | ||
1240 | if (intel_crtc->config.has_audio) { | 1230 | if (intel_crtc->config.has_audio) { |
1241 | tmp = I915_READ(HSW_AUD_PIN_ELD_CP_VLD); | 1231 | intel_audio_codec_disable(intel_encoder); |
1242 | tmp &= ~((AUDIO_OUTPUT_ENABLE_A | AUDIO_ELD_VALID_A) << | ||
1243 | (pipe * 4)); | ||
1244 | I915_WRITE(HSW_AUD_PIN_ELD_CP_VLD, tmp); | ||
1245 | intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO); | 1232 | intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO); |
1246 | } | 1233 | } |
1247 | 1234 | ||