aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-04-22 09:42:07 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-04-23 18:03:59 -0400
commit1586505a5db2b221a99feabe61199c2657e9ee23 (patch)
treec9bc5bd27a94af33687896d33a4aad346d0c6f1a
parent46892caabe756228666d8d83aea5724d9557601a (diff)
drm/radeon: fix up audio dto programming for DCE2
Uses a different register than DCE3 asics. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/radeon/r600_hdmi.c15
-rw-r--r--drivers/gpu/drm/radeon/r600d.h7
2 files changed, 18 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c
index 2e15888d8307..47f180a79352 100644
--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -246,9 +246,18 @@ void r600_audio_set_dto(struct drm_encoder *encoder, u32 clock)
246 * number (coefficient of two integer numbers. DCCG_AUDIO_DTOx_PHASE 246 * number (coefficient of two integer numbers. DCCG_AUDIO_DTOx_PHASE
247 * is the numerator, DCCG_AUDIO_DTOx_MODULE is the denominator 247 * is the numerator, DCCG_AUDIO_DTOx_MODULE is the denominator
248 */ 248 */
249 WREG32(DCCG_AUDIO_DTO0_PHASE, (base_rate*50) & 0xffffff); 249 if (ASIC_IS_DCE3(rdev)) {
250 WREG32(DCCG_AUDIO_DTO0_MODULE, (clock*100) & 0xffffff); 250 /* according to the reg specs, this should DCE3.2 only, but in
251 WREG32(DCCG_AUDIO_DTO_SELECT, 0); /* select DTO0 */ 251 * practice it seems to cover DCE3.0 as well.
252 */
253 WREG32(DCCG_AUDIO_DTO0_PHASE, base_rate * 50);
254 WREG32(DCCG_AUDIO_DTO0_MODULE, clock * 100);
255 WREG32(DCCG_AUDIO_DTO_SELECT, 0); /* select DTO0 */
256 } else {
257 /* according to the reg specs, this should be DCE2.0 and DCE3.0 */
258 WREG32(AUDIO_DTO, AUDIO_DTO_PHASE(base_rate * 50) |
259 AUDIO_DTO_MODULE(clock * 100));
260 }
252} 261}
253 262
254/* 263/*
diff --git a/drivers/gpu/drm/radeon/r600d.h b/drivers/gpu/drm/radeon/r600d.h
index 441bdb809a0b..6105b25b18c3 100644
--- a/drivers/gpu/drm/radeon/r600d.h
+++ b/drivers/gpu/drm/radeon/r600d.h
@@ -910,7 +910,12 @@
910# define TARGET_LINK_SPEED_MASK (0xf << 0) 910# define TARGET_LINK_SPEED_MASK (0xf << 0)
911# define SELECTABLE_DEEMPHASIS (1 << 6) 911# define SELECTABLE_DEEMPHASIS (1 << 6)
912 912
913/* Audio clocks */ 913/* Audio clocks DCE 2.0/3.0 */
914#define AUDIO_DTO 0x7340
915# define AUDIO_DTO_PHASE(x) (((x) & 0xffff) << 0)
916# define AUDIO_DTO_MODULE(x) (((x) & 0xffff) << 16)
917
918/* Audio clocks DCE 3.2 */
914#define DCCG_AUDIO_DTO0_PHASE 0x0514 919#define DCCG_AUDIO_DTO0_PHASE 0x0514
915#define DCCG_AUDIO_DTO0_MODULE 0x0518 920#define DCCG_AUDIO_DTO0_MODULE 0x0518
916#define DCCG_AUDIO_DTO0_LOAD 0x051c 921#define DCCG_AUDIO_DTO0_LOAD 0x051c