The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Breno Baptista <brenomb07@gmail.com>
To: linux-sound@vger.kernel.org
Cc: tiwai@suse.com, perex@perex.cz, linux-kernel@vger.kernel.org,
	Breno Baptista <brenomb07@gmail.com>
Subject: [PATCH] ALSA: hda/realtek: Restore headset mic after suspend for Acer Nitro 5
Date: Fri,  8 May 2026 18:57:46 -0300	[thread overview]
Message-ID: <20260508215746.15564-1-brenomb07@gmail.com> (raw)

The headset mic on the AN515-57 was shown as unplugged after resuming
from S3/S4, requiring a reboot to recover.

Signed-off-by: Breno Baptista <brenomb07@gmail.com>
---
 sound/hda/codecs/realtek/alc269.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index 11d0ea8ed859..449a5ab3b0d0 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -3578,6 +3578,16 @@ static void alc2xx_fixup_headset_mic(struct hda_codec *codec,
 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
 		break;
+	case HDA_FIXUP_ACT_INIT:
+		/*
+		 * COEF 0x45 (CTIA combo jack mode) is not preserved across suspend.
+		 * Restore it before restarting HP JD so the headset is re-detected.
+		 */
+		if (is_s3_resume(codec) || is_s4_resume(codec)) {
+			alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
+			alc_combo_jack_hp_jd_restart(codec);
+		}
+		break;
 	}
 }
 
-- 
2.54.0


                 reply	other threads:[~2026-05-08 21:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260508215746.15564-1-brenomb07@gmail.com \
    --to=brenomb07@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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