diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-06-19 01:54:09 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-25 17:07:24 -0400 |
commit | 1f563ec40d24e0af579911dfbd6ac8856889bb89 (patch) | |
tree | f2325d425ef04da8908e0948bba4381199bc3aab /sound/pci | |
parent | 27035caa37556524ef30311438cefaf1a80a5364 (diff) |
ALSA: hda - Fix missing Mic Boost controls for VIA codecs
commit d045c5dc43d829df9f067d363c3b42b14dacf434 upstream.
Some VIA codecs like VT1708S have Mic boost amps in the mic pins but
they aren't exposed in the capability bits. In the past driver code,
we override the pin caps and create mic boost controls forcibly.
While transition to the generic parser, we lost the mic boost controls
although the pin caps are still overridden, because the generic parser
code checks the widget caps, too.
So this patch adds a new helper function to allow the override of the
given widget capability bits, and makes VIA codecs driver to add the
missing input-amp capability bit.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=59861
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/hda_local.h | 8 | ||||
-rw-r--r-- | sound/pci/hda/patch_via.c | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 29ed7d9b27e4..2e7493ef8ee0 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -562,6 +562,14 @@ static inline unsigned int get_wcaps_channels(u32 wcaps) | |||
562 | return chans; | 562 | return chans; |
563 | } | 563 | } |
564 | 564 | ||
565 | static inline void snd_hda_override_wcaps(struct hda_codec *codec, | ||
566 | hda_nid_t nid, u32 val) | ||
567 | { | ||
568 | if (nid >= codec->start_nid && | ||
569 | nid < codec->start_nid + codec->num_nodes) | ||
570 | codec->wcaps[nid - codec->start_nid] = val; | ||
571 | } | ||
572 | |||
565 | u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction); | 573 | u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction); |
566 | int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, | 574 | int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, |
567 | unsigned int caps); | 575 | unsigned int caps); |
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index e5245544eb52..aed19c3f8466 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -910,6 +910,8 @@ static const struct hda_verb vt1708S_init_verbs[] = { | |||
910 | static void override_mic_boost(struct hda_codec *codec, hda_nid_t pin, | 910 | static void override_mic_boost(struct hda_codec *codec, hda_nid_t pin, |
911 | int offset, int num_steps, int step_size) | 911 | int offset, int num_steps, int step_size) |
912 | { | 912 | { |
913 | snd_hda_override_wcaps(codec, pin, | ||
914 | get_wcaps(codec, pin) | AC_WCAP_IN_AMP); | ||
913 | snd_hda_override_amp_caps(codec, pin, HDA_INPUT, | 915 | snd_hda_override_amp_caps(codec, pin, HDA_INPUT, |
914 | (offset << AC_AMPCAP_OFFSET_SHIFT) | | 916 | (offset << AC_AMPCAP_OFFSET_SHIFT) | |
915 | (num_steps << AC_AMPCAP_NUM_STEPS_SHIFT) | | 917 | (num_steps << AC_AMPCAP_NUM_STEPS_SHIFT) | |