提交 f302240d 编写于 作者: S Subhransu S. Prusty 提交者: Takashi Iwai

ALSA: hda - Use hdac name space for CEA spk alloc structure

Signed-off-by: NSubhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 9b3dc8aa
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <sound/hdaudio.h> #include <sound/hdaudio.h>
struct cea_channel_speaker_allocation { struct hdac_cea_channel_speaker_allocation {
int ca_index; int ca_index;
int speakers[8]; int speakers[8];
...@@ -23,9 +23,9 @@ struct hdac_chmap_ops { ...@@ -23,9 +23,9 @@ struct hdac_chmap_ops {
* for devices that have non-standard mapping requirements. * for devices that have non-standard mapping requirements.
*/ */
int (*chmap_cea_alloc_validate_get_type)(struct hdac_chmap *chmap, int (*chmap_cea_alloc_validate_get_type)(struct hdac_chmap *chmap,
struct cea_channel_speaker_allocation *cap, int channels); struct hdac_cea_channel_speaker_allocation *cap, int channels);
void (*cea_alloc_to_tlv_chmap) void (*cea_alloc_to_tlv_chmap)
(struct cea_channel_speaker_allocation *cap, (struct hdac_cea_channel_speaker_allocation *cap,
unsigned int *chmap, int channels); unsigned int *chmap, int channels);
/* check that the user-given chmap is supported */ /* check that the user-given chmap is supported */
......
...@@ -297,7 +297,7 @@ static int hdmi_channel_mapping[0x32][8] = { ...@@ -297,7 +297,7 @@ static int hdmi_channel_mapping[0x32][8] = {
* The preceding ones have better chances to be selected by * The preceding ones have better chances to be selected by
* hdmi_channel_allocation(). * hdmi_channel_allocation().
*/ */
static struct cea_channel_speaker_allocation channel_allocations[] = { static struct hdac_cea_channel_speaker_allocation channel_allocations[] = {
/* channel: 7 6 5 4 3 2 1 0 */ /* channel: 7 6 5 4 3 2 1 0 */
{ .ca_index = 0x00, .speakers = { 0, 0, 0, 0, 0, 0, FR, FL } }, { .ca_index = 0x00, .speakers = { 0, 0, 0, 0, 0, 0, FR, FL } },
/* 2.1 */ /* 2.1 */
...@@ -683,7 +683,7 @@ static inline void eld_proc_free(struct hdmi_spec_per_pin *per_pin) ...@@ -683,7 +683,7 @@ static inline void eld_proc_free(struct hdmi_spec_per_pin *per_pin)
static void init_channel_allocations(void) static void init_channel_allocations(void)
{ {
int i, j; int i, j;
struct cea_channel_speaker_allocation *p; struct hdac_cea_channel_speaker_allocation *p;
for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) { for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) {
p = channel_allocations + i; p = channel_allocations + i;
...@@ -791,7 +791,7 @@ static void hdmi_std_setup_channel_mapping(struct hda_codec *codec, ...@@ -791,7 +791,7 @@ static void hdmi_std_setup_channel_mapping(struct hda_codec *codec,
int ca) int ca)
{ {
struct hdmi_spec *spec = codec->spec; struct hdmi_spec *spec = codec->spec;
struct cea_channel_speaker_allocation *ch_alloc; struct hdac_cea_channel_speaker_allocation *ch_alloc;
int i; int i;
int err; int err;
int order; int order;
...@@ -2358,7 +2358,7 @@ static int hdmi_chmap_ctl_info(struct snd_kcontrol *kcontrol, ...@@ -2358,7 +2358,7 @@ static int hdmi_chmap_ctl_info(struct snd_kcontrol *kcontrol,
} }
static int hdmi_chmap_cea_alloc_validate_get_type(struct hdac_chmap *chmap, static int hdmi_chmap_cea_alloc_validate_get_type(struct hdac_chmap *chmap,
struct cea_channel_speaker_allocation *cap, int channels) struct hdac_cea_channel_speaker_allocation *cap, int channels)
{ {
/* If the speaker allocation matches the channel count, it is OK.*/ /* If the speaker allocation matches the channel count, it is OK.*/
if (cap->channels != channels) if (cap->channels != channels)
...@@ -2368,8 +2368,9 @@ static int hdmi_chmap_cea_alloc_validate_get_type(struct hdac_chmap *chmap, ...@@ -2368,8 +2368,9 @@ static int hdmi_chmap_cea_alloc_validate_get_type(struct hdac_chmap *chmap,
return SNDRV_CTL_TLVT_CHMAP_VAR; return SNDRV_CTL_TLVT_CHMAP_VAR;
} }
static void hdmi_cea_alloc_to_tlv_chmap(struct cea_channel_speaker_allocation *cap, static void hdmi_cea_alloc_to_tlv_chmap(
unsigned int *chmap, int channels) struct hdac_cea_channel_speaker_allocation *cap,
unsigned int *chmap, int channels)
{ {
int count = 0; int count = 0;
int c; int c;
...@@ -2439,7 +2440,7 @@ static int hdmi_chmap_ctl_tlv(struct snd_kcontrol *kcontrol, int op_flag, ...@@ -2439,7 +2440,7 @@ static int hdmi_chmap_ctl_tlv(struct snd_kcontrol *kcontrol, int op_flag,
dst = tlv + 2; dst = tlv + 2;
for (chs = 2; chs <= chmap->channels_max; chs++) { for (chs = 2; chs <= chmap->channels_max; chs++) {
int i; int i;
struct cea_channel_speaker_allocation *cap; struct hdac_cea_channel_speaker_allocation *cap;
cap = channel_allocations; cap = channel_allocations;
for (i = 0; i < ARRAY_SIZE(channel_allocations); i++, cap++) { for (i = 0; i < ARRAY_SIZE(channel_allocations); i++, cap++) {
int chs_bytes = chs * 4; int chs_bytes = chs * 4;
...@@ -3524,7 +3525,7 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec) ...@@ -3524,7 +3525,7 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec)
* - 0x10de0040 * - 0x10de0040
*/ */
static int nvhdmi_chmap_cea_alloc_validate_get_type(struct hdac_chmap *chmap, static int nvhdmi_chmap_cea_alloc_validate_get_type(struct hdac_chmap *chmap,
struct cea_channel_speaker_allocation *cap, int channels) struct hdac_cea_channel_speaker_allocation *cap, int channels)
{ {
if (cap->ca_index == 0x00 && channels == 2) if (cap->ca_index == 0x00 && channels == 2)
return SNDRV_CTL_TLVT_CHMAP_FIXED; return SNDRV_CTL_TLVT_CHMAP_FIXED;
...@@ -3805,7 +3806,7 @@ static int atihdmi_paired_swap_fc_lfe(int pos) ...@@ -3805,7 +3806,7 @@ static int atihdmi_paired_swap_fc_lfe(int pos)
static int atihdmi_paired_chmap_validate(int ca, int chs, unsigned char *map) static int atihdmi_paired_chmap_validate(int ca, int chs, unsigned char *map)
{ {
struct cea_channel_speaker_allocation *cap; struct hdac_cea_channel_speaker_allocation *cap;
int i, j; int i, j;
/* check that only channel pairs need to be remapped on old pre-rev3 ATI/AMD */ /* 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,7 +3917,7 @@ static int atihdmi_pin_get_slot_channel(struct hda_codec *codec, hda_nid_t pin_n
static int atihdmi_paired_chmap_cea_alloc_validate_get_type( static int atihdmi_paired_chmap_cea_alloc_validate_get_type(
struct hdac_chmap *chmap, struct hdac_chmap *chmap,
struct cea_channel_speaker_allocation *cap, struct hdac_cea_channel_speaker_allocation *cap,
int channels) int channels)
{ {
int c; int c;
...@@ -3944,8 +3945,9 @@ static int atihdmi_paired_chmap_cea_alloc_validate_get_type( ...@@ -3944,8 +3945,9 @@ static int atihdmi_paired_chmap_cea_alloc_validate_get_type(
return SNDRV_CTL_TLVT_CHMAP_PAIRED; return SNDRV_CTL_TLVT_CHMAP_PAIRED;
} }
static void atihdmi_paired_cea_alloc_to_tlv_chmap(struct cea_channel_speaker_allocation *cap, static void atihdmi_paired_cea_alloc_to_tlv_chmap(
unsigned int *chmap, int channels) struct hdac_cea_channel_speaker_allocation *cap,
unsigned int *chmap, int channels)
{ {
/* produce paired maps for pre-rev3 ATI/AMD codecs */ /* produce paired maps for pre-rev3 ATI/AMD codecs */
int count = 0; int count = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册