Skip to content

Commit 39815cd

Browse files
committed
ALSA: hda/realtek: Fix conflicting PCI SSID 17aa:386f for Lenovo Legion models
Unfortunately both Lenovo Legion Pro 7 16ARX8H and Legion 7i 16IAX7 got the very same PCI SSID while the hardware implementations are completely different (the former is with TI TAS2781 codec while the latter is with Cirrus CS35L41 codec). The former model got broken by the recent fix for the latter model. For addressing the regression, check the codec SSID and apply the proper quirk for each model now. Fixes: 24b6332 ("ALSA: hda: Add Lenovo Legion 7i gen7 sound quirk") Cc: <[email protected]> Link: https://bugzilla.suse.com/show_bug.cgi?id=1223462 Message-ID: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 1e70776 commit 39815cd

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

sound/pci/hda/patch_realtek.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7466,6 +7466,7 @@ enum {
74667466
ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
74677467
ALC298_FIXUP_LENOVO_C940_DUET7,
74687468
ALC287_FIXUP_LENOVO_14IRP8_DUETITL,
7469+
ALC287_FIXUP_LENOVO_LEGION_7,
74697470
ALC287_FIXUP_13S_GEN2_SPEAKERS,
74707471
ALC256_FIXUP_SET_COEF_DEFAULTS,
74717472
ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
@@ -7551,6 +7552,23 @@ static void alc287_fixup_lenovo_14irp8_duetitl(struct hda_codec *codec,
75517552
__snd_hda_apply_fixup(codec, id, action, 0);
75527553
}
75537554

7555+
/* Another hilarious PCI SSID conflict with Lenovo Legion Pro 7 16ARX8H (with
7556+
* TAS2781 codec) and Legion 7i 16IAX7 (with CS35L41 codec);
7557+
* we apply a corresponding fixup depending on the codec SSID instead
7558+
*/
7559+
static void alc287_fixup_lenovo_legion_7(struct hda_codec *codec,
7560+
const struct hda_fixup *fix,
7561+
int action)
7562+
{
7563+
int id;
7564+
7565+
if (codec->core.subsystem_id == 0x17aa38a8)
7566+
id = ALC287_FIXUP_TAS2781_I2C; /* Legion Pro 7 16ARX8H */
7567+
else
7568+
id = ALC287_FIXUP_CS35L41_I2C_2; /* Legion 7i 16IAX7 */
7569+
__snd_hda_apply_fixup(codec, id, action, 0);
7570+
}
7571+
75547572
static const struct hda_fixup alc269_fixups[] = {
75557573
[ALC269_FIXUP_GPIO2] = {
75567574
.type = HDA_FIXUP_FUNC,
@@ -9445,6 +9463,10 @@ static const struct hda_fixup alc269_fixups[] = {
94459463
.type = HDA_FIXUP_FUNC,
94469464
.v.func = alc287_fixup_lenovo_14irp8_duetitl,
94479465
},
9466+
[ALC287_FIXUP_LENOVO_LEGION_7] = {
9467+
.type = HDA_FIXUP_FUNC,
9468+
.v.func = alc287_fixup_lenovo_legion_7,
9469+
},
94489470
[ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
94499471
.type = HDA_FIXUP_VERBS,
94509472
.v.verbs = (const struct hda_verb[]) {
@@ -10472,7 +10494,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
1047210494
SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
1047310495
SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
1047410496
SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10475-
SND_PCI_QUIRK(0x17aa, 0x386f, "Legion 7i 16IAX7", ALC287_FIXUP_CS35L41_I2C_2),
10497+
SND_PCI_QUIRK(0x17aa, 0x386f, "Legion Pro 7/7i", ALC287_FIXUP_LENOVO_LEGION_7),
1047610498
SND_PCI_QUIRK(0x17aa, 0x3870, "Lenovo Yoga 7 14ARB7", ALC287_FIXUP_YOGA7_14ARB7_I2C),
1047710499
SND_PCI_QUIRK(0x17aa, 0x3877, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
1047810500
SND_PCI_QUIRK(0x17aa, 0x3878, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),

0 commit comments

Comments
 (0)