[v2,02/11] ALSA: hda - Add macro to test pin widget's input capability
diff mbox

Message ID 1472814300-5629-3-git-send-email-subhransu.s.prusty@intel.com
State New
Headers show

Commit Message

Subhransu S. Prusty Sept. 2, 2016, 11:04 a.m. UTC
The macro will be used to identify pins input capability. Based
on the capability ASoC driver creates DAPM widget for pin. Also
based on input capability widget parsing is done for DAPM graph
creation.

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

Patch
diff mbox

diff --git a/sound/hda/local.h b/sound/hda/local.h
index 0d5bb15..9f89e85 100644
--- a/sound/hda/local.h
+++ b/sound/hda/local.h
@@ -8,6 +8,16 @@ 
 #define get_wcaps(codec, nid) \
 	snd_hdac_read_parm(codec, nid, AC_PAR_AUDIO_WIDGET_CAP)
 
+#define get_pcaps(codec, nid) \
+	snd_hdac_read_parm(codec, nid, AC_PAR_PIN_CAP)
+
+static inline bool is_input_pin(struct hdac_device *codec, hda_nid_t nid)
+{
+	unsigned int pincap = get_pcaps(codec, nid);
+
+	return (pincap & AC_PINCAP_IN) != 0;
+}
+
 /* get the widget type from widget capability bits */
 static inline int get_wcaps_type(unsigned int wcaps)
 {