From 930a9785120d7397ba8912e1a4f72b65e7e25f25 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Tue, 20 Jan 2015 19:20:52 -0500 Subject: radeon/audio: moved VBI packet programming to separate functions 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/radeon_audio.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'drivers/gpu/drm/radeon/radeon_audio.c') diff --git a/drivers/gpu/drm/radeon/radeon_audio.c b/drivers/gpu/drm/radeon/radeon_audio.c index dbb3c594e9ae..8fad9af92ec8 100644 --- a/drivers/gpu/drm/radeon/radeon_audio.c +++ b/drivers/gpu/drm/radeon/radeon_audio.c @@ -85,6 +85,8 @@ void dce3_2_hdmi_update_acr(struct drm_encoder *encoder, long offset, const struct radeon_hdmi_acr *acr); void evergreen_hdmi_update_acr(struct drm_encoder *encoder, long offset, const struct radeon_hdmi_acr *acr); +void r600_set_vbi_packet(struct drm_encoder *encoder, u32 offset); +void dce4_set_vbi_packet(struct drm_encoder *encoder, u32 offset); static const u32 pin_offsets[7] = { @@ -140,6 +142,7 @@ static struct radeon_audio_funcs r600_hdmi_funcs = { .get_pin = r600_audio_get_pin, .set_dto = r600_hdmi_audio_set_dto, .update_acr = r600_hdmi_update_acr, + .set_vbi_packet = r600_set_vbi_packet, }; static struct radeon_audio_funcs dce32_hdmi_funcs = { @@ -148,6 +151,7 @@ static struct radeon_audio_funcs dce32_hdmi_funcs = { .write_speaker_allocation = dce3_2_afmt_hdmi_write_speaker_allocation, .set_dto = dce3_2_audio_set_dto, .update_acr = dce3_2_hdmi_update_acr, + .set_vbi_packet = r600_set_vbi_packet, }; static struct radeon_audio_funcs dce32_dp_funcs = { @@ -164,6 +168,7 @@ static struct radeon_audio_funcs dce4_hdmi_funcs = { .write_latency_fields = dce4_afmt_write_latency_fields, .set_dto = dce4_hdmi_audio_set_dto, .update_acr = evergreen_hdmi_update_acr, + .set_vbi_packet = dce4_set_vbi_packet, }; static struct radeon_audio_funcs dce4_dp_funcs = { @@ -182,6 +187,7 @@ static struct radeon_audio_funcs dce6_hdmi_funcs = { .write_latency_fields = dce6_afmt_write_latency_fields, .set_dto = dce6_hdmi_audio_set_dto, .update_acr = evergreen_hdmi_update_acr, + .set_vbi_packet = dce4_set_vbi_packet, }; static struct radeon_audio_funcs dce6_dp_funcs = { @@ -556,3 +562,15 @@ void radeon_audio_update_acr(struct drm_encoder *encoder, unsigned int clock) if (radeon_encoder->audio && radeon_encoder->audio->update_acr) radeon_encoder->audio->update_acr(encoder, dig->afmt->offset, acr); } + +void radeon_audio_set_vbi_packet(struct drm_encoder *encoder) +{ + struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); + struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; + + if (!dig || !dig->afmt) + return; + + if (radeon_encoder->audio && radeon_encoder->audio->set_vbi_packet) + radeon_encoder->audio->set_vbi_packet(encoder, dig->afmt->offset); +} -- cgit v1.2.3-59-g8ed1b