aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/sid.h
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-07-31 16:51:33 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-08-30 16:30:45 -0400
commitb530602fd4625f763344e455902981b22f85f609 (patch)
treefb1c932b2bf74b76fbbdc198d527a698088500c2 /drivers/gpu/drm/radeon/sid.h
parenta4d39e68949f5b4f7b426be63782b421018f741a (diff)
drm/radeon: add audio support for DCE6/8 GPUs (v12)
Similar to DCE4/5, but supports multiple audio pins which can be assigned per afmt block. v2: rework the driver to handle more than one audio pin. v3: try different dto reg v4: properly program dto v5 (ck): change dto programming order v6: program speaker allocation block v7: rebase v8: rebase on Rafał's changes v9: integrated Rafał's comments, update to latest drm_edid_to_speaker_allocation API v10: add missing line break in error message v11: add back audio enabled messages v12: fix copy paste typo in r600_audio_enable Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Rafał Miłecki <zajec5@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/sid.h')
-rw-r--r--drivers/gpu/drm/radeon/sid.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/sid.h b/drivers/gpu/drm/radeon/sid.h
index 2c8da27a929f..968cf699c29e 100644
--- a/drivers/gpu/drm/radeon/sid.h
+++ b/drivers/gpu/drm/radeon/sid.h
@@ -635,6 +635,54 @@
635 635
636#define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0 636#define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0
637 637
638/* DCE6 ELD audio interface */
639#define AZ_F0_CODEC_ENDPOINT_INDEX 0x5E00
640# define AZ_ENDPOINT_REG_INDEX(x) (((x) & 0xff) << 0)
641# define AZ_ENDPOINT_REG_WRITE_EN (1 << 8)
642#define AZ_F0_CODEC_ENDPOINT_DATA 0x5E04
643
644#define AZ_F0_CODEC_PIN_CONTROL_CHANNEL_SPEAKER 0x25
645#define SPEAKER_ALLOCATION(x) (((x) & 0x7f) << 0)
646#define SPEAKER_ALLOCATION_MASK (0x7f << 0)
647#define SPEAKER_ALLOCATION_SHIFT 0
648#define HDMI_CONNECTION (1 << 16)
649#define DP_CONNECTION (1 << 17)
650
651#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR0 0x28 /* LPCM */
652#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR1 0x29 /* AC3 */
653#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR2 0x2A /* MPEG1 */
654#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR3 0x2B /* MP3 */
655#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR4 0x2C /* MPEG2 */
656#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR5 0x2D /* AAC */
657#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR6 0x2E /* DTS */
658#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR7 0x2F /* ATRAC */
659#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR8 0x30 /* one bit audio - leave at 0 (default) */
660#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR9 0x31 /* Dolby Digital */
661#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR10 0x32 /* DTS-HD */
662#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR11 0x33 /* MAT-MLP */
663#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR12 0x34 /* DTS */
664#define AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR13 0x35 /* WMA Pro */
665# define MAX_CHANNELS(x) (((x) & 0x7) << 0)
666/* max channels minus one. 7 = 8 channels */
667# define SUPPORTED_FREQUENCIES(x) (((x) & 0xff) << 8)
668# define DESCRIPTOR_BYTE_2(x) (((x) & 0xff) << 16)
669# define SUPPORTED_FREQUENCIES_STEREO(x) (((x) & 0xff) << 24) /* LPCM only */
670/* SUPPORTED_FREQUENCIES, SUPPORTED_FREQUENCIES_STEREO
671 * bit0 = 32 kHz
672 * bit1 = 44.1 kHz
673 * bit2 = 48 kHz
674 * bit3 = 88.2 kHz
675 * bit4 = 96 kHz
676 * bit5 = 176.4 kHz
677 * bit6 = 192 kHz
678 */
679#define AZ_F0_CODEC_PIN_CONTROL_HOTPLUG_CONTROL 0x54
680# define AUDIO_ENABLED (1 << 31)
681
682#define AZ_F0_CODEC_PIN_CONTROL_RESPONSE_CONFIGURATION_DEFAULT 0x56
683#define PORT_CONNECTIVITY_MASK (3 << 30)
684#define PORT_CONNECTIVITY_SHIFT 30
685
638#define DC_LB_MEMORY_SPLIT 0x6b0c 686#define DC_LB_MEMORY_SPLIT 0x6b0c
639#define DC_LB_MEMORY_CONFIG(x) ((x) << 20) 687#define DC_LB_MEMORY_CONFIG(x) ((x) << 20)
640 688
@@ -755,6 +803,17 @@
755/* 0x6e98, 0x7a98, 0x10698, 0x11298, 0x11e98, 0x12a98 */ 803/* 0x6e98, 0x7a98, 0x10698, 0x11298, 0x11e98, 0x12a98 */
756#define CRTC_STATUS_FRAME_COUNT 0x6e98 804#define CRTC_STATUS_FRAME_COUNT 0x6e98
757 805
806#define AFMT_AUDIO_SRC_CONTROL 0x713c
807#define AFMT_AUDIO_SRC_SELECT(x) (((x) & 7) << 0)
808/* AFMT_AUDIO_SRC_SELECT
809 * 0 = stream0
810 * 1 = stream1
811 * 2 = stream2
812 * 3 = stream3
813 * 4 = stream4
814 * 5 = stream5
815 */
816
758#define GRBM_CNTL 0x8000 817#define GRBM_CNTL 0x8000
759#define GRBM_READ_TIMEOUT(x) ((x) << 0) 818#define GRBM_READ_TIMEOUT(x) ((x) << 0)
760 819