]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ALSA: hda - Update jack-sense info even when no automute is set
authorTakashi Iwai <tiwai@suse.de>
Tue, 23 Aug 2011 10:41:09 +0000 (12:41 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 23 Aug 2011 10:41:09 +0000 (12:41 +0200)
The internal states, jack_present and line_jack_present should be
updated upon unsolicited events even if no automute is set.
Otherwise the wrong state is referred when the automute behavior is
changed by the mixer control.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_realtek.c

index 0fefc1088d1175cb88b98db78883eb783541d671..7cabd731716395e7f5386425236660283f096fdf 100644 (file)
@@ -565,11 +565,11 @@ static void alc_hp_automute(struct hda_codec *codec)
 {
        struct alc_spec *spec = codec->spec;
 
-       if (!spec->automute)
-               return;
        spec->jack_present =
                detect_jacks(codec, ARRAY_SIZE(spec->autocfg.hp_pins),
                             spec->autocfg.hp_pins);
+       if (!spec->automute)
+               return;
        update_speakers(codec);
 }
 
@@ -578,11 +578,11 @@ static void alc_line_automute(struct hda_codec *codec)
 {
        struct alc_spec *spec = codec->spec;
 
-       if (!spec->automute || !spec->detect_line)
-               return;
        spec->line_jack_present =
                detect_jacks(codec, ARRAY_SIZE(spec->autocfg.line_out_pins),
                             spec->autocfg.line_out_pins);
+       if (!spec->automute || !spec->detect_line)
+               return;
        update_speakers(codec);
 }