aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorZhang, Rui <rui.zhang@intel.com>2010-02-23 20:38:49 -0500
committerTakashi Iwai <tiwai@suse.de>2010-02-24 03:12:57 -0500
commitdd2b4a7abf82d88261f8f98e1361388a7db2ffe4 (patch)
tree19e48a88187a962707c4bf6c56a188ecb6d2615e /sound/pci
parent0d7d8bf3b896dd8752284e2a7639a03936085e5f (diff)
ALSA: hda - remove unnecessary msleep on power state transitions
This will save ~15ms boot time. The first 10ms sleep was introduced in commit d2595d86e5 for (buggy) Cxt codecs, so better to limit the sleep to the problem hardware. For the second 10ms sleep, the HDA spec says: Power State[1:0]: 00: Node Power state (D0) is fully on. 01: Node Power state (D1) allows for (does not require) the lowest possible power consuming state from which it can return to the "fully on" state (D0) within 10 ms, excepting analog pass through circuits (e.g., CD analog playback) which must remain fully on. 10: Node Power state (D2) allows for (does not require) the lowest possible power consuming state from which it can return to the "fully on" state (D0) within 10 ms. For modems, this is the "wake on ring" power state. 11: Node Power state (D3) allows for (does not require) lowest possible power consuming state under software control. Note that any low power state set by software must retain sufficient operational capability to properly respond to subsequent software Power State command. So 10ms is actually the max wait time. It should be safe to remove/reduce it and rely on the loop of 1ms-sleeps. CC: Marc Boucher <marc@linuxant.com> CC: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_codec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 98767df4f03a..76d3c4c049db 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2767,7 +2767,8 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
2767 snd_hda_codec_read(codec, fg, 0, AC_VERB_SET_POWER_STATE, 2767 snd_hda_codec_read(codec, fg, 0, AC_VERB_SET_POWER_STATE,
2768 power_state); 2768 power_state);
2769 /* partial workaround for "azx_get_response timeout" */ 2769 /* partial workaround for "azx_get_response timeout" */
2770 if (power_state == AC_PWRST_D0) 2770 if (power_state == AC_PWRST_D0 &&
2771 (codec->vendor_id & 0xffff0000) == 0x14f10000)
2771 msleep(10); 2772 msleep(10);
2772 2773
2773 nid = codec->start_nid; 2774 nid = codec->start_nid;
@@ -2801,7 +2802,6 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
2801 if (power_state == AC_PWRST_D0) { 2802 if (power_state == AC_PWRST_D0) {
2802 unsigned long end_time; 2803 unsigned long end_time;
2803 int state; 2804 int state;
2804 msleep(10);
2805 /* wait until the codec reachs to D0 */ 2805 /* wait until the codec reachs to D0 */
2806 end_time = jiffies + msecs_to_jiffies(500); 2806 end_time = jiffies + msecs_to_jiffies(500);
2807 do { 2807 do {