aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorSubhransu S. Prusty <subhransu.s.prusty@intel.com>2016-03-04 09:29:48 -0500
committerTakashi Iwai <tiwai@suse.de>2016-03-07 09:41:30 -0500
commitf302240da5d5cfc7366dc6994c523aa2aa17c122 (patch)
tree6bb092ed8a949b6a9cf4566dbaa9106e75cdb9bf /sound/pci
parent9b3dc8aa3fb1a5f38ca9501f20f6ea4dced10fa0 (diff)
ALSA: hda - Use hdac name space for CEA spk alloc structure
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_hdmi.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 345b83da46c5..12b0287784c8 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -297,7 +297,7 @@ static int hdmi_channel_mapping[0x32][8] = {
297 * The preceding ones have better chances to be selected by 297 * The preceding ones have better chances to be selected by
298 * hdmi_channel_allocation(). 298 * hdmi_channel_allocation().
299 */ 299 */
300static struct cea_channel_speaker_allocation channel_allocations[] = { 300static struct hdac_cea_channel_speaker_allocation channel_allocations[] = {
301/* channel: 7 6 5 4 3 2 1 0 */ 301/* channel: 7 6 5 4 3 2 1 0 */
302{ .ca_index = 0x00, .speakers = { 0, 0, 0, 0, 0, 0, FR, FL } }, 302{ .ca_index = 0x00, .speakers = { 0, 0, 0, 0, 0, 0, FR, FL } },
303 /* 2.1 */ 303 /* 2.1 */
@@ -683,7 +683,7 @@ static inline void eld_proc_free(struct hdmi_spec_per_pin *per_pin)
683static void init_channel_allocations(void) 683static void init_channel_allocations(void)
684{ 684{
685 int i, j; 685 int i, j;
686 struct cea_channel_speaker_allocation *p; 686 struct hdac_cea_channel_speaker_allocation *p;
687 687
688 for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) { 688 for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) {
689 p = channel_allocations + i; 689 p = channel_allocations + i;
@@ -791,7 +791,7 @@ static void hdmi_std_setup_channel_mapping(struct hda_codec *codec,
791 int ca) 791 int ca)
792{ 792{
793 struct hdmi_spec *spec = codec->spec; 793 struct hdmi_spec *spec = codec->spec;
794 struct cea_channel_speaker_allocation *ch_alloc; 794 struct hdac_cea_channel_speaker_allocation *ch_alloc;
795 int i; 795 int i;
796 int err; 796 int err;
797 int order; 797 int order;
@@ -2358,7 +2358,7 @@ static int hdmi_chmap_ctl_info(struct snd_kcontrol *kcontrol,
2358} 2358}
2359 2359
2360static int hdmi_chmap_cea_alloc_validate_get_type(struct hdac_chmap *chmap, 2360static int hdmi_chmap_cea_alloc_validate_get_type(struct hdac_chmap *chmap,
2361 struct cea_channel_speaker_allocation *cap, int channels) 2361 struct hdac_cea_channel_speaker_allocation *cap, int channels)
2362{ 2362{
2363 /* If the speaker allocation matches the channel count, it is OK.*/ 2363 /* If the speaker allocation matches the channel count, it is OK.*/
2364 if (cap->channels != channels) 2364 if (cap->channels != channels)
@@ -2368,8 +2368,9 @@ static int hdmi_chmap_cea_alloc_validate_get_type(struct hdac_chmap *chmap,
2368 return SNDRV_CTL_TLVT_CHMAP_VAR; 2368 return SNDRV_CTL_TLVT_CHMAP_VAR;
2369} 2369}
2370 2370
2371static void hdmi_cea_alloc_to_tlv_chmap(struct cea_channel_speaker_allocation *cap, 2371static void hdmi_cea_alloc_to_tlv_chmap(
2372 unsigned int *chmap, int channels) 2372 struct hdac_cea_channel_speaker_allocation *cap,
2373 unsigned int *chmap, int channels)
2373{ 2374{
2374 int count = 0; 2375 int count = 0;
2375 int c; 2376 int c;
@@ -2439,7 +2440,7 @@ static int hdmi_chmap_ctl_tlv(struct snd_kcontrol *kcontrol, int op_flag,
2439 dst = tlv + 2; 2440 dst = tlv + 2;
2440 for (chs = 2; chs <= chmap->channels_max; chs++) { 2441 for (chs = 2; chs <= chmap->channels_max; chs++) {
2441 int i; 2442 int i;
2442 struct cea_channel_speaker_allocation *cap; 2443 struct hdac_cea_channel_speaker_allocation *cap;
2443 cap = channel_allocations; 2444 cap = channel_allocations;
2444 for (i = 0; i < ARRAY_SIZE(channel_allocations); i++, cap++) { 2445 for (i = 0; i < ARRAY_SIZE(channel_allocations); i++, cap++) {
2445 int chs_bytes = chs * 4; 2446 int chs_bytes = chs * 4;
@@ -3524,7 +3525,7 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec)
3524 * - 0x10de0040 3525 * - 0x10de0040
3525 */ 3526 */
3526static int nvhdmi_chmap_cea_alloc_validate_get_type(struct hdac_chmap *chmap, 3527static int nvhdmi_chmap_cea_alloc_validate_get_type(struct hdac_chmap *chmap,
3527 struct cea_channel_speaker_allocation *cap, int channels) 3528 struct hdac_cea_channel_speaker_allocation *cap, int channels)
3528{ 3529{
3529 if (cap->ca_index == 0x00 && channels == 2) 3530 if (cap->ca_index == 0x00 && channels == 2)
3530 return SNDRV_CTL_TLVT_CHMAP_FIXED; 3531 return SNDRV_CTL_TLVT_CHMAP_FIXED;
@@ -3805,7 +3806,7 @@ static int atihdmi_paired_swap_fc_lfe(int pos)
3805 3806
3806static int atihdmi_paired_chmap_validate(int ca, int chs, unsigned char *map) 3807static int atihdmi_paired_chmap_validate(int ca, int chs, unsigned char *map)
3807{ 3808{
3808 struct cea_channel_speaker_allocation *cap; 3809 struct hdac_cea_channel_speaker_allocation *cap;
3809 int i, j; 3810 int i, j;
3810 3811
3811 /* check that only channel pairs need to be remapped on old pre-rev3 ATI/AMD */ 3812 /* check that only channel pairs need to be remapped on old pre-rev3 ATI/AMD */
@@ -3916,7 +3917,7 @@ static int atihdmi_pin_get_slot_channel(struct hda_codec *codec, hda_nid_t pin_n
3916 3917
3917static int atihdmi_paired_chmap_cea_alloc_validate_get_type( 3918static int atihdmi_paired_chmap_cea_alloc_validate_get_type(
3918 struct hdac_chmap *chmap, 3919 struct hdac_chmap *chmap,
3919 struct cea_channel_speaker_allocation *cap, 3920 struct hdac_cea_channel_speaker_allocation *cap,
3920 int channels) 3921 int channels)
3921{ 3922{
3922 int c; 3923 int c;
@@ -3944,8 +3945,9 @@ static int atihdmi_paired_chmap_cea_alloc_validate_get_type(
3944 return SNDRV_CTL_TLVT_CHMAP_PAIRED; 3945 return SNDRV_CTL_TLVT_CHMAP_PAIRED;
3945} 3946}
3946 3947
3947static void atihdmi_paired_cea_alloc_to_tlv_chmap(struct cea_channel_speaker_allocation *cap, 3948static void atihdmi_paired_cea_alloc_to_tlv_chmap(
3948 unsigned int *chmap, int channels) 3949 struct hdac_cea_channel_speaker_allocation *cap,
3950 unsigned int *chmap, int channels)
3949{ 3951{
3950 /* produce paired maps for pre-rev3 ATI/AMD codecs */ 3952 /* produce paired maps for pre-rev3 ATI/AMD codecs */
3951 int count = 0; 3953 int count = 0;