diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-08-24 12:38:08 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-08-30 10:50:13 -0400 |
commit | 83012a7ccbb90dee33c97a004b3e374f988612af (patch) | |
tree | 4e6e4c6f1f21150a4c82cbbefb97995cda924d17 /sound/pci | |
parent | 432c641e013d6e294e2ddf06d32a610eb1d4d856 (diff) |
ALSA: hda - Clean up CONFIG_SND_HDA_POWER_SAVE
CONFIG_SND_HDA_POWER_SAVE is no longer an experimental feature and its
behavior can be well controlled via the default value and module
parameter. Let's just replace it with the standard CONFIG_PM.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/Kconfig | 10 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.c | 23 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 10 | ||||
-rw-r--r-- | sound/pci/hda/hda_generic.c | 8 | ||||
-rw-r--r-- | sound/pci/hda/hda_hwdep.c | 4 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 16 | ||||
-rw-r--r-- | sound/pci/hda/hda_local.h | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_trace.h | 4 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 36 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 6 | ||||
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 14 | ||||
-rw-r--r-- | sound/pci/hda/patch_via.c | 4 |
13 files changed, 59 insertions, 80 deletions
diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig index 194d625c1f83..7105c3de1bca 100644 --- a/sound/pci/hda/Kconfig +++ b/sound/pci/hda/Kconfig | |||
@@ -228,17 +228,9 @@ config SND_HDA_GENERIC | |||
228 | Say Y here to enable the generic HD-audio codec parser | 228 | Say Y here to enable the generic HD-audio codec parser |
229 | in snd-hda-intel driver. | 229 | in snd-hda-intel driver. |
230 | 230 | ||
231 | config SND_HDA_POWER_SAVE | ||
232 | bool "Aggressive power-saving on HD-audio" | ||
233 | depends on PM | ||
234 | help | ||
235 | Say Y here to enable more aggressive power-saving mode on | ||
236 | HD-audio driver. The power-saving timeout can be configured | ||
237 | via power_save option or over sysfs on-the-fly. | ||
238 | |||
239 | config SND_HDA_POWER_SAVE_DEFAULT | 231 | config SND_HDA_POWER_SAVE_DEFAULT |
240 | int "Default time-out for HD-audio power-save mode" | 232 | int "Default time-out for HD-audio power-save mode" |
241 | depends on SND_HDA_POWER_SAVE | 233 | depends on PM |
242 | default 0 | 234 | default 0 |
243 | help | 235 | help |
244 | The default time-out value in seconds for HD-audio automatic | 236 | The default time-out value in seconds for HD-audio automatic |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 409f5ecd0a71..8a72f7b30a33 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -94,7 +94,7 @@ int snd_hda_delete_codec_preset(struct hda_codec_preset_list *preset) | |||
94 | } | 94 | } |
95 | EXPORT_SYMBOL_HDA(snd_hda_delete_codec_preset); | 95 | EXPORT_SYMBOL_HDA(snd_hda_delete_codec_preset); |
96 | 96 | ||
97 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 97 | #ifdef CONFIG_PM |
98 | static void hda_power_work(struct work_struct *work); | 98 | static void hda_power_work(struct work_struct *work); |
99 | static void hda_keep_power_on(struct hda_codec *codec); | 99 | static void hda_keep_power_on(struct hda_codec *codec); |
100 | #define hda_codec_is_power_on(codec) ((codec)->power_on) | 100 | #define hda_codec_is_power_on(codec) ((codec)->power_on) |
@@ -1192,7 +1192,7 @@ static void snd_hda_codec_free(struct hda_codec *codec) | |||
1192 | return; | 1192 | return; |
1193 | snd_hda_jack_tbl_clear(codec); | 1193 | snd_hda_jack_tbl_clear(codec); |
1194 | restore_init_pincfgs(codec); | 1194 | restore_init_pincfgs(codec); |
1195 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1195 | #ifdef CONFIG_PM |
1196 | cancel_delayed_work(&codec->power_work); | 1196 | cancel_delayed_work(&codec->power_work); |
1197 | flush_workqueue(codec->bus->workq); | 1197 | flush_workqueue(codec->bus->workq); |
1198 | #endif | 1198 | #endif |
@@ -1205,7 +1205,7 @@ static void snd_hda_codec_free(struct hda_codec *codec) | |||
1205 | codec->bus->caddr_tbl[codec->addr] = NULL; | 1205 | codec->bus->caddr_tbl[codec->addr] = NULL; |
1206 | if (codec->patch_ops.free) | 1206 | if (codec->patch_ops.free) |
1207 | codec->patch_ops.free(codec); | 1207 | codec->patch_ops.free(codec); |
1208 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1208 | #ifdef CONFIG_PM |
1209 | if (codec->power_on) | 1209 | if (codec->power_on) |
1210 | hda_call_pm_notify(codec->bus, false); | 1210 | hda_call_pm_notify(codec->bus, false); |
1211 | #endif | 1211 | #endif |
@@ -1273,7 +1273,7 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, | |||
1273 | snd_array_init(&codec->conn_lists, sizeof(hda_nid_t), 64); | 1273 | snd_array_init(&codec->conn_lists, sizeof(hda_nid_t), 64); |
1274 | snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16); | 1274 | snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16); |
1275 | 1275 | ||
1276 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1276 | #ifdef CONFIG_PM |
1277 | spin_lock_init(&codec->power_lock); | 1277 | spin_lock_init(&codec->power_lock); |
1278 | INIT_DELAYED_WORK(&codec->power_work, hda_power_work); | 1278 | INIT_DELAYED_WORK(&codec->power_work, hda_power_work); |
1279 | /* snd_hda_codec_new() marks the codec as power-up, and leave it as is. | 1279 | /* snd_hda_codec_new() marks the codec as power-up, and leave it as is. |
@@ -1331,7 +1331,7 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, | |||
1331 | AC_VERB_GET_SUBSYSTEM_ID, 0); | 1331 | AC_VERB_GET_SUBSYSTEM_ID, 0); |
1332 | } | 1332 | } |
1333 | 1333 | ||
1334 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1334 | #ifdef CONFIG_PM |
1335 | codec->d3_stop_clk = snd_hda_codec_get_supported_ps(codec, | 1335 | codec->d3_stop_clk = snd_hda_codec_get_supported_ps(codec, |
1336 | codec->afg ? codec->afg : codec->mfg, | 1336 | codec->afg ? codec->afg : codec->mfg, |
1337 | AC_PWRST_CLKSTOP); | 1337 | AC_PWRST_CLKSTOP); |
@@ -2353,7 +2353,7 @@ int snd_hda_codec_reset(struct hda_codec *codec) | |||
2353 | 2353 | ||
2354 | /* OK, let it free */ | 2354 | /* OK, let it free */ |
2355 | 2355 | ||
2356 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 2356 | #ifdef CONFIG_PM |
2357 | cancel_delayed_work_sync(&codec->power_work); | 2357 | cancel_delayed_work_sync(&codec->power_work); |
2358 | codec->power_on = 0; | 2358 | codec->power_on = 0; |
2359 | codec->power_transition = 0; | 2359 | codec->power_transition = 0; |
@@ -3572,7 +3572,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, | |||
3572 | int count; | 3572 | int count; |
3573 | unsigned int state; | 3573 | unsigned int state; |
3574 | 3574 | ||
3575 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 3575 | #ifdef CONFIG_PM |
3576 | codec->d3_stop_clk_ok = 0; | 3576 | codec->d3_stop_clk_ok = 0; |
3577 | #endif | 3577 | #endif |
3578 | 3578 | ||
@@ -3599,7 +3599,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, | |||
3599 | break; | 3599 | break; |
3600 | } | 3600 | } |
3601 | 3601 | ||
3602 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 3602 | #ifdef CONFIG_PM |
3603 | if (!codec->bus->power_keep_link_on && power_state == AC_PWRST_D3 | 3603 | if (!codec->bus->power_keep_link_on && power_state == AC_PWRST_D3 |
3604 | && codec->d3_stop_clk && (state & AC_PWRST_CLK_STOP_OK)) | 3604 | && codec->d3_stop_clk && (state & AC_PWRST_CLK_STOP_OK)) |
3605 | codec->d3_stop_clk_ok = 1; | 3605 | codec->d3_stop_clk_ok = 1; |
@@ -3629,7 +3629,6 @@ static void hda_call_codec_suspend(struct hda_codec *codec) | |||
3629 | hda_set_power_state(codec, | 3629 | hda_set_power_state(codec, |
3630 | codec->afg ? codec->afg : codec->mfg, | 3630 | codec->afg ? codec->afg : codec->mfg, |
3631 | AC_PWRST_D3); | 3631 | AC_PWRST_D3); |
3632 | #ifdef CONFIG_SND_HDA_POWER_SAVE | ||
3633 | cancel_delayed_work(&codec->power_work); | 3632 | cancel_delayed_work(&codec->power_work); |
3634 | spin_lock(&codec->power_lock); | 3633 | spin_lock(&codec->power_lock); |
3635 | snd_hda_update_power_acct(codec); | 3634 | snd_hda_update_power_acct(codec); |
@@ -3638,7 +3637,6 @@ static void hda_call_codec_suspend(struct hda_codec *codec) | |||
3638 | codec->power_transition = 0; | 3637 | codec->power_transition = 0; |
3639 | codec->power_jiffies = jiffies; | 3638 | codec->power_jiffies = jiffies; |
3640 | spin_unlock(&codec->power_lock); | 3639 | spin_unlock(&codec->power_lock); |
3641 | #endif | ||
3642 | } | 3640 | } |
3643 | 3641 | ||
3644 | /* | 3642 | /* |
@@ -4434,7 +4432,7 @@ int snd_hda_add_new_ctls(struct hda_codec *codec, | |||
4434 | } | 4432 | } |
4435 | EXPORT_SYMBOL_HDA(snd_hda_add_new_ctls); | 4433 | EXPORT_SYMBOL_HDA(snd_hda_add_new_ctls); |
4436 | 4434 | ||
4437 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 4435 | #ifdef CONFIG_PM |
4438 | static void hda_power_work(struct work_struct *work) | 4436 | static void hda_power_work(struct work_struct *work) |
4439 | { | 4437 | { |
4440 | struct hda_codec *codec = | 4438 | struct hda_codec *codec = |
@@ -5107,9 +5105,6 @@ EXPORT_SYMBOL_HDA(snd_hda_suspend); | |||
5107 | * @bus: the HDA bus | 5105 | * @bus: the HDA bus |
5108 | * | 5106 | * |
5109 | * Returns 0 if successful. | 5107 | * Returns 0 if successful. |
5110 | * | ||
5111 | * This function is defined only when POWER_SAVE isn't set. | ||
5112 | * In the power-save mode, the codec is resumed dynamically. | ||
5113 | */ | 5108 | */ |
5114 | int snd_hda_resume(struct hda_bus *bus) | 5109 | int snd_hda_resume(struct hda_bus *bus) |
5115 | { | 5110 | { |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 2e5a22fec0be..7e1709cb8995 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -614,7 +614,7 @@ struct hda_bus_ops { | |||
614 | struct hda_pcm *pcm); | 614 | struct hda_pcm *pcm); |
615 | /* reset bus for retry verb */ | 615 | /* reset bus for retry verb */ |
616 | void (*bus_reset)(struct hda_bus *bus); | 616 | void (*bus_reset)(struct hda_bus *bus); |
617 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 617 | #ifdef CONFIG_PM |
618 | /* notify power-up/down from codec to controller */ | 618 | /* notify power-up/down from codec to controller */ |
619 | void (*pm_notify)(struct hda_bus *bus, bool power_up); | 619 | void (*pm_notify)(struct hda_bus *bus, bool power_up); |
620 | #endif | 620 | #endif |
@@ -712,8 +712,6 @@ struct hda_codec_ops { | |||
712 | #ifdef CONFIG_PM | 712 | #ifdef CONFIG_PM |
713 | int (*suspend)(struct hda_codec *codec); | 713 | int (*suspend)(struct hda_codec *codec); |
714 | int (*resume)(struct hda_codec *codec); | 714 | int (*resume)(struct hda_codec *codec); |
715 | #endif | ||
716 | #ifdef CONFIG_SND_HDA_POWER_SAVE | ||
717 | int (*check_power_status)(struct hda_codec *codec, hda_nid_t nid); | 715 | int (*check_power_status)(struct hda_codec *codec, hda_nid_t nid); |
718 | #endif | 716 | #endif |
719 | void (*reboot_notify)(struct hda_codec *codec); | 717 | void (*reboot_notify)(struct hda_codec *codec); |
@@ -867,7 +865,7 @@ struct hda_codec { | |||
867 | unsigned int no_jack_detect:1; /* Machine has no jack-detection */ | 865 | unsigned int no_jack_detect:1; /* Machine has no jack-detection */ |
868 | unsigned int pcm_format_first:1; /* PCM format must be set first */ | 866 | unsigned int pcm_format_first:1; /* PCM format must be set first */ |
869 | unsigned int epss:1; /* supporting EPSS? */ | 867 | unsigned int epss:1; /* supporting EPSS? */ |
870 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 868 | #ifdef CONFIG_PM |
871 | unsigned int power_on :1; /* current (global) power-state */ | 869 | unsigned int power_on :1; /* current (global) power-state */ |
872 | int power_transition; /* power-state in transition */ | 870 | int power_transition; /* power-state in transition */ |
873 | int power_count; /* current (global) power refcount */ | 871 | int power_count; /* current (global) power refcount */ |
@@ -1049,7 +1047,7 @@ int snd_hda_resume(struct hda_bus *bus); | |||
1049 | static inline | 1047 | static inline |
1050 | int hda_call_check_power_status(struct hda_codec *codec, hda_nid_t nid) | 1048 | int hda_call_check_power_status(struct hda_codec *codec, hda_nid_t nid) |
1051 | { | 1049 | { |
1052 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1050 | #ifdef CONFIG_PM |
1053 | if (codec->patch_ops.check_power_status) | 1051 | if (codec->patch_ops.check_power_status) |
1054 | return codec->patch_ops.check_power_status(codec, nid); | 1052 | return codec->patch_ops.check_power_status(codec, nid); |
1055 | #endif | 1053 | #endif |
@@ -1066,7 +1064,7 @@ const char *snd_hda_get_jack_location(u32 cfg); | |||
1066 | /* | 1064 | /* |
1067 | * power saving | 1065 | * power saving |
1068 | */ | 1066 | */ |
1069 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1067 | #ifdef CONFIG_PM |
1070 | void snd_hda_power_save(struct hda_codec *codec, int delta, bool d3wait); | 1068 | void snd_hda_power_save(struct hda_codec *codec, int delta, bool d3wait); |
1071 | void snd_hda_update_power_acct(struct hda_codec *codec); | 1069 | void snd_hda_update_power_acct(struct hda_codec *codec); |
1072 | #else | 1070 | #else |
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 431bf868711e..b81d3d0b952d 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c | |||
@@ -70,7 +70,7 @@ struct hda_gspec { | |||
70 | 70 | ||
71 | struct list_head nid_list; /* list of widgets */ | 71 | struct list_head nid_list; /* list of widgets */ |
72 | 72 | ||
73 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 73 | #ifdef CONFIG_PM |
74 | #define MAX_LOOPBACK_AMPS 7 | 74 | #define MAX_LOOPBACK_AMPS 7 |
75 | struct hda_loopback_check loopback; | 75 | struct hda_loopback_check loopback; |
76 | int num_loopbacks; | 76 | int num_loopbacks; |
@@ -654,7 +654,7 @@ static int parse_input(struct hda_codec *codec) | |||
654 | return 0; | 654 | return 0; |
655 | } | 655 | } |
656 | 656 | ||
657 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 657 | #ifdef CONFIG_PM |
658 | static void add_input_loopback(struct hda_codec *codec, hda_nid_t nid, | 658 | static void add_input_loopback(struct hda_codec *codec, hda_nid_t nid, |
659 | int dir, int idx) | 659 | int dir, int idx) |
660 | { | 660 | { |
@@ -1028,7 +1028,7 @@ static int build_generic_pcms(struct hda_codec *codec) | |||
1028 | return 0; | 1028 | return 0; |
1029 | } | 1029 | } |
1030 | 1030 | ||
1031 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1031 | #ifdef CONFIG_PM |
1032 | static int generic_check_power_status(struct hda_codec *codec, hda_nid_t nid) | 1032 | static int generic_check_power_status(struct hda_codec *codec, hda_nid_t nid) |
1033 | { | 1033 | { |
1034 | struct hda_gspec *spec = codec->spec; | 1034 | struct hda_gspec *spec = codec->spec; |
@@ -1043,7 +1043,7 @@ static struct hda_codec_ops generic_patch_ops = { | |||
1043 | .build_controls = build_generic_controls, | 1043 | .build_controls = build_generic_controls, |
1044 | .build_pcms = build_generic_pcms, | 1044 | .build_pcms = build_generic_pcms, |
1045 | .free = snd_hda_generic_free, | 1045 | .free = snd_hda_generic_free, |
1046 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1046 | #ifdef CONFIG_PM |
1047 | .check_power_status = generic_check_power_status, | 1047 | .check_power_status = generic_check_power_status, |
1048 | #endif | 1048 | #endif |
1049 | }; | 1049 | }; |
diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c index b9a644ca03b3..1af86d40eb23 100644 --- a/sound/pci/hda/hda_hwdep.c +++ b/sound/pci/hda/hda_hwdep.c | |||
@@ -155,7 +155,7 @@ int /*__devinit*/ snd_hda_create_hwdep(struct hda_codec *codec) | |||
155 | return 0; | 155 | return 0; |
156 | } | 156 | } |
157 | 157 | ||
158 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 158 | #ifdef CONFIG_PM |
159 | static ssize_t power_on_acct_show(struct device *dev, | 159 | static ssize_t power_on_acct_show(struct device *dev, |
160 | struct device_attribute *attr, | 160 | struct device_attribute *attr, |
161 | char *buf) | 161 | char *buf) |
@@ -191,7 +191,7 @@ int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec) | |||
191 | hwdep->device, &power_attrs[i]); | 191 | hwdep->device, &power_attrs[i]); |
192 | return 0; | 192 | return 0; |
193 | } | 193 | } |
194 | #endif /* CONFIG_SND_HDA_POWER_SAVE */ | 194 | #endif /* CONFIG_PM */ |
195 | 195 | ||
196 | #ifdef CONFIG_SND_HDA_RECONFIG | 196 | #ifdef CONFIG_SND_HDA_RECONFIG |
197 | 197 | ||
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 1b6e856e7ab1..6a19f6af9517 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -110,7 +110,7 @@ MODULE_PARM_DESC(beep_mode, "Select HDA Beep registration mode " | |||
110 | "(0=off, 1=on) (default=1)."); | 110 | "(0=off, 1=on) (default=1)."); |
111 | #endif | 111 | #endif |
112 | 112 | ||
113 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 113 | #ifdef CONFIG_PM |
114 | static int param_set_xint(const char *val, const struct kernel_param *kp); | 114 | static int param_set_xint(const char *val, const struct kernel_param *kp); |
115 | static struct kernel_param_ops param_ops_xint = { | 115 | static struct kernel_param_ops param_ops_xint = { |
116 | .set = param_set_xint, | 116 | .set = param_set_xint, |
@@ -130,7 +130,7 @@ MODULE_PARM_DESC(power_save, "Automatic power-saving timeout " | |||
130 | static bool power_save_controller = 1; | 130 | static bool power_save_controller = 1; |
131 | module_param(power_save_controller, bool, 0644); | 131 | module_param(power_save_controller, bool, 0644); |
132 | MODULE_PARM_DESC(power_save_controller, "Reset controller in power save mode."); | 132 | MODULE_PARM_DESC(power_save_controller, "Reset controller in power save mode."); |
133 | #endif | 133 | #endif /* CONFIG_PM */ |
134 | 134 | ||
135 | static int align_buffer_size = -1; | 135 | static int align_buffer_size = -1; |
136 | module_param(align_buffer_size, bint, 0644); | 136 | module_param(align_buffer_size, bint, 0644); |
@@ -1032,7 +1032,7 @@ static unsigned int azx_get_response(struct hda_bus *bus, | |||
1032 | return azx_rirb_get_response(bus, addr); | 1032 | return azx_rirb_get_response(bus, addr); |
1033 | } | 1033 | } |
1034 | 1034 | ||
1035 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1035 | #ifdef CONFIG_PM |
1036 | static void azx_power_notify(struct hda_bus *bus, bool power_up); | 1036 | static void azx_power_notify(struct hda_bus *bus, bool power_up); |
1037 | #endif | 1037 | #endif |
1038 | 1038 | ||
@@ -1605,7 +1605,7 @@ static int DELAYED_INIT_MARK azx_codec_create(struct azx *chip, const char *mode | |||
1605 | bus_temp.ops.get_response = azx_get_response; | 1605 | bus_temp.ops.get_response = azx_get_response; |
1606 | bus_temp.ops.attach_pcm = azx_attach_pcm_stream; | 1606 | bus_temp.ops.attach_pcm = azx_attach_pcm_stream; |
1607 | bus_temp.ops.bus_reset = azx_bus_reset; | 1607 | bus_temp.ops.bus_reset = azx_bus_reset; |
1608 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1608 | #ifdef CONFIG_PM |
1609 | bus_temp.power_save = &power_save; | 1609 | bus_temp.power_save = &power_save; |
1610 | bus_temp.ops.pm_notify = azx_power_notify; | 1610 | bus_temp.ops.pm_notify = azx_power_notify; |
1611 | #endif | 1611 | #endif |
@@ -2404,7 +2404,7 @@ static void azx_stop_chip(struct azx *chip) | |||
2404 | chip->initialized = 0; | 2404 | chip->initialized = 0; |
2405 | } | 2405 | } |
2406 | 2406 | ||
2407 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 2407 | #ifdef CONFIG_PM |
2408 | /* power-up/down the controller */ | 2408 | /* power-up/down the controller */ |
2409 | static void azx_power_notify(struct hda_bus *bus, bool power_up) | 2409 | static void azx_power_notify(struct hda_bus *bus, bool power_up) |
2410 | { | 2410 | { |
@@ -2457,7 +2457,7 @@ static int param_set_xint(const char *val, const struct kernel_param *kp) | |||
2457 | #else | 2457 | #else |
2458 | #define azx_add_card_list(chip) /* NOP */ | 2458 | #define azx_add_card_list(chip) /* NOP */ |
2459 | #define azx_del_card_list(chip) /* NOP */ | 2459 | #define azx_del_card_list(chip) /* NOP */ |
2460 | #endif /* CONFIG_SND_HDA_POWER_SAVE */ | 2460 | #endif /* CONFIG_PM */ |
2461 | 2461 | ||
2462 | #if defined(CONFIG_PM_SLEEP) || defined(SUPPORT_VGA_SWITCHEROO) | 2462 | #if defined(CONFIG_PM_SLEEP) || defined(SUPPORT_VGA_SWITCHEROO) |
2463 | /* | 2463 | /* |
@@ -2525,10 +2525,8 @@ static int azx_runtime_suspend(struct device *dev) | |||
2525 | struct snd_card *card = dev_get_drvdata(dev); | 2525 | struct snd_card *card = dev_get_drvdata(dev); |
2526 | struct azx *chip = card->private_data; | 2526 | struct azx *chip = card->private_data; |
2527 | 2527 | ||
2528 | #ifdef CONFIG_SND_HDA_POWER_SAVE | ||
2529 | if (!power_save_controller) | 2528 | if (!power_save_controller) |
2530 | return -EAGAIN; | 2529 | return -EAGAIN; |
2531 | #endif | ||
2532 | 2530 | ||
2533 | azx_stop_chip(chip); | 2531 | azx_stop_chip(chip); |
2534 | azx_clear_irq_pending(chip); | 2532 | azx_clear_irq_pending(chip); |
@@ -3232,7 +3230,7 @@ static int DELAYED_INIT_MARK azx_first_init(struct azx *chip) | |||
3232 | 3230 | ||
3233 | static void power_down_all_codecs(struct azx *chip) | 3231 | static void power_down_all_codecs(struct azx *chip) |
3234 | { | 3232 | { |
3235 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 3233 | #ifdef CONFIG_PM |
3236 | /* The codecs were powered up in snd_hda_codec_new(). | 3234 | /* The codecs were powered up in snd_hda_codec_new(). |
3237 | * Now all initialization done, so turn them down if possible | 3235 | * Now all initialization done, so turn them down if possible |
3238 | */ | 3236 | */ |
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 1b4c12941baa..09dbdc37f781 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -529,7 +529,7 @@ int snd_hda_create_hwdep(struct hda_codec *codec); | |||
529 | static inline int snd_hda_create_hwdep(struct hda_codec *codec) { return 0; } | 529 | static inline int snd_hda_create_hwdep(struct hda_codec *codec) { return 0; } |
530 | #endif | 530 | #endif |
531 | 531 | ||
532 | #if defined(CONFIG_SND_HDA_POWER_SAVE) && defined(CONFIG_SND_HDA_HWDEP) | 532 | #if defined(CONFIG_PM) && defined(CONFIG_SND_HDA_HWDEP) |
533 | int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec); | 533 | int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec); |
534 | #else | 534 | #else |
535 | static inline int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec) | 535 | static inline int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec) |
diff --git a/sound/pci/hda/hda_trace.h b/sound/pci/hda/hda_trace.h index d42fe911abae..3a1c63161eb1 100644 --- a/sound/pci/hda/hda_trace.h +++ b/sound/pci/hda/hda_trace.h | |||
@@ -58,7 +58,7 @@ TRACE_EVENT(hda_bus_reset, | |||
58 | TP_printk("[%d]", __entry->card) | 58 | TP_printk("[%d]", __entry->card) |
59 | ); | 59 | ); |
60 | 60 | ||
61 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 61 | #ifdef CONFIG_PM |
62 | DECLARE_EVENT_CLASS(hda_power, | 62 | DECLARE_EVENT_CLASS(hda_power, |
63 | 63 | ||
64 | TP_PROTO(struct hda_codec *codec), | 64 | TP_PROTO(struct hda_codec *codec), |
@@ -111,7 +111,7 @@ TRACE_EVENT(hda_power_count, | |||
111 | __entry->card, __entry->addr, __entry->power_count, | 111 | __entry->card, __entry->addr, __entry->power_count, |
112 | __entry->power_on, __entry->power_transition) | 112 | __entry->power_on, __entry->power_transition) |
113 | ); | 113 | ); |
114 | #endif /* CONFIG_SND_HDA_POWER_SAVE */ | 114 | #endif /* CONFIG_PM */ |
115 | 115 | ||
116 | TRACE_EVENT(hda_unsol_event, | 116 | TRACE_EVENT(hda_unsol_event, |
117 | 117 | ||
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 21218853366d..1a82cce4b551 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -85,7 +85,7 @@ struct ad198x_spec { | |||
85 | unsigned int analog_beep: 1; /* analog beep input present */ | 85 | unsigned int analog_beep: 1; /* analog beep input present */ |
86 | unsigned int avoid_init_slave_vol:1; | 86 | unsigned int avoid_init_slave_vol:1; |
87 | 87 | ||
88 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 88 | #ifdef CONFIG_PM |
89 | struct hda_loopback_check loopback; | 89 | struct hda_loopback_check loopback; |
90 | #endif | 90 | #endif |
91 | /* for virtual master */ | 91 | /* for virtual master */ |
@@ -269,7 +269,7 @@ static int ad198x_build_controls(struct hda_codec *codec) | |||
269 | return 0; | 269 | return 0; |
270 | } | 270 | } |
271 | 271 | ||
272 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 272 | #ifdef CONFIG_PM |
273 | static int ad198x_check_power_status(struct hda_codec *codec, hda_nid_t nid) | 273 | static int ad198x_check_power_status(struct hda_codec *codec, hda_nid_t nid) |
274 | { | 274 | { |
275 | struct ad198x_spec *spec = codec->spec; | 275 | struct ad198x_spec *spec = codec->spec; |
@@ -654,10 +654,8 @@ static const struct hda_codec_ops ad198x_patch_ops = { | |||
654 | .build_pcms = ad198x_build_pcms, | 654 | .build_pcms = ad198x_build_pcms, |
655 | .init = ad198x_init, | 655 | .init = ad198x_init, |
656 | .free = ad198x_free, | 656 | .free = ad198x_free, |
657 | #ifdef CONFIG_SND_HDA_POWER_SAVE | ||
658 | .check_power_status = ad198x_check_power_status, | ||
659 | #endif | ||
660 | #ifdef CONFIG_PM | 657 | #ifdef CONFIG_PM |
658 | .check_power_status = ad198x_check_power_status, | ||
661 | .suspend = ad198x_suspend, | 659 | .suspend = ad198x_suspend, |
662 | #endif | 660 | #endif |
663 | .reboot_notify = ad198x_shutup, | 661 | .reboot_notify = ad198x_shutup, |
@@ -1231,7 +1229,7 @@ static const struct snd_pci_quirk ad1986a_cfg_tbl[] = { | |||
1231 | {} | 1229 | {} |
1232 | }; | 1230 | }; |
1233 | 1231 | ||
1234 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1232 | #ifdef CONFIG_PM |
1235 | static const struct hda_amp_list ad1986a_loopbacks[] = { | 1233 | static const struct hda_amp_list ad1986a_loopbacks[] = { |
1236 | { 0x13, HDA_OUTPUT, 0 }, /* Mic */ | 1234 | { 0x13, HDA_OUTPUT, 0 }, /* Mic */ |
1237 | { 0x14, HDA_OUTPUT, 0 }, /* Phone */ | 1235 | { 0x14, HDA_OUTPUT, 0 }, /* Phone */ |
@@ -1278,7 +1276,7 @@ static int patch_ad1986a(struct hda_codec *codec) | |||
1278 | spec->mixers[0] = ad1986a_mixers; | 1276 | spec->mixers[0] = ad1986a_mixers; |
1279 | spec->num_init_verbs = 1; | 1277 | spec->num_init_verbs = 1; |
1280 | spec->init_verbs[0] = ad1986a_init_verbs; | 1278 | spec->init_verbs[0] = ad1986a_init_verbs; |
1281 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1279 | #ifdef CONFIG_PM |
1282 | spec->loopback.amplist = ad1986a_loopbacks; | 1280 | spec->loopback.amplist = ad1986a_loopbacks; |
1283 | #endif | 1281 | #endif |
1284 | spec->vmaster_nid = 0x1b; | 1282 | spec->vmaster_nid = 0x1b; |
@@ -1537,7 +1535,7 @@ static const struct hda_verb ad1983_init_verbs[] = { | |||
1537 | { } /* end */ | 1535 | { } /* end */ |
1538 | }; | 1536 | }; |
1539 | 1537 | ||
1540 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1538 | #ifdef CONFIG_PM |
1541 | static const struct hda_amp_list ad1983_loopbacks[] = { | 1539 | static const struct hda_amp_list ad1983_loopbacks[] = { |
1542 | { 0x12, HDA_OUTPUT, 0 }, /* Mic */ | 1540 | { 0x12, HDA_OUTPUT, 0 }, /* Mic */ |
1543 | { 0x13, HDA_OUTPUT, 0 }, /* Line */ | 1541 | { 0x13, HDA_OUTPUT, 0 }, /* Line */ |
@@ -1576,7 +1574,7 @@ static int patch_ad1983(struct hda_codec *codec) | |||
1576 | spec->num_init_verbs = 1; | 1574 | spec->num_init_verbs = 1; |
1577 | spec->init_verbs[0] = ad1983_init_verbs; | 1575 | spec->init_verbs[0] = ad1983_init_verbs; |
1578 | spec->spdif_route = 0; | 1576 | spec->spdif_route = 0; |
1579 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1577 | #ifdef CONFIG_PM |
1580 | spec->loopback.amplist = ad1983_loopbacks; | 1578 | spec->loopback.amplist = ad1983_loopbacks; |
1581 | #endif | 1579 | #endif |
1582 | spec->vmaster_nid = 0x05; | 1580 | spec->vmaster_nid = 0x05; |
@@ -1704,7 +1702,7 @@ static const struct hda_verb ad1981_init_verbs[] = { | |||
1704 | { } /* end */ | 1702 | { } /* end */ |
1705 | }; | 1703 | }; |
1706 | 1704 | ||
1707 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1705 | #ifdef CONFIG_PM |
1708 | static const struct hda_amp_list ad1981_loopbacks[] = { | 1706 | static const struct hda_amp_list ad1981_loopbacks[] = { |
1709 | { 0x12, HDA_OUTPUT, 0 }, /* Front Mic */ | 1707 | { 0x12, HDA_OUTPUT, 0 }, /* Front Mic */ |
1710 | { 0x13, HDA_OUTPUT, 0 }, /* Line */ | 1708 | { 0x13, HDA_OUTPUT, 0 }, /* Line */ |
@@ -1982,7 +1980,7 @@ static int patch_ad1981(struct hda_codec *codec) | |||
1982 | spec->num_init_verbs = 1; | 1980 | spec->num_init_verbs = 1; |
1983 | spec->init_verbs[0] = ad1981_init_verbs; | 1981 | spec->init_verbs[0] = ad1981_init_verbs; |
1984 | spec->spdif_route = 0; | 1982 | spec->spdif_route = 0; |
1985 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1983 | #ifdef CONFIG_PM |
1986 | spec->loopback.amplist = ad1981_loopbacks; | 1984 | spec->loopback.amplist = ad1981_loopbacks; |
1987 | #endif | 1985 | #endif |
1988 | spec->vmaster_nid = 0x05; | 1986 | spec->vmaster_nid = 0x05; |
@@ -2807,7 +2805,7 @@ static void ad1988_laptop_unsol_event(struct hda_codec *codec, unsigned int res) | |||
2807 | snd_hda_sequence_write(codec, ad1988_laptop_hp_off); | 2805 | snd_hda_sequence_write(codec, ad1988_laptop_hp_off); |
2808 | } | 2806 | } |
2809 | 2807 | ||
2810 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 2808 | #ifdef CONFIG_PM |
2811 | static const struct hda_amp_list ad1988_loopbacks[] = { | 2809 | static const struct hda_amp_list ad1988_loopbacks[] = { |
2812 | { 0x20, HDA_INPUT, 0 }, /* Front Mic */ | 2810 | { 0x20, HDA_INPUT, 0 }, /* Front Mic */ |
2813 | { 0x20, HDA_INPUT, 1 }, /* Line */ | 2811 | { 0x20, HDA_INPUT, 1 }, /* Line */ |
@@ -3399,7 +3397,7 @@ static int patch_ad1988(struct hda_codec *codec) | |||
3399 | codec->patch_ops.unsol_event = ad1988_laptop_unsol_event; | 3397 | codec->patch_ops.unsol_event = ad1988_laptop_unsol_event; |
3400 | break; | 3398 | break; |
3401 | } | 3399 | } |
3402 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 3400 | #ifdef CONFIG_PM |
3403 | spec->loopback.amplist = ad1988_loopbacks; | 3401 | spec->loopback.amplist = ad1988_loopbacks; |
3404 | #endif | 3402 | #endif |
3405 | spec->vmaster_nid = 0x04; | 3403 | spec->vmaster_nid = 0x04; |
@@ -3555,7 +3553,7 @@ static const struct hda_verb ad1884_init_verbs[] = { | |||
3555 | { } /* end */ | 3553 | { } /* end */ |
3556 | }; | 3554 | }; |
3557 | 3555 | ||
3558 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 3556 | #ifdef CONFIG_PM |
3559 | static const struct hda_amp_list ad1884_loopbacks[] = { | 3557 | static const struct hda_amp_list ad1884_loopbacks[] = { |
3560 | { 0x20, HDA_INPUT, 0 }, /* Front Mic */ | 3558 | { 0x20, HDA_INPUT, 0 }, /* Front Mic */ |
3561 | { 0x20, HDA_INPUT, 1 }, /* Mic */ | 3559 | { 0x20, HDA_INPUT, 1 }, /* Mic */ |
@@ -3602,7 +3600,7 @@ static int patch_ad1884(struct hda_codec *codec) | |||
3602 | spec->num_init_verbs = 1; | 3600 | spec->num_init_verbs = 1; |
3603 | spec->init_verbs[0] = ad1884_init_verbs; | 3601 | spec->init_verbs[0] = ad1884_init_verbs; |
3604 | spec->spdif_route = 0; | 3602 | spec->spdif_route = 0; |
3605 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 3603 | #ifdef CONFIG_PM |
3606 | spec->loopback.amplist = ad1884_loopbacks; | 3604 | spec->loopback.amplist = ad1884_loopbacks; |
3607 | #endif | 3605 | #endif |
3608 | spec->vmaster_nid = 0x04; | 3606 | spec->vmaster_nid = 0x04; |
@@ -3994,7 +3992,7 @@ static const struct hda_verb ad1884a_init_verbs[] = { | |||
3994 | { } /* end */ | 3992 | { } /* end */ |
3995 | }; | 3993 | }; |
3996 | 3994 | ||
3997 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 3995 | #ifdef CONFIG_PM |
3998 | static const struct hda_amp_list ad1884a_loopbacks[] = { | 3996 | static const struct hda_amp_list ad1884a_loopbacks[] = { |
3999 | { 0x20, HDA_INPUT, 0 }, /* Front Mic */ | 3997 | { 0x20, HDA_INPUT, 0 }, /* Front Mic */ |
4000 | { 0x20, HDA_INPUT, 1 }, /* Mic */ | 3998 | { 0x20, HDA_INPUT, 1 }, /* Mic */ |
@@ -4602,7 +4600,7 @@ static int patch_ad1884a(struct hda_codec *codec) | |||
4602 | spec->num_init_verbs = 1; | 4600 | spec->num_init_verbs = 1; |
4603 | spec->init_verbs[0] = ad1884a_init_verbs; | 4601 | spec->init_verbs[0] = ad1884a_init_verbs; |
4604 | spec->spdif_route = 0; | 4602 | spec->spdif_route = 0; |
4605 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 4603 | #ifdef CONFIG_PM |
4606 | spec->loopback.amplist = ad1884a_loopbacks; | 4604 | spec->loopback.amplist = ad1884a_loopbacks; |
4607 | #endif | 4605 | #endif |
4608 | codec->patch_ops = ad198x_patch_ops; | 4606 | codec->patch_ops = ad198x_patch_ops; |
@@ -4959,7 +4957,7 @@ static const struct hda_verb ad1882_3stack_automute_verbs[] = { | |||
4959 | { } /* end */ | 4957 | { } /* end */ |
4960 | }; | 4958 | }; |
4961 | 4959 | ||
4962 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 4960 | #ifdef CONFIG_PM |
4963 | static const struct hda_amp_list ad1882_loopbacks[] = { | 4961 | static const struct hda_amp_list ad1882_loopbacks[] = { |
4964 | { 0x20, HDA_INPUT, 0 }, /* Front Mic */ | 4962 | { 0x20, HDA_INPUT, 0 }, /* Front Mic */ |
4965 | { 0x20, HDA_INPUT, 1 }, /* Mic */ | 4963 | { 0x20, HDA_INPUT, 1 }, /* Mic */ |
@@ -5022,7 +5020,7 @@ static int patch_ad1882(struct hda_codec *codec) | |||
5022 | spec->num_init_verbs = 1; | 5020 | spec->num_init_verbs = 1; |
5023 | spec->init_verbs[0] = ad1882_init_verbs; | 5021 | spec->init_verbs[0] = ad1882_init_verbs; |
5024 | spec->spdif_route = 0; | 5022 | spec->spdif_route = 0; |
5025 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 5023 | #ifdef CONFIG_PM |
5026 | spec->loopback.amplist = ad1882_loopbacks; | 5024 | spec->loopback.amplist = ad1882_loopbacks; |
5027 | #endif | 5025 | #endif |
5028 | spec->vmaster_nid = 0x04; | 5026 | spec->vmaster_nid = 0x04; |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 172895a8add4..7d70210d7623 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -553,7 +553,7 @@ static int conexant_build_controls(struct hda_codec *codec) | |||
553 | return 0; | 553 | return 0; |
554 | } | 554 | } |
555 | 555 | ||
556 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 556 | #ifdef CONFIG_PM |
557 | static int conexant_suspend(struct hda_codec *codec) | 557 | static int conexant_suspend(struct hda_codec *codec) |
558 | { | 558 | { |
559 | snd_hda_shutup_pins(codec); | 559 | snd_hda_shutup_pins(codec); |
@@ -567,7 +567,7 @@ static const struct hda_codec_ops conexant_patch_ops = { | |||
567 | .init = conexant_init, | 567 | .init = conexant_init, |
568 | .free = conexant_free, | 568 | .free = conexant_free, |
569 | .set_power_state = conexant_set_power, | 569 | .set_power_state = conexant_set_power, |
570 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 570 | #ifdef CONFIG_PM |
571 | .suspend = conexant_suspend, | 571 | .suspend = conexant_suspend, |
572 | #endif | 572 | #endif |
573 | .reboot_notify = snd_hda_shutup_pins, | 573 | .reboot_notify = snd_hda_shutup_pins, |
@@ -4395,7 +4395,7 @@ static const struct hda_codec_ops cx_auto_patch_ops = { | |||
4395 | .init = cx_auto_init, | 4395 | .init = cx_auto_init, |
4396 | .free = conexant_free, | 4396 | .free = conexant_free, |
4397 | .unsol_event = cx_auto_unsol_event, | 4397 | .unsol_event = cx_auto_unsol_event, |
4398 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 4398 | #ifdef CONFIG_PM |
4399 | .suspend = conexant_suspend, | 4399 | .suspend = conexant_suspend, |
4400 | #endif | 4400 | #endif |
4401 | .reboot_notify = snd_hda_shutup_pins, | 4401 | .reboot_notify = snd_hda_shutup_pins, |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index d9439c59bb8b..afd6850670e7 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -1115,7 +1115,7 @@ static int hdmi_parse_codec(struct hda_codec *codec) | |||
1115 | * can be lost and presence sense verb will become inaccurate if the | 1115 | * can be lost and presence sense verb will become inaccurate if the |
1116 | * HDA link is powered off at hot plug or hw initialization time. | 1116 | * HDA link is powered off at hot plug or hw initialization time. |
1117 | */ | 1117 | */ |
1118 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1118 | #ifdef CONFIG_PM |
1119 | if (!(snd_hda_param_read(codec, codec->afg, AC_PAR_POWER_STATE) & | 1119 | if (!(snd_hda_param_read(codec, codec->afg, AC_PAR_POWER_STATE) & |
1120 | AC_PWRST_EPSS)) | 1120 | AC_PWRST_EPSS)) |
1121 | codec->bus->power_keep_link_on = 1; | 1121 | codec->bus->power_keep_link_on = 1; |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index ce99cc955326..613499932b2b 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -174,7 +174,7 @@ struct alc_spec { | |||
174 | 174 | ||
175 | /* hooks */ | 175 | /* hooks */ |
176 | void (*init_hook)(struct hda_codec *codec); | 176 | void (*init_hook)(struct hda_codec *codec); |
177 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 177 | #ifdef CONFIG_PM |
178 | void (*power_hook)(struct hda_codec *codec); | 178 | void (*power_hook)(struct hda_codec *codec); |
179 | #endif | 179 | #endif |
180 | void (*shutup)(struct hda_codec *codec); | 180 | void (*shutup)(struct hda_codec *codec); |
@@ -215,7 +215,7 @@ struct alc_spec { | |||
215 | /* for virtual master */ | 215 | /* for virtual master */ |
216 | hda_nid_t vmaster_nid; | 216 | hda_nid_t vmaster_nid; |
217 | struct hda_vmaster_mute_hook vmaster_mute; | 217 | struct hda_vmaster_mute_hook vmaster_mute; |
218 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 218 | #ifdef CONFIG_PM |
219 | struct hda_loopback_check loopback; | 219 | struct hda_loopback_check loopback; |
220 | int num_loopbacks; | 220 | int num_loopbacks; |
221 | struct hda_amp_list loopback_list[8]; | 221 | struct hda_amp_list loopback_list[8]; |
@@ -2057,7 +2057,7 @@ static int alc_init(struct hda_codec *codec) | |||
2057 | return 0; | 2057 | return 0; |
2058 | } | 2058 | } |
2059 | 2059 | ||
2060 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 2060 | #ifdef CONFIG_PM |
2061 | static int alc_check_power_status(struct hda_codec *codec, hda_nid_t nid) | 2061 | static int alc_check_power_status(struct hda_codec *codec, hda_nid_t nid) |
2062 | { | 2062 | { |
2063 | struct alc_spec *spec = codec->spec; | 2063 | struct alc_spec *spec = codec->spec; |
@@ -2435,7 +2435,7 @@ static void alc_free(struct hda_codec *codec) | |||
2435 | snd_hda_detach_beep_device(codec); | 2435 | snd_hda_detach_beep_device(codec); |
2436 | } | 2436 | } |
2437 | 2437 | ||
2438 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 2438 | #ifdef CONFIG_PM |
2439 | static void alc_power_eapd(struct hda_codec *codec) | 2439 | static void alc_power_eapd(struct hda_codec *codec) |
2440 | { | 2440 | { |
2441 | alc_auto_setup_eapd(codec, false); | 2441 | alc_auto_setup_eapd(codec, false); |
@@ -2475,7 +2475,7 @@ static const struct hda_codec_ops alc_patch_ops = { | |||
2475 | #ifdef CONFIG_PM | 2475 | #ifdef CONFIG_PM |
2476 | .resume = alc_resume, | 2476 | .resume = alc_resume, |
2477 | #endif | 2477 | #endif |
2478 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 2478 | #ifdef CONFIG_PM |
2479 | .suspend = alc_suspend, | 2479 | .suspend = alc_suspend, |
2480 | .check_power_status = alc_check_power_status, | 2480 | .check_power_status = alc_check_power_status, |
2481 | #endif | 2481 | #endif |
@@ -2631,7 +2631,7 @@ static const char *alc_get_line_out_pfx(struct alc_spec *spec, int ch, | |||
2631 | return channel_name[ch]; | 2631 | return channel_name[ch]; |
2632 | } | 2632 | } |
2633 | 2633 | ||
2634 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 2634 | #ifdef CONFIG_PM |
2635 | /* add the powersave loopback-list entry */ | 2635 | /* add the powersave loopback-list entry */ |
2636 | static void add_loopback_list(struct alc_spec *spec, hda_nid_t mix, int idx) | 2636 | static void add_loopback_list(struct alc_spec *spec, hda_nid_t mix, int idx) |
2637 | { | 2637 | { |
@@ -6501,7 +6501,7 @@ static int patch_alc861(struct hda_codec *codec) | |||
6501 | } | 6501 | } |
6502 | 6502 | ||
6503 | codec->patch_ops = alc_patch_ops; | 6503 | codec->patch_ops = alc_patch_ops; |
6504 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 6504 | #ifdef CONFIG_PM |
6505 | spec->power_hook = alc_power_eapd; | 6505 | spec->power_hook = alc_power_eapd; |
6506 | #endif | 6506 | #endif |
6507 | 6507 | ||
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 4b0796b30f78..d5f36a179eb5 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -1764,7 +1764,7 @@ static int via_suspend(struct hda_codec *codec) | |||
1764 | } | 1764 | } |
1765 | #endif | 1765 | #endif |
1766 | 1766 | ||
1767 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1767 | #ifdef CONFIG_PM |
1768 | static int via_check_power_status(struct hda_codec *codec, hda_nid_t nid) | 1768 | static int via_check_power_status(struct hda_codec *codec, hda_nid_t nid) |
1769 | { | 1769 | { |
1770 | struct via_spec *spec = codec->spec; | 1770 | struct via_spec *spec = codec->spec; |
@@ -1785,8 +1785,6 @@ static const struct hda_codec_ops via_patch_ops = { | |||
1785 | .unsol_event = via_unsol_event, | 1785 | .unsol_event = via_unsol_event, |
1786 | #ifdef CONFIG_PM | 1786 | #ifdef CONFIG_PM |
1787 | .suspend = via_suspend, | 1787 | .suspend = via_suspend, |
1788 | #endif | ||
1789 | #ifdef CONFIG_SND_HDA_POWER_SAVE | ||
1790 | .check_power_status = via_check_power_status, | 1788 | .check_power_status = via_check_power_status, |
1791 | #endif | 1789 | #endif |
1792 | }; | 1790 | }; |