1 From 7f665b1c3283aae5b61843136d0a8ee808ba3199 Mon Sep 17 00:00:00 2001
2 From: Jeremy Soller <jeremy@system76.com>
3 Date: Wed, 13 Feb 2019 10:56:19 -0700
4 Subject: ALSA: hda/realtek - Headset microphone and internal speaker support for System76 oryp5
6 From: Jeremy Soller <jeremy@system76.com>
8 commit 7f665b1c3283aae5b61843136d0a8ee808ba3199 upstream.
10 On the System76 Oryx Pro (oryp5), there is a headset microphone input
11 attached to 0x19 that does not have a jack detect. In order to get it
12 working, the pin configuration needs to be set correctly, and the
13 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC fixup needs to be applied. This is
14 similar to the MIC_NO_PRESENCE fixups for some Dell laptops, except we
15 have a separate microphone jack that is already configured correctly.
17 Since the ALC1220 does not have a fixup similar to
18 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, I have exposed the fixup from the
19 ALC269 in a way that it can be accessed from the
20 alc1220_fixup_system76_oryp5 function. In addition, the
21 alc1220_fixup_clevo_p950 needs to be applied to gain speaker output.
23 Signed-off-by: Jeremy Soller <jeremy@system76.com>
24 Cc: <stable@vger.kernel.org>
25 Signed-off-by: Takashi Iwai <tiwai@suse.de>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29 sound/pci/hda/patch_realtek.c | 28 ++++++++++++++++++++++++++++
30 1 file changed, 28 insertions(+)
32 --- a/sound/pci/hda/patch_realtek.c
33 +++ b/sound/pci/hda/patch_realtek.c
34 @@ -1855,6 +1855,8 @@ enum {
35 ALC887_FIXUP_BASS_CHMAP,
36 ALC1220_FIXUP_GB_DUAL_CODECS,
37 ALC1220_FIXUP_CLEVO_P950,
38 + ALC1220_FIXUP_SYSTEM76_ORYP5,
39 + ALC1220_FIXUP_SYSTEM76_ORYP5_PINS,
42 static void alc889_fixup_coef(struct hda_codec *codec,
43 @@ -2056,6 +2058,17 @@ static void alc1220_fixup_clevo_p950(str
44 snd_hda_override_conn_list(codec, 0x1b, 1, conn1);
47 +static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
48 + const struct hda_fixup *fix, int action);
50 +static void alc1220_fixup_system76_oryp5(struct hda_codec *codec,
51 + const struct hda_fixup *fix,
54 + alc1220_fixup_clevo_p950(codec, fix, action);
55 + alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
58 static const struct hda_fixup alc882_fixups[] = {
59 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
60 .type = HDA_FIXUP_PINS,
61 @@ -2300,6 +2313,19 @@ static const struct hda_fixup alc882_fix
62 .type = HDA_FIXUP_FUNC,
63 .v.func = alc1220_fixup_clevo_p950,
65 + [ALC1220_FIXUP_SYSTEM76_ORYP5] = {
66 + .type = HDA_FIXUP_FUNC,
67 + .v.func = alc1220_fixup_system76_oryp5,
69 + [ALC1220_FIXUP_SYSTEM76_ORYP5_PINS] = {
70 + .type = HDA_FIXUP_PINS,
71 + .v.pins = (const struct hda_pintbl[]) {
72 + { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
76 + .chain_id = ALC1220_FIXUP_SYSTEM76_ORYP5,
80 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
81 @@ -2376,6 +2402,8 @@ static const struct snd_pci_quirk alc882
82 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
83 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
84 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
85 + SND_PCI_QUIRK(0x1558, 0x96e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS),
86 + SND_PCI_QUIRK(0x1558, 0x97e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS),
87 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
88 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
89 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),