diff options
author | David Henningsson <david.henningsson@canonical.com> | 2014-10-30 03:26:01 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-10-30 03:59:52 -0400 |
commit | 7a5255f17d913581cc8351582676e06d4613c20d (patch) | |
tree | efc53c51cad501eb259a9f63b3a8b89206f4f8e8 | |
parent | 7c21539c45eace48e9f6fbdd59347d8416960af5 (diff) |
ALSA: hda - Set GPIO 4 low for a few HP machines
These HP machines needs GPIO 4 low to enable the headphone amplifier.
In addition, we still need to control LEDs via vref and GPIO.
Cc: stable@vger.kernel.org
BugLink: https://bugs.launchpad.net/bugs/1387128
Tested-by: TienFu Chen <tienfu.chen@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 9bc0301ddf4c..d16d8ec95200 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -3350,6 +3350,27 @@ static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, | |||
3350 | } | 3350 | } |
3351 | } | 3351 | } |
3352 | 3352 | ||
3353 | static void alc280_fixup_hp_gpio4(struct hda_codec *codec, | ||
3354 | const struct hda_fixup *fix, int action) | ||
3355 | { | ||
3356 | /* Like hp_gpio_mic1_led, but also needs GPIO4 low to enable headphone amp */ | ||
3357 | struct alc_spec *spec = codec->spec; | ||
3358 | static const struct hda_verb gpio_init[] = { | ||
3359 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x18 }, | ||
3360 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x18 }, | ||
3361 | {} | ||
3362 | }; | ||
3363 | |||
3364 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | ||
3365 | spec->gen.vmaster_mute.hook = alc269_fixup_hp_gpio_mute_hook; | ||
3366 | spec->gen.cap_sync_hook = alc269_fixup_hp_cap_mic_mute_hook; | ||
3367 | spec->gpio_led = 0; | ||
3368 | spec->cap_mute_led_nid = 0x18; | ||
3369 | snd_hda_add_verbs(codec, gpio_init); | ||
3370 | codec->power_filter = led_power_filter; | ||
3371 | } | ||
3372 | } | ||
3373 | |||
3353 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, | 3374 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, |
3354 | const struct hda_fixup *fix, int action) | 3375 | const struct hda_fixup *fix, int action) |
3355 | { | 3376 | { |
@@ -4217,6 +4238,7 @@ enum { | |||
4217 | ALC283_FIXUP_BXBT2807_MIC, | 4238 | ALC283_FIXUP_BXBT2807_MIC, |
4218 | ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED, | 4239 | ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED, |
4219 | ALC282_FIXUP_ASPIRE_V5_PINS, | 4240 | ALC282_FIXUP_ASPIRE_V5_PINS, |
4241 | ALC280_FIXUP_HP_GPIO4, | ||
4220 | }; | 4242 | }; |
4221 | 4243 | ||
4222 | static const struct hda_fixup alc269_fixups[] = { | 4244 | static const struct hda_fixup alc269_fixups[] = { |
@@ -4680,7 +4702,10 @@ static const struct hda_fixup alc269_fixups[] = { | |||
4680 | { }, | 4702 | { }, |
4681 | }, | 4703 | }, |
4682 | }, | 4704 | }, |
4683 | 4705 | [ALC280_FIXUP_HP_GPIO4] = { | |
4706 | .type = HDA_FIXUP_FUNC, | ||
4707 | .v.func = alc280_fixup_hp_gpio4, | ||
4708 | }, | ||
4684 | }; | 4709 | }; |
4685 | 4710 | ||
4686 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { | 4711 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
@@ -4728,7 +4753,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
4728 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 4753 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
4729 | SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | 4754 | SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
4730 | SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | 4755 | SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
4731 | SND_PCI_QUIRK(0x103c, 0x8004, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | 4756 | SND_PCI_QUIRK(0x103c, 0x8004, "HP", ALC269_FIXUP_HP_GPIO4), |
4732 | /* ALC290 */ | 4757 | /* ALC290 */ |
4733 | SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | 4758 | SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
4734 | SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | 4759 | SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
@@ -4742,7 +4767,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
4742 | SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | 4767 | SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
4743 | SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | 4768 | SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
4744 | SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | 4769 | SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
4745 | SND_PCI_QUIRK(0x103c, 0x2258, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | 4770 | SND_PCI_QUIRK(0x103c, 0x2258, "HP", ALC269_FIXUP_HP_GPIO4), |
4746 | SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | 4771 | SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
4747 | SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | 4772 | SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
4748 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 4773 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
@@ -4751,7 +4776,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
4751 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 4776 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
4752 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | 4777 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
4753 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | 4778 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
4754 | SND_PCI_QUIRK(0x103c, 0x2277, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | 4779 | SND_PCI_QUIRK(0x103c, 0x2277, "HP", ALC269_FIXUP_HP_GPIO4), |
4755 | SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | 4780 | SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
4756 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 4781 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
4757 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 4782 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |