]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ALSA: hda/realtek: Always honor no_shutup_pins
authorTakashi Iwai <tiwai@suse.de>
Sat, 15 Mar 2025 14:30:19 +0000 (15:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:30:56 +0000 (14:30 +0200)
[ Upstream commit 5a0c72c1da3cbc0cd4940a95d1be2830104c6edf ]

The workaround for Dell machines to skip the pin-shutup for mic pins
introduced alc_headset_mic_no_shutup() that is replaced from the
generic snd_hda_shutup_pins() for certain codecs.  The problem is that
the call is done unconditionally even if spec->no_shutup_pins is set.
This seems causing problems on other platforms like Lenovo.

This patch corrects the behavior and the driver honors always
spec->no_shutup_pins flag and skips alc_headset_mic_no_shutup() if
it's set.

Fixes: dad3197da7a3 ("ALSA: hda/realtek - Fixup headphone noise via runtime suspend")
Reported-and-tested-by: Oleg Gorobets <oleg.goro@gmail.com>
Link: https://patch.msgid.link/20250315143020.27184-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/pci/hda/patch_realtek.c

index 494a34af46b03e551332d5f601faaec50ff4877a..f3cb24ed3a78a0b728a4ce66e87f1a746db8f5c6 100644 (file)
@@ -577,6 +577,9 @@ static void alc_shutup_pins(struct hda_codec *codec)
 {
        struct alc_spec *spec = codec->spec;
 
+       if (spec->no_shutup_pins)
+               return;
+
        switch (codec->core.vendor_id) {
        case 0x10ec0236:
        case 0x10ec0256:
@@ -592,8 +595,7 @@ static void alc_shutup_pins(struct hda_codec *codec)
                alc_headset_mic_no_shutup(codec);
                break;
        default:
-               if (!spec->no_shutup_pins)
-                       snd_hda_shutup_pins(codec);
+               snd_hda_shutup_pins(codec);
                break;
        }
 }