aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-09-11 06:59:21 -0400
committerTakashi Iwai <tiwai@suse.de>2014-09-11 07:05:32 -0400
commit7a9744cb455e6faa287e148394b4b422a6f3c5c4 (patch)
tree175b76e9545df50e35d71efa25ad63ffed69c5bf /sound
parent05244d166739ae273fdc7a2151bdef61df49ca7d (diff)
ALSA: hda - Fix invalid pin powermap without jack detection
When a driver is set up without the jack detection explicitly (either by passing a model option or via a specific fixup), the pin powermap of IDT/STAC codecs is set up wrongly, resulting in the silence output. It's because of a logic failure in stac_init_power_map(). It tries to avoid creating a callback for the pins that have other auto-hp and auto-mic callbacks, but the check is done in a wrong way at a wrong time. The stac_init_power_map() should be called after creating other jack detection ctls, and the jack callback should be created only for jack-detectable widgets. This patch fixes the check in stac_init_power_map() and its callee at the right place, after snd_hda_gen_build_controls(). Reported-by: Adam Richter <adam_richter2004@yahoo.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_sigmatel.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index ea823e1100da..98cd1908c039 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -566,8 +566,8 @@ static void stac_init_power_map(struct hda_codec *codec)
566 if (snd_hda_jack_tbl_get(codec, nid)) 566 if (snd_hda_jack_tbl_get(codec, nid))
567 continue; 567 continue;
568 if (def_conf == AC_JACK_PORT_COMPLEX && 568 if (def_conf == AC_JACK_PORT_COMPLEX &&
569 !(spec->vref_mute_led_nid == nid || 569 spec->vref_mute_led_nid != nid &&
570 is_jack_detectable(codec, nid))) { 570 is_jack_detectable(codec, nid)) {
571 snd_hda_jack_detect_enable_callback(codec, nid, 571 snd_hda_jack_detect_enable_callback(codec, nid,
572 STAC_PWR_EVENT, 572 STAC_PWR_EVENT,
573 jack_update_power); 573 jack_update_power);
@@ -4276,11 +4276,18 @@ static int stac_parse_auto_config(struct hda_codec *codec)
4276 return err; 4276 return err;
4277 } 4277 }
4278 4278
4279 stac_init_power_map(codec);
4280
4281 return 0; 4279 return 0;
4282} 4280}
4283 4281
4282static int stac_build_controls(struct hda_codec *codec)
4283{
4284 int err = snd_hda_gen_build_controls(codec);
4285
4286 if (err < 0)
4287 return err;
4288 stac_init_power_map(codec);
4289 return 0;
4290}
4284 4291
4285static int stac_init(struct hda_codec *codec) 4292static int stac_init(struct hda_codec *codec)
4286{ 4293{
@@ -4392,7 +4399,7 @@ static int stac_suspend(struct hda_codec *codec)
4392#endif /* CONFIG_PM */ 4399#endif /* CONFIG_PM */
4393 4400
4394static const struct hda_codec_ops stac_patch_ops = { 4401static const struct hda_codec_ops stac_patch_ops = {
4395 .build_controls = snd_hda_gen_build_controls, 4402 .build_controls = stac_build_controls,
4396 .build_pcms = snd_hda_gen_build_pcms, 4403 .build_pcms = snd_hda_gen_build_pcms,
4397 .init = stac_init, 4404 .init = stac_init,
4398 .free = stac_free, 4405 .free = stac_free,