aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-11-03 11:54:06 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-11 12:36:51 -0500
commitd429701077f158a4b7bdf4a8490d3ed9847217e5 (patch)
tree3c2e44f26f5cb63af19e7b95961cc7a7c33623e4 /sound/pci
parentec0baacddc46b83b95b6bb4245f16a3c7d16988b (diff)
ALSA: hda/realtek - Skip invalid digital out pins
commit 51e4152a969aa6d2306492ebf143932dcb535c9b upstream. Some BIOS report invalid pins as digital output pins. The driver checks the connection but it doesn't do it fully correctly, and it leaves some undefined value as the audio-out widget, which makes the driver spewing warnings. This patch fixes the issue. Reference: https://bugzilla.novell.com/show_bug.cgi?id=727348 Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_realtek.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 62b13141876..e7dc0340da6 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2088,25 +2088,27 @@ static void alc_auto_init_digital(struct hda_codec *codec)
2088static void alc_auto_parse_digital(struct hda_codec *codec) 2088static void alc_auto_parse_digital(struct hda_codec *codec)
2089{ 2089{
2090 struct alc_spec *spec = codec->spec; 2090 struct alc_spec *spec = codec->spec;
2091 int i, err; 2091 int i, err, nums;
2092 hda_nid_t dig_nid; 2092 hda_nid_t dig_nid;
2093 2093
2094 /* support multiple SPDIFs; the secondary is set up as a slave */ 2094 /* support multiple SPDIFs; the secondary is set up as a slave */
2095 nums = 0;
2095 for (i = 0; i < spec->autocfg.dig_outs; i++) { 2096 for (i = 0; i < spec->autocfg.dig_outs; i++) {
2096 err = snd_hda_get_connections(codec, 2097 err = snd_hda_get_connections(codec,
2097 spec->autocfg.dig_out_pins[i], 2098 spec->autocfg.dig_out_pins[i],
2098 &dig_nid, 1); 2099 &dig_nid, 1);
2099 if (err < 0) 2100 if (err <= 0)
2100 continue; 2101 continue;
2101 if (!i) { 2102 if (!nums) {
2102 spec->multiout.dig_out_nid = dig_nid; 2103 spec->multiout.dig_out_nid = dig_nid;
2103 spec->dig_out_type = spec->autocfg.dig_out_type[0]; 2104 spec->dig_out_type = spec->autocfg.dig_out_type[0];
2104 } else { 2105 } else {
2105 spec->multiout.slave_dig_outs = spec->slave_dig_outs; 2106 spec->multiout.slave_dig_outs = spec->slave_dig_outs;
2106 if (i >= ARRAY_SIZE(spec->slave_dig_outs) - 1) 2107 if (nums >= ARRAY_SIZE(spec->slave_dig_outs) - 1)
2107 break; 2108 break;
2108 spec->slave_dig_outs[i - 1] = dig_nid; 2109 spec->slave_dig_outs[nums - 1] = dig_nid;
2109 } 2110 }
2111 nums++;
2110 } 2112 }
2111 2113
2112 if (spec->autocfg.dig_in_pin) { 2114 if (spec->autocfg.dig_in_pin) {