summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2010-09-21 16:37:52 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2010-09-21 16:37:52 +1000
commitfaf8dd9f8b7bb917d41bfcc8db82ac9057308628 (patch)
treeaf0ba5e04178c84aea451a7ccd50ae6f27b7bf88
parent8c62db094407252cd3b8c2d3b9e504b88a9a9f4a (diff)
Revert "ALSA: hda - Refactor ALC269 power-ups/downs in PM callbacks"
This reverts commit 0ec33d1f952934ea3251cefc6d108b47818eedd0.
-rw-r--r--sound/pci/hda/patch_realtek.c51
1 files changed, 30 insertions, 21 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 99a5695cf3c5..562a54b5d10b 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4128,8 +4128,10 @@ static int alc_resume(struct hda_codec *codec)
codec->patch_ops.init(codec);
snd_hda_codec_resume_amp(codec);
snd_hda_codec_resume_cache(codec);
+#ifdef CONFIG_SND_HDA_POWER_SAVE
if (codec->patch_ops.check_power_status)
codec->patch_ops.check_power_status(codec, 0x01);
+#endif
return 0;
}
#endif
@@ -14654,26 +14656,22 @@ static void alc269_auto_init(struct hda_codec *codec)
alc_inithook(codec);
}
-#ifdef SND_HDA_NEEDS_RESUME
-static void alc269_toggle_power_output(struct hda_codec *codec, int power_up)
-{
- int val = alc_read_coef_idx(codec, 0x04);
- if (power_up)
- val |= 1 << 11;
- else
- val &= ~(1 << 11);
- alc_write_coef_idx(codec, 0x04, val);
-}
-
#ifdef CONFIG_SND_HDA_POWER_SAVE
static int alc269_suspend(struct hda_codec *codec, pm_message_t state)
{
struct alc_spec *spec = codec->spec;
+ int val;
+
+ if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x017) {
+ val = alc_read_coef_idx(codec, 0x04);
+ /* Power down output pin */
+ alc_write_coef_idx(codec, 0x04, val & ~(1<<11));
+ }
- if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x017)
- alc269_toggle_power_output(codec, 0);
if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x018) {
- alc269_toggle_power_output(codec, 0);
+ val = alc_read_coef_idx(codec, 0x04);
+ /* Power down output pin */
+ alc_write_coef_idx(codec, 0x04, val & ~(1<<11));
msleep(150);
}
@@ -14682,32 +14680,43 @@ static int alc269_suspend(struct hda_codec *codec, pm_message_t state)
spec->power_hook(codec);
return 0;
}
-#endif /* CONFIG_SND_HDA_POWER_SAVE */
-
+#endif
+#ifdef SND_HDA_NEEDS_RESUME
static int alc269_resume(struct hda_codec *codec)
{
+ int val;
+
if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x018) {
- alc269_toggle_power_output(codec, 0);
+ val = alc_read_coef_idx(codec, 0x04);
+ /* Power down output pin */
+ alc_write_coef_idx(codec, 0x04, val & ~(1<<11));
msleep(150);
}
codec->patch_ops.init(codec);
if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x017) {
- alc269_toggle_power_output(codec, 1);
+ val = alc_read_coef_idx(codec, 0x04);
+ /* Power up output pin */
+ alc_write_coef_idx(codec, 0x04, val | (1<<11));
msleep(200);
}
- if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x018)
- alc269_toggle_power_output(codec, 1);
+ if ((alc_read_coef_idx(codec, 0) & 0x00ff) == 0x018) {
+ val = alc_read_coef_idx(codec, 0x04);
+ /* Power up output pin */
+ alc_write_coef_idx(codec, 0x04, val | (1<<11));
+ }
snd_hda_codec_resume_amp(codec);
snd_hda_codec_resume_cache(codec);
+#ifdef CONFIG_SND_HDA_POWER_SAVE
if (codec->patch_ops.check_power_status)
codec->patch_ops.check_power_status(codec, 0x01);
+#endif
return 0;
}
-#endif /* SND_HDA_NEEDS_RESUME */
+#endif
enum {
ALC269_FIXUP_SONY_VAIO,