Skip to content

Commit 64e0924

Browse files
martin-hamiltontiwai
authored andcommitted
ALSA: hda/realtek: ALC269 fixup for Lenovo Yoga Book 9i 13IRU8 audio
The amp/speakers on the Lenovo Yoga Book 9i 13IRU8 laptop aren't fully powered up, resulting in horrible tinny sound by default. The kernel has an existing quirk for PCI SSID 0x17aa3843 which matches this machine and several others. The quirk applies the ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP fixup, however the fixup does not work on this machine. This patch modifies the existing quirk by adding a check for the subsystem ID 0x17aa3881. If present, ALC287_FIXUP_TAS2781_I2C will be applied instead of ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP. With this change the TAS2781 amp is powered up, firmware is downloaded and recognised by HDA/SOF - i.e. all is good, and we can boogie. Code is re-used from alc298_fixup_lenovo_c940_duet7(), which fixes a similar problem with two other Lenovo laptops. Cross checked against ALSA cardinfo database for potential clashes. Tested against 6.18.5 kernel built with Arch Linux default options. Tested in HDA mode and SOF mode. Note: Possible further work required to address quality of life issues caused by the firmware's agressive power saving, and to improve ALSA control mappings. Signed-off-by: Martin Hamilton <m@martinh.net> Link: https://patch.msgid.link/20260122-alc269-yogabook9i-fixup-v1-1-a6883429400f@martinh.net Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent c45385e commit 64e0924

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

sound/hda/codecs/realtek/alc269.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3736,6 +3736,7 @@ enum {
37363736
ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
37373737
ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
37383738
ALC298_FIXUP_LENOVO_C940_DUET7,
3739+
ALC287_FIXUP_LENOVO_YOGA_BOOK_9I,
37393740
ALC287_FIXUP_13S_GEN2_SPEAKERS,
37403741
ALC256_FIXUP_SET_COEF_DEFAULTS,
37413742
ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
@@ -3823,6 +3824,23 @@ static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
38233824
__snd_hda_apply_fixup(codec, id, action, 0);
38243825
}
38253826

3827+
/* A special fixup for Lenovo Yoga 9i and Yoga Book 9i 13IRU8
3828+
* both have the very same PCI SSID and vendor ID, so we need
3829+
* to apply different fixups depending on the subsystem ID
3830+
*/
3831+
static void alc287_fixup_lenovo_yoga_book_9i(struct hda_codec *codec,
3832+
const struct hda_fixup *fix,
3833+
int action)
3834+
{
3835+
int id;
3836+
3837+
if (codec->core.subsystem_id == 0x17aa3881)
3838+
id = ALC287_FIXUP_TAS2781_I2C; /* Yoga Book 9i 13IRU8 */
3839+
else
3840+
id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP; /* Yoga 9i */
3841+
__snd_hda_apply_fixup(codec, id, action, 0);
3842+
}
3843+
38263844
static const struct hda_fixup alc269_fixups[] = {
38273845
[ALC269_FIXUP_GPIO2] = {
38283846
.type = HDA_FIXUP_FUNC,
@@ -5834,6 +5852,10 @@ static const struct hda_fixup alc269_fixups[] = {
58345852
.type = HDA_FIXUP_FUNC,
58355853
.v.func = alc298_fixup_lenovo_c940_duet7,
58365854
},
5855+
[ALC287_FIXUP_LENOVO_YOGA_BOOK_9I] = {
5856+
.type = HDA_FIXUP_FUNC,
5857+
.v.func = alc287_fixup_lenovo_yoga_book_9i,
5858+
},
58375859
[ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
58385860
.type = HDA_FIXUP_VERBS,
58395861
.v.verbs = (const struct hda_verb[]) {
@@ -7192,7 +7214,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
71927214
SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
71937215
SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
71947216
SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
7195-
SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
7217+
SND_PCI_QUIRK(0x17aa, 0x3843, "Lenovo Yoga 9i / Yoga Book 9i", ALC287_FIXUP_LENOVO_YOGA_BOOK_9I),
71967218
SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
71977219
SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
71987220
SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),

0 commit comments

Comments
 (0)