ALSA: hda - Fix missing ADC list in ALC260 auto-probe mode
authorTakashi Iwai <tiwai@suse.de>
Mon, 3 Nov 2008 16:47:49 +0000 (17:47 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 3 Nov 2008 16:50:48 +0000 (17:50 +0100)
The commit f9e336f65b666b8f1764d17e9b7c21c90748a37e
    ALSA: hda - Unify capture mixer creation in realtek codes
removed the ADC check for ALC260 auto-probe mode accidentally.
Re-added to patch_alc260() again.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_realtek.c

index 700fc8632c663931d11a5430d30c5dfe62e8c1cf..e727e48a48e38d4d893bb21e6eeffdbfc79958df 100644 (file)
@@ -5618,6 +5618,19 @@ static int patch_alc260(struct hda_codec *codec)
        spec->stream_digital_playback = &alc260_pcm_digital_playback;
        spec->stream_digital_capture = &alc260_pcm_digital_capture;
 
+       if (!spec->adc_nids && spec->input_mux) {
+               /* check whether NID 0x04 is valid */
+               unsigned int wcap = get_wcaps(codec, 0x04);
+               wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
+               /* get type */
+               if (wcap != AC_WID_AUD_IN || spec->input_mux->num_items == 1) {
+                       spec->adc_nids = alc260_adc_nids_alt;
+                       spec->num_adc_nids = ARRAY_SIZE(alc260_adc_nids_alt);
+               } else {
+                       spec->adc_nids = alc260_adc_nids;
+                       spec->num_adc_nids = ARRAY_SIZE(alc260_adc_nids);
+               }
+       }
        set_capture_mixer(spec);
 
        spec->vmaster_nid = 0x08;