Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Aaron Ma <mapengyu@gmail.com>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Zhang Heng <zhangheng@kylinos.cn>,
	Kailang Yang <kailang@realtek.com>,
	Damien Dagorn <damien.dagorn29@gmail.com>,
	Aaron Ma <mapengyu@gmail.com>, Bob Song <songxiebing@kylinos.cn>,
	marco_giunta@outlook.it
Subject: [PATCH 3/3] ALSA: hda/realtek: Rename headphone jack kcontrol on Legion machines
Date: Sat,  1 Aug 2026 14:06:30 +0800	[thread overview]
Message-ID: <20260801060630.2768318-3-mapengyu@gmail.com> (raw)
In-Reply-To: <20260801060630.2768318-1-mapengyu@gmail.com>

The Lenovo Legion machines pairing an ALC287 codec with two AW88399
smart amplifiers report the headphone and headset functions in the
same jack group. With a kcontrol named "Headphone Jack", GNOME
treats them as two candidate devices of one port group and prompts
the user to choose between them on every plug event.

Rename the control to "Dock Headphone Jack", following the ThinkPad
naming convention, so the jack is presented as a distinct port and no
selection dialog appears.

Signed-off-by: Aaron Ma <mapengyu@gmail.com>
---
 sound/hda/codecs/realtek/alc269.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index 42fcdfe54225a..83bb74c94b785 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -3280,15 +3280,26 @@ static const struct snd_pcm_chmap_elem aw88399_pcm_quad_chmaps[] = {
 static void aw88399_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
 {
 	struct alc_spec *spec = cdc->spec;
+	struct snd_ctl_elem_id id = {
+		.iface = SNDRV_CTL_ELEM_IFACE_CARD,
+	};
+	struct snd_kcontrol *kctl;
 
 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
 		spec->gen.suppress_auto_mic = 1;
 
 	comp_generic_fixup(cdc, action, "i2c", "AWDZ8399", "-%s:00-aw88399-hda.%d", 2);
 	/* the second speaker pair is full-range rear, not LFE */
-	if (action == HDA_FIXUP_ACT_BUILD)
+	if (action == HDA_FIXUP_ACT_BUILD) {
 		spec->gen.pcm_rec[0]->stream[SNDRV_PCM_STREAM_PLAYBACK].chmap =
 			aw88399_pcm_quad_chmaps;
+
+		strscpy(id.name, "Headphone Jack", sizeof(id.name));
+		kctl = snd_ctl_find_id(cdc->card, &id);
+		if (kctl)
+			snd_ctl_rename(cdc->card, kctl,
+				       "Dock Headphone Jack");
+	}
 }
 
 static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
-- 
2.53.0


  parent reply	other threads:[~2026-08-01  6:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-01  6:06 [PATCH 1/3] ALSA: hda/realtek: Use AW88399 I2C fixup chain on Legion machines Aaron Ma
2026-08-01  6:06 ` [PATCH 2/3] ALSA: hda/realtek: Use quad channel map for Legion AW88399 speakers Aaron Ma
2026-08-01  6:06 ` Aaron Ma [this message]
2026-08-01 12:56 ` [PATCH 1/3] ALSA: hda/realtek: Use AW88399 I2C fixup chain on Legion machines Marco Giunta
2026-08-01 16:43   ` Pengyu Ma
2026-08-01 18:34     ` Marco Giunta

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=20260801060630.2768318-3-mapengyu@gmail.com \
    --to=mapengyu@gmail.com \
    --cc=damien.dagorn29@gmail.com \
    --cc=kailang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=marco_giunta@outlook.it \
    --cc=perex@perex.cz \
    --cc=songxiebing@kylinos.cn \
    --cc=tiwai@suse.com \
    --cc=zhangheng@kylinos.cn \
    /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