Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178098
b: refs/heads/master
c: f5de24b
h: refs/heads/master
v: v3
  • Loading branch information
Hector Martin authored and Takashi Iwai committed Dec 21, 2009
1 parent 75321bf commit c92920e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 556eea9a926bff8f014b4f80522b4de97ae84213
refs/heads/master: f5de24b06aa46427500d0fdbe8616b73a71d8c28
36 changes: 36 additions & 0 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ struct alc_spec {
/* hooks */
void (*init_hook)(struct hda_codec *codec);
void (*unsol_event)(struct hda_codec *codec, unsigned int res);
#ifdef CONFIG_SND_HDA_POWER_SAVE
void (*power_hook)(struct hda_codec *codec, int power);
#endif

/* for pin sensing */
unsigned int sense_updated: 1;
Expand Down Expand Up @@ -388,6 +391,7 @@ struct alc_config_preset {
void (*init_hook)(struct hda_codec *);
#ifdef CONFIG_SND_HDA_POWER_SAVE
struct hda_amp_list *loopbacks;
void (*power_hook)(struct hda_codec *codec, int power);
#endif
};

Expand Down Expand Up @@ -900,6 +904,7 @@ static void setup_preset(struct hda_codec *codec,
spec->unsol_event = preset->unsol_event;
spec->init_hook = preset->init_hook;
#ifdef CONFIG_SND_HDA_POWER_SAVE
spec->power_hook = preset->power_hook;
spec->loopback.amplist = preset->loopbacks;
#endif

Expand Down Expand Up @@ -1826,6 +1831,16 @@ static void alc889_acer_aspire_8930g_setup(struct hda_codec *codec)
spec->autocfg.speaker_pins[2] = 0x1b;
}

#ifdef CONFIG_SND_HDA_POWER_SAVE
static void alc889_power_eapd(struct hda_codec *codec, int power)
{
snd_hda_codec_write(codec, 0x14, 0,
AC_VERB_SET_EAPD_BTLENABLE, power ? 2 : 0);
snd_hda_codec_write(codec, 0x15, 0,
AC_VERB_SET_EAPD_BTLENABLE, power ? 2 : 0);
}
#endif

/*
* ALC880 3-stack model
*
Expand Down Expand Up @@ -3619,12 +3634,29 @@ static void alc_free(struct hda_codec *codec)
snd_hda_detach_beep_device(codec);
}

#ifdef CONFIG_SND_HDA_POWER_SAVE
static int alc_suspend(struct hda_codec *codec, pm_message_t state)
{
struct alc_spec *spec = codec->spec;
if (spec && spec->power_hook)
spec->power_hook(codec, 0);
return 0;
}
#endif

#ifdef SND_HDA_NEEDS_RESUME
static int alc_resume(struct hda_codec *codec)
{
#ifdef CONFIG_SND_HDA_POWER_SAVE
struct alc_spec *spec = codec->spec;
#endif
codec->patch_ops.init(codec);
snd_hda_codec_resume_amp(codec);
snd_hda_codec_resume_cache(codec);
#ifdef CONFIG_SND_HDA_POWER_SAVE
if (spec && spec->power_hook)
spec->power_hook(codec, 1);
#endif
return 0;
}
#endif
Expand All @@ -3641,6 +3673,7 @@ static struct hda_codec_ops alc_patch_ops = {
.resume = alc_resume,
#endif
#ifdef CONFIG_SND_HDA_POWER_SAVE
.suspend = alc_suspend,
.check_power_status = alc_check_power_status,
#endif
};
Expand Down Expand Up @@ -9420,6 +9453,9 @@ static struct alc_config_preset alc882_presets[] = {
.unsol_event = alc_automute_amp_unsol_event,
.setup = alc889_acer_aspire_8930g_setup,
.init_hook = alc_automute_amp,
#ifdef CONFIG_SND_HDA_POWER_SAVE
.power_hook = alc889_power_eapd,
#endif
},
[ALC888_ACER_ASPIRE_7730G] = {
.mixers = { alc883_3ST_6ch_mixer,
Expand Down

0 comments on commit c92920e

Please sign in to comment.