Skip to contentSkip to conversation

ALSA: hda/conexant: Implement resume function

PATCH In review [email protected] 2 participants 2 messages Nov 19, 2025 Sound

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ALSA: hda/conexant: Implement resume function

From: wangdicheng <[email protected]>

During S3 sleep state, if headphones are unplugged, we need to re-report their status during the wake phase to ensure proper headphone presence detection after system resume.

---

v1->v2:
Problem: No audio output device after S3.
Cause: The audio driver misses re-initialization upon resume, resulting in stale jack status (remaining in the pre-sleep state), which prevents the system from finding the correct output device.

 sound/hda/codecs/conexant.c | 8 ++++++++
 1 file changed, 8 insertions(+)
sound/hda/codecs/conexant.c +8 -0
index 5fcbc1312c69..146ff65ccc30 100644
@@ -264,6 +264,13 @@ static int cx_suspend(struct hda_codec *codec)
 	return 0;
 }
 
+static int cx_resume(struct hda_codec *codec)
+{
+	cx_init(codec);
+	snd_hda_jack_report_sync(codec);
+	return 0;
+}
+
 /*
  * pin fix-up
  */
@@ -1277,6 +1284,7 @@ static const struct hda_codec_ops cx_codec_ops = {
 	.init = cx_init,
 	.unsol_event = snd_hda_jack_unsol_event,
 	.suspend = cx_suspend,
+	.resume = cx_resume,
 	.check_power_status = snd_hda_gen_check_power_status,
 	.stream_pm = snd_hda_gen_stream_pm,
 };
Signature · 1 line
2.25.1
#1 lore raw
Quoted 7 lines · On Wed, 19 Nov 2025 09:53:45 +0100, [email protected] wrote:

From: wangdicheng <[email protected]>

During S3 sleep state, if headphones are unplugged, we need to re-report their status during the wake phase to ensure proper headphone presence detection after system resume.

Quoted 8 lines

---

v1->v2:
Problem: No audio output device after S3.
Cause: The audio driver misses re-initialization upon resume, resulting in stale jack status (remaining in the pre-sleep state), which prevents the system from finding the correct output device.

Again, please double-check what is the really cause.

snd_hda_jack_report_sync() *is* called already in hda_call_codec_resume(). So snd_hda_jack_report_sync() is just called twice with your patch, which must be superfluous.

The other significant difference with your patch is that you dropped snd_hda_regmap_sync(). So it must break something else.

Takashi

Quoted 33 lines
 sound/hda/codecs/conexant.c | 8 ++++++++
 1 file changed, 8 insertions(+)
sound/hda/codecs/conexant.c +8 -0
index 5fcbc1312c69..146ff65ccc30 100644
@@ -264,6 +264,13 @@ static int cx_suspend(struct hda_codec *codec)
 	return 0;
 }
 
+static int cx_resume(struct hda_codec *codec)
+{
+	cx_init(codec);
+	snd_hda_jack_report_sync(codec);
+	return 0;
+}
+
 /*
  * pin fix-up
  */
@@ -1277,6 +1284,7 @@ static const struct hda_codec_ops cx_codec_ops = {
 	.init = cx_init,
 	.unsol_event = snd_hda_jack_unsol_event,
 	.suspend = cx_suspend,
+	.resume = cx_resume,
 	.check_power_status = snd_hda_gen_check_power_status,
 	.stream_pm = snd_hda_gen_stream_pm,
 };
Signature · 1 line
2.25.1