aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2013-11-06 04:50:44 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-29 14:11:46 -0500
commitca4c12c0cf1d0efb5e7ffecf31cb17f95e1e77df (patch)
tree40daf0b651748e77c7f337a2a59773ff852146e0 /sound
parent0009160a1b27a03d11ba007c542474aaba0b5380 (diff)
ALSA: hda - Make sure mute LEDs stay on during runtime suspend (Realtek)
commit d5b6b65e75ce607c2734227524e11574317a1c1a upstream. Some HP machines with Realtek codecs have mute LEDs connected to VREF pins. However when these go into runtime suspend, the pin powers down and its pin control is disabled, thus disabling the LED too. This patch fixes that issue by making sure that the pin stays in D0 with correct pin control. BugLink: https://bugs.launchpad.net/bugs/1248465 Tested-by: Franz Hsieh <franz.hsieh@canonical.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_realtek.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index ca945d63af50..3f8f4e4e519f 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2765,6 +2765,23 @@ static void alc269_fixup_mic_mute_hook(void *private_data, int enabled)
2765 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval); 2765 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval);
2766} 2766}
2767 2767
2768/* Make sure the led works even in runtime suspend */
2769static unsigned int led_power_filter(struct hda_codec *codec,
2770 hda_nid_t nid,
2771 unsigned int power_state)
2772{
2773 struct alc_spec *spec = codec->spec;
2774
2775 if (power_state != AC_PWRST_D3 || nid != spec->mute_led_nid)
2776 return power_state;
2777
2778 /* Set pin ctl again, it might have just been set to 0 */
2779 snd_hda_set_pin_ctl(codec, nid,
2780 snd_hda_codec_get_pin_target(codec, nid));
2781
2782 return AC_PWRST_D0;
2783}
2784
2768static void alc269_fixup_hp_mute_led(struct hda_codec *codec, 2785static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
2769 const struct hda_fixup *fix, int action) 2786 const struct hda_fixup *fix, int action)
2770{ 2787{
@@ -2784,6 +2801,7 @@ static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
2784 spec->mute_led_nid = pin - 0x0a + 0x18; 2801 spec->mute_led_nid = pin - 0x0a + 0x18;
2785 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; 2802 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
2786 spec->gen.vmaster_mute_enum = 1; 2803 spec->gen.vmaster_mute_enum = 1;
2804 codec->power_filter = led_power_filter;
2787 snd_printd("Detected mute LED for %x:%d\n", spec->mute_led_nid, 2805 snd_printd("Detected mute LED for %x:%d\n", spec->mute_led_nid,
2788 spec->mute_led_polarity); 2806 spec->mute_led_polarity);
2789 break; 2807 break;
@@ -2799,6 +2817,7 @@ static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
2799 spec->mute_led_nid = 0x18; 2817 spec->mute_led_nid = 0x18;
2800 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; 2818 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
2801 spec->gen.vmaster_mute_enum = 1; 2819 spec->gen.vmaster_mute_enum = 1;
2820 codec->power_filter = led_power_filter;
2802 } 2821 }
2803} 2822}
2804 2823
@@ -2811,6 +2830,7 @@ static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
2811 spec->mute_led_nid = 0x19; 2830 spec->mute_led_nid = 0x19;
2812 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; 2831 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
2813 spec->gen.vmaster_mute_enum = 1; 2832 spec->gen.vmaster_mute_enum = 1;
2833 codec->power_filter = led_power_filter;
2814 } 2834 }
2815} 2835}
2816 2836