Re: [PATCH 1/3] ALSA: hda/realtek: Use AW88399 I2C fixup chain on Legion machines

Marco Giunta <[email protected]> Tue, 4 Aug 2026 15:20:17 +0200
Newsgroups org.kernel.vger.linux-sound,org.kernel.vger.linux-kernel
Message-ID <DS7PR19MB7724CE7E55EC17D2B2E61A9DFCD42@DS7PR19MB7724.namprd19.prod.outlook.com>
> Not much from my side, but I just prefer receiving a solution that
> satisfies both of you :)
>
> So, if any, let's try a v2 patch set.  We still have a bit of time for
> 7.3 release.

Here is my proposal for a compromise:

    [ALC287_FIXUP_AW88399_I2C_2] = {
        .type = HDA_FIXUP_FUNC,
        .v.func = aw88399_fixup_i2c_two,
    },
    [ALC287_FIXUP_LENOVO_LEGION_AW88399] = {
        .type = HDA_FIXUP_FUNC,
        .v.func = alc287_fixup_legion_16iax10h_aw88399,
        .chained = true,
        .chain_id = ALC287_FIXUP_AW88399_I2C_2,
    },

    static void aw88399_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
    {
        comp_generic_fixup(cdc, action, "i2c", "AWDZ8399", "-%s:00-aw88399-hda.%d", 2);
    }

    static void alc287_fixup_legion_16iax10h_aw88399(struct hda_codec *codec,
                            const struct hda_fixup *fix, int action)
    {
        struct alc_spec *spec = codec->spec;
        static const hda_nid_t conn[] = { 0x02 };

        alc269_fixup_limit_int_mic_boost(codec, fix, action);
        alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
        alc_fixup_headset_jack(codec, fix, action);

        switch (action) {
        case HDA_FIXUP_ACT_PRE_PROBE:
            spec->gen.suppress_auto_mic = 1;
            snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
            break;
        }
    }

I believe this offers several advantages. In particular, it preserves
Aaron's fixes regarding working headset buttons and keeping the internal
mic available with headphones plugged in, while keeping a clean separation
between the generic aw88399 i2c fixup quirk and the Legion-specific stuff.
It also avoids picking up baggage from thinkpad/ideapad-specific quirks,
removes the SKU warning from the logs, and keeps the DAC rerouting explicit
rather than having it as the side-effect from deep within a long quirk chain.
Finally, it minimizes the number of quirks to be added overall, with no
redundancy, and avoids removing the "alc287-lenovo-legion-aw88399" entry
from alc269_fixup_models.

I'm happy to prepare and send the patch myself based on the above;
alternatively, I'm also fine with just offering whatever tag may be
relevant (Tested-by, Suggested-by, etc.).

Regarding the jack rename: given that I cannot reproduce that GNOME issue
on KDE Plasma, I remain unconvinced this isn't something to be dealt with
in userspace. That said, I'm not necessarily against implementing a kernel
level fix, but I'd like it to be a different fix. Whether that means
simply choosing a different, not misleading, name, or something else
altogether, I can't say right now.
Maybe Aaron can submit a follow-up patch on top of the above.

Regarding the quad channel map and DAC 0x03 rerouting: I still believe
that it's not useful to try to fix 4.0 support on an exclusively 2.0
laptop. The fact that there are 4 physical units on the laptop doesn't
mean they are supposed to be used independently: even when forcing 4.0
content, all this achieves is letting users use the tweeters independently,
which is the same broken state the aw88399 series was meant to fix in the
first place. Likewise for using the woofers without the tweeters.
I believe instead the proper fix is suppressing bogus 4.0 profiles at
userspace level (or more simply just ignoring them), as they don't
represent a meaningful configuration for this hardware.

Best regards,
Marco