diff options
author | David Henningsson <david.henningsson@canonical.com> | 2014-09-23 10:38:17 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-09-23 15:57:28 +0200 |
commit | 861a04ed15a48e9af7b591cd8ae3bc46aece1733 (patch) | |
tree | 8cab89d6faa04cff840fe155b18b480dd4dd753f /sound/pci/hda/hda_codec.c | |
parent | a5062dee82826f54529c89d0e58211897b1b4c68 (diff) | |
download | op-kernel-dev-861a04ed15a48e9af7b591cd8ae3bc46aece1733.zip op-kernel-dev-861a04ed15a48e9af7b591cd8ae3bc46aece1733.tar.gz |
ALSA: hda - Move the function "check_amp_caps" to hda_codec.c
The next patch will use it, so make it visible across modules.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 0aa2e1e..15e0089 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -2002,6 +2002,26 @@ u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction) EXPORT_SYMBOL_GPL(query_amp_caps); /** + * snd_hda_check_amp_caps - query AMP capabilities + * @codec: the HD-audio codec + * @nid: the NID to query + * @dir: either #HDA_INPUT or #HDA_OUTPUT + * + * Check whether the widget has the given amp capability for the direction. + */ +bool snd_hda_check_amp_caps(struct hda_codec *codec, hda_nid_t nid, + int dir, unsigned int bits) +{ + if (!nid) + return false; + if (get_wcaps(codec, nid) & (1 << (dir + 1))) + if (query_amp_caps(codec, nid, dir) & bits) + return true; + return false; +} +EXPORT_SYMBOL_GPL(snd_hda_check_amp_caps); + +/** * snd_hda_override_amp_caps - Override the AMP capabilities * @codec: the CODEC to clean up * @nid: the NID to clean up |