aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKailang Yang <kailang@realtek.com>2013-11-29 00:35:26 -0500
committerTakashi Iwai <tiwai@suse.de>2013-11-29 07:55:38 -0500
commit97a2657076f463ef06b6ef4ab6d54bb903ea9ff3 (patch)
tree0b9562961f2947123ff16cd13e66445a06c5b40e
parent4b016931a997be59a2be0da3398985a19fdfa5be (diff)
ALSA: hda/realtek - Remove depop delay for suspend and resume if applicable
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>
-rw-r--r--sound/pci/hda/patch_realtek.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 01fadf0e0b3c..521a9d281a5f 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -118,7 +118,8 @@ struct alc_spec {
118 118
119 int init_amp; 119 int init_amp;
120 int codec_variant; /* flag for other variants */ 120 int codec_variant; /* flag for other variants */
121 bool has_alc5505_dsp; 121 unsigned int has_alc5505_dsp:1;
122 unsigned int no_depop_delay:1;
122 123
123 /* for PLL fix */ 124 /* for PLL fix */
124 hda_nid_t pll_nid; 125 hda_nid_t pll_nid;
@@ -280,8 +281,11 @@ static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
280 */ 281 */
281static void alc_eapd_shutup(struct hda_codec *codec) 282static void alc_eapd_shutup(struct hda_codec *codec)
282{ 283{
284 struct alc_spec *spec = codec->spec;
285
283 alc_auto_setup_eapd(codec, false); 286 alc_auto_setup_eapd(codec, false);
284 msleep(200); 287 if (!spec->no_depop_delay)
288 msleep(200);
285 snd_hda_shutup_pins(codec); 289 snd_hda_shutup_pins(codec);
286} 290}
287 291
@@ -863,7 +867,10 @@ static int alc_suspend(struct hda_codec *codec)
863#ifdef CONFIG_PM 867#ifdef CONFIG_PM
864static int alc_resume(struct hda_codec *codec) 868static int alc_resume(struct hda_codec *codec)
865{ 869{
866 msleep(150); /* to avoid pop noise */ 870 struct alc_spec *spec = codec->spec;
871
872 if (!spec->no_depop_delay)
873 msleep(150); /* to avoid pop noise */
867 codec->patch_ops.init(codec); 874 codec->patch_ops.init(codec);
868 snd_hda_codec_resume_amp(codec); 875 snd_hda_codec_resume_amp(codec);
869 snd_hda_codec_resume_cache(codec); 876 snd_hda_codec_resume_cache(codec);
@@ -4457,7 +4464,7 @@ static int patch_alc269(struct hda_codec *codec)
4457 } 4464 }
4458 4465
4459 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) { 4466 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
4460 spec->has_alc5505_dsp = true; 4467 spec->has_alc5505_dsp = 1;
4461 spec->init_hook = alc5505_dsp_init; 4468 spec->init_hook = alc5505_dsp_init;
4462 } 4469 }
4463 4470