Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a43952a authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: hda - Make CONFIG_SND_HDA_POWER_SAVE depending on CONFIG_PM



It makes little sense to enable power-saving without PM.
This removes SND_HDA_NEEDS_RESUME define so that we can use CONFIG_PM
in all places.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 7df1ce1a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -243,6 +243,7 @@ config SND_HDA_GENERIC

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
+8 −8
Original line number Diff line number Diff line
@@ -1101,7 +1101,7 @@ void snd_hda_shutup_pins(struct hda_codec *codec)
}
EXPORT_SYMBOL_HDA(snd_hda_shutup_pins);

#ifdef SND_HDA_NEEDS_RESUME
#ifdef CONFIG_PM
/* Restore the pin controls cleared previously via snd_hda_shutup_pins() */
static void restore_shutup_pins(struct hda_codec *codec)
{
@@ -1499,7 +1499,7 @@ static void purify_inactive_streams(struct hda_codec *codec)
	}
}

#ifdef SND_HDA_NEEDS_RESUME
#ifdef CONFIG_PM
/* clean up all streams; called from suspend */
static void hda_cleanup_all_streams(struct hda_codec *codec)
{
@@ -1838,7 +1838,7 @@ int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid,
}
EXPORT_SYMBOL_HDA(snd_hda_codec_amp_stereo);

#ifdef SND_HDA_NEEDS_RESUME
#ifdef CONFIG_PM
/**
 * snd_hda_codec_resume_amp - Resume all AMP commands from the cache
 * @codec: HD-audio codec
@@ -1868,7 +1868,7 @@ void snd_hda_codec_resume_amp(struct hda_codec *codec)
	}
}
EXPORT_SYMBOL_HDA(snd_hda_codec_resume_amp);
#endif /* SND_HDA_NEEDS_RESUME */
#endif /* CONFIG_PM */

static u32 get_amp_max_value(struct hda_codec *codec, hda_nid_t nid, int dir,
			     unsigned int ofs)
@@ -3082,7 +3082,7 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid)
}
EXPORT_SYMBOL_HDA(snd_hda_create_spdif_in_ctls);

#ifdef SND_HDA_NEEDS_RESUME
#ifdef CONFIG_PM
/*
 * command cache
 */
@@ -3199,7 +3199,7 @@ void snd_hda_sequence_write_cache(struct hda_codec *codec,
					  seq->param);
}
EXPORT_SYMBOL_HDA(snd_hda_sequence_write_cache);
#endif /* SND_HDA_NEEDS_RESUME */
#endif /* CONFIG_PM */

/*
 * set power state of the codec
@@ -3274,7 +3274,7 @@ static void hda_exec_init_verbs(struct hda_codec *codec)
static inline void hda_exec_init_verbs(struct hda_codec *codec) {}
#endif

#ifdef SND_HDA_NEEDS_RESUME
#ifdef CONFIG_PM
/*
 * call suspend and power-down; used both from PM and power-save
 */
@@ -3315,7 +3315,7 @@ static void hda_call_codec_resume(struct hda_codec *codec)
		snd_hda_codec_resume_cache(codec);
	}
}
#endif /* SND_HDA_NEEDS_RESUME */
#endif /* CONFIG_PM */


/**
+3 −9
Original line number Diff line number Diff line
@@ -26,10 +26,6 @@
#include <sound/pcm.h>
#include <sound/hwdep.h>

#if defined(CONFIG_PM) || defined(CONFIG_SND_HDA_POWER_SAVE)
#define SND_HDA_NEEDS_RESUME	/* resume control code is required */
#endif

/*
 * nodes
 */
@@ -704,17 +700,15 @@ struct hda_codec_ops {
	int (*init)(struct hda_codec *codec);
	void (*free)(struct hda_codec *codec);
	void (*unsol_event)(struct hda_codec *codec, unsigned int res);
#ifdef SND_HDA_NEEDS_RESUME
#ifdef CONFIG_PM
	int (*suspend)(struct hda_codec *codec, pm_message_t state);
	int (*pre_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);
#endif
	void (*reboot_notify)(struct hda_codec *codec);
#ifdef SND_HDA_NEEDS_RESUME
	int (*pre_resume)(struct hda_codec *codec);
#endif
};

/* record for amp information cache */
@@ -930,7 +924,7 @@ void snd_hda_sequence_write(struct hda_codec *codec,
int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex);

/* cached write */
#ifdef SND_HDA_NEEDS_RESUME
#ifdef CONFIG_PM
int snd_hda_codec_write_cache(struct hda_codec *codec, hda_nid_t nid,
			      int direct, unsigned int verb, unsigned int parm);
void snd_hda_sequence_write_cache(struct hda_codec *codec,
+1 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, int ch,
			     int direction, int idx, int mask, int val);
int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid,
			     int dir, int idx, int mask, int val);
#ifdef SND_HDA_NEEDS_RESUME
#ifdef CONFIG_PM
void snd_hda_codec_resume_amp(struct hda_codec *codec);
#endif

+2 −2
Original line number Diff line number Diff line
@@ -563,7 +563,7 @@ static void ad198x_free(struct hda_codec *codec)
	snd_hda_detach_beep_device(codec);
}

#ifdef SND_HDA_NEEDS_RESUME
#ifdef CONFIG_PM
static int ad198x_suspend(struct hda_codec *codec, pm_message_t state)
{
	ad198x_shutup(codec);
@@ -579,7 +579,7 @@ static const struct hda_codec_ops ad198x_patch_ops = {
#ifdef CONFIG_SND_HDA_POWER_SAVE
	.check_power_status = ad198x_check_power_status,
#endif
#ifdef SND_HDA_NEEDS_RESUME
#ifdef CONFIG_PM
	.suspend = ad198x_suspend,
#endif
	.reboot_notify = ad198x_shutup,
Loading