[PATCH 3/3] ALSA: hda/realtek: Rename headphone jack kcontrol on Legion machines

From: Aaron Ma

Date: Sat Aug 01 2026 - 02:07:15 EST


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@xxxxxxxxx>
---
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