aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2013-11-06 04:50:44 -0500
committerTakashi Iwai <tiwai@suse.de>2013-11-06 05:08:12 -0500
commitd5b6b65e75ce607c2734227524e11574317a1c1a (patch)
tree313fec24387a68903577b9432aecbe65be7d53de /sound/pci/hda
parent88ec7ae82dff8ca815ff8a31622a2811240b5d0c (diff)
ALSA: hda - Make sure mute LEDs stay on during runtime suspend (Realtek)
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. Cc: stable@kernel.org 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>
Diffstat (limited to 'sound/pci/hda')
-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 02071a58f3f8..f19cd4fcb024 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2959,6 +2959,23 @@ static void alc269_fixup_mic_mute_hook(void *private_data, int enabled)
2959 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval); 2959 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval);
2960} 2960}
2961 2961
2962/* Make sure the led works even in runtime suspend */
2963static unsigned int led_power_filter(struct hda_codec *codec,
2964 hda_nid_t nid,
2965 unsigned int power_state)
2966{
2967 struct alc_spec *spec = codec->spec;
2968
2969 if (power_state != AC_PWRST_D3 || nid != spec->mute_led_nid)
2970 return power_state;
2971
2972 /* Set pin ctl again, it might have just been set to 0 */
2973 snd_hda_set_pin_ctl(codec, nid,
2974 snd_hda_codec_get_pin_target(codec, nid));
2975
2976 return AC_PWRST_D0;
2977}
2978
2962static void alc269_fixup_hp_mute_led(struct hda_codec *codec, 2979static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
2963 const struct hda_fixup *fix, int action) 2980 const struct hda_fixup *fix, int action)
2964{ 2981{
@@ -2978,6 +2995,7 @@ static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
2978 spec->mute_led_nid = pin - 0x0a + 0x18; 2995 spec->mute_led_nid = pin - 0x0a + 0x18;
2979 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; 2996 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
2980 spec->gen.vmaster_mute_enum = 1; 2997 spec->gen.vmaster_mute_enum = 1;
2998 codec->power_filter = led_power_filter;
2981 snd_printd("Detected mute LED for %x:%d\n", spec->mute_led_nid, 2999 snd_printd("Detected mute LED for %x:%d\n", spec->mute_led_nid,
2982 spec->mute_led_polarity); 3000 spec->mute_led_polarity);
2983 break; 3001 break;
@@ -2993,6 +3011,7 @@ static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
2993 spec->mute_led_nid = 0x18; 3011 spec->mute_led_nid = 0x18;
2994 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; 3012 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
2995 spec->gen.vmaster_mute_enum = 1; 3013 spec->gen.vmaster_mute_enum = 1;
3014 codec->power_filter = led_power_filter;
2996 } 3015 }
2997} 3016}
2998 3017
@@ -3005,6 +3024,7 @@ static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
3005 spec->mute_led_nid = 0x19; 3024 spec->mute_led_nid = 0x19;
3006 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; 3025 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
3007 spec->gen.vmaster_mute_enum = 1; 3026 spec->gen.vmaster_mute_enum = 1;
3027 codec->power_filter = led_power_filter;
3008 } 3028 }
3009} 3029}
3010 3030