ALSA: hda - Don't enable unsol for jacks we're polling
authorDavid Henningsson <david.henningsson@canonical.com>
Wed, 17 Oct 2012 12:45:05 +0000 (14:45 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 17 Oct 2012 12:47:31 +0000 (14:47 +0200)
This will greatly reduce the frequency for detection errors in
those cases where the hardware is "flaky", i e, rapidly changing
between plugged and unplugged states even without user interaction.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_jack.c

index 07d5288ce8cfd8b5a7ec75e523badf7471333c8d..5bdbadaa20fec32cd5b8e7242964f6a536c3af0e 100644 (file)
@@ -206,6 +206,8 @@ int snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
                jack->action = action;
        if (cb)
                jack->callback = cb;
+       if (codec->jackpoll_interval > 0)
+               return 0; /* No unsol if we're polling instead */
        return snd_hda_codec_write_cache(codec, nid, 0,
                                         AC_VERB_SET_UNSOLICITED_ENABLE,
                                         AC_USRSP_EN | jack->tag);