diff options
author | Jani Nikula <jani.nikula@intel.com> | 2014-10-27 15:26:59 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-11-07 18:42:18 +0100 |
commit | 82910ac6d575d4ce4bd4dcefb61923623b263e00 (patch) | |
tree | b46f4531256e4b9940d966ac67c5ebc2719dca9c /drivers/gpu/drm/i915/intel_audio.c | |
parent | drm/i915/audio: add audio codec enable debug log for g4x (diff) | |
download | linux-82910ac6d575d4ce4bd4dcefb61923623b263e00.tar.xz linux-82910ac6d575d4ce4bd4dcefb61923623b263e00.zip |
drm/i915: make pipe/port based audio valid accessors easier to use
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 | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c index c4c036a86d75..9181b85d86c4 100644 --- a/drivers/gpu/drm/i915/intel_audio.c +++ b/drivers/gpu/drm/i915/intel_audio.c @@ -172,7 +172,7 @@ static void hsw_audio_codec_disable(struct intel_encoder *encoder) /* Invalidate ELD */ tmp = I915_READ(HSW_AUD_PIN_ELD_CP_VLD); - tmp &= ~(AUDIO_ELD_VALID_A << (pipe * 4)); + tmp &= ~AUDIO_ELD_VALID(pipe); I915_WRITE(HSW_AUD_PIN_ELD_CP_VLD, tmp); } @@ -192,8 +192,8 @@ static void hsw_audio_codec_enable(struct drm_connector *connector, /* Enable audio presence detect, invalidate ELD */ tmp = I915_READ(HSW_AUD_PIN_ELD_CP_VLD); - tmp |= AUDIO_OUTPUT_ENABLE_A << (pipe * 4); - tmp &= ~(AUDIO_ELD_VALID_A << (pipe * 4)); + tmp |= AUDIO_OUTPUT_ENABLE(pipe); + tmp &= ~AUDIO_ELD_VALID(pipe); I915_WRITE(HSW_AUD_PIN_ELD_CP_VLD, tmp); /* @@ -215,7 +215,7 @@ static void hsw_audio_codec_enable(struct drm_connector *connector, /* ELD valid */ tmp = I915_READ(HSW_AUD_PIN_ELD_CP_VLD); - tmp |= AUDIO_ELD_VALID_A << (pipe * 4); + tmp |= AUDIO_ELD_VALID(pipe); I915_WRITE(HSW_AUD_PIN_ELD_CP_VLD, tmp); /* Enable timestamps */ @@ -267,11 +267,10 @@ static void ilk_audio_codec_disable(struct intel_encoder *encoder) I915_WRITE(aud_config, tmp); if (WARN_ON(!port)) { - eldv = IBX_ELD_VALIDB; - eldv |= IBX_ELD_VALIDB << 4; - eldv |= IBX_ELD_VALIDB << 8; + eldv = IBX_ELD_VALID(PORT_B) | IBX_ELD_VALID(PORT_C) | + IBX_ELD_VALID(PORT_D); } else { - eldv = IBX_ELD_VALIDB << ((port - 1) * 4); + eldv = IBX_ELD_VALID(port); } /* Invalidate ELD */ @@ -327,11 +326,10 @@ static void ilk_audio_codec_enable(struct drm_connector *connector, } if (WARN_ON(!port)) { - eldv = IBX_ELD_VALIDB; - eldv |= IBX_ELD_VALIDB << 4; - eldv |= IBX_ELD_VALIDB << 8; + eldv = IBX_ELD_VALID(PORT_B) | IBX_ELD_VALID(PORT_C) | + IBX_ELD_VALID(PORT_D); } else { - eldv = IBX_ELD_VALIDB << ((port - 1) * 4); + eldv = IBX_ELD_VALID(port); } /* Invalidate ELD */ |