Loading sound/pci/hda/hda_codec.c +20 −0 Original line number Diff line number Diff line Loading @@ -2001,6 +2001,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 Loading sound/pci/hda/hda_generic.c +0 −17 Original line number Diff line number Diff line Loading @@ -519,18 +519,6 @@ static unsigned int amp_val_replace_channels(unsigned int val, unsigned int chs) return val; } /* check whether the widget has the given amp capability for the direction */ static bool 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; } static bool same_amp_caps(struct hda_codec *codec, hda_nid_t nid1, hda_nid_t nid2, int dir) { Loading @@ -540,11 +528,6 @@ static bool same_amp_caps(struct hda_codec *codec, hda_nid_t nid1, query_amp_caps(codec, nid2, dir)); } #define nid_has_mute(codec, nid, dir) \ check_amp_caps(codec, nid, dir, (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE)) #define nid_has_volume(codec, nid, dir) \ check_amp_caps(codec, nid, dir, AC_AMPCAP_NUM_STEPS) /* look for a widget suitable for assigning a mute switch in the path */ static hda_nid_t look_for_out_mute_nid(struct hda_codec *codec, struct nid_path *path) Loading sound/pci/hda/hda_local.h +8 −0 Original line number Diff line number Diff line Loading @@ -603,6 +603,14 @@ int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid); int snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid, unsigned int caps); bool snd_hda_check_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, unsigned int bits); #define nid_has_mute(codec, nid, dir) \ snd_hda_check_amp_caps(codec, nid, dir, (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE)) #define nid_has_volume(codec, nid, dir) \ snd_hda_check_amp_caps(codec, nid, dir, AC_AMPCAP_NUM_STEPS) /* flags for hda_nid_item */ #define HDA_NID_ITEM_AMP (1<<0) Loading Loading
sound/pci/hda/hda_codec.c +20 −0 Original line number Diff line number Diff line Loading @@ -2001,6 +2001,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 Loading
sound/pci/hda/hda_generic.c +0 −17 Original line number Diff line number Diff line Loading @@ -519,18 +519,6 @@ static unsigned int amp_val_replace_channels(unsigned int val, unsigned int chs) return val; } /* check whether the widget has the given amp capability for the direction */ static bool 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; } static bool same_amp_caps(struct hda_codec *codec, hda_nid_t nid1, hda_nid_t nid2, int dir) { Loading @@ -540,11 +528,6 @@ static bool same_amp_caps(struct hda_codec *codec, hda_nid_t nid1, query_amp_caps(codec, nid2, dir)); } #define nid_has_mute(codec, nid, dir) \ check_amp_caps(codec, nid, dir, (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE)) #define nid_has_volume(codec, nid, dir) \ check_amp_caps(codec, nid, dir, AC_AMPCAP_NUM_STEPS) /* look for a widget suitable for assigning a mute switch in the path */ static hda_nid_t look_for_out_mute_nid(struct hda_codec *codec, struct nid_path *path) Loading
sound/pci/hda/hda_local.h +8 −0 Original line number Diff line number Diff line Loading @@ -603,6 +603,14 @@ int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid); int snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid, unsigned int caps); bool snd_hda_check_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, unsigned int bits); #define nid_has_mute(codec, nid, dir) \ snd_hda_check_amp_caps(codec, nid, dir, (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE)) #define nid_has_volume(codec, nid, dir) \ snd_hda_check_amp_caps(codec, nid, dir, AC_AMPCAP_NUM_STEPS) /* flags for hda_nid_item */ #define HDA_NID_ITEM_AMP (1<<0) Loading