aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-11-07 04:32:47 -0500
committerTakashi Iwai <tiwai@suse.de>2012-11-07 08:42:00 -0500
commit5b3761954dac2d1393beef8210eb8cee81d16b8d (patch)
treed72f684863372804ae1d1203c3ab552c4b0f4a03 /sound/pci
parentae24c3191ba2ab03ec6b4be323e730e00404b4b6 (diff)
ALSA: hda - Fix empty DAC filling in patch_via.c
In via_auto_fill_adc_nids(), the parser tries to fill dac_nids[] at the point of the current line-out (i). When no valid path is found for this output, this results in dac = 0, thus it creates a hole in dac_nids[]. This confuses is_empty_dac() and trims the detected DAC in later reference. This patch fixes the bug by appending DAC properly to dac_nids[] in via_auto_fill_adc_nids(). Reported-by: Massimo Del Fedele <max@veneto.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_via.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 72a2f60b087c..bf57fa6a4add 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -1809,11 +1809,11 @@ static int via_auto_fill_dac_nids(struct hda_codec *codec)
1809{ 1809{
1810 struct via_spec *spec = codec->spec; 1810 struct via_spec *spec = codec->spec;
1811 const struct auto_pin_cfg *cfg = &spec->autocfg; 1811 const struct auto_pin_cfg *cfg = &spec->autocfg;
1812 int i, dac_num; 1812 int i;
1813 hda_nid_t nid; 1813 hda_nid_t nid;
1814 1814
1815 spec->multiout.num_dacs = 0;
1815 spec->multiout.dac_nids = spec->private_dac_nids; 1816 spec->multiout.dac_nids = spec->private_dac_nids;
1816 dac_num = 0;
1817 for (i = 0; i < cfg->line_outs; i++) { 1817 for (i = 0; i < cfg->line_outs; i++) {
1818 hda_nid_t dac = 0; 1818 hda_nid_t dac = 0;
1819 nid = cfg->line_out_pins[i]; 1819 nid = cfg->line_out_pins[i];
@@ -1824,16 +1824,13 @@ static int via_auto_fill_dac_nids(struct hda_codec *codec)
1824 if (!i && parse_output_path(codec, nid, dac, 1, 1824 if (!i && parse_output_path(codec, nid, dac, 1,
1825 &spec->out_mix_path)) 1825 &spec->out_mix_path))
1826 dac = spec->out_mix_path.path[0]; 1826 dac = spec->out_mix_path.path[0];
1827 if (dac) { 1827 if (dac)
1828 spec->private_dac_nids[i] = dac; 1828 spec->private_dac_nids[spec->multiout.num_dacs++] = dac;
1829 dac_num++;
1830 }
1831 } 1829 }
1832 if (!spec->out_path[0].depth && spec->out_mix_path.depth) { 1830 if (!spec->out_path[0].depth && spec->out_mix_path.depth) {
1833 spec->out_path[0] = spec->out_mix_path; 1831 spec->out_path[0] = spec->out_mix_path;
1834 spec->out_mix_path.depth = 0; 1832 spec->out_mix_path.depth = 0;
1835 } 1833 }
1836 spec->multiout.num_dacs = dac_num;
1837 return 0; 1834 return 0;
1838} 1835}
1839 1836