Commit 965f1b2e authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Allow different assoc numbers for multiple speakers

In snd_hda_parse_pin_def_config(), we checked the associated number
of speaker pins and accepts only one number exclusively.  But many BIOS
seem to give different assoc number for surround speakers, thus we'd
better to accept all speaker pins no matter which assoc number, and sort
like done for the headphone pins.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 23c09b00
...@@ -4700,7 +4700,7 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, ...@@ -4700,7 +4700,7 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
const hda_nid_t *ignore_nids) const hda_nid_t *ignore_nids)
{ {
hda_nid_t nid, end_nid; hda_nid_t nid, end_nid;
short seq, assoc_line_out, assoc_speaker; short seq, assoc_line_out;
short sequences_line_out[ARRAY_SIZE(cfg->line_out_pins)]; short sequences_line_out[ARRAY_SIZE(cfg->line_out_pins)];
short sequences_speaker[ARRAY_SIZE(cfg->speaker_pins)]; short sequences_speaker[ARRAY_SIZE(cfg->speaker_pins)];
short sequences_hp[ARRAY_SIZE(cfg->hp_pins)]; short sequences_hp[ARRAY_SIZE(cfg->hp_pins)];
...@@ -4711,7 +4711,7 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, ...@@ -4711,7 +4711,7 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
memset(sequences_line_out, 0, sizeof(sequences_line_out)); memset(sequences_line_out, 0, sizeof(sequences_line_out));
memset(sequences_speaker, 0, sizeof(sequences_speaker)); memset(sequences_speaker, 0, sizeof(sequences_speaker));
memset(sequences_hp, 0, sizeof(sequences_hp)); memset(sequences_hp, 0, sizeof(sequences_hp));
assoc_line_out = assoc_speaker = 0; assoc_line_out = 0;
end_nid = codec->start_nid + codec->num_nodes; end_nid = codec->start_nid + codec->num_nodes;
for (nid = codec->start_nid; nid < end_nid; nid++) { for (nid = codec->start_nid; nid < end_nid; nid++) {
...@@ -4763,16 +4763,10 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, ...@@ -4763,16 +4763,10 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
case AC_JACK_SPEAKER: case AC_JACK_SPEAKER:
seq = get_defcfg_sequence(def_conf); seq = get_defcfg_sequence(def_conf);
assoc = get_defcfg_association(def_conf); assoc = get_defcfg_association(def_conf);
if (!assoc)
continue;
if (!assoc_speaker)
assoc_speaker = assoc;
else if (assoc_speaker != assoc)
continue;
if (cfg->speaker_outs >= ARRAY_SIZE(cfg->speaker_pins)) if (cfg->speaker_outs >= ARRAY_SIZE(cfg->speaker_pins))
continue; continue;
cfg->speaker_pins[cfg->speaker_outs] = nid; cfg->speaker_pins[cfg->speaker_outs] = nid;
sequences_speaker[cfg->speaker_outs] = seq; sequences_speaker[cfg->speaker_outs] = (assoc << 4) | seq;
cfg->speaker_outs++; cfg->speaker_outs++;
break; break;
case AC_JACK_HP_OUT: case AC_JACK_HP_OUT:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment