diff options
author | Slava Grigorev <slava.grigorev@amd.com> | 2014-12-06 20:19:16 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-01-22 10:42:11 -0500 |
commit | 64424d6e45aeee311a4231def7e125bcc2de0855 (patch) | |
tree | f7a6692f1f20070df377435c352cd2cd5e60cc48 /drivers/gpu/drm/radeon/dce3_1_afmt.c | |
parent | 96ea7afbc256ce7e2b2446909f52dab357942c3c (diff) |
radeon/audio: consolidate update_acr() functions (v2)
V2: fix missing dce6 callback
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/dce3_1_afmt.c')
-rw-r--r-- | drivers/gpu/drm/radeon/dce3_1_afmt.c | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c b/drivers/gpu/drm/radeon/dce3_1_afmt.c index 0accc5ee0e39..2a963c173cc1 100644 --- a/drivers/gpu/drm/radeon/dce3_1_afmt.c +++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c | |||
@@ -167,6 +167,38 @@ void dce3_2_audio_set_dto(struct radeon_device *rdev, | |||
167 | } | 167 | } |
168 | } | 168 | } |
169 | 169 | ||
170 | void dce3_2_hdmi_update_acr(struct drm_encoder *encoder, long offset, | ||
171 | const struct radeon_hdmi_acr *acr) | ||
172 | { | ||
173 | struct drm_device *dev = encoder->dev; | ||
174 | struct radeon_device *rdev = dev->dev_private; | ||
175 | |||
176 | WREG32(HDMI0_ACR_PACKET_CONTROL + offset, | ||
177 | HDMI0_ACR_SOURCE | /* select SW CTS value */ | ||
178 | HDMI0_ACR_AUTO_SEND); /* allow hw to sent ACR packets when required */ | ||
179 | |||
180 | WREG32_P(HDMI0_ACR_32_0 + offset, | ||
181 | HDMI0_ACR_CTS_32(acr->cts_32khz), | ||
182 | ~HDMI0_ACR_CTS_32_MASK); | ||
183 | WREG32_P(HDMI0_ACR_32_1 + offset, | ||
184 | HDMI0_ACR_N_32(acr->n_32khz), | ||
185 | ~HDMI0_ACR_N_32_MASK); | ||
186 | |||
187 | WREG32_P(HDMI0_ACR_44_0 + offset, | ||
188 | HDMI0_ACR_CTS_44(acr->cts_44_1khz), | ||
189 | ~HDMI0_ACR_CTS_44_MASK); | ||
190 | WREG32_P(HDMI0_ACR_44_1 + offset, | ||
191 | HDMI0_ACR_N_44(acr->n_44_1khz), | ||
192 | ~HDMI0_ACR_N_44_MASK); | ||
193 | |||
194 | WREG32_P(HDMI0_ACR_48_0 + offset, | ||
195 | HDMI0_ACR_CTS_48(acr->cts_48khz), | ||
196 | ~HDMI0_ACR_CTS_48_MASK); | ||
197 | WREG32_P(HDMI0_ACR_48_1 + offset, | ||
198 | HDMI0_ACR_N_48(acr->n_48khz), | ||
199 | ~HDMI0_ACR_N_48_MASK); | ||
200 | } | ||
201 | |||
170 | /* | 202 | /* |
171 | * update the info frames with the data from the current display mode | 203 | * update the info frames with the data from the current display mode |
172 | */ | 204 | */ |
@@ -220,10 +252,6 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *m | |||
220 | radeon_audio_write_sad_regs(encoder); | 252 | radeon_audio_write_sad_regs(encoder); |
221 | } | 253 | } |
222 | 254 | ||
223 | WREG32(HDMI0_ACR_PACKET_CONTROL + offset, | ||
224 | HDMI0_ACR_SOURCE | /* select SW CTS value - XXX verify that hw CTS works on all families */ | ||
225 | HDMI0_ACR_AUTO_SEND); /* allow hw to sent ACR packets when required */ | ||
226 | |||
227 | WREG32(HDMI0_VBI_PACKET_CONTROL + offset, | 255 | WREG32(HDMI0_VBI_PACKET_CONTROL + offset, |
228 | HDMI0_NULL_SEND | /* send null packets when required */ | 256 | HDMI0_NULL_SEND | /* send null packets when required */ |
229 | HDMI0_GC_SEND | /* send general control packets */ | 257 | HDMI0_GC_SEND | /* send general control packets */ |
@@ -255,7 +283,7 @@ void dce3_1_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *m | |||
255 | } | 283 | } |
256 | 284 | ||
257 | radeon_update_avi_infoframe(encoder, buffer, sizeof(buffer)); | 285 | radeon_update_avi_infoframe(encoder, buffer, sizeof(buffer)); |
258 | r600_hdmi_update_ACR(encoder, mode->clock); | 286 | radeon_audio_update_acr(encoder, mode->clock); |
259 | 287 | ||
260 | /* it's unknown what these bits do excatly, but it's indeed quite useful for debugging */ | 288 | /* it's unknown what these bits do excatly, but it's indeed quite useful for debugging */ |
261 | WREG32(HDMI0_RAMP_CONTROL0 + offset, 0x00FFFFFF); | 289 | WREG32(HDMI0_RAMP_CONTROL0 + offset, 0x00FFFFFF); |