Skip to content

Commit

Permalink
ALSA: hda/realtek - Remove depop delay for suspend and resume if appl…
Browse files Browse the repository at this point in the history
…icable

This patch defines a flag "no_depop_delay" in alc_spec. If this flag is set,
delay in alc_eapd_shutup and alc_resume will be skipped.

Machine-specific fixup can set this flag to reduce suspend/resume time, if
the codec and hardware analog design can avoid pop noise without this delay.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Kailang Yang authored and Takashi Iwai committed Nov 29, 2013
1 parent 4b01693 commit 97a2657
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ struct alc_spec {

int init_amp;
int codec_variant; /* flag for other variants */
bool has_alc5505_dsp;
unsigned int has_alc5505_dsp:1;
unsigned int no_depop_delay:1;

/* for PLL fix */
hda_nid_t pll_nid;
Expand Down Expand Up @@ -280,8 +281,11 @@ static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
*/
static void alc_eapd_shutup(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;

alc_auto_setup_eapd(codec, false);
msleep(200);
if (!spec->no_depop_delay)
msleep(200);
snd_hda_shutup_pins(codec);
}

Expand Down Expand Up @@ -863,7 +867,10 @@ static int alc_suspend(struct hda_codec *codec)
#ifdef CONFIG_PM
static int alc_resume(struct hda_codec *codec)
{
msleep(150); /* to avoid pop noise */
struct alc_spec *spec = codec->spec;

if (!spec->no_depop_delay)
msleep(150); /* to avoid pop noise */
codec->patch_ops.init(codec);
snd_hda_codec_resume_amp(codec);
snd_hda_codec_resume_cache(codec);
Expand Down Expand Up @@ -4457,7 +4464,7 @@ static int patch_alc269(struct hda_codec *codec)
}

if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
spec->has_alc5505_dsp = true;
spec->has_alc5505_dsp = 1;
spec->init_hook = alc5505_dsp_init;
}

Expand Down

0 comments on commit 97a2657

Please sign in to comment.