All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ALSA: hda - check supported power states
@ 2012-06-06 14:02 Wang Xingchao
  2012-06-06 14:02 ` [PATCH 2/2] ALSA: hda - reduce msleep time if EPSS power states supported Wang Xingchao
  2012-06-07  9:42 ` [PATCH 1/2] ALSA: hda - check supported power states Takashi Iwai
  0 siblings, 2 replies; 5+ messages in thread
From: Wang Xingchao @ 2012-06-06 14:02 UTC (permalink / raw)
  To: tiwai, alsa-devel; +Cc: wangxingchao2011, Wang Xingchao

Add function to check whether power states supported by specific
codec node.

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
---
 sound/pci/hda/hda_codec.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 41ca803..b89c8ec 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -3505,6 +3505,22 @@ void snd_hda_codec_set_power_to_all(struct hda_codec *codec, hda_nid_t fg,
 EXPORT_SYMBOL_HDA(snd_hda_codec_set_power_to_all);
 
 /*
+ *  supported power states check
+ */
+static bool snd_hda_codec_get_supported_ps(struct hda_codec *codec, hda_nid_t fg,
+				unsigned int power_state)
+{
+	int sup = snd_hda_param_read(codec, fg, AC_PAR_POWER_STATE);
+
+	if (sup < 0)
+		return false;
+	if (sup & power_state)
+		return true;
+	else
+		return false;
+}
+
+/*
  * set power state of the codec
  */
 static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-06-07  9:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-06 14:02 [PATCH 1/2] ALSA: hda - check supported power states Wang Xingchao
2012-06-06 14:02 ` [PATCH 2/2] ALSA: hda - reduce msleep time if EPSS power states supported Wang Xingchao
2012-06-07  7:15   ` David Henningsson
2012-06-07  7:26     ` Wang Xingchao
2012-06-07  9:42 ` [PATCH 1/2] ALSA: hda - check supported power states Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.