]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[ALSA] hda-codec - Enable VIA SPDIF input pin
authorTakashi Iwai <tiwai@suse.de>
Tue, 15 Jan 2008 11:39:38 +0000 (12:39 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 31 Jan 2008 16:29:59 +0000 (17:29 +0100)
Enable the SPDIF input-pin on VIA codecs when SPDIF-input is enabled
by BIOS.  Also, including a bit code clean up.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
sound/pci/hda/patch_via.c

index d4dc5596c946e243fa547c1912cda2dde5579ea9..4e5dd4cf36f5f6404852e9ef70a0fc7110fc5730 100644 (file)
@@ -566,25 +566,27 @@ static int via_init(struct hda_codec *codec)
                if (IS_VT1708_VENDORID(codec->vendor_id)) {
                        snd_hda_codec_write(codec, VT1708_DIGIN_PIN, 0,
                                            AC_VERB_SET_PIN_WIDGET_CONTROL,
-                                           0x40);
+                                           PIN_OUT);
                        snd_hda_codec_write(codec, VT1708_DIGIN_PIN, 0,
                                            AC_VERB_SET_EAPD_BTLENABLE, 0x02);
                } else if (IS_VT1709_10CH_VENDORID(codec->vendor_id) ||
                           IS_VT1709_6CH_VENDORID(codec->vendor_id)) {
                        snd_hda_codec_write(codec, VT1709_DIGIN_PIN, 0,
                                            AC_VERB_SET_PIN_WIDGET_CONTROL,
-                                           0x40);
+                                           PIN_OUT);
                        snd_hda_codec_write(codec, VT1709_DIGIN_PIN, 0,
                                            AC_VERB_SET_EAPD_BTLENABLE, 0x02);
                } else if (IS_VT1708B_8CH_VENDORID(codec->vendor_id) ||
                           IS_VT1708B_4CH_VENDORID(codec->vendor_id)) {
                        snd_hda_codec_write(codec, VT1708B_DIGIN_PIN, 0,
                                            AC_VERB_SET_PIN_WIDGET_CONTROL,
-                                           0x40);
+                                           PIN_OUT);
                        snd_hda_codec_write(codec, VT1708B_DIGIN_PIN, 0,
                                            AC_VERB_SET_EAPD_BTLENABLE, 0x02);
                }
-       }
+       } else /* enable SPDIF-input pin */
+               snd_hda_codec_write(codec, spec->autocfg.dig_in_pin, 0,
+                                   AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN);
 
        return 0;
 }