ALSA: hda - add mute LED for HP Pavilion 17 (Realtek codec)

The mute LED is in this case connected to the Mic1 VREF.

The machine also exposes the following string in BIOS:
"HP_Mute_LED_0_A", so if more machines are coming, it probably
makes sense to try to do something more generic, like for the
IDT codec.

Cc: stable@vger.kernel.org
BugLink: https://bugs.launchpad.net/bugs/1096789
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

David Henningsson and committed by
Takashi Iwai
6d3cd5d4 61ed1dca

+30
+30
sound/pci/hda/patch_realtek.c
··· 5992 5992 spec->automute_hook = alc269_quanta_automute; 5993 5993 } 5994 5994 5995 + /* update mute-LED according to the speaker mute state via mic1 VREF pin */ 5996 + static void alc269_fixup_mic1_mute_hook(void *private_data, int enabled) 5997 + { 5998 + struct hda_codec *codec = private_data; 5999 + unsigned int pinval = AC_PINCTL_IN_EN + (enabled ? 6000 + AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80); 6001 + snd_hda_set_pin_ctl_cache(codec, 0x18, pinval); 6002 + } 6003 + 6004 + static void alc269_fixup_mic1_mute(struct hda_codec *codec, 6005 + const struct alc_fixup *fix, int action) 6006 + { 6007 + struct alc_spec *spec = codec->spec; 6008 + switch (action) { 6009 + case ALC_FIXUP_ACT_BUILD: 6010 + spec->vmaster_mute.hook = alc269_fixup_mic1_mute_hook; 6011 + snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, true); 6012 + /* fallthru */ 6013 + case ALC_FIXUP_ACT_INIT: 6014 + snd_hda_sync_vmaster_hook(&spec->vmaster_mute); 6015 + break; 6016 + } 6017 + } 6018 + 5995 6019 /* update mute-LED according to the speaker mute state via mic2 VREF pin */ 5996 6020 static void alc269_fixup_mic2_mute_hook(void *private_data, int enabled) 5997 6021 { ··· 6067 6043 ALC269_FIXUP_DMIC, 6068 6044 ALC269VB_FIXUP_AMIC, 6069 6045 ALC269VB_FIXUP_DMIC, 6046 + ALC269_FIXUP_MIC1_MUTE_LED, 6070 6047 ALC269_FIXUP_MIC2_MUTE_LED, 6071 6048 ALC269_FIXUP_INV_DMIC, 6072 6049 ALC269_FIXUP_LENOVO_DOCK, ··· 6196 6171 { } 6197 6172 }, 6198 6173 }, 6174 + [ALC269_FIXUP_MIC1_MUTE_LED] = { 6175 + .type = ALC_FIXUP_FUNC, 6176 + .v.func = alc269_fixup_mic1_mute, 6177 + }, 6199 6178 [ALC269_FIXUP_MIC2_MUTE_LED] = { 6200 6179 .type = ALC_FIXUP_FUNC, 6201 6180 .v.func = alc269_fixup_mic2_mute, ··· 6244 6215 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), 6245 6216 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), 6246 6217 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED), 6218 + SND_PCI_QUIRK(0x103c, 0x1972, "HP Pavilion 17", ALC269_FIXUP_MIC1_MUTE_LED), 6247 6219 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC), 6248 6220 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC), 6249 6221 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),