summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHui Wang <hui.wang@canonical.com>2021-03-20 17:15:42 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-07 12:05:40 +0200
commit4576584fd04da7908b1aae04d2c00013c16d4829 (patch)
tree8a53ec9092336a4a93476e60746de5c21ed6f011
parentf7c26b75c5f1986f83a6baa5afcd8164bf832026 (diff)
downloadlinux-stable-4576584fd04da7908b1aae04d2c00013c16d4829.tar.gz
linux-stable-4576584fd04da7908b1aae04d2c00013c16d4829.tar.bz2
linux-stable-4576584fd04da7908b1aae04d2c00013c16d4829.zip
ALSA: hda/realtek: call alc_update_headset_mode() in hp_automute_hook
commit e54f30befa7990b897189b44a56c1138c6bfdbb5 upstream. We found the alc_update_headset_mode() is not called on some machines when unplugging the headset, as a result, the mode of the ALC_HEADSET_MODE_UNPLUGGED can't be set, then the current_headset_type is not cleared, if users plug a differnt type of headset next time, the determine_headset_type() will not be called and the audio jack is set to the headset type of previous time. On the Dell machines which connect the dmic to the PCH, if we open the gnome-sound-setting and unplug the headset, this issue will happen. Those machines disable the auto-mute by ucm and has no internal mic in the input source, so the update_headset_mode() will not be called by cap_sync_hook or automute_hook when unplugging, and because the gnome-sound-setting is opened, the codec will not enter the runtime_suspend state, so the update_headset_mode() will not be called by alc_resume when unplugging. In this case the hp_automute_hook is called when unplugging, so add update_headset_mode() calling to this function. Cc: <stable@vger.kernel.org> Signed-off-by: Hui Wang <hui.wang@canonical.com> Link: https://lore.kernel.org/r/20210320091542.6748-2-hui.wang@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--sound/pci/hda/patch_realtek.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index b003cb07254a..79c45046edc6 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4304,6 +4304,7 @@ static void alc_update_headset_jack_cb(struct hda_codec *codec,
struct alc_spec *spec = codec->spec;
spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
snd_hda_gen_hp_automute(codec, jack);
+ alc_update_headset_mode(codec);
}
static void alc_probe_headset_mode(struct hda_codec *codec)