Commit 0aecb5a4 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Dave Airlie

drm/radeon/audio: don't hardcode CRTC id

This is based on info released by AMD, should allow using audio in much
more cases.
Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent d4e30ef0
...@@ -192,6 +192,7 @@ void r600_audio_set_clock(struct drm_encoder *encoder, int clock) ...@@ -192,6 +192,7 @@ void r600_audio_set_clock(struct drm_encoder *encoder, int clock)
struct radeon_device *rdev = dev->dev_private; struct radeon_device *rdev = dev->dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc);
int base_rate = 48000; int base_rate = 48000;
switch (radeon_encoder->encoder_id) { switch (radeon_encoder->encoder_id) {
...@@ -217,8 +218,8 @@ void r600_audio_set_clock(struct drm_encoder *encoder, int clock) ...@@ -217,8 +218,8 @@ void r600_audio_set_clock(struct drm_encoder *encoder, int clock)
WREG32(EVERGREEN_AUDIO_PLL1_DIV, clock * 10); WREG32(EVERGREEN_AUDIO_PLL1_DIV, clock * 10);
WREG32(EVERGREEN_AUDIO_PLL1_UNK, 0x00000071); WREG32(EVERGREEN_AUDIO_PLL1_UNK, 0x00000071);
/* Some magic trigger or src sel? */ /* Select DTO source */
WREG32_P(0x5ac, 0x01, ~0x77); WREG32(0x5ac, radeon_crtc->crtc_id);
} else { } else {
switch (dig->dig_encoder) { switch (dig->dig_encoder) {
case 0: case 0:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment