summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
authorVitaliy Kulikov <Vitaliy.Kulikov@idt.com>2011-07-22 18:18:15 -0500
committerTakashi Iwai <tiwai@suse.de>2011-07-26 09:38:36 +0200
commitd02667e6206fb3be0990c38af8447a4ed2b74c11 (patch)
tree1f44f8708224332ca37e305724f8b09c05fa308f /sound/pci/hda/patch_sigmatel.c
parent0c27c1805269f9ff01cc1d77752a662065ebcfe5 (diff)
ALSA: hda - Fix invalid mute led state on resume of IDT codecs
Codec state is not restored immediately on resume but on the first access when power-save is enabled. That leads to an invalid mute led state after resume until either sound is played or some control is changed. This patch adds a possibility for a vendor specific patch to restore codec state immediately after resume if required. And it adds code to restore IDT codecs state immediately on resume on HP systems with mute led support. Signed-off-by: Vitaliy Kulikov <Vitaliy.Kulikov@idt.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 00ea2bd6bc1..c4a6ecb8e08 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4935,6 +4935,17 @@ static void stac927x_proc_hook(struct snd_info_buffer *buffer,
#endif
#ifdef SND_HDA_NEEDS_RESUME
+static int stac92xx_pre_resume(struct hda_codec *codec)
+{
+ struct sigmatel_spec *spec = codec->spec;
+
+ /* sync mute LED */
+ if (spec->gpio_led)
+ stac_gpio_set(codec, spec->gpio_mask,
+ spec->gpio_dir, spec->gpio_data);
+ return 0;
+}
+
static int stac92xx_resume(struct hda_codec *codec)
{
struct sigmatel_spec *spec = codec->spec;
@@ -5013,6 +5024,7 @@ static const struct hda_codec_ops stac92xx_patch_ops = {
#ifdef SND_HDA_NEEDS_RESUME
.suspend = stac92xx_suspend,
.resume = stac92xx_resume,
+ .pre_resume = stac92xx_pre_resume,
#endif
.reboot_notify = stac92xx_shutup,
};