mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 15:15:47 +00:00
ALSA: hda - Exclude unusable ADCs for ALC88x
On Realtek codecs, a digital mic pin is connected often only to a single ADC. But the parser tries to set up all ADCs no matter whether the digital mic is available, and results in non-selectable input source. This patch adds a check of input-source availability of each ADC, and excludes ones that don't support all input sources. Reference: Novell bnc#561235 http://bugzilla.novell.com/show_bug.cgi?id=561235 Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
23033b2bce
commit
d11f74c62f
1 changed files with 12 additions and 1 deletions
|
@ -10021,10 +10021,12 @@ static int patch_alc882(struct hda_codec *codec)
|
||||||
spec->init_amp = ALC_INIT_DEFAULT; /* always initialize */
|
spec->init_amp = ALC_INIT_DEFAULT; /* always initialize */
|
||||||
|
|
||||||
if (!spec->adc_nids && spec->input_mux) {
|
if (!spec->adc_nids && spec->input_mux) {
|
||||||
int i;
|
int i, j;
|
||||||
spec->num_adc_nids = 0;
|
spec->num_adc_nids = 0;
|
||||||
for (i = 0; i < ARRAY_SIZE(alc882_adc_nids); i++) {
|
for (i = 0; i < ARRAY_SIZE(alc882_adc_nids); i++) {
|
||||||
|
const struct hda_input_mux *imux = spec->input_mux;
|
||||||
hda_nid_t cap;
|
hda_nid_t cap;
|
||||||
|
hda_nid_t items[16];
|
||||||
hda_nid_t nid = alc882_adc_nids[i];
|
hda_nid_t nid = alc882_adc_nids[i];
|
||||||
unsigned int wcap = get_wcaps(codec, nid);
|
unsigned int wcap = get_wcaps(codec, nid);
|
||||||
/* get type */
|
/* get type */
|
||||||
|
@ -10035,6 +10037,15 @@ static int patch_alc882(struct hda_codec *codec)
|
||||||
err = snd_hda_get_connections(codec, nid, &cap, 1);
|
err = snd_hda_get_connections(codec, nid, &cap, 1);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
continue;
|
continue;
|
||||||
|
err = snd_hda_get_connections(codec, cap, items,
|
||||||
|
ARRAY_SIZE(items));
|
||||||
|
if (err < 0)
|
||||||
|
continue;
|
||||||
|
for (j = 0; j < imux->num_items; j++)
|
||||||
|
if (imux->items[j].index >= err)
|
||||||
|
break;
|
||||||
|
if (j < imux->num_items)
|
||||||
|
continue;
|
||||||
spec->private_capsrc_nids[spec->num_adc_nids] = cap;
|
spec->private_capsrc_nids[spec->num_adc_nids] = cap;
|
||||||
spec->num_adc_nids++;
|
spec->num_adc_nids++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue