diff options
-rw-r--r-- | sound/pci/hda/hda_codec.c | 18 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 1 |
2 files changed, 9 insertions, 10 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 27b0c78abb5b..056cd9ade1fb 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 |
92 | static void hda_power_work(struct work_struct *work); | 92 | static void hda_power_work(struct work_struct *work); |
93 | static void hda_keep_power_on(struct hda_codec *codec); | 93 | static void hda_keep_power_on(struct hda_codec *codec); |
94 | #define hda_codec_is_power_on(codec) ((codec)->power_on) | ||
94 | #else | 95 | #else |
95 | static inline void hda_keep_power_on(struct hda_codec *codec) {} | 96 | static 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 663aa4fc384a..c7ca753d94ee 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 |