summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_local.h
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2009-08-24 09:50:46 +0800
committerTakashi Iwai <tiwai@suse.de>2009-08-24 09:42:48 +0200
commitfd72d008465d45db63d7f8931eea6a04e05916d6 (patch)
tree8daba43d08b3162e028799d06f0c487e301a1ab5 /sound/pci/hda/hda_local.h
parent454e134d0e9e38421830f26426c66f37a6d39465 (diff)
downloadlinux-3.10-fd72d008465d45db63d7f8931eea6a04e05916d6.tar.gz
linux-3.10-fd72d008465d45db63d7f8931eea6a04e05916d6.tar.bz2
linux-3.10-fd72d008465d45db63d7f8931eea6a04e05916d6.zip
ALSA: hda: move open coded tricks into get_wcaps_channels()
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_local.h')
-rw-r--r--sound/pci/hda/hda_local.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index fa57cb93b44..5f1dcc59002 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -410,6 +410,16 @@ static inline u32 get_wcaps(struct hda_codec *codec, hda_nid_t nid)
/* get the widget type from widget capability bits */
#define get_wcaps_type(wcaps) (((wcaps) & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT)
+static inline unsigned int get_wcaps_channels(u32 wcaps)
+{
+ unsigned int chans;
+
+ chans = (wcaps & AC_WCAP_CHAN_CNT_EXT) >> 13;
+ chans = ((chans << 1) | 1) + 1;
+
+ return chans;
+}
+
u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction);
int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
unsigned int caps);