diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2012-05-06 11:29:46 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-05-13 09:19:37 -0400 |
commit | a366e3926664aa615666dcea892b56909b5c994c (patch) | |
tree | 7b5bce92cc169edc3f0d29b76eebd7a6dc0366af /drivers/gpu/drm | |
parent | 1c3439f228db0f9b81111752a1d009d26a8ba47e (diff) |
drm/radeon/hdmi: fix some coding style
Use defined macros by the way.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/radeon/r600_hdmi.c | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c index 30e616a33d34..c308432445a9 100644 --- a/drivers/gpu/drm/radeon/r600_hdmi.c +++ b/drivers/gpu/drm/radeon/r600_hdmi.c | |||
@@ -417,34 +417,51 @@ void r600_hdmi_update_audio_settings(struct drm_encoder *encoder) | |||
417 | if (status_bits & AUDIO_STATUS_EMPHASIS) | 417 | if (status_bits & AUDIO_STATUS_EMPHASIS) |
418 | iec |= 1 << 3; | 418 | iec |= 1 << 3; |
419 | 419 | ||
420 | iec |= category_code << 8; | 420 | iec |= HDMI0_60958_CS_CATEGORY_CODE(category_code); |
421 | 421 | ||
422 | switch (rate) { | 422 | switch (rate) { |
423 | case 32000: iec |= 0x3 << 24; break; | 423 | case 32000: |
424 | case 44100: iec |= 0x0 << 24; break; | 424 | iec |= HDMI0_60958_CS_SAMPLING_FREQUENCY(0x3); |
425 | case 88200: iec |= 0x8 << 24; break; | 425 | break; |
426 | case 176400: iec |= 0xc << 24; break; | 426 | case 44100: |
427 | case 48000: iec |= 0x2 << 24; break; | 427 | iec |= HDMI0_60958_CS_SAMPLING_FREQUENCY(0x0); |
428 | case 96000: iec |= 0xa << 24; break; | 428 | break; |
429 | case 192000: iec |= 0xe << 24; break; | 429 | case 48000: |
430 | iec |= HDMI0_60958_CS_SAMPLING_FREQUENCY(0x2); | ||
431 | break; | ||
432 | case 88200: | ||
433 | iec |= HDMI0_60958_CS_SAMPLING_FREQUENCY(0x8); | ||
434 | break; | ||
435 | case 96000: | ||
436 | iec |= HDMI0_60958_CS_SAMPLING_FREQUENCY(0xa); | ||
437 | break; | ||
438 | case 176400: | ||
439 | iec |= HDMI0_60958_CS_SAMPLING_FREQUENCY(0xc); | ||
440 | break; | ||
441 | case 192000: | ||
442 | iec |= HDMI0_60958_CS_SAMPLING_FREQUENCY(0xe); | ||
443 | break; | ||
430 | } | 444 | } |
431 | 445 | ||
432 | WREG32(HDMI0_60958_0 + offset, iec); | 446 | WREG32(HDMI0_60958_0 + offset, iec); |
433 | 447 | ||
434 | iec = 0; | 448 | iec = 0; |
435 | switch (bps) { | 449 | switch (bps) { |
436 | case 16: iec |= 0x2; break; | 450 | case 16: |
437 | case 20: iec |= 0x3; break; | 451 | iec |= HDMI0_60958_CS_WORD_LENGTH(0x2); |
438 | case 24: iec |= 0xb; break; | 452 | break; |
453 | case 20: | ||
454 | iec |= HDMI0_60958_CS_WORD_LENGTH(0x3); | ||
455 | break; | ||
456 | case 24: | ||
457 | iec |= HDMI0_60958_CS_WORD_LENGTH(0xb); | ||
458 | break; | ||
439 | } | 459 | } |
440 | if (status_bits & AUDIO_STATUS_V) | 460 | if (status_bits & AUDIO_STATUS_V) |
441 | iec |= 0x5 << 16; | 461 | iec |= 0x5 << 16; |
442 | |||
443 | WREG32_P(HDMI0_60958_1 + offset, iec, ~0x5000f); | 462 | WREG32_P(HDMI0_60958_1 + offset, iec, ~0x5000f); |
444 | 463 | ||
445 | /* 0x021 or 0x031 sets the audio frame length */ | 464 | r600_hdmi_audioinfoframe(encoder, channels - 1, 0, 0, 0, 0, 0, 0, 0); |
446 | WREG32(HDMI0_VBI_PACKET_CONTROL + offset, 0x31); | ||
447 | r600_hdmi_audioinfoframe(encoder, channels-1, 0, 0, 0, 0, 0, 0, 0); | ||
448 | 465 | ||
449 | r600_hdmi_audio_workaround(encoder); | 466 | r600_hdmi_audio_workaround(encoder); |
450 | } | 467 | } |