summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-12-10 11:33:49 -0500
committerTakashi Iwai <tiwai@suse.de>2013-12-10 15:16:50 -0500
commitebb93c057dda376414fbc499ad6ace9b527dff5a (patch)
tree524813e7a7d239d1f0e861c245d3d25d21991b59 /sound
parent6733cf572a9e20db2b7580a5dd39d5782d571eec (diff)
ALSA: hda - Mute all aamix inputs as default
Not all channels have been initialized, so far, especially when aamix NID itself doesn't have amps but its leaves have. This patch fixes these holes. Otherwise you might get unexpected loopback inputs, e.g. from surround channels. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_generic.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index c4671d00babd..249cd4615908 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -4297,6 +4297,26 @@ static unsigned int snd_hda_gen_path_power_filter(struct hda_codec *codec,
4297 return AC_PWRST_D3; 4297 return AC_PWRST_D3;
4298} 4298}
4299 4299
4300/* mute all aamix inputs initially; parse up to the first leaves */
4301static void mute_all_mixer_nid(struct hda_codec *codec, hda_nid_t mix)
4302{
4303 int i, nums;
4304 const hda_nid_t *conn;
4305 bool has_amp;
4306
4307 nums = snd_hda_get_conn_list(codec, mix, &conn);
4308 has_amp = nid_has_mute(codec, mix, HDA_INPUT);
4309 for (i = 0; i < nums; i++) {
4310 if (has_amp)
4311 snd_hda_codec_amp_stereo(codec, mix,
4312 HDA_INPUT, i,
4313 0xff, HDA_AMP_MUTE);
4314 else if (nid_has_volume(codec, conn[i], HDA_OUTPUT))
4315 snd_hda_codec_amp_stereo(codec, conn[i],
4316 HDA_OUTPUT, 0,
4317 0xff, HDA_AMP_MUTE);
4318 }
4319}
4300 4320
4301/* 4321/*
4302 * Parse the given BIOS configuration and set up the hda_gen_spec 4322 * Parse the given BIOS configuration and set up the hda_gen_spec
@@ -4435,6 +4455,10 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec,
4435 } 4455 }
4436 } 4456 }
4437 4457
4458 /* mute all aamix input initially */
4459 if (spec->mixer_nid)
4460 mute_all_mixer_nid(codec, spec->mixer_nid);
4461
4438 dig_only: 4462 dig_only:
4439 parse_digital(codec); 4463 parse_digital(codec);
4440 4464