diff mbox

[v2,08/11] ALSA: hda - macro to get default config device of pin widgets

Message ID 1472814300-5629-9-git-send-email-subhransu.s.prusty@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Subhransu S. Prusty Sept. 2, 2016, 11:04 a.m. UTC
In ASoC this easy macro can be used to identify the default
endpoint configuration and create DAPM endpoint widgets.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/hda/local.h | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/sound/hda/local.h b/sound/hda/local.h
index 9f89e85..41186ab 100644
--- a/sound/hda/local.h
+++ b/sound/hda/local.h
@@ -11,6 +11,9 @@ 
 #define get_pcaps(codec, nid) \
 	snd_hdac_read_parm(codec, nid, AC_PAR_PIN_CAP)
 
+#define get_defcfg_device(cfg) \
+	((cfg & AC_DEFCFG_DEVICE) >> AC_DEFCFG_DEVICE_SHIFT)
+
 static inline bool is_input_pin(struct hdac_device *codec, hda_nid_t nid)
 {
 	unsigned int pincap = get_pcaps(codec, nid);