mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
ALSA: hda - allow a codec to define its own depop delay time
This patch adds 'depop_delay' to struct hda_codec, to indicate a depop delay time in ms when power-down, in function set_power_state() to D3. Default value is -1, for a default delay time. Machine fixup can set a suitable value according to the codec chip and HW audio design. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
b5c6611fb4
commit
7f13292743
2 changed files with 7 additions and 2 deletions
|
@ -1471,6 +1471,7 @@ int snd_hda_codec_new(struct hda_bus *bus,
|
||||||
INIT_LIST_HEAD(&codec->conn_list);
|
INIT_LIST_HEAD(&codec->conn_list);
|
||||||
|
|
||||||
INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work);
|
INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work);
|
||||||
|
codec->depop_delay = -1;
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
spin_lock_init(&codec->power_lock);
|
spin_lock_init(&codec->power_lock);
|
||||||
|
@ -3975,8 +3976,10 @@ static unsigned int hda_set_power_state(struct hda_codec *codec,
|
||||||
|
|
||||||
/* this delay seems necessary to avoid click noise at power-down */
|
/* this delay seems necessary to avoid click noise at power-down */
|
||||||
if (power_state == AC_PWRST_D3) {
|
if (power_state == AC_PWRST_D3) {
|
||||||
/* transition time less than 10ms for power down */
|
if (codec->depop_delay < 0)
|
||||||
msleep(codec->epss ? 10 : 100);
|
msleep(codec->epss ? 10 : 100);
|
||||||
|
else if (codec->depop_delay > 0)
|
||||||
|
msleep(codec->depop_delay);
|
||||||
flags = HDA_RW_NO_RESPONSE_FALLBACK;
|
flags = HDA_RW_NO_RESPONSE_FALLBACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -944,6 +944,8 @@ struct hda_codec {
|
||||||
struct snd_array jacks;
|
struct snd_array jacks;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int depop_delay; /* depop delay in ms, -1 for default delay time */
|
||||||
|
|
||||||
/* fix-up list */
|
/* fix-up list */
|
||||||
int fixup_id;
|
int fixup_id;
|
||||||
const struct hda_fixup *fixup_list;
|
const struct hda_fixup *fixup_list;
|
||||||
|
|
Loading…
Add table
Reference in a new issue