aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-07-07 07:39:03 -0400
committerTakashi Iwai <tiwai@suse.de>2009-07-07 07:39:03 -0400
commit55d1d6c1ef630dddd3cb5354c32a5aca954399e8 (patch)
tree4cd1d697c448b77e810cb575f932da89b658f69c /sound/pci
parentaba6653617754e12763a0d3c9dda332b66190a50 (diff)
ALSA: hda - Clean up VT170x dig-in initialization code
Minor clean up for initializing the digital-in pin. No functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_via.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 8e004fb6961a..c4ddbbc6231a 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -211,6 +211,7 @@ struct via_spec {
211 unsigned int num_adc_nids; 211 unsigned int num_adc_nids;
212 hda_nid_t *adc_nids; 212 hda_nid_t *adc_nids;
213 hda_nid_t dig_in_nid; 213 hda_nid_t dig_in_nid;
214 hda_nid_t dig_in_pin;
214 215
215 /* capture source */ 216 /* capture source */
216 const struct hda_input_mux *input_mux; 217 const struct hda_input_mux *input_mux;
@@ -998,25 +999,11 @@ static int via_init(struct hda_codec *codec)
998 999
999 /* Lydia Add for EAPD enable */ 1000 /* Lydia Add for EAPD enable */
1000 if (!spec->dig_in_nid) { /* No Digital In connection */ 1001 if (!spec->dig_in_nid) { /* No Digital In connection */
1001 if (IS_VT1708_VENDORID(codec->vendor_id)) { 1002 if (spec->dig_in_pin) {
1002 snd_hda_codec_write(codec, VT1708_DIGIN_PIN, 0, 1003 snd_hda_codec_write(codec, spec->dig_in_pin, 0,
1003 AC_VERB_SET_PIN_WIDGET_CONTROL, 1004 AC_VERB_SET_PIN_WIDGET_CONTROL,
1004 PIN_OUT); 1005 PIN_OUT);
1005 snd_hda_codec_write(codec, VT1708_DIGIN_PIN, 0, 1006 snd_hda_codec_write(codec, spec->dig_in_pin, 0,
1006 AC_VERB_SET_EAPD_BTLENABLE, 0x02);
1007 } else if (IS_VT1709_10CH_VENDORID(codec->vendor_id) ||
1008 IS_VT1709_6CH_VENDORID(codec->vendor_id)) {
1009 snd_hda_codec_write(codec, VT1709_DIGIN_PIN, 0,
1010 AC_VERB_SET_PIN_WIDGET_CONTROL,
1011 PIN_OUT);
1012 snd_hda_codec_write(codec, VT1709_DIGIN_PIN, 0,
1013 AC_VERB_SET_EAPD_BTLENABLE, 0x02);
1014 } else if (IS_VT1708B_8CH_VENDORID(codec->vendor_id) ||
1015 IS_VT1708B_4CH_VENDORID(codec->vendor_id)) {
1016 snd_hda_codec_write(codec, VT1708B_DIGIN_PIN, 0,
1017 AC_VERB_SET_PIN_WIDGET_CONTROL,
1018 PIN_OUT);
1019 snd_hda_codec_write(codec, VT1708B_DIGIN_PIN, 0,
1020 AC_VERB_SET_EAPD_BTLENABLE, 0x02); 1007 AC_VERB_SET_EAPD_BTLENABLE, 0x02);
1021 } 1008 }
1022 } else /* enable SPDIF-input pin */ 1009 } else /* enable SPDIF-input pin */
@@ -1326,6 +1313,7 @@ static int vt1708_parse_auto_config(struct hda_codec *codec)
1326 1313
1327 if (spec->autocfg.dig_outs) 1314 if (spec->autocfg.dig_outs)
1328 spec->multiout.dig_out_nid = VT1708_DIGOUT_NID; 1315 spec->multiout.dig_out_nid = VT1708_DIGOUT_NID;
1316 spec->dig_in_pin = VT1708_DIGIN_PIN;
1329 if (spec->autocfg.dig_in_pin) 1317 if (spec->autocfg.dig_in_pin)
1330 spec->dig_in_nid = VT1708_DIGIN_NID; 1318 spec->dig_in_nid = VT1708_DIGIN_NID;
1331 1319
@@ -1799,6 +1787,7 @@ static int vt1709_parse_auto_config(struct hda_codec *codec)
1799 1787
1800 if (spec->autocfg.dig_outs) 1788 if (spec->autocfg.dig_outs)
1801 spec->multiout.dig_out_nid = VT1709_DIGOUT_NID; 1789 spec->multiout.dig_out_nid = VT1709_DIGOUT_NID;
1790 spec->dig_in_pin = VT1709_DIGIN_PIN;
1802 if (spec->autocfg.dig_in_pin) 1791 if (spec->autocfg.dig_in_pin)
1803 spec->dig_in_nid = VT1709_DIGIN_NID; 1792 spec->dig_in_nid = VT1709_DIGIN_NID;
1804 1793
@@ -2344,6 +2333,7 @@ static int vt1708B_parse_auto_config(struct hda_codec *codec)
2344 2333
2345 if (spec->autocfg.dig_outs) 2334 if (spec->autocfg.dig_outs)
2346 spec->multiout.dig_out_nid = VT1708B_DIGOUT_NID; 2335 spec->multiout.dig_out_nid = VT1708B_DIGOUT_NID;
2336 spec->dig_in_pin = VT1708B_DIGIN_PIN;
2347 if (spec->autocfg.dig_in_pin) 2337 if (spec->autocfg.dig_in_pin)
2348 spec->dig_in_nid = VT1708B_DIGIN_NID; 2338 spec->dig_in_nid = VT1708B_DIGIN_NID;
2349 2339