aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorVitaliy Kulikov <Vitaliy.Kulikov@idt.com>2011-07-22 19:18:15 -0400
committerTakashi Iwai <tiwai@suse.de>2011-07-26 03:38:36 -0400
commitd02667e6206fb3be0990c38af8447a4ed2b74c11 (patch)
tree1f44f8708224332ca37e305724f8b09c05fa308f /sound/pci
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')
-rw-r--r--sound/pci/hda/hda_codec.c2
-rw-r--r--sound/pci/hda/hda_codec.h3
-rw-r--r--sound/pci/hda/patch_sigmatel.c12
3 files changed, 17 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 9c27a3a4c4d..c0e83ed0b35 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -5103,6 +5103,8 @@ int snd_hda_resume(struct hda_bus *bus)
5103 struct hda_codec *codec; 5103 struct hda_codec *codec;
5104 5104
5105 list_for_each_entry(codec, &bus->codec_list, list) { 5105 list_for_each_entry(codec, &bus->codec_list, list) {
5106 if (codec->patch_ops.pre_resume)
5107 codec->patch_ops.pre_resume(codec);
5106 if (snd_hda_codec_needs_resume(codec)) 5108 if (snd_hda_codec_needs_resume(codec))
5107 hda_call_codec_resume(codec); 5109 hda_call_codec_resume(codec);
5108 } 5110 }
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index f465e07a487..82161466d3b 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -712,6 +712,9 @@ struct hda_codec_ops {
712 int (*check_power_status)(struct hda_codec *codec, hda_nid_t nid); 712 int (*check_power_status)(struct hda_codec *codec, hda_nid_t nid);
713#endif 713#endif
714 void (*reboot_notify)(struct hda_codec *codec); 714 void (*reboot_notify)(struct hda_codec *codec);
715#ifdef SND_HDA_NEEDS_RESUME
716 int (*pre_resume)(struct hda_codec *codec);
717#endif
715}; 718};
716 719
717/* record for amp information cache */ 720/* record for amp information cache */
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,
4935#endif 4935#endif
4936 4936
4937#ifdef SND_HDA_NEEDS_RESUME 4937#ifdef SND_HDA_NEEDS_RESUME
4938static int stac92xx_pre_resume(struct hda_codec *codec)
4939{
4940 struct sigmatel_spec *spec = codec->spec;
4941
4942 /* sync mute LED */
4943 if (spec->gpio_led)
4944 stac_gpio_set(codec, spec->gpio_mask,
4945 spec->gpio_dir, spec->gpio_data);
4946 return 0;
4947}
4948
4938static int stac92xx_resume(struct hda_codec *codec) 4949static int stac92xx_resume(struct hda_codec *codec)
4939{ 4950{
4940 struct sigmatel_spec *spec = codec->spec; 4951 struct sigmatel_spec *spec = codec->spec;
@@ -5013,6 +5024,7 @@ static const struct hda_codec_ops stac92xx_patch_ops = {
5013#ifdef SND_HDA_NEEDS_RESUME 5024#ifdef SND_HDA_NEEDS_RESUME
5014 .suspend = stac92xx_suspend, 5025 .suspend = stac92xx_suspend,
5015 .resume = stac92xx_resume, 5026 .resume = stac92xx_resume,
5027 .pre_resume = stac92xx_pre_resume,
5016#endif 5028#endif
5017 .reboot_notify = stac92xx_shutup, 5029 .reboot_notify = stac92xx_shutup,
5018}; 5030};