Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH 1/2] ALSA: hda/realtek: Add speaker depop sequence to alc225_shutup
@ 2026-10-29  5:59 Zhang Heng
  2026-10-29  5:59 ` [PATCH 2/2] ALSA: hda/realtek: Convert HP AIO SPK fixup to INIT-stage depop Zhang Heng
  2026-10-29  6:18 ` [PATCH 1/2] ALSA: hda/realtek: Add speaker depop sequence to alc225_shutup sashiko-bot
  0 siblings, 2 replies; 4+ messages in thread
From: Zhang Heng @ 2026-10-29  5:59 UTC (permalink / raw)
  To: tiwai; +Cc: perex, kailang, linux-sound, linux-kernel, Zhang Heng, John Doe

Mute speaker pins and disable their pin widgets, with a 75 ms delay
after each step, before cutting EAPD in alc225_shutup().  This
prevents the pop noise that occurs on suspend when the amplifier
loses its input signal while still powered.

Reported-by: John Doe <coolcrew45@disroot.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=221616
Tested-by: John Doe <coolcrew45@disroot.org>
Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
---
 sound/hda/codecs/realtek/alc269.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index 23329d5887a5..67ce5b130f81 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -665,6 +665,7 @@ static void alc225_shutup(struct hda_codec *codec)
 	struct alc_spec *spec = codec->spec;
 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
 	bool hp1_pin_sense, hp2_pin_sense;
+	int i;
 
 	if (!hp_pin)
 		hp_pin = 0x21;
@@ -698,6 +699,16 @@ static void alc225_shutup(struct hda_codec *codec)
 		alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
 		alc_enable_headset_jack_key(codec);
 	}
+
+	for (i = 0; i < spec->gen.autocfg.speaker_outs; i++)
+		snd_hda_codec_write(codec, spec->gen.autocfg.speaker_pins[i], 0,
+				    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
+	msleep(75);
+	for (i = 0; i < spec->gen.autocfg.speaker_outs; i++)
+		snd_hda_codec_write(codec, spec->gen.autocfg.speaker_pins[i], 0,
+				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
+	msleep(75);
+
 	alc_auto_setup_eapd(codec, false);
 	alc_shutup_pins(codec);
 	if (spec->ultra_low_power) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-29  6:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-29  5:59 [PATCH 1/2] ALSA: hda/realtek: Add speaker depop sequence to alc225_shutup Zhang Heng
2026-10-29  5:59 ` [PATCH 2/2] ALSA: hda/realtek: Convert HP AIO SPK fixup to INIT-stage depop Zhang Heng
2026-10-29  6:13   ` sashiko-bot
2026-10-29  6:18 ` [PATCH 1/2] ALSA: hda/realtek: Add speaker depop sequence to alc225_shutup sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox