aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2013-01-07 06:03:47 -0500
committerTakashi Iwai <tiwai@suse.de>2013-01-07 11:29:55 -0500
commit6d3cd5d444223c41eabb70dccff14fae4e8cb8b1 (patch)
treec79d6c185a9c476e37c14dba7daf517bc01b9602 /sound/pci/hda/patch_realtek.c
parent61ed1dca1645d2dd64c83a01f728dfd59fa789b6 (diff)
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>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 6ee34593774a..71ae23dd7103 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5992,6 +5992,30 @@ static void alc269_fixup_quanta_mute(struct hda_codec *codec,
5992 spec->automute_hook = alc269_quanta_automute; 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 */
5996static 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
6004static 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/* update mute-LED according to the speaker mute state via mic2 VREF pin */ 6019/* update mute-LED according to the speaker mute state via mic2 VREF pin */
5996static void alc269_fixup_mic2_mute_hook(void *private_data, int enabled) 6020static void alc269_fixup_mic2_mute_hook(void *private_data, int enabled)
5997{ 6021{
@@ -6043,6 +6067,7 @@ enum {
6043 ALC269_FIXUP_DMIC, 6067 ALC269_FIXUP_DMIC,
6044 ALC269VB_FIXUP_AMIC, 6068 ALC269VB_FIXUP_AMIC,
6045 ALC269VB_FIXUP_DMIC, 6069 ALC269VB_FIXUP_DMIC,
6070 ALC269_FIXUP_MIC1_MUTE_LED,
6046 ALC269_FIXUP_MIC2_MUTE_LED, 6071 ALC269_FIXUP_MIC2_MUTE_LED,
6047 ALC269_FIXUP_INV_DMIC, 6072 ALC269_FIXUP_INV_DMIC,
6048 ALC269_FIXUP_LENOVO_DOCK, 6073 ALC269_FIXUP_LENOVO_DOCK,
@@ -6171,6 +6196,10 @@ static const struct alc_fixup alc269_fixups[] = {
6171 { } 6196 { }
6172 }, 6197 },
6173 }, 6198 },
6199 [ALC269_FIXUP_MIC1_MUTE_LED] = {
6200 .type = ALC_FIXUP_FUNC,
6201 .v.func = alc269_fixup_mic1_mute,
6202 },
6174 [ALC269_FIXUP_MIC2_MUTE_LED] = { 6203 [ALC269_FIXUP_MIC2_MUTE_LED] = {
6175 .type = ALC_FIXUP_FUNC, 6204 .type = ALC_FIXUP_FUNC,
6176 .v.func = alc269_fixup_mic2_mute, 6205 .v.func = alc269_fixup_mic2_mute,
@@ -6215,6 +6244,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6215 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), 6244 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
6216 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), 6245 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
6217 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED), 6246 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED),
6247 SND_PCI_QUIRK(0x103c, 0x1972, "HP Pavilion 17", ALC269_FIXUP_MIC1_MUTE_LED),
6218 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC), 6248 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC),
6219 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC), 6249 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC),
6220 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), 6250 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),