diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-01-13 16:18:25 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-02-25 08:39:54 +0100 |
commit | bf68665d7a5647591258c120382fd64465db7d63 (patch) | |
tree | a66d2076ee71bfd4b72d2e3d318460db2e5c13ba | |
parent | 20c8cd593abb3faf8d03a84ebf156c113ab58023 (diff) | |
download | op-kernel-dev-bf68665d7a5647591258c120382fd64465db7d63.zip op-kernel-dev-bf68665d7a5647591258c120382fd64465db7d63.tar.gz |
ALSA: hda - Avoid codec D3 for keeping mute LED up on Lenovo Yxx0
The GPIO line used for the mute LED control on Lenovo Yxx0 laptops is
cleared unexpectedly when the codec goes to D3, typically by
power-saving. For avoiding it, add a power filter in the fixup.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=16373
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index c5405f3..6151ece 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -4894,6 +4894,17 @@ static void alc662_led_gpio1_mute_hook(void *private_data, int enabled) spec->gpio_led); } +/* avoid D3 for keeping GPIO up */ +static unsigned int gpio_led_power_filter(struct hda_codec *codec, + hda_nid_t nid, + unsigned int power_state) +{ + struct alc_spec *spec = codec->spec; + if (nid == codec->afg && power_state == AC_PWRST_D3 && spec->gpio_led) + return AC_PWRST_D0; + return power_state; +} + static void alc662_fixup_led_gpio1(struct hda_codec *codec, const struct hda_fixup *fix, int action) { @@ -4908,6 +4919,7 @@ static void alc662_fixup_led_gpio1(struct hda_codec *codec, spec->gen.vmaster_mute.hook = alc662_led_gpio1_mute_hook; spec->gpio_led = 0; snd_hda_add_verbs(codec, gpio_init); + codec->power_filter = gpio_led_power_filter; } } |