Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322476
b: refs/heads/master
c: 983f6b9
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Aug 28, 2012
1 parent e5eddcf commit a6649bd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 042b92c185cbd7b4291710255510ae76b2d7797b
refs/heads/master: 983f6b93818aa62fbc74c37fcb8a482718a19252
10 changes: 8 additions & 2 deletions trunk/sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,9 @@ static void snd_hda_codec_free(struct hda_codec *codec)
kfree(codec);
}

static bool snd_hda_codec_get_supported_ps(struct hda_codec *codec,
hda_nid_t fg, unsigned int power_state);

static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
unsigned int power_state);

Expand Down Expand Up @@ -1317,6 +1320,10 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus,
AC_VERB_GET_SUBSYSTEM_ID, 0);
}

codec->epss = snd_hda_codec_get_supported_ps(codec,
codec->afg ? codec->afg : codec->mfg,
AC_PWRST_EPSS);

/* power-up all before initialization */
hda_set_power_state(codec,
codec->afg ? codec->afg : codec->mfg,
Expand Down Expand Up @@ -3543,8 +3550,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
/* this delay seems necessary to avoid click noise at power-down */
if (power_state == AC_PWRST_D3) {
/* transition time less than 10ms for power down */
bool epss = snd_hda_codec_get_supported_ps(codec, fg, AC_PWRST_EPSS);
msleep(epss ? 10 : 100);
msleep(codec->epss ? 10 : 100);
}

/* repeat power states setting at most 10 times*/
Expand Down
1 change: 1 addition & 0 deletions trunk/sound/pci/hda/hda_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,7 @@ struct hda_codec {
unsigned int ignore_misc_bit:1; /* ignore MISC_NO_PRESENCE bit */
unsigned int no_jack_detect:1; /* Machine has no jack-detection */
unsigned int pcm_format_first:1; /* PCM format must be set first */
unsigned int epss:1; /* supporting EPSS? */
#ifdef CONFIG_SND_HDA_POWER_SAVE
unsigned int power_on :1; /* current (global) power-state */
int power_transition; /* power-state in transition */
Expand Down

0 comments on commit a6649bd

Please sign in to comment.