aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-08-19 03:10:29 -0400
committerTakashi Iwai <tiwai@suse.de>2011-08-19 03:10:29 -0400
commit965f1b2e196924dbe7143e36bf4a2bcdc07fc810 (patch)
tree999edd6ba796f81e7a57e6a68503b9664a0da4c5 /sound
parent23c09b00900c3fa6672148738cad29d6fc6ded7c (diff)
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: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_codec.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 83d3eb5e5552..7004c3f64058 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -4700,7 +4700,7 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
4700 const hda_nid_t *ignore_nids) 4700 const hda_nid_t *ignore_nids)
4701{ 4701{
4702 hda_nid_t nid, end_nid; 4702 hda_nid_t nid, end_nid;
4703 short seq, assoc_line_out, assoc_speaker; 4703 short seq, assoc_line_out;
4704 short sequences_line_out[ARRAY_SIZE(cfg->line_out_pins)]; 4704 short sequences_line_out[ARRAY_SIZE(cfg->line_out_pins)];
4705 short sequences_speaker[ARRAY_SIZE(cfg->speaker_pins)]; 4705 short sequences_speaker[ARRAY_SIZE(cfg->speaker_pins)];
4706 short sequences_hp[ARRAY_SIZE(cfg->hp_pins)]; 4706 short sequences_hp[ARRAY_SIZE(cfg->hp_pins)];
@@ -4711,7 +4711,7 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
4711 memset(sequences_line_out, 0, sizeof(sequences_line_out)); 4711 memset(sequences_line_out, 0, sizeof(sequences_line_out));
4712 memset(sequences_speaker, 0, sizeof(sequences_speaker)); 4712 memset(sequences_speaker, 0, sizeof(sequences_speaker));
4713 memset(sequences_hp, 0, sizeof(sequences_hp)); 4713 memset(sequences_hp, 0, sizeof(sequences_hp));
4714 assoc_line_out = assoc_speaker = 0; 4714 assoc_line_out = 0;
4715 4715
4716 end_nid = codec->start_nid + codec->num_nodes; 4716 end_nid = codec->start_nid + codec->num_nodes;
4717 for (nid = codec->start_nid; nid < end_nid; nid++) { 4717 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 case AC_JACK_SPEAKER: 4763 case AC_JACK_SPEAKER:
4764 seq = get_defcfg_sequence(def_conf); 4764 seq = get_defcfg_sequence(def_conf);
4765 assoc = get_defcfg_association(def_conf); 4765 assoc = get_defcfg_association(def_conf);
4766 if (!assoc)
4767 continue;
4768 if (!assoc_speaker)
4769 assoc_speaker = assoc;
4770 else if (assoc_speaker != assoc)
4771 continue;
4772 if (cfg->speaker_outs >= ARRAY_SIZE(cfg->speaker_pins)) 4766 if (cfg->speaker_outs >= ARRAY_SIZE(cfg->speaker_pins))
4773 continue; 4767 continue;
4774 cfg->speaker_pins[cfg->speaker_outs] = nid; 4768 cfg->speaker_pins[cfg->speaker_outs] = nid;
4775 sequences_speaker[cfg->speaker_outs] = seq; 4769 sequences_speaker[cfg->speaker_outs] = (assoc << 4) | seq;
4776 cfg->speaker_outs++; 4770 cfg->speaker_outs++;
4777 break; 4771 break;
4778 case AC_JACK_HP_OUT: 4772 case AC_JACK_HP_OUT: