Skip to content

Commit

Permalink
ALSA: hda - Fix initial capture source connections of ALC880/260
Browse files Browse the repository at this point in the history
The widget connections of ADC of ALC880 and ALC2260 aren't initialized,
thus it might point to invalid pin.  This can be a problem when mode=auto
and there is only one input pin.  Then user can't change the connection
at all.

This patch adds the code to initialize the input pin connection of these
codecs.

Reference: Novell bnc#594363
	https://bugzilla.novell.com/show_bug.cgi?id=594363

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Apr 9, 2010
1 parent 226b1ec commit 7f311a4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -4809,6 +4809,25 @@ static void alc880_auto_init_analog_input(struct hda_codec *codec)
}
}

static void alc880_auto_init_input_src(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
int c;

for (c = 0; c < spec->num_adc_nids; c++) {
unsigned int mux_idx;
const struct hda_input_mux *imux;
mux_idx = c >= spec->num_mux_defs ? 0 : c;
imux = &spec->input_mux[mux_idx];
if (!imux->num_items && mux_idx > 0)
imux = &spec->input_mux[0];
if (imux)
snd_hda_codec_write(codec, spec->adc_nids[c], 0,
AC_VERB_SET_CONNECT_SEL,
imux->items[0].index);
}
}

/* parse the BIOS configuration and set up the alc_spec */
/* return 1 if successful, 0 if the proper config is not found,
* or a negative error code
Expand Down Expand Up @@ -4887,6 +4906,7 @@ static void alc880_auto_init(struct hda_codec *codec)
alc880_auto_init_multi_out(codec);
alc880_auto_init_extra_out(codec);
alc880_auto_init_analog_input(codec);
alc880_auto_init_input_src(codec);
if (spec->unsol_event)
alc_inithook(codec);
}
Expand Down Expand Up @@ -6398,6 +6418,8 @@ static void alc260_auto_init_analog_input(struct hda_codec *codec)
}
}

#define alc260_auto_init_input_src alc880_auto_init_input_src

/*
* generic initialization of ADC, input mixers and output mixers
*/
Expand Down Expand Up @@ -6484,6 +6506,7 @@ static void alc260_auto_init(struct hda_codec *codec)
struct alc_spec *spec = codec->spec;
alc260_auto_init_multi_out(codec);
alc260_auto_init_analog_input(codec);
alc260_auto_init_input_src(codec);
if (spec->unsol_event)
alc_inithook(codec);
}
Expand Down

0 comments on commit 7f311a4

Please sign in to comment.