]> Pileus Git - ~andy/linux/commitdiff
ALSA: hda - Add a block_report flag to jacks
authorDavid Henningsson <david.henningsson@canonical.com>
Thu, 7 Nov 2013 12:38:24 +0000 (13:38 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 7 Nov 2013 13:03:17 +0000 (14:03 +0100)
If the jack should not be reported to userspace (e g, because it is
in some transitional state), one can set this flag.

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

index 05b3e3e9108fda50f16f2472b2dad5bfbc870067..afe594411a565d855297fe5cecd4561b10022967 100644 (file)
@@ -286,7 +286,7 @@ void snd_hda_jack_report_sync(struct hda_codec *codec)
        jack = codec->jacktbl.list;
        for (i = 0; i < codec->jacktbl.used; i++, jack++)
                if (jack->nid) {
-                       if (!jack->kctl)
+                       if (!jack->kctl || jack->block_report)
                                continue;
                        state = get_jack_plug_state(jack->pin_sense);
                        snd_kctl_jack_report(codec->bus->card, jack->kctl, state);
index 379420c44eefac051e512b83c67790f9f3ce99a2..46e1ea83ce3c208da42afb98e8668ae3b48e8591 100644 (file)
@@ -28,6 +28,7 @@ struct hda_jack_tbl {
        unsigned int jack_detect:1;     /* capable of jack-detection? */
        unsigned int jack_dirty:1;      /* needs to update? */
        unsigned int phantom_jack:1;    /* a fixed, always present port? */
+       unsigned int block_report:1;    /* in a transitional state - do not report to userspace */
        hda_nid_t gating_jack;          /* valid when gating jack plugged */
        hda_nid_t gated_jack;           /* gated is dependent on this jack */
        struct snd_kcontrol *kctl;      /* assigned kctl for jack-detection */