Skip to contentSkip to conversation

ALSA: hda - reduce msleep time if EPSS power states supported

PATCH New Wang Xingchao 1 participant 1 message Jun 7, 2012 Sound

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ALSA: hda - reduce msleep time if EPSS power states supported

if EPSS supported, transition from D3 state to D0 state in less than 10ms

---
 sound/pci/hda/hda_codec.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
sound/pci/hda/hda_codec.c +5 -2
index b89c8ec..2737fe7 100644
@@ -3532,8 +3532,11 @@ 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)
-		msleep(100);
+	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);
+	}
 	snd_hda_codec_read(codec, fg, 0, AC_VERB_SET_POWER_STATE,
 			    power_state);
 	snd_hda_codec_set_power_to_all(codec, fg, power_state, true);
Signature · 1 line
1.7.9.5