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>
This commit is contained in:
parent
432c641e01
commit
83012a7ccb
@ -228,17 +228,9 @@ config SND_HDA_GENERIC
|
||||
Say Y here to enable the generic HD-audio codec parser
|
||||
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
|
||||
int "Default time-out for HD-audio power-save mode"
|
||||
depends on SND_HDA_POWER_SAVE
|
||||
depends on PM
|
||||
default 0
|
||||
help
|
||||
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)
|
||||
}
|
||||
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_keep_power_on(struct hda_codec *codec);
|
||||
#define hda_codec_is_power_on(codec) ((codec)->power_on)
|
||||
@ -1192,7 +1192,7 @@ static void snd_hda_codec_free(struct hda_codec *codec)
|
||||
return;
|
||||
snd_hda_jack_tbl_clear(codec);
|
||||
restore_init_pincfgs(codec);
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
cancel_delayed_work(&codec->power_work);
|
||||
flush_workqueue(codec->bus->workq);
|
||||
#endif
|
||||
@ -1205,7 +1205,7 @@ static void snd_hda_codec_free(struct hda_codec *codec)
|
||||
codec->bus->caddr_tbl[codec->addr] = NULL;
|
||||
if (codec->patch_ops.free)
|
||||
codec->patch_ops.free(codec);
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
if (codec->power_on)
|
||||
hda_call_pm_notify(codec->bus, false);
|
||||
#endif
|
||||
@ -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->spdif_out, sizeof(struct hda_spdif_out), 16);
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
spin_lock_init(&codec->power_lock);
|
||||
INIT_DELAYED_WORK(&codec->power_work, hda_power_work);
|
||||
/* 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,
|
||||
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->afg ? codec->afg : codec->mfg,
|
||||
AC_PWRST_CLKSTOP);
|
||||
@ -2353,7 +2353,7 @@ int snd_hda_codec_reset(struct hda_codec *codec)
|
||||
|
||||
/* OK, let it free */
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
cancel_delayed_work_sync(&codec->power_work);
|
||||
codec->power_on = 0;
|
||||
codec->power_transition = 0;
|
||||
@ -3572,7 +3572,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
|
||||
int count;
|
||||
unsigned int state;
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
codec->d3_stop_clk_ok = 0;
|
||||
#endif
|
||||
|
||||
@ -3599,7 +3599,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
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_ok = 1;
|
||||
@ -3629,7 +3629,6 @@ static void hda_call_codec_suspend(struct hda_codec *codec)
|
||||
hda_set_power_state(codec,
|
||||
codec->afg ? codec->afg : codec->mfg,
|
||||
AC_PWRST_D3);
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
cancel_delayed_work(&codec->power_work);
|
||||
spin_lock(&codec->power_lock);
|
||||
snd_hda_update_power_acct(codec);
|
||||
@ -3638,7 +3637,6 @@ static void hda_call_codec_suspend(struct hda_codec *codec)
|
||||
codec->power_transition = 0;
|
||||
codec->power_jiffies = jiffies;
|
||||
spin_unlock(&codec->power_lock);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@ -4434,7 +4432,7 @@ int snd_hda_add_new_ctls(struct hda_codec *codec,
|
||||
}
|
||||
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)
|
||||
{
|
||||
struct hda_codec *codec =
|
||||
@ -5107,9 +5105,6 @@ EXPORT_SYMBOL_HDA(snd_hda_suspend);
|
||||
* @bus: the HDA bus
|
||||
*
|
||||
* 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)
|
||||
{
|
||||
|
@ -614,7 +614,7 @@ struct hda_bus_ops {
|
||||
struct hda_pcm *pcm);
|
||||
/* reset bus for retry verb */
|
||||
void (*bus_reset)(struct hda_bus *bus);
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
/* notify power-up/down from codec to controller */
|
||||
void (*pm_notify)(struct hda_bus *bus, bool power_up);
|
||||
#endif
|
||||
@ -712,8 +712,6 @@ struct hda_codec_ops {
|
||||
#ifdef CONFIG_PM
|
||||
int (*suspend)(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);
|
||||
#endif
|
||||
void (*reboot_notify)(struct hda_codec *codec);
|
||||
@ -867,7 +865,7 @@ struct hda_codec {
|
||||
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 epss:1; /* supporting EPSS? */
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
unsigned int power_on :1; /* current (global) power-state */
|
||||
int power_transition; /* power-state in transition */
|
||||
int power_count; /* current (global) power refcount */
|
||||
@ -1049,7 +1047,7 @@ int snd_hda_resume(struct hda_bus *bus);
|
||||
static inline
|
||||
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)
|
||||
return codec->patch_ops.check_power_status(codec, nid);
|
||||
#endif
|
||||
@ -1066,7 +1064,7 @@ const char *snd_hda_get_jack_location(u32 cfg);
|
||||
/*
|
||||
* 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_update_power_acct(struct hda_codec *codec);
|
||||
#else
|
||||
|
@ -70,7 +70,7 @@ struct hda_gspec {
|
||||
|
||||
struct list_head nid_list; /* list of widgets */
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
#define MAX_LOOPBACK_AMPS 7
|
||||
struct hda_loopback_check loopback;
|
||||
int num_loopbacks;
|
||||
@ -654,7 +654,7 @@ static int parse_input(struct hda_codec *codec)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
static void add_input_loopback(struct hda_codec *codec, hda_nid_t nid,
|
||||
int dir, int idx)
|
||||
{
|
||||
@ -1028,7 +1028,7 @@ static int build_generic_pcms(struct hda_codec *codec)
|
||||
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)
|
||||
{
|
||||
struct hda_gspec *spec = codec->spec;
|
||||
@ -1043,7 +1043,7 @@ static struct hda_codec_ops generic_patch_ops = {
|
||||
.build_controls = build_generic_controls,
|
||||
.build_pcms = build_generic_pcms,
|
||||
.free = snd_hda_generic_free,
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
.check_power_status = generic_check_power_status,
|
||||
#endif
|
||||
};
|
||||
|
@ -155,7 +155,7 @@ int /*__devinit*/ snd_hda_create_hwdep(struct hda_codec *codec)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
static ssize_t power_on_acct_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
@ -191,7 +191,7 @@ int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec)
|
||||
hwdep->device, &power_attrs[i]);
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_SND_HDA_POWER_SAVE */
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
#ifdef CONFIG_SND_HDA_RECONFIG
|
||||
|
||||
|
@ -110,7 +110,7 @@ MODULE_PARM_DESC(beep_mode, "Select HDA Beep registration mode "
|
||||
"(0=off, 1=on) (default=1).");
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
static int param_set_xint(const char *val, const struct kernel_param *kp);
|
||||
static struct kernel_param_ops param_ops_xint = {
|
||||
.set = param_set_xint,
|
||||
@ -130,7 +130,7 @@ MODULE_PARM_DESC(power_save, "Automatic power-saving timeout "
|
||||
static bool power_save_controller = 1;
|
||||
module_param(power_save_controller, bool, 0644);
|
||||
MODULE_PARM_DESC(power_save_controller, "Reset controller in power save mode.");
|
||||
#endif
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
static int align_buffer_size = -1;
|
||||
module_param(align_buffer_size, bint, 0644);
|
||||
@ -1032,7 +1032,7 @@ static unsigned int azx_get_response(struct hda_bus *bus,
|
||||
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);
|
||||
#endif
|
||||
|
||||
@ -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.attach_pcm = azx_attach_pcm_stream;
|
||||
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.ops.pm_notify = azx_power_notify;
|
||||
#endif
|
||||
@ -2404,7 +2404,7 @@ static void azx_stop_chip(struct azx *chip)
|
||||
chip->initialized = 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
/* power-up/down the controller */
|
||||
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)
|
||||
#else
|
||||
#define azx_add_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)
|
||||
/*
|
||||
@ -2525,10 +2525,8 @@ static int azx_runtime_suspend(struct device *dev)
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct azx *chip = card->private_data;
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
if (!power_save_controller)
|
||||
return -EAGAIN;
|
||||
#endif
|
||||
|
||||
azx_stop_chip(chip);
|
||||
azx_clear_irq_pending(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)
|
||||
{
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
/* The codecs were powered up in snd_hda_codec_new().
|
||||
* Now all initialization done, so turn them down if possible
|
||||
*/
|
||||
|
@ -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; }
|
||||
#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);
|
||||
#else
|
||||
static inline int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec)
|
||||
|
@ -58,7 +58,7 @@ TRACE_EVENT(hda_bus_reset,
|
||||
TP_printk("[%d]", __entry->card)
|
||||
);
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
DECLARE_EVENT_CLASS(hda_power,
|
||||
|
||||
TP_PROTO(struct hda_codec *codec),
|
||||
@ -111,7 +111,7 @@ TRACE_EVENT(hda_power_count,
|
||||
__entry->card, __entry->addr, __entry->power_count,
|
||||
__entry->power_on, __entry->power_transition)
|
||||
);
|
||||
#endif /* CONFIG_SND_HDA_POWER_SAVE */
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
TRACE_EVENT(hda_unsol_event,
|
||||
|
||||
|
@ -85,7 +85,7 @@ struct ad198x_spec {
|
||||
unsigned int analog_beep: 1; /* analog beep input present */
|
||||
unsigned int avoid_init_slave_vol:1;
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
struct hda_loopback_check loopback;
|
||||
#endif
|
||||
/* for virtual master */
|
||||
@ -269,7 +269,7 @@ static int ad198x_build_controls(struct hda_codec *codec)
|
||||
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)
|
||||
{
|
||||
struct ad198x_spec *spec = codec->spec;
|
||||
@ -654,10 +654,8 @@ static const struct hda_codec_ops ad198x_patch_ops = {
|
||||
.build_pcms = ad198x_build_pcms,
|
||||
.init = ad198x_init,
|
||||
.free = ad198x_free,
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
.check_power_status = ad198x_check_power_status,
|
||||
#endif
|
||||
#ifdef CONFIG_PM
|
||||
.check_power_status = ad198x_check_power_status,
|
||||
.suspend = ad198x_suspend,
|
||||
#endif
|
||||
.reboot_notify = ad198x_shutup,
|
||||
@ -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[] = {
|
||||
{ 0x13, HDA_OUTPUT, 0 }, /* Mic */
|
||||
{ 0x14, HDA_OUTPUT, 0 }, /* Phone */
|
||||
@ -1278,7 +1276,7 @@ static int patch_ad1986a(struct hda_codec *codec)
|
||||
spec->mixers[0] = ad1986a_mixers;
|
||||
spec->num_init_verbs = 1;
|
||||
spec->init_verbs[0] = ad1986a_init_verbs;
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
spec->loopback.amplist = ad1986a_loopbacks;
|
||||
#endif
|
||||
spec->vmaster_nid = 0x1b;
|
||||
@ -1537,7 +1535,7 @@ static const struct hda_verb ad1983_init_verbs[] = {
|
||||
{ } /* end */
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
static const struct hda_amp_list ad1983_loopbacks[] = {
|
||||
{ 0x12, HDA_OUTPUT, 0 }, /* Mic */
|
||||
{ 0x13, HDA_OUTPUT, 0 }, /* Line */
|
||||
@ -1576,7 +1574,7 @@ static int patch_ad1983(struct hda_codec *codec)
|
||||
spec->num_init_verbs = 1;
|
||||
spec->init_verbs[0] = ad1983_init_verbs;
|
||||
spec->spdif_route = 0;
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
spec->loopback.amplist = ad1983_loopbacks;
|
||||
#endif
|
||||
spec->vmaster_nid = 0x05;
|
||||
@ -1704,7 +1702,7 @@ static const struct hda_verb ad1981_init_verbs[] = {
|
||||
{ } /* end */
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
static const struct hda_amp_list ad1981_loopbacks[] = {
|
||||
{ 0x12, HDA_OUTPUT, 0 }, /* Front Mic */
|
||||
{ 0x13, HDA_OUTPUT, 0 }, /* Line */
|
||||
@ -1982,7 +1980,7 @@ static int patch_ad1981(struct hda_codec *codec)
|
||||
spec->num_init_verbs = 1;
|
||||
spec->init_verbs[0] = ad1981_init_verbs;
|
||||
spec->spdif_route = 0;
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
spec->loopback.amplist = ad1981_loopbacks;
|
||||
#endif
|
||||
spec->vmaster_nid = 0x05;
|
||||
@ -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);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
static const struct hda_amp_list ad1988_loopbacks[] = {
|
||||
{ 0x20, HDA_INPUT, 0 }, /* Front Mic */
|
||||
{ 0x20, HDA_INPUT, 1 }, /* Line */
|
||||
@ -3399,7 +3397,7 @@ static int patch_ad1988(struct hda_codec *codec)
|
||||
codec->patch_ops.unsol_event = ad1988_laptop_unsol_event;
|
||||
break;
|
||||
}
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
spec->loopback.amplist = ad1988_loopbacks;
|
||||
#endif
|
||||
spec->vmaster_nid = 0x04;
|
||||
@ -3555,7 +3553,7 @@ static const struct hda_verb ad1884_init_verbs[] = {
|
||||
{ } /* end */
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
static const struct hda_amp_list ad1884_loopbacks[] = {
|
||||
{ 0x20, HDA_INPUT, 0 }, /* Front Mic */
|
||||
{ 0x20, HDA_INPUT, 1 }, /* Mic */
|
||||
@ -3602,7 +3600,7 @@ static int patch_ad1884(struct hda_codec *codec)
|
||||
spec->num_init_verbs = 1;
|
||||
spec->init_verbs[0] = ad1884_init_verbs;
|
||||
spec->spdif_route = 0;
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
spec->loopback.amplist = ad1884_loopbacks;
|
||||
#endif
|
||||
spec->vmaster_nid = 0x04;
|
||||
@ -3994,7 +3992,7 @@ static const struct hda_verb ad1884a_init_verbs[] = {
|
||||
{ } /* end */
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
static const struct hda_amp_list ad1884a_loopbacks[] = {
|
||||
{ 0x20, HDA_INPUT, 0 }, /* Front Mic */
|
||||
{ 0x20, HDA_INPUT, 1 }, /* Mic */
|
||||
@ -4602,7 +4600,7 @@ static int patch_ad1884a(struct hda_codec *codec)
|
||||
spec->num_init_verbs = 1;
|
||||
spec->init_verbs[0] = ad1884a_init_verbs;
|
||||
spec->spdif_route = 0;
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
spec->loopback.amplist = ad1884a_loopbacks;
|
||||
#endif
|
||||
codec->patch_ops = ad198x_patch_ops;
|
||||
@ -4959,7 +4957,7 @@ static const struct hda_verb ad1882_3stack_automute_verbs[] = {
|
||||
{ } /* end */
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
static const struct hda_amp_list ad1882_loopbacks[] = {
|
||||
{ 0x20, HDA_INPUT, 0 }, /* Front Mic */
|
||||
{ 0x20, HDA_INPUT, 1 }, /* Mic */
|
||||
@ -5022,7 +5020,7 @@ static int patch_ad1882(struct hda_codec *codec)
|
||||
spec->num_init_verbs = 1;
|
||||
spec->init_verbs[0] = ad1882_init_verbs;
|
||||
spec->spdif_route = 0;
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
spec->loopback.amplist = ad1882_loopbacks;
|
||||
#endif
|
||||
spec->vmaster_nid = 0x04;
|
||||
|
@ -553,7 +553,7 @@ static int conexant_build_controls(struct hda_codec *codec)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
static int conexant_suspend(struct hda_codec *codec)
|
||||
{
|
||||
snd_hda_shutup_pins(codec);
|
||||
@ -567,7 +567,7 @@ static const struct hda_codec_ops conexant_patch_ops = {
|
||||
.init = conexant_init,
|
||||
.free = conexant_free,
|
||||
.set_power_state = conexant_set_power,
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
.suspend = conexant_suspend,
|
||||
#endif
|
||||
.reboot_notify = snd_hda_shutup_pins,
|
||||
@ -4395,7 +4395,7 @@ static const struct hda_codec_ops cx_auto_patch_ops = {
|
||||
.init = cx_auto_init,
|
||||
.free = conexant_free,
|
||||
.unsol_event = cx_auto_unsol_event,
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
.suspend = conexant_suspend,
|
||||
#endif
|
||||
.reboot_notify = snd_hda_shutup_pins,
|
||||
|
@ -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
|
||||
* 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) &
|
||||
AC_PWRST_EPSS))
|
||||
codec->bus->power_keep_link_on = 1;
|
||||
|
@ -174,7 +174,7 @@ struct alc_spec {
|
||||
|
||||
/* hooks */
|
||||
void (*init_hook)(struct hda_codec *codec);
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
void (*power_hook)(struct hda_codec *codec);
|
||||
#endif
|
||||
void (*shutup)(struct hda_codec *codec);
|
||||
@ -215,7 +215,7 @@ struct alc_spec {
|
||||
/* for virtual master */
|
||||
hda_nid_t vmaster_nid;
|
||||
struct hda_vmaster_mute_hook vmaster_mute;
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
struct hda_loopback_check loopback;
|
||||
int num_loopbacks;
|
||||
struct hda_amp_list loopback_list[8];
|
||||
@ -2057,7 +2057,7 @@ static int alc_init(struct hda_codec *codec)
|
||||
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)
|
||||
{
|
||||
struct alc_spec *spec = codec->spec;
|
||||
@ -2435,7 +2435,7 @@ static void alc_free(struct hda_codec *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)
|
||||
{
|
||||
alc_auto_setup_eapd(codec, false);
|
||||
@ -2475,7 +2475,7 @@ static const struct hda_codec_ops alc_patch_ops = {
|
||||
#ifdef CONFIG_PM
|
||||
.resume = alc_resume,
|
||||
#endif
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
.suspend = alc_suspend,
|
||||
.check_power_status = alc_check_power_status,
|
||||
#endif
|
||||
@ -2631,7 +2631,7 @@ static const char *alc_get_line_out_pfx(struct alc_spec *spec, int ch,
|
||||
return channel_name[ch];
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
/* add the powersave loopback-list entry */
|
||||
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)
|
||||
}
|
||||
|
||||
codec->patch_ops = alc_patch_ops;
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
spec->power_hook = alc_power_eapd;
|
||||
#endif
|
||||
|
||||
|
@ -1764,7 +1764,7 @@ static int via_suspend(struct hda_codec *codec)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
#ifdef CONFIG_PM
|
||||
static int via_check_power_status(struct hda_codec *codec, hda_nid_t nid)
|
||||
{
|
||||
struct via_spec *spec = codec->spec;
|
||||
@ -1785,8 +1785,6 @@ static const struct hda_codec_ops via_patch_ops = {
|
||||
.unsol_event = via_unsol_event,
|
||||
#ifdef CONFIG_PM
|
||||
.suspend = via_suspend,
|
||||
#endif
|
||||
#ifdef CONFIG_SND_HDA_POWER_SAVE
|
||||
.check_power_status = via_check_power_status,
|
||||
#endif
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user