aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-12-20 09:16:09 -0500
committerTakashi Iwai <tiwai@suse.de>2013-01-12 02:34:14 -0500
commit973e4972f9f0fe8f854451f7559c847a8cdc8bc7 (patch)
tree5787b883948dcb99c4c14168a05a614041e915a6 /sound
parentfd25a97a97c78e7f09b0b3069a40bf7671654366 (diff)
ALSA: hda - Clear unsol enable bits on unused pins in generic parser
For preliminary works to migrate the generic parser for Conexant codecs: the same function is ported to hda_generic.c. But now it looks through the jack detect table so that it can cover better. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_generic.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index a5c4bc05d16f..b7b8d7eee7c6 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -3532,6 +3532,23 @@ static void init_digital(struct hda_codec *codec)
3532 snd_hda_set_pin_ctl(codec, pin, PIN_IN); 3532 snd_hda_set_pin_ctl(codec, pin, PIN_IN);
3533} 3533}
3534 3534
3535/* clear unsol-event tags on unused pins; Conexant codecs seem to leave
3536 * invalid unsol tags by some reason
3537 */
3538static void clear_unsol_on_unused_pins(struct hda_codec *codec)
3539{
3540 int i;
3541
3542 for (i = 0; i < codec->init_pins.used; i++) {
3543 struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i);
3544 hda_nid_t nid = pin->nid;
3545 if (is_jack_detectable(codec, nid) &&
3546 !snd_hda_jack_tbl_get(codec, nid))
3547 snd_hda_codec_update_cache(codec, nid, 0,
3548 AC_VERB_SET_UNSOLICITED_ENABLE, 0);
3549 }
3550}
3551
3535int snd_hda_gen_init(struct hda_codec *codec) 3552int snd_hda_gen_init(struct hda_codec *codec)
3536{ 3553{
3537 struct hda_gen_spec *spec = codec->spec; 3554 struct hda_gen_spec *spec = codec->spec;
@@ -3550,6 +3567,8 @@ int snd_hda_gen_init(struct hda_codec *codec)
3550 init_input_src(codec); 3567 init_input_src(codec);
3551 init_digital(codec); 3568 init_digital(codec);
3552 3569
3570 clear_unsol_on_unused_pins(codec);
3571
3553 /* call init functions of standard auto-mute helpers */ 3572 /* call init functions of standard auto-mute helpers */
3554 snd_hda_gen_hp_automute(codec, NULL); 3573 snd_hda_gen_hp_automute(codec, NULL);
3555 snd_hda_gen_line_automute(codec, NULL); 3574 snd_hda_gen_line_automute(codec, NULL);