Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DMI matching for conflicting SSID 0x1f660101 between Ayaneo and AYN #11

Merged
merged 1 commit into from
Jul 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 31 additions & 7 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/input.h>
#include <linux/leds.h>
#include <linux/ctype.h>
#include <linux/dmi.h>
#include <sound/core.h>
#include <sound/jack.h>
#include <sound/hda_codec.h>
Expand Down Expand Up @@ -7285,8 +7286,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 @@ -7534,6 +7535,30 @@ enum {
ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318,
};

/* 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 @@ -8802,11 +8827,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 @@ -10637,8 +10662,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
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