diff options
author | Jani Nikula <jani.nikula@intel.com> | 2014-10-27 15:26:57 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-11-07 18:42:17 +0100 |
commit | 76d8d3e5b57d7938613e4018eddbf0a16913338a (patch) | |
tree | a91f405c596c6c0e7d3801ccbdaa5c7343d3e44a /drivers/gpu/drm/i915/intel_audio.c | |
parent | drm/i915: enable audio codec after port (diff) | |
download | linux-76d8d3e5b57d7938613e4018eddbf0a16913338a.tar.xz linux-76d8d3e5b57d7938613e4018eddbf0a16913338a.zip |
drm/i915/audio: add audio codec disable on g4x
This not based on any documentation...
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_audio.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_audio.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c index 5c2d06c71ae7..fa0eecf6a792 100644 --- a/drivers/gpu/drm/i915/intel_audio.c +++ b/drivers/gpu/drm/i915/intel_audio.c @@ -93,6 +93,25 @@ static bool intel_eld_uptodate(struct drm_connector *connector, return true; } +static void g4x_audio_codec_disable(struct intel_encoder *encoder) +{ + struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; + uint32_t eldv, tmp; + + DRM_DEBUG_KMS("Disable audio codec\n"); + + tmp = I915_READ(G4X_AUD_VID_DID); + if (tmp == INTEL_AUDIO_DEVBLC || tmp == INTEL_AUDIO_DEVCL) + eldv = G4X_ELDV_DEVCL_DEVBLC; + else + eldv = G4X_ELDV_DEVCTG; + + /* Invalidate ELD */ + tmp = I915_READ(G4X_AUD_CNTL_ST); + tmp &= ~eldv; + I915_WRITE(G4X_AUD_CNTL_ST, tmp); +} + static void g4x_audio_codec_enable(struct drm_connector *connector, struct intel_encoder *encoder, struct drm_display_mode *mode) @@ -408,6 +427,7 @@ void intel_init_audio(struct drm_device *dev) if (IS_G4X(dev)) { dev_priv->display.audio_codec_enable = g4x_audio_codec_enable; + dev_priv->display.audio_codec_disable = g4x_audio_codec_disable; } else if (IS_VALLEYVIEW(dev)) { dev_priv->display.audio_codec_enable = ilk_audio_codec_enable; dev_priv->display.audio_codec_disable = ilk_audio_codec_disable; |