aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-09-25 12:04:37 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-05 10:13:12 -0400
commitddcca42fb47e59b1655d866b364c3dac4ba3f135 (patch)
tree3b7d3bce14c9908923622c08579da4f178822920
parentb2a9484006875ecd7d94582e7bcb72a02682be92 (diff)
drm/radeon: fix hdmi audio on DCE3.0/3.1 asics
commit 58d327da9721f7a0f6e46c8dfa5cc5546fd7078a upstream. These asics seem to use a mix of the DCE2.x and DCE3.2 audio interfaces despite what the register spec says. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=69729 https://bugs.freedesktop.org/show_bug.cgi?id=69671 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/gpu/drm/radeon/r600_hdmi.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c
index b9b1139da356..0efe2a93ca97 100644
--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -238,9 +238,19 @@ void r600_audio_set_dto(struct drm_encoder *encoder, u32 clock)
238 * number (coefficient of two integer numbers. DCCG_AUDIO_DTOx_PHASE 238 * number (coefficient of two integer numbers. DCCG_AUDIO_DTOx_PHASE
239 * is the numerator, DCCG_AUDIO_DTOx_MODULE is the denominator 239 * is the numerator, DCCG_AUDIO_DTOx_MODULE is the denominator
240 */ 240 */
241 if (ASIC_IS_DCE3(rdev)) { 241 if (ASIC_IS_DCE32(rdev)) {
242 if (dig->dig_encoder == 0) {
243 WREG32(DCCG_AUDIO_DTO0_PHASE, base_rate * 100);
244 WREG32(DCCG_AUDIO_DTO0_MODULE, clock * 100);
245 WREG32(DCCG_AUDIO_DTO_SELECT, 0); /* select DTO0 */
246 } else {
247 WREG32(DCCG_AUDIO_DTO1_PHASE, base_rate * 100);
248 WREG32(DCCG_AUDIO_DTO1_MODULE, clock * 100);
249 WREG32(DCCG_AUDIO_DTO_SELECT, 1); /* select DTO1 */
250 }
251 } else if (ASIC_IS_DCE3(rdev)) {
242 /* according to the reg specs, this should DCE3.2 only, but in 252 /* according to the reg specs, this should DCE3.2 only, but in
243 * practice it seems to cover DCE3.0 as well. 253 * practice it seems to cover DCE3.0/3.1 as well.
244 */ 254 */
245 if (dig->dig_encoder == 0) { 255 if (dig->dig_encoder == 0) {
246 WREG32(DCCG_AUDIO_DTO0_PHASE, base_rate * 100); 256 WREG32(DCCG_AUDIO_DTO0_PHASE, base_rate * 100);
@@ -252,7 +262,7 @@ void r600_audio_set_dto(struct drm_encoder *encoder, u32 clock)
252 WREG32(DCCG_AUDIO_DTO_SELECT, 1); /* select DTO1 */ 262 WREG32(DCCG_AUDIO_DTO_SELECT, 1); /* select DTO1 */
253 } 263 }
254 } else { 264 } else {
255 /* according to the reg specs, this should be DCE2.0 and DCE3.0 */ 265 /* according to the reg specs, this should be DCE2.0 and DCE3.0/3.1 */
256 WREG32(AUDIO_DTO, AUDIO_DTO_PHASE(base_rate / 10) | 266 WREG32(AUDIO_DTO, AUDIO_DTO_PHASE(base_rate / 10) |
257 AUDIO_DTO_MODULE(clock / 10)); 267 AUDIO_DTO_MODULE(clock / 10));
258 } 268 }