Skip to content

Commit d7f3279

Browse files
KailangYangtiwai
authored andcommitted
ALSA: hda/realtek - Add headset Mic support for Lenovo ALC897 platform
Lenovo ALC897 platform had headset Mic. This patch enable supported headset Mic. Signed-off-by: Kailang Yang <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 38ddfb2 commit d7f3279

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

sound/pci/hda/patch_realtek.c

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10235,6 +10235,27 @@ static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
1023510235
}
1023610236
}
1023710237

10238+
static void alc897_hp_automute_hook(struct hda_codec *codec,
10239+
struct hda_jack_callback *jack)
10240+
{
10241+
struct alc_spec *spec = codec->spec;
10242+
int vref;
10243+
10244+
snd_hda_gen_hp_automute(codec, jack);
10245+
vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
10246+
snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10247+
vref);
10248+
}
10249+
10250+
static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
10251+
const struct hda_fixup *fix, int action)
10252+
{
10253+
struct alc_spec *spec = codec->spec;
10254+
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10255+
spec->gen.hp_automute_hook = alc897_hp_automute_hook;
10256+
}
10257+
}
10258+
1023810259
static const struct coef_fw alc668_coefs[] = {
1023910260
WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
1024010261
WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
@@ -10315,6 +10336,8 @@ enum {
1031510336
ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
1031610337
ALC668_FIXUP_HEADSET_MIC,
1031710338
ALC668_FIXUP_MIC_DET_COEF,
10339+
ALC897_FIXUP_LENOVO_HEADSET_MIC,
10340+
ALC897_FIXUP_HEADSET_MIC_PIN,
1031810341
};
1031910342

1032010343
static const struct hda_fixup alc662_fixups[] = {
@@ -10721,6 +10744,19 @@ static const struct hda_fixup alc662_fixups[] = {
1072110744
{}
1072210745
},
1072310746
},
10747+
[ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
10748+
.type = HDA_FIXUP_FUNC,
10749+
.v.func = alc897_fixup_lenovo_headset_mic,
10750+
},
10751+
[ALC897_FIXUP_HEADSET_MIC_PIN] = {
10752+
.type = HDA_FIXUP_PINS,
10753+
.v.pins = (const struct hda_pintbl[]) {
10754+
{ 0x1a, 0x03a11050 },
10755+
{ }
10756+
},
10757+
.chained = true,
10758+
.chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
10759+
},
1072410760
};
1072510761

1072610762
static const struct snd_pci_quirk alc662_fixup_tbl[] = {
@@ -10765,6 +10801,10 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
1076510801
SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
1076610802
SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
1076710803
SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
10804+
SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
10805+
SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
10806+
SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
10807+
SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
1076810808
SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
1076910809
SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
1077010810
SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),

0 commit comments

Comments
 (0)