Commit 83012a7c authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarTakashi Iwai <tiwai@suse.de>
parent 432c641e
...@@ -228,17 +228,9 @@ config SND_HDA_GENERIC ...@@ -228,17 +228,9 @@ config SND_HDA_GENERIC
Say Y here to enable the generic HD-audio codec parser Say Y here to enable the generic HD-audio codec parser
in snd-hda-intel driver. in snd-hda-intel driver.
config SND_HDA_POWER_SAVE
bool "Aggressive power-saving on HD-audio"
depends on PM
help
Say Y here to enable more aggressive power-saving mode on
HD-audio driver. The power-saving timeout can be configured
via power_save option or over sysfs on-the-fly.
config SND_HDA_POWER_SAVE_DEFAULT config SND_HDA_POWER_SAVE_DEFAULT
int "Default time-out for HD-audio power-save mode" int "Default time-out for HD-audio power-save mode"
depends on SND_HDA_POWER_SAVE depends on PM
default 0 default 0
help help
The default time-out value in seconds for HD-audio automatic The default time-out value in seconds for HD-audio automatic
......
...@@ -94,7 +94,7 @@ int snd_hda_delete_codec_preset(struct hda_codec_preset_list *preset) ...@@ -94,7 +94,7 @@ int snd_hda_delete_codec_preset(struct hda_codec_preset_list *preset)
} }
EXPORT_SYMBOL_HDA(snd_hda_delete_codec_preset); EXPORT_SYMBOL_HDA(snd_hda_delete_codec_preset);
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static void hda_power_work(struct work_struct *work); static void hda_power_work(struct work_struct *work);
static void hda_keep_power_on(struct hda_codec *codec); static void hda_keep_power_on(struct hda_codec *codec);
#define hda_codec_is_power_on(codec) ((codec)->power_on) #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,7 +1192,7 @@ static void snd_hda_codec_free(struct hda_codec *codec)
return; return;
snd_hda_jack_tbl_clear(codec); snd_hda_jack_tbl_clear(codec);
restore_init_pincfgs(codec); restore_init_pincfgs(codec);
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
cancel_delayed_work(&codec->power_work); cancel_delayed_work(&codec->power_work);
flush_workqueue(codec->bus->workq); flush_workqueue(codec->bus->workq);
#endif #endif
...@@ -1205,7 +1205,7 @@ static void snd_hda_codec_free(struct hda_codec *codec) ...@@ -1205,7 +1205,7 @@ static void snd_hda_codec_free(struct hda_codec *codec)
codec->bus->caddr_tbl[codec->addr] = NULL; codec->bus->caddr_tbl[codec->addr] = NULL;
if (codec->patch_ops.free) if (codec->patch_ops.free)
codec->patch_ops.free(codec); codec->patch_ops.free(codec);
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
if (codec->power_on) if (codec->power_on)
hda_call_pm_notify(codec->bus, false); hda_call_pm_notify(codec->bus, false);
#endif #endif
...@@ -1273,7 +1273,7 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, ...@@ -1273,7 +1273,7 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus,
snd_array_init(&codec->conn_lists, sizeof(hda_nid_t), 64); snd_array_init(&codec->conn_lists, sizeof(hda_nid_t), 64);
snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16); snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16);
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
spin_lock_init(&codec->power_lock); spin_lock_init(&codec->power_lock);
INIT_DELAYED_WORK(&codec->power_work, hda_power_work); INIT_DELAYED_WORK(&codec->power_work, hda_power_work);
/* snd_hda_codec_new() marks the codec as power-up, and leave it as is. /* 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,7 +1331,7 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus,
AC_VERB_GET_SUBSYSTEM_ID, 0); AC_VERB_GET_SUBSYSTEM_ID, 0);
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
codec->d3_stop_clk = snd_hda_codec_get_supported_ps(codec, codec->d3_stop_clk = snd_hda_codec_get_supported_ps(codec,
codec->afg ? codec->afg : codec->mfg, codec->afg ? codec->afg : codec->mfg,
AC_PWRST_CLKSTOP); AC_PWRST_CLKSTOP);
...@@ -2353,7 +2353,7 @@ int snd_hda_codec_reset(struct hda_codec *codec) ...@@ -2353,7 +2353,7 @@ int snd_hda_codec_reset(struct hda_codec *codec)
/* OK, let it free */ /* OK, let it free */
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
cancel_delayed_work_sync(&codec->power_work); cancel_delayed_work_sync(&codec->power_work);
codec->power_on = 0; codec->power_on = 0;
codec->power_transition = 0; codec->power_transition = 0;
...@@ -3572,7 +3572,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, ...@@ -3572,7 +3572,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
int count; int count;
unsigned int state; unsigned int state;
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
codec->d3_stop_clk_ok = 0; codec->d3_stop_clk_ok = 0;
#endif #endif
...@@ -3599,7 +3599,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, ...@@ -3599,7 +3599,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
break; break;
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
if (!codec->bus->power_keep_link_on && power_state == AC_PWRST_D3 if (!codec->bus->power_keep_link_on && power_state == AC_PWRST_D3
&& codec->d3_stop_clk && (state & AC_PWRST_CLK_STOP_OK)) && codec->d3_stop_clk && (state & AC_PWRST_CLK_STOP_OK))
codec->d3_stop_clk_ok = 1; codec->d3_stop_clk_ok = 1;
...@@ -3629,7 +3629,6 @@ static void hda_call_codec_suspend(struct hda_codec *codec) ...@@ -3629,7 +3629,6 @@ static void hda_call_codec_suspend(struct hda_codec *codec)
hda_set_power_state(codec, hda_set_power_state(codec,
codec->afg ? codec->afg : codec->mfg, codec->afg ? codec->afg : codec->mfg,
AC_PWRST_D3); AC_PWRST_D3);
#ifdef CONFIG_SND_HDA_POWER_SAVE
cancel_delayed_work(&codec->power_work); cancel_delayed_work(&codec->power_work);
spin_lock(&codec->power_lock); spin_lock(&codec->power_lock);
snd_hda_update_power_acct(codec); snd_hda_update_power_acct(codec);
...@@ -3638,7 +3637,6 @@ static void hda_call_codec_suspend(struct hda_codec *codec) ...@@ -3638,7 +3637,6 @@ static void hda_call_codec_suspend(struct hda_codec *codec)
codec->power_transition = 0; codec->power_transition = 0;
codec->power_jiffies = jiffies; codec->power_jiffies = jiffies;
spin_unlock(&codec->power_lock); spin_unlock(&codec->power_lock);
#endif
} }
/* /*
...@@ -4434,7 +4432,7 @@ int snd_hda_add_new_ctls(struct hda_codec *codec, ...@@ -4434,7 +4432,7 @@ int snd_hda_add_new_ctls(struct hda_codec *codec,
} }
EXPORT_SYMBOL_HDA(snd_hda_add_new_ctls); EXPORT_SYMBOL_HDA(snd_hda_add_new_ctls);
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static void hda_power_work(struct work_struct *work) static void hda_power_work(struct work_struct *work)
{ {
struct hda_codec *codec = struct hda_codec *codec =
...@@ -5107,9 +5105,6 @@ EXPORT_SYMBOL_HDA(snd_hda_suspend); ...@@ -5107,9 +5105,6 @@ EXPORT_SYMBOL_HDA(snd_hda_suspend);
* @bus: the HDA bus * @bus: the HDA bus
* *
* Returns 0 if successful. * Returns 0 if successful.
*
* This function is defined only when POWER_SAVE isn't set.
* In the power-save mode, the codec is resumed dynamically.
*/ */
int snd_hda_resume(struct hda_bus *bus) int snd_hda_resume(struct hda_bus *bus)
{ {
......
...@@ -614,7 +614,7 @@ struct hda_bus_ops { ...@@ -614,7 +614,7 @@ struct hda_bus_ops {
struct hda_pcm *pcm); struct hda_pcm *pcm);
/* reset bus for retry verb */ /* reset bus for retry verb */
void (*bus_reset)(struct hda_bus *bus); void (*bus_reset)(struct hda_bus *bus);
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
/* notify power-up/down from codec to controller */ /* notify power-up/down from codec to controller */
void (*pm_notify)(struct hda_bus *bus, bool power_up); void (*pm_notify)(struct hda_bus *bus, bool power_up);
#endif #endif
...@@ -712,8 +712,6 @@ struct hda_codec_ops { ...@@ -712,8 +712,6 @@ struct hda_codec_ops {
#ifdef CONFIG_PM #ifdef CONFIG_PM
int (*suspend)(struct hda_codec *codec); int (*suspend)(struct hda_codec *codec);
int (*resume)(struct hda_codec *codec); int (*resume)(struct hda_codec *codec);
#endif
#ifdef CONFIG_SND_HDA_POWER_SAVE
int (*check_power_status)(struct hda_codec *codec, hda_nid_t nid); int (*check_power_status)(struct hda_codec *codec, hda_nid_t nid);
#endif #endif
void (*reboot_notify)(struct hda_codec *codec); void (*reboot_notify)(struct hda_codec *codec);
...@@ -867,7 +865,7 @@ struct hda_codec { ...@@ -867,7 +865,7 @@ struct hda_codec {
unsigned int no_jack_detect:1; /* Machine has no jack-detection */ unsigned int no_jack_detect:1; /* Machine has no jack-detection */
unsigned int pcm_format_first:1; /* PCM format must be set first */ unsigned int pcm_format_first:1; /* PCM format must be set first */
unsigned int epss:1; /* supporting EPSS? */ unsigned int epss:1; /* supporting EPSS? */
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
unsigned int power_on :1; /* current (global) power-state */ unsigned int power_on :1; /* current (global) power-state */
int power_transition; /* power-state in transition */ int power_transition; /* power-state in transition */
int power_count; /* current (global) power refcount */ int power_count; /* current (global) power refcount */
...@@ -1049,7 +1047,7 @@ int snd_hda_resume(struct hda_bus *bus); ...@@ -1049,7 +1047,7 @@ int snd_hda_resume(struct hda_bus *bus);
static inline static inline
int hda_call_check_power_status(struct hda_codec *codec, hda_nid_t nid) int hda_call_check_power_status(struct hda_codec *codec, hda_nid_t nid)
{ {
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
if (codec->patch_ops.check_power_status) if (codec->patch_ops.check_power_status)
return codec->patch_ops.check_power_status(codec, nid); return codec->patch_ops.check_power_status(codec, nid);
#endif #endif
...@@ -1066,7 +1064,7 @@ const char *snd_hda_get_jack_location(u32 cfg); ...@@ -1066,7 +1064,7 @@ const char *snd_hda_get_jack_location(u32 cfg);
/* /*
* power saving * power saving
*/ */
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
void snd_hda_power_save(struct hda_codec *codec, int delta, bool d3wait); void snd_hda_power_save(struct hda_codec *codec, int delta, bool d3wait);
void snd_hda_update_power_acct(struct hda_codec *codec); void snd_hda_update_power_acct(struct hda_codec *codec);
#else #else
......
...@@ -70,7 +70,7 @@ struct hda_gspec { ...@@ -70,7 +70,7 @@ struct hda_gspec {
struct list_head nid_list; /* list of widgets */ struct list_head nid_list; /* list of widgets */
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
#define MAX_LOOPBACK_AMPS 7 #define MAX_LOOPBACK_AMPS 7
struct hda_loopback_check loopback; struct hda_loopback_check loopback;
int num_loopbacks; int num_loopbacks;
...@@ -654,7 +654,7 @@ static int parse_input(struct hda_codec *codec) ...@@ -654,7 +654,7 @@ static int parse_input(struct hda_codec *codec)
return 0; return 0;
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static void add_input_loopback(struct hda_codec *codec, hda_nid_t nid, static void add_input_loopback(struct hda_codec *codec, hda_nid_t nid,
int dir, int idx) int dir, int idx)
{ {
...@@ -1028,7 +1028,7 @@ static int build_generic_pcms(struct hda_codec *codec) ...@@ -1028,7 +1028,7 @@ static int build_generic_pcms(struct hda_codec *codec)
return 0; return 0;
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static int generic_check_power_status(struct hda_codec *codec, hda_nid_t nid) static int generic_check_power_status(struct hda_codec *codec, hda_nid_t nid)
{ {
struct hda_gspec *spec = codec->spec; struct hda_gspec *spec = codec->spec;
...@@ -1043,7 +1043,7 @@ static struct hda_codec_ops generic_patch_ops = { ...@@ -1043,7 +1043,7 @@ static struct hda_codec_ops generic_patch_ops = {
.build_controls = build_generic_controls, .build_controls = build_generic_controls,
.build_pcms = build_generic_pcms, .build_pcms = build_generic_pcms,
.free = snd_hda_generic_free, .free = snd_hda_generic_free,
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
.check_power_status = generic_check_power_status, .check_power_status = generic_check_power_status,
#endif #endif
}; };
......
...@@ -155,7 +155,7 @@ int /*__devinit*/ snd_hda_create_hwdep(struct hda_codec *codec) ...@@ -155,7 +155,7 @@ int /*__devinit*/ snd_hda_create_hwdep(struct hda_codec *codec)
return 0; return 0;
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static ssize_t power_on_acct_show(struct device *dev, static ssize_t power_on_acct_show(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
...@@ -191,7 +191,7 @@ int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec) ...@@ -191,7 +191,7 @@ int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec)
hwdep->device, &power_attrs[i]); hwdep->device, &power_attrs[i]);
return 0; return 0;
} }
#endif /* CONFIG_SND_HDA_POWER_SAVE */ #endif /* CONFIG_PM */
#ifdef CONFIG_SND_HDA_RECONFIG #ifdef CONFIG_SND_HDA_RECONFIG
......
...@@ -110,7 +110,7 @@ MODULE_PARM_DESC(beep_mode, "Select HDA Beep registration mode " ...@@ -110,7 +110,7 @@ MODULE_PARM_DESC(beep_mode, "Select HDA Beep registration mode "
"(0=off, 1=on) (default=1)."); "(0=off, 1=on) (default=1).");
#endif #endif
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static int param_set_xint(const char *val, const struct kernel_param *kp); static int param_set_xint(const char *val, const struct kernel_param *kp);
static struct kernel_param_ops param_ops_xint = { static struct kernel_param_ops param_ops_xint = {
.set = param_set_xint, .set = param_set_xint,
...@@ -130,7 +130,7 @@ MODULE_PARM_DESC(power_save, "Automatic power-saving timeout " ...@@ -130,7 +130,7 @@ MODULE_PARM_DESC(power_save, "Automatic power-saving timeout "
static bool power_save_controller = 1; static bool power_save_controller = 1;
module_param(power_save_controller, bool, 0644); module_param(power_save_controller, bool, 0644);
MODULE_PARM_DESC(power_save_controller, "Reset controller in power save mode."); MODULE_PARM_DESC(power_save_controller, "Reset controller in power save mode.");
#endif #endif /* CONFIG_PM */
static int align_buffer_size = -1; static int align_buffer_size = -1;
module_param(align_buffer_size, bint, 0644); module_param(align_buffer_size, bint, 0644);
...@@ -1032,7 +1032,7 @@ static unsigned int azx_get_response(struct hda_bus *bus, ...@@ -1032,7 +1032,7 @@ static unsigned int azx_get_response(struct hda_bus *bus,
return azx_rirb_get_response(bus, addr); return azx_rirb_get_response(bus, addr);
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static void azx_power_notify(struct hda_bus *bus, bool power_up); static void azx_power_notify(struct hda_bus *bus, bool power_up);
#endif #endif
...@@ -1605,7 +1605,7 @@ static int DELAYED_INIT_MARK azx_codec_create(struct azx *chip, const char *mode ...@@ -1605,7 +1605,7 @@ static int DELAYED_INIT_MARK azx_codec_create(struct azx *chip, const char *mode
bus_temp.ops.get_response = azx_get_response; bus_temp.ops.get_response = azx_get_response;
bus_temp.ops.attach_pcm = azx_attach_pcm_stream; bus_temp.ops.attach_pcm = azx_attach_pcm_stream;
bus_temp.ops.bus_reset = azx_bus_reset; bus_temp.ops.bus_reset = azx_bus_reset;
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
bus_temp.power_save = &power_save; bus_temp.power_save = &power_save;
bus_temp.ops.pm_notify = azx_power_notify; bus_temp.ops.pm_notify = azx_power_notify;
#endif #endif
...@@ -2404,7 +2404,7 @@ static void azx_stop_chip(struct azx *chip) ...@@ -2404,7 +2404,7 @@ static void azx_stop_chip(struct azx *chip)
chip->initialized = 0; chip->initialized = 0;
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
/* power-up/down the controller */ /* power-up/down the controller */
static void azx_power_notify(struct hda_bus *bus, bool power_up) static void azx_power_notify(struct hda_bus *bus, bool power_up)
{ {
...@@ -2457,7 +2457,7 @@ static int param_set_xint(const char *val, const struct kernel_param *kp) ...@@ -2457,7 +2457,7 @@ static int param_set_xint(const char *val, const struct kernel_param *kp)
#else #else
#define azx_add_card_list(chip) /* NOP */ #define azx_add_card_list(chip) /* NOP */
#define azx_del_card_list(chip) /* NOP */ #define azx_del_card_list(chip) /* NOP */
#endif /* CONFIG_SND_HDA_POWER_SAVE */ #endif /* CONFIG_PM */
#if defined(CONFIG_PM_SLEEP) || defined(SUPPORT_VGA_SWITCHEROO) #if defined(CONFIG_PM_SLEEP) || defined(SUPPORT_VGA_SWITCHEROO)
/* /*
...@@ -2525,10 +2525,8 @@ static int azx_runtime_suspend(struct device *dev) ...@@ -2525,10 +2525,8 @@ static int azx_runtime_suspend(struct device *dev)
struct snd_card *card = dev_get_drvdata(dev); struct snd_card *card = dev_get_drvdata(dev);
struct azx *chip = card->private_data; struct azx *chip = card->private_data;
#ifdef CONFIG_SND_HDA_POWER_SAVE
if (!power_save_controller) if (!power_save_controller)
return -EAGAIN; return -EAGAIN;
#endif
azx_stop_chip(chip); azx_stop_chip(chip);
azx_clear_irq_pending(chip); azx_clear_irq_pending(chip);
...@@ -3232,7 +3230,7 @@ static int DELAYED_INIT_MARK azx_first_init(struct azx *chip) ...@@ -3232,7 +3230,7 @@ static int DELAYED_INIT_MARK azx_first_init(struct azx *chip)
static void power_down_all_codecs(struct azx *chip) static void power_down_all_codecs(struct azx *chip)
{ {
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
/* The codecs were powered up in snd_hda_codec_new(). /* The codecs were powered up in snd_hda_codec_new().
* Now all initialization done, so turn them down if possible * Now all initialization done, so turn them down if possible
*/ */
......
...@@ -529,7 +529,7 @@ int snd_hda_create_hwdep(struct hda_codec *codec); ...@@ -529,7 +529,7 @@ int snd_hda_create_hwdep(struct hda_codec *codec);
static inline int snd_hda_create_hwdep(struct hda_codec *codec) { return 0; } static inline int snd_hda_create_hwdep(struct hda_codec *codec) { return 0; }
#endif #endif
#if defined(CONFIG_SND_HDA_POWER_SAVE) && defined(CONFIG_SND_HDA_HWDEP) #if defined(CONFIG_PM) && defined(CONFIG_SND_HDA_HWDEP)
int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec); int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec);
#else #else
static inline int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec) static inline int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec)
......
...@@ -58,7 +58,7 @@ TRACE_EVENT(hda_bus_reset, ...@@ -58,7 +58,7 @@ TRACE_EVENT(hda_bus_reset,
TP_printk("[%d]", __entry->card) TP_printk("[%d]", __entry->card)
); );
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
DECLARE_EVENT_CLASS(hda_power, DECLARE_EVENT_CLASS(hda_power,
TP_PROTO(struct hda_codec *codec), TP_PROTO(struct hda_codec *codec),
...@@ -111,7 +111,7 @@ TRACE_EVENT(hda_power_count, ...@@ -111,7 +111,7 @@ TRACE_EVENT(hda_power_count,
__entry->card, __entry->addr, __entry->power_count, __entry->card, __entry->addr, __entry->power_count,
__entry->power_on, __entry->power_transition) __entry->power_on, __entry->power_transition)
); );
#endif /* CONFIG_SND_HDA_POWER_SAVE */ #endif /* CONFIG_PM */
TRACE_EVENT(hda_unsol_event, TRACE_EVENT(hda_unsol_event,
......
...@@ -85,7 +85,7 @@ struct ad198x_spec { ...@@ -85,7 +85,7 @@ struct ad198x_spec {
unsigned int analog_beep: 1; /* analog beep input present */ unsigned int analog_beep: 1; /* analog beep input present */
unsigned int avoid_init_slave_vol:1; unsigned int avoid_init_slave_vol:1;
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
struct hda_loopback_check loopback; struct hda_loopback_check loopback;
#endif #endif
/* for virtual master */ /* for virtual master */
...@@ -269,7 +269,7 @@ static int ad198x_build_controls(struct hda_codec *codec) ...@@ -269,7 +269,7 @@ static int ad198x_build_controls(struct hda_codec *codec)
return 0; return 0;
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static int ad198x_check_power_status(struct hda_codec *codec, hda_nid_t nid) static int ad198x_check_power_status(struct hda_codec *codec, hda_nid_t nid)
{ {
struct ad198x_spec *spec = codec->spec; struct ad198x_spec *spec = codec->spec;
...@@ -654,10 +654,8 @@ static const struct hda_codec_ops ad198x_patch_ops = { ...@@ -654,10 +654,8 @@ static const struct hda_codec_ops ad198x_patch_ops = {
.build_pcms = ad198x_build_pcms, .build_pcms = ad198x_build_pcms,
.init = ad198x_init, .init = ad198x_init,
.free = ad198x_free, .free = ad198x_free,
#ifdef CONFIG_SND_HDA_POWER_SAVE
.check_power_status = ad198x_check_power_status,
#endif
#ifdef CONFIG_PM #ifdef CONFIG_PM
.check_power_status = ad198x_check_power_status,
.suspend = ad198x_suspend, .suspend = ad198x_suspend,
#endif #endif
.reboot_notify = ad198x_shutup, .reboot_notify = ad198x_shutup,
...@@ -1231,7 +1229,7 @@ static const struct snd_pci_quirk ad1986a_cfg_tbl[] = { ...@@ -1231,7 +1229,7 @@ static const struct snd_pci_quirk ad1986a_cfg_tbl[] = {
{} {}
}; };
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static const struct hda_amp_list ad1986a_loopbacks[] = { static const struct hda_amp_list ad1986a_loopbacks[] = {
{ 0x13, HDA_OUTPUT, 0 }, /* Mic */ { 0x13, HDA_OUTPUT, 0 }, /* Mic */
{ 0x14, HDA_OUTPUT, 0 }, /* Phone */ { 0x14, HDA_OUTPUT, 0 }, /* Phone */
...@@ -1278,7 +1276,7 @@ static int patch_ad1986a(struct hda_codec *codec) ...@@ -1278,7 +1276,7 @@ static int patch_ad1986a(struct hda_codec *codec)
spec->mixers[0] = ad1986a_mixers; spec->mixers[0] = ad1986a_mixers;
spec->num_init_verbs = 1; spec->num_init_verbs = 1;
spec->init_verbs[0] = ad1986a_init_verbs; spec->init_verbs[0] = ad1986a_init_verbs;
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
spec->loopback.amplist = ad1986a_loopbacks; spec->loopback.amplist = ad1986a_loopbacks;
#endif #endif
spec->vmaster_nid = 0x1b; spec->vmaster_nid = 0x1b;
...@@ -1537,7 +1535,7 @@ static const struct hda_verb ad1983_init_verbs[] = { ...@@ -1537,7 +1535,7 @@ static const struct hda_verb ad1983_init_verbs[] = {
{ } /* end */ { } /* end */
}; };
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static const struct hda_amp_list ad1983_loopbacks[] = { static const struct hda_amp_list ad1983_loopbacks[] = {
{ 0x12, HDA_OUTPUT, 0 }, /* Mic */ { 0x12, HDA_OUTPUT, 0 }, /* Mic */
{ 0x13, HDA_OUTPUT, 0 }, /* Line */ { 0x13, HDA_OUTPUT, 0 }, /* Line */
...@@ -1576,7 +1574,7 @@ static int patch_ad1983(struct hda_codec *codec) ...@@ -1576,7 +1574,7 @@ static int patch_ad1983(struct hda_codec *codec)
spec->num_init_verbs = 1; spec->num_init_verbs = 1;
spec->init_verbs[0] = ad1983_init_verbs; spec->init_verbs[0] = ad1983_init_verbs;
spec->spdif_route = 0; spec->spdif_route = 0;
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
spec->loopback.amplist = ad1983_loopbacks; spec->loopback.amplist = ad1983_loopbacks;
#endif #endif
spec->vmaster_nid = 0x05; spec->vmaster_nid = 0x05;
...@@ -1704,7 +1702,7 @@ static const struct hda_verb ad1981_init_verbs[] = { ...@@ -1704,7 +1702,7 @@ static const struct hda_verb ad1981_init_verbs[] = {
{ } /* end */ { } /* end */
}; };
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static const struct hda_amp_list ad1981_loopbacks[] = { static const struct hda_amp_list ad1981_loopbacks[] = {
{ 0x12, HDA_OUTPUT, 0 }, /* Front Mic */ { 0x12, HDA_OUTPUT, 0 }, /* Front Mic */
{ 0x13, HDA_OUTPUT, 0 }, /* Line */ { 0x13, HDA_OUTPUT, 0 }, /* Line */
...@@ -1982,7 +1980,7 @@ static int patch_ad1981(struct hda_codec *codec) ...@@ -1982,7 +1980,7 @@ static int patch_ad1981(struct hda_codec *codec)
spec->num_init_verbs = 1; spec->num_init_verbs = 1;
spec->init_verbs[0] = ad1981_init_verbs; spec->init_verbs[0] = ad1981_init_verbs;
spec->spdif_route = 0; spec->spdif_route = 0;
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
spec->loopback.amplist = ad1981_loopbacks; spec->loopback.amplist = ad1981_loopbacks;
#endif #endif
spec->vmaster_nid = 0x05; spec->vmaster_nid = 0x05;
...@@ -2807,7 +2805,7 @@ static void ad1988_laptop_unsol_event(struct hda_codec *codec, unsigned int res) ...@@ -2807,7 +2805,7 @@ static void ad1988_laptop_unsol_event(struct hda_codec *codec, unsigned int res)
snd_hda_sequence_write(codec, ad1988_laptop_hp_off); snd_hda_sequence_write(codec, ad1988_laptop_hp_off);
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static const struct hda_amp_list ad1988_loopbacks[] = { static const struct hda_amp_list ad1988_loopbacks[] = {
{ 0x20, HDA_INPUT, 0 }, /* Front Mic */ { 0x20, HDA_INPUT, 0 }, /* Front Mic */
{ 0x20, HDA_INPUT, 1 }, /* Line */ { 0x20, HDA_INPUT, 1 }, /* Line */
...@@ -3399,7 +3397,7 @@ static int patch_ad1988(struct hda_codec *codec) ...@@ -3399,7 +3397,7 @@ static int patch_ad1988(struct hda_codec *codec)
codec->patch_ops.unsol_event = ad1988_laptop_unsol_event; codec->patch_ops.unsol_event = ad1988_laptop_unsol_event;
break; break;
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
spec->loopback.amplist = ad1988_loopbacks; spec->loopback.amplist = ad1988_loopbacks;
#endif #endif
spec->vmaster_nid = 0x04; spec->vmaster_nid = 0x04;
...@@ -3555,7 +3553,7 @@ static const struct hda_verb ad1884_init_verbs[] = { ...@@ -3555,7 +3553,7 @@ static const struct hda_verb ad1884_init_verbs[] = {
{ } /* end */ { } /* end */
}; };
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static const struct hda_amp_list ad1884_loopbacks[] = { static const struct hda_amp_list ad1884_loopbacks[] = {
{ 0x20, HDA_INPUT, 0 }, /* Front Mic */ { 0x20, HDA_INPUT, 0 }, /* Front Mic */
{ 0x20, HDA_INPUT, 1 }, /* Mic */ { 0x20, HDA_INPUT, 1 }, /* Mic */
...@@ -3602,7 +3600,7 @@ static int patch_ad1884(struct hda_codec *codec) ...@@ -3602,7 +3600,7 @@ static int patch_ad1884(struct hda_codec *codec)
spec->num_init_verbs = 1; spec->num_init_verbs = 1;
spec->init_verbs[0] = ad1884_init_verbs; spec->init_verbs[0] = ad1884_init_verbs;
spec->spdif_route = 0; spec->spdif_route = 0;
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
spec->loopback.amplist = ad1884_loopbacks; spec->loopback.amplist = ad1884_loopbacks;
#endif #endif
spec->vmaster_nid = 0x04; spec->vmaster_nid = 0x04;
...@@ -3994,7 +3992,7 @@ static const struct hda_verb ad1884a_init_verbs[] = { ...@@ -3994,7 +3992,7 @@ static const struct hda_verb ad1884a_init_verbs[] = {
{ } /* end */ { } /* end */
}; };
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static const struct hda_amp_list ad1884a_loopbacks[] = { static const struct hda_amp_list ad1884a_loopbacks[] = {
{ 0x20, HDA_INPUT, 0 }, /* Front Mic */ { 0x20, HDA_INPUT, 0 }, /* Front Mic */
{ 0x20, HDA_INPUT, 1 }, /* Mic */ { 0x20, HDA_INPUT, 1 }, /* Mic */
...@@ -4602,7 +4600,7 @@ static int patch_ad1884a(struct hda_codec *codec) ...@@ -4602,7 +4600,7 @@ static int patch_ad1884a(struct hda_codec *codec)
spec->num_init_verbs = 1; spec->num_init_verbs = 1;
spec->init_verbs[0] = ad1884a_init_verbs; spec->init_verbs[0] = ad1884a_init_verbs;
spec->spdif_route = 0; spec->spdif_route = 0;
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
spec->loopback.amplist = ad1884a_loopbacks; spec->loopback.amplist = ad1884a_loopbacks;
#endif #endif
codec->patch_ops = ad198x_patch_ops; codec->patch_ops = ad198x_patch_ops;
...@@ -4959,7 +4957,7 @@ static const struct hda_verb ad1882_3stack_automute_verbs[] = { ...@@ -4959,7 +4957,7 @@ static const struct hda_verb ad1882_3stack_automute_verbs[] = {
{ } /* end */ { } /* end */
}; };
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static const struct hda_amp_list ad1882_loopbacks[] = { static const struct hda_amp_list ad1882_loopbacks[] = {
{ 0x20, HDA_INPUT, 0 }, /* Front Mic */ { 0x20, HDA_INPUT, 0 }, /* Front Mic */
{ 0x20, HDA_INPUT, 1 }, /* Mic */ { 0x20, HDA_INPUT, 1 }, /* Mic */
...@@ -5022,7 +5020,7 @@ static int patch_ad1882(struct hda_codec *codec) ...@@ -5022,7 +5020,7 @@ static int patch_ad1882(struct hda_codec *codec)
spec->num_init_verbs = 1; spec->num_init_verbs = 1;
spec->init_verbs[0] = ad1882_init_verbs; spec->init_verbs[0] = ad1882_init_verbs;
spec->spdif_route = 0; spec->spdif_route = 0;
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
spec->loopback.amplist = ad1882_loopbacks; spec->loopback.amplist = ad1882_loopbacks;
#endif #endif
spec->vmaster_nid = 0x04; spec->vmaster_nid = 0x04;
......
...@@ -553,7 +553,7 @@ static int conexant_build_controls(struct hda_codec *codec) ...@@ -553,7 +553,7 @@ static int conexant_build_controls(struct hda_codec *codec)
return 0; return 0;
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static int conexant_suspend(struct hda_codec *codec) static int conexant_suspend(struct hda_codec *codec)
{ {
snd_hda_shutup_pins(codec); snd_hda_shutup_pins(codec);
...@@ -567,7 +567,7 @@ static const struct hda_codec_ops conexant_patch_ops = { ...@@ -567,7 +567,7 @@ static const struct hda_codec_ops conexant_patch_ops = {
.init = conexant_init, .init = conexant_init,
.free = conexant_free, .free = conexant_free,
.set_power_state = conexant_set_power, .set_power_state = conexant_set_power,
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
.suspend = conexant_suspend, .suspend = conexant_suspend,
#endif #endif
.reboot_notify = snd_hda_shutup_pins, .reboot_notify = snd_hda_shutup_pins,
...@@ -4395,7 +4395,7 @@ static const struct hda_codec_ops cx_auto_patch_ops = { ...@@ -4395,7 +4395,7 @@ static const struct hda_codec_ops cx_auto_patch_ops = {
.init = cx_auto_init, .init = cx_auto_init,
.free = conexant_free, .free = conexant_free,
.unsol_event = cx_auto_unsol_event, .unsol_event = cx_auto_unsol_event,
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
.suspend = conexant_suspend, .suspend = conexant_suspend,
#endif #endif
.reboot_notify = snd_hda_shutup_pins, .reboot_notify = snd_hda_shutup_pins,
......
...@@ -1115,7 +1115,7 @@ static int hdmi_parse_codec(struct hda_codec *codec) ...@@ -1115,7 +1115,7 @@ static int hdmi_parse_codec(struct hda_codec *codec)
* can be lost and presence sense verb will become inaccurate if the * can be lost and presence sense verb will become inaccurate if the
* HDA link is powered off at hot plug or hw initialization time. * HDA link is powered off at hot plug or hw initialization time.
*/ */
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
if (!(snd_hda_param_read(codec, codec->afg, AC_PAR_POWER_STATE) & if (!(snd_hda_param_read(codec, codec->afg, AC_PAR_POWER_STATE) &
AC_PWRST_EPSS)) AC_PWRST_EPSS))
codec->bus->power_keep_link_on = 1; codec->bus->power_keep_link_on = 1;
......
...@@ -174,7 +174,7 @@ struct alc_spec { ...@@ -174,7 +174,7 @@ struct alc_spec {
/* hooks */ /* hooks */
void (*init_hook)(struct hda_codec *codec); void (*init_hook)(struct hda_codec *codec);
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
void (*power_hook)(struct hda_codec *codec); void (*power_hook)(struct hda_codec *codec);
#endif #endif
void (*shutup)(struct hda_codec *codec); void (*shutup)(struct hda_codec *codec);
...@@ -215,7 +215,7 @@ struct alc_spec { ...@@ -215,7 +215,7 @@ struct alc_spec {
/* for virtual master */ /* for virtual master */
hda_nid_t vmaster_nid; hda_nid_t vmaster_nid;
struct hda_vmaster_mute_hook vmaster_mute; struct hda_vmaster_mute_hook vmaster_mute;
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
struct hda_loopback_check loopback; struct hda_loopback_check loopback;
int num_loopbacks; int num_loopbacks;
struct hda_amp_list loopback_list[8]; struct hda_amp_list loopback_list[8];
...@@ -2057,7 +2057,7 @@ static int alc_init(struct hda_codec *codec) ...@@ -2057,7 +2057,7 @@ static int alc_init(struct hda_codec *codec)
return 0; return 0;
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static int alc_check_power_status(struct hda_codec *codec, hda_nid_t nid) static int alc_check_power_status(struct hda_codec *codec, hda_nid_t nid)
{ {
struct alc_spec *spec = codec->spec; struct alc_spec *spec = codec->spec;
...@@ -2435,7 +2435,7 @@ static void alc_free(struct hda_codec *codec) ...@@ -2435,7 +2435,7 @@ static void alc_free(struct hda_codec *codec)
snd_hda_detach_beep_device(codec); snd_hda_detach_beep_device(codec);
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static void alc_power_eapd(struct hda_codec *codec) static void alc_power_eapd(struct hda_codec *codec)
{ {
alc_auto_setup_eapd(codec, false); alc_auto_setup_eapd(codec, false);
...@@ -2475,7 +2475,7 @@ static const struct hda_codec_ops alc_patch_ops = { ...@@ -2475,7 +2475,7 @@ static const struct hda_codec_ops alc_patch_ops = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.resume = alc_resume, .resume = alc_resume,
#endif #endif
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
.suspend = alc_suspend, .suspend = alc_suspend,
.check_power_status = alc_check_power_status, .check_power_status = alc_check_power_status,
#endif #endif
...@@ -2631,7 +2631,7 @@ static const char *alc_get_line_out_pfx(struct alc_spec *spec, int ch, ...@@ -2631,7 +2631,7 @@ static const char *alc_get_line_out_pfx(struct alc_spec *spec, int ch,
return channel_name[ch]; return channel_name[ch];
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
/* add the powersave loopback-list entry */ /* add the powersave loopback-list entry */
static void add_loopback_list(struct alc_spec *spec, hda_nid_t mix, int idx) static void add_loopback_list(struct alc_spec *spec, hda_nid_t mix, int idx)
{ {
...@@ -6501,7 +6501,7 @@ static int patch_alc861(struct hda_codec *codec) ...@@ -6501,7 +6501,7 @@ static int patch_alc861(struct hda_codec *codec)
} }
codec->patch_ops = alc_patch_ops; codec->patch_ops = alc_patch_ops;
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
spec->power_hook = alc_power_eapd; spec->power_hook = alc_power_eapd;
#endif #endif
......
...@@ -1764,7 +1764,7 @@ static int via_suspend(struct hda_codec *codec) ...@@ -1764,7 +1764,7 @@ static int via_suspend(struct hda_codec *codec)
} }
#endif #endif
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_PM
static int via_check_power_status(struct hda_codec *codec, hda_nid_t nid) static int via_check_power_status(struct hda_codec *codec, hda_nid_t nid)
{ {
struct via_spec *spec = codec->spec; struct via_spec *spec = codec->spec;
...@@ -1785,8 +1785,6 @@ static const struct hda_codec_ops via_patch_ops = { ...@@ -1785,8 +1785,6 @@ static const struct hda_codec_ops via_patch_ops = {
.unsol_event = via_unsol_event, .unsol_event = via_unsol_event,
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = via_suspend, .suspend = via_suspend,
#endif
#ifdef CONFIG_SND_HDA_POWER_SAVE
.check_power_status = via_check_power_status, .check_power_status = via_check_power_status,
#endif #endif
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment