From 3be2e7d0e705621c1bb41eeabb63b122d50ecff3 Mon Sep 17 00:00:00 2001 From: Slava Grigorev Date: Tue, 9 Dec 2014 17:17:35 -0500 Subject: radeon/audio: moved mute programming to a separate function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Christian König Signed-off-by: Slava Grigorev Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/dce3_1_afmt.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/drm/radeon/dce3_1_afmt.c') diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c b/drivers/gpu/drm/radeon/dce3_1_afmt.c index cf788db5873a..07869ca8125d 100644 --- a/drivers/gpu/drm/radeon/dce3_1_afmt.c +++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c @@ -220,6 +220,17 @@ void dce3_2_set_audio_packet(struct drm_encoder *encoder, u32 offset) HDMI0_AUDIO_INFO_LINE(2)); /* anything other than 0 */ } +void dce3_2_set_mute(struct drm_encoder *encoder, u32 offset, bool mute) +{ + struct drm_device *dev = encoder->dev; + struct radeon_device *rdev = dev->dev_private; + + if (mute) + WREG32_OR(HDMI0_GC + offset, HDMI0_GC_AVMUTE); + else + WREG32_AND(HDMI0_GC + offset, ~HDMI0_GC_AVMUTE); +} + /* * update the info frames with the data from the current display mode */ @@ -246,9 +257,7 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *m radeon_audio_set_dto(encoder, mode->clock); radeon_audio_set_vbi_packet(encoder); radeon_hdmi_set_color_depth(encoder); - - WREG32(HDMI0_GC + offset, 0); /* unset HDMI0_GC_AVMUTE */ - + radeon_audio_set_mute(encoder, false); radeon_audio_update_acr(encoder, mode->clock); radeon_audio_write_speaker_allocation(encoder); radeon_audio_set_audio_packet(encoder); -- cgit v1.2.1