diff options
author | Jani Nikula <jani.nikula@intel.com> | 2014-10-27 16:26:59 +0200 |
---|---|---|
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 | d5ee08de1bbeac867818c37b5b8413f68c742703 (diff) | |
download | op-kernel-dev-82910ac6d575d4ce4bd4dcefb61923623b263e00.zip op-kernel-dev-82910ac6d575d4ce4bd4dcefb61923623b263e00.tar.gz |
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 c4c036a..9181b85d 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 */ |