Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Hsinyi Chien <suzu1dev@gmail.com>
To: tiwai@suse.com, perex@perex.cz
Cc: linux-sound@vger.kernel.org, Hsinyi Chien <suzu1dev@gmail.com>
Subject: [PATCH v2 1/2] ALSA: hda/realtek: Honor no_shutup_pins in alc225_shutup()
Date: Sun,  6 Dec 2026 05:38:39 +0800	[thread overview]
Message-ID: <20261205213840.62481-2-suzu1dev@gmail.com> (raw)
In-Reply-To: <20261205213840.62481-1-suzu1dev@gmail.com>

alc282_shutup(), alc283_shutup(), alc256_shutup() and
alc_default_shutup() do not clear the headphone pin control when
spec->no_shutup_pins is set. alc225_shutup() clears it
unconditionally, so on the codecs that use alc225_shutup() the flag
only skips the later alc_shutup_pins() call.

Skip the pin control write in alc225_shutup() too when the flag is
set. The 3k pull-low toggle, the headphone amp mute and the EAPD
change stay as they are.

This changes runtime suspend and shutdown on every machine that
already sets no_shutup_pins and has a codec that uses
alc225_shutup(), for example through alc_fixup_thinkpad_acpi(). The
headphone pin control is no longer cleared there. Only the ASUS
GU605CX was tested, with the fixup from the next patch.

This patch and its changelog were drafted with an LLM coding
assistant (Anthropic Claude).

Signed-off-by: Hsinyi Chien <suzu1dev@gmail.com>
---
 sound/hda/codecs/realtek/alc269.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index d4646f025..1bf5c78ac 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -687,12 +687,14 @@ static void alc225_shutup(struct hda_codec *codec)
 
 		msleep(75);
 
-		if (hp1_pin_sense)
-			snd_hda_codec_write(codec, hp_pin, 0,
-				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
-		if (hp2_pin_sense)
-			snd_hda_codec_write(codec, 0x16, 0,
-				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
+		if (!spec->no_shutup_pins) {
+			if (hp1_pin_sense)
+				snd_hda_codec_write(codec, hp_pin, 0,
+					    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
+			if (hp2_pin_sense)
+				snd_hda_codec_write(codec, 0x16, 0,
+					    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
+		}
 
 		msleep(75);
 		alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
-- 
2.56.1


  reply	other threads:[~2026-12-05 21:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05 21:38 [PATCH v2 0/2] ALSA: hda/realtek: Fix headphone jack pop on ASUS GU605C Hsinyi Chien
2026-12-05 21:38 ` Hsinyi Chien [this message]
2026-12-05 21:53   ` [PATCH v2 1/2] ALSA: hda/realtek: Honor no_shutup_pins in alc225_shutup() sashiko-bot
2026-12-05 22:01     ` Hsinyi Chien
2026-12-05 21:38 ` [PATCH v2 2/2] ALSA: hda/realtek: Fix headphone jack pop on ASUS GU605C Hsinyi Chien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261205213840.62481-2-suzu1dev@gmail.com \
    --to=suzu1dev@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox