diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-08-15 06:49:07 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-08-15 06:49:07 -0400 |
commit | f57c25650b9f011290539a888d9df0e5dd3ce9f7 (patch) | |
tree | 591f662a98802ade20922fe1d519afaf2f8b0db4 | |
parent | 2d9f8a6e73ef2ec8ecaa24ca98e7010d6edd089f (diff) |
ALSA: hda - Add snd_hda_override_pin_caps() helper function
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/hda_codec.c | 23 | ||||
-rw-r--r-- | sound/pci/hda/hda_local.h | 2 |
2 files changed, 25 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 2a8d447c8ed6..83d3eb5e5552 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -1693,6 +1693,29 @@ u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid) | |||
1693 | EXPORT_SYMBOL_HDA(snd_hda_query_pin_caps); | 1693 | EXPORT_SYMBOL_HDA(snd_hda_query_pin_caps); |
1694 | 1694 | ||
1695 | /** | 1695 | /** |
1696 | * snd_hda_override_pin_caps - Override the pin capabilities | ||
1697 | * @codec: the CODEC | ||
1698 | * @nid: the NID to override | ||
1699 | * @caps: the capability bits to set | ||
1700 | * | ||
1701 | * Override the cached PIN capabilitiy bits value by the given one. | ||
1702 | * | ||
1703 | * Returns zero if successful or a negative error code. | ||
1704 | */ | ||
1705 | int snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid, | ||
1706 | unsigned int caps) | ||
1707 | { | ||
1708 | struct hda_amp_info *info; | ||
1709 | info = get_alloc_amp_hash(codec, HDA_HASH_PINCAP_KEY(nid)); | ||
1710 | if (!info) | ||
1711 | return -ENOMEM; | ||
1712 | info->amp_caps = caps; | ||
1713 | info->head.val |= INFO_AMP_CAPS; | ||
1714 | return 0; | ||
1715 | } | ||
1716 | EXPORT_SYMBOL_HDA(snd_hda_override_pin_caps); | ||
1717 | |||
1718 | /** | ||
1696 | * snd_hda_pin_sense - execute pin sense measurement | 1719 | * snd_hda_pin_sense - execute pin sense measurement |
1697 | * @codec: the CODEC to sense | 1720 | * @codec: the CODEC to sense |
1698 | * @nid: the pin NID to sense | 1721 | * @nid: the pin NID to sense |
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 2e7ac31afa8d..9ed4b0dd6724 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -492,6 +492,8 @@ u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction); | |||
492 | int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, | 492 | int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, |
493 | unsigned int caps); | 493 | unsigned int caps); |
494 | u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid); | 494 | u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid); |
495 | int snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid, | ||
496 | unsigned int caps); | ||
495 | u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid); | 497 | u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid); |
496 | int snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid); | 498 | int snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid); |
497 | 499 | ||