aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-07-26 04:19:20 -0400
committerTakashi Iwai <tiwai@suse.de>2011-07-26 11:21:23 -0400
commite581f3dba509f6d48e4939aa70e9b768aa5fd4f3 (patch)
tree90600a19dbefda57a6e60d1333aa8c5ae62250b8 /sound
parent2a43952a99072f43c92355882b7965c8762ae3f3 (diff)
ALSA: hda - Add post_suspend patch ops
Add a new ops, post_suspend(), which is called after suspend() ops is performed. This is called only in the case of the real PM suspend, and the codec driver can use this for further changing of D-state or clearing the LED, etc. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_codec.c18
-rw-r--r--sound/pci/hda/hda_codec.h1
2 files changed, 9 insertions, 10 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 27b0c78abb5..056cd9ade1f 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -91,8 +91,10 @@ EXPORT_SYMBOL_HDA(snd_hda_delete_codec_preset);
91#ifdef CONFIG_SND_HDA_POWER_SAVE 91#ifdef CONFIG_SND_HDA_POWER_SAVE
92static void hda_power_work(struct work_struct *work); 92static void hda_power_work(struct work_struct *work);
93static void hda_keep_power_on(struct hda_codec *codec); 93static void hda_keep_power_on(struct hda_codec *codec);
94#define hda_codec_is_power_on(codec) ((codec)->power_on)
94#else 95#else
95static inline void hda_keep_power_on(struct hda_codec *codec) {} 96static inline void hda_keep_power_on(struct hda_codec *codec) {}
97#define hda_codec_is_power_on(codec) 1
96#endif 98#endif
97 99
98/** 100/**
@@ -4376,11 +4378,8 @@ void snd_hda_bus_reboot_notify(struct hda_bus *bus)
4376 if (!bus) 4378 if (!bus)
4377 return; 4379 return;
4378 list_for_each_entry(codec, &bus->codec_list, list) { 4380 list_for_each_entry(codec, &bus->codec_list, list) {
4379#ifdef CONFIG_SND_HDA_POWER_SAVE 4381 if (hda_codec_is_power_on(codec) &&
4380 if (!codec->power_on) 4382 codec->patch_ops.reboot_notify)
4381 continue;
4382#endif
4383 if (codec->patch_ops.reboot_notify)
4384 codec->patch_ops.reboot_notify(codec); 4383 codec->patch_ops.reboot_notify(codec);
4385 } 4384 }
4386} 4385}
@@ -5079,11 +5078,10 @@ int snd_hda_suspend(struct hda_bus *bus)
5079 struct hda_codec *codec; 5078 struct hda_codec *codec;
5080 5079
5081 list_for_each_entry(codec, &bus->codec_list, list) { 5080 list_for_each_entry(codec, &bus->codec_list, list) {
5082#ifdef CONFIG_SND_HDA_POWER_SAVE 5081 if (hda_codec_is_power_on(codec))
5083 if (!codec->power_on) 5082 hda_call_codec_suspend(codec);
5084 continue; 5083 if (codec->patch_ops.post_suspend)
5085#endif 5084 codec->patch_ops.post_suspend(codec);
5086 hda_call_codec_suspend(codec);
5087 } 5085 }
5088 return 0; 5086 return 0;
5089} 5087}
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index 663aa4fc384..c7ca753d94e 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -702,6 +702,7 @@ struct hda_codec_ops {
702 void (*unsol_event)(struct hda_codec *codec, unsigned int res); 702 void (*unsol_event)(struct hda_codec *codec, unsigned int res);
703#ifdef CONFIG_PM 703#ifdef CONFIG_PM
704 int (*suspend)(struct hda_codec *codec, pm_message_t state); 704 int (*suspend)(struct hda_codec *codec, pm_message_t state);
705 int (*post_suspend)(struct hda_codec *codec);
705 int (*pre_resume)(struct hda_codec *codec); 706 int (*pre_resume)(struct hda_codec *codec);
706 int (*resume)(struct hda_codec *codec); 707 int (*resume)(struct hda_codec *codec);
707#endif 708#endif