Skip to content

Commit

Permalink
Use DMI matching for conflicting SSID 0x1f660101 between Ayaneo and AYN
Browse files Browse the repository at this point in the history
  • Loading branch information
CVMagic authored and BoukeHaarsma23 committed Jul 27, 2024
1 parent 2857e0f commit cc972ed
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -7294,8 +7294,8 @@ enum {
ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
ALC269_FIXUP_HEADSET_MODE,
ALC269_FIXUP_HEADSET_AYA_2,
ALC269_FIXUP_HEADSET_AYA_GEEK,
ALC269_FIXUP_DMI_MATCH,
ALC269_FIXUP_AYA_HEADSET_VOLUME,
ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
ALC269_FIXUP_ASPIRE_HEADSET_MIC,
ALC269_FIXUP_ASUS_X101_FUNC,
Expand Down Expand Up @@ -7547,6 +7547,30 @@ enum {
ALC287_FIXUP_LENOVO_SSID_17AA3820,
};

/* A special fixup for AYN and AYANEO handhelds as both
* have the same PCI SSID as well as the same codec, but
* require different quirks, falling back to DMI matching.
*/
static void alc269_fixup_match_via_dmi(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
int alc269_fix_id;
const char *board_name = dmi_get_system_info(DMI_BOARD_NAME);

if (dmi_name_in_vendors("AYANEO") || dmi_name_in_vendors("AYADEVICE") || dmi_name_in_vendors("AYA DEVICE")) {
if (board_name && (strcmp(board_name, "AYANEO 2") || strcmp(board_name, "AYANEO 2S") || strcmp(board_name, "GEEK") || strcmp(board_name, "GEEK 1S"))) {
alc269_fix_id = ALC269_FIXUP_AYA_HEADSET_VOLUME;
} else {
return;
}
} else if (dmi_name_in_vendors("ayn") && strcmp(board_name, "Loki MiniPro")) {
alc269_fix_id = ALC269VB_FIXUP_AYANEO_SPKR_PIN_FIX;
} else {
return;
}
__snd_hda_apply_fixup(codec, alc269_fix_id, action, 0);
}

/* A special fixup for Lenovo C940 and Yoga Duet 7;
* both have the very same PCI SSID, and we need to apply different fixups
* depending on the codec ID
Expand Down Expand Up @@ -8835,11 +8859,11 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true,
.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
},
[ALC269_FIXUP_HEADSET_AYA_2] = {
[ALC269_FIXUP_DMI_MATCH] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc269_fixup_headphone_volume,
.v.func = alc269_fixup_match_via_dmi,
},
[ALC269_FIXUP_HEADSET_AYA_GEEK] = {
[ALC269_FIXUP_AYA_HEADSET_VOLUME] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc269_fixup_headphone_volume,
},
Expand Down Expand Up @@ -10702,8 +10726,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME),
SND_PCI_QUIRK(0x1f66, 0x0101, "AYANEO 2", ALC269_FIXUP_HEADSET_AYA_2),
SND_PCI_QUIRK(0x1f66, 0x0101, "GEEK", ALC269_FIXUP_HEADSET_AYA_GEEK),
SND_PCI_QUIRK(0x1f66, 0x0101, "Multiple Vendors", ALC269_FIXUP_DMI_MATCH),
SND_PCI_QUIRK(0x1f66, 0x0103, "AYANEO AIR 1S", ALC269VB_FIXUP_AYANEO_SPKR_PIN_FIX),
SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
Expand Down

0 comments on commit cc972ed

Please sign in to comment.