From 8ebb1fb36341a1fb066e104c54998fe3bab24576 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 15 Aug 2011 12:49:07 +0200 Subject: [PATCH] --- yaml --- r: 270333 b: refs/heads/master c: f57c25650b9f011290539a888d9df0e5dd3ce9f7 h: refs/heads/master i: 270331: 9998c4057287512b6fd20972511db8591fbc9a1b v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/hda_codec.c | 23 +++++++++++++++++++++++ trunk/sound/pci/hda/hda_local.h | 2 ++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index bf9f51e6ebbc..e5aa58470abc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2d9f8a6e73ef2ec8ecaa24ca98e7010d6edd089f +refs/heads/master: f57c25650b9f011290539a888d9df0e5dd3ce9f7 diff --git a/trunk/sound/pci/hda/hda_codec.c b/trunk/sound/pci/hda/hda_codec.c index 2a8d447c8ed6..83d3eb5e5552 100644 --- a/trunk/sound/pci/hda/hda_codec.c +++ b/trunk/sound/pci/hda/hda_codec.c @@ -1692,6 +1692,29 @@ u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid) } EXPORT_SYMBOL_HDA(snd_hda_query_pin_caps); +/** + * snd_hda_override_pin_caps - Override the pin capabilities + * @codec: the CODEC + * @nid: the NID to override + * @caps: the capability bits to set + * + * Override the cached PIN capabilitiy bits value by the given one. + * + * Returns zero if successful or a negative error code. + */ +int snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid, + unsigned int caps) +{ + struct hda_amp_info *info; + info = get_alloc_amp_hash(codec, HDA_HASH_PINCAP_KEY(nid)); + if (!info) + return -ENOMEM; + info->amp_caps = caps; + info->head.val |= INFO_AMP_CAPS; + return 0; +} +EXPORT_SYMBOL_HDA(snd_hda_override_pin_caps); + /** * snd_hda_pin_sense - execute pin sense measurement * @codec: the CODEC to sense diff --git a/trunk/sound/pci/hda/hda_local.h b/trunk/sound/pci/hda/hda_local.h index 2e7ac31afa8d..9ed4b0dd6724 100644 --- a/trunk/sound/pci/hda/hda_local.h +++ b/trunk/sound/pci/hda/hda_local.h @@ -492,6 +492,8 @@ 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); 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); u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid); int snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid);