summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_local.h
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_local.h')
-rw-r--r--sound/pci/hda/hda_local.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index 2ff62dc..05f1d59 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -657,6 +657,19 @@ int snd_hda_check_amp_list_power(struct hda_codec *codec,
struct hda_loopback_check *check,
hda_nid_t nid);
+/* check whether the actual power state matches with the target state */
+static inline bool
+snd_hda_check_power_state(struct hda_codec *codec, hda_nid_t nid,
+ unsigned int target_state)
+{
+ unsigned int state = snd_hda_codec_read(codec, nid, 0,
+ AC_VERB_GET_POWER_STATE, 0);
+ if (state & AC_PWRST_ERROR)
+ return true;
+ state = (state >> 4) & 0x0f;
+ return (state != target_state);
+}
+
/*
* AMP control callbacks
*/
OpenPOWER on IntegriCloud