aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_via.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 13:13:38 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 13:13:38 -0400
commitfc8a327db6c46de783b1a4276d846841b9abc24c (patch)
treebee512c142cccea93511debd98ef954581693727 /sound/pci/hda/patch_via.c
parent92d15c2ccbb3e31a3fc71ad28fdb55e1319383c0 (diff)
parent24837e6f249a2c83667552e6871c1543b4a6b934 (diff)
Merge branch 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
* 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa: (264 commits) [ALSA] version 1.0.15 [ALSA] Fix thinko in cs4231 mce down check [ALSA] sun-cs4231: improved waiting after MCE down [ALSA] sun-cs4231: use cs4231-regs.h [ALSA] This simplifies and fixes waiting loops of the mce_down() [ALSA] This patch adds support for a wavetable chip on [ALSA] This patch removes open_mutex from the ad1848-lib as [ALSA] fix bootup crash in snd_gus_interrupt() [ALSA] hda-codec - Fix SKU ID function for realtek codecs [ALSA] Support ASUS P701 eeepc [0x1043 0x82a1] support [ALSA] hda-codec - Add array terminator for dmic in STAC codec [ALSA] hdsp - Fix zero division [ALSA] usb-audio - Fix double comment [ALSA] hda-codec - Fix STAC922x volume knob control [ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz [ALSA] hda-codec - Fix for Fujitsu Lifebook C1410 [ALSA] mpu-401: remove MPU401_INFO_UART_ONLY flag [ALSA] mpu-401: do not require an ACK byte for the ENTER_UART command [ALSA] via82xx - Add DXS quirk for Shuttle AK31v2 [ALSA] hda-codec - Fix input_mux numbers for vaio stac92xx ...
Diffstat (limited to 'sound/pci/hda/patch_via.c')
-rw-r--r--sound/pci/hda/patch_via.c80
1 files changed, 50 insertions, 30 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index ba32d1e52cb8..33b5e1ffa817 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -115,6 +115,10 @@ struct via_spec {
115 struct snd_kcontrol_new *kctl_alloc; 115 struct snd_kcontrol_new *kctl_alloc;
116 struct hda_input_mux private_imux; 116 struct hda_input_mux private_imux;
117 hda_nid_t private_dac_nids[4]; 117 hda_nid_t private_dac_nids[4];
118
119#ifdef CONFIG_SND_HDA_POWER_SAVE
120 struct hda_loopback_check loopback;
121#endif
118}; 122};
119 123
120static hda_nid_t vt1708_adc_nids[2] = { 124static hda_nid_t vt1708_adc_nids[2] = {
@@ -305,15 +309,15 @@ static struct hda_verb vt1708_volume_init_verbs[] = {
305 {0x27, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 309 {0x27, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
306 310
307 311
308 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback 312 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
309 * mixer widget 313 * mixer widget
310 */ 314 */
311 /* Amp Indices: CD = 1, Mic1 = 2, Line = 3, Mic2 = 4 */ 315 /* Amp Indices: CD = 1, Mic1 = 2, Line = 3, Mic2 = 4 */
312 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 316 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, /* master */
313 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 317 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
314 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 318 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
315 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, 319 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
316 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)}, 320 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
317 321
318 /* 322 /*
319 * Set up output mixers (0x19 - 0x1b) 323 * Set up output mixers (0x19 - 0x1b)
@@ -543,24 +547,11 @@ static int via_init(struct hda_codec *codec)
543 return 0; 547 return 0;
544} 548}
545 549
546#ifdef CONFIG_PM 550#ifdef CONFIG_SND_HDA_POWER_SAVE
547/* 551static int via_check_power_status(struct hda_codec *codec, hda_nid_t nid)
548 * resume
549 */
550static int via_resume(struct hda_codec *codec)
551{ 552{
552 struct via_spec *spec = codec->spec; 553 struct via_spec *spec = codec->spec;
553 int i; 554 return snd_hda_check_amp_list_power(codec, &spec->loopback, nid);
554
555 via_init(codec);
556 for (i = 0; i < spec->num_mixers; i++)
557 snd_hda_resume_ctls(codec, spec->mixers[i]);
558 if (spec->multiout.dig_out_nid)
559 snd_hda_resume_spdif_out(codec);
560 if (spec->dig_in_nid)
561 snd_hda_resume_spdif_in(codec);
562
563 return 0;
564} 555}
565#endif 556#endif
566 557
@@ -571,8 +562,8 @@ static struct hda_codec_ops via_patch_ops = {
571 .build_pcms = via_build_pcms, 562 .build_pcms = via_build_pcms,
572 .init = via_init, 563 .init = via_init,
573 .free = via_free, 564 .free = via_free,
574#ifdef CONFIG_PM 565#ifdef CONFIG_SND_HDA_POWER_SAVE
575 .resume = via_resume, 566 .check_power_status = via_check_power_status,
576#endif 567#endif
577}; 568};
578 569
@@ -762,6 +753,16 @@ static int vt1708_auto_create_analog_input_ctls(struct via_spec *spec,
762 return 0; 753 return 0;
763} 754}
764 755
756#ifdef CONFIG_SND_HDA_POWER_SAVE
757static struct hda_amp_list vt1708_loopbacks[] = {
758 { 0x17, HDA_INPUT, 1 },
759 { 0x17, HDA_INPUT, 2 },
760 { 0x17, HDA_INPUT, 3 },
761 { 0x17, HDA_INPUT, 4 },
762 { } /* end */
763};
764#endif
765
765static int vt1708_parse_auto_config(struct hda_codec *codec) 766static int vt1708_parse_auto_config(struct hda_codec *codec)
766{ 767{
767 struct via_spec *spec = codec->spec; 768 struct via_spec *spec = codec->spec;
@@ -855,6 +856,9 @@ static int patch_vt1708(struct hda_codec *codec)
855 codec->patch_ops = via_patch_ops; 856 codec->patch_ops = via_patch_ops;
856 857
857 codec->patch_ops.init = via_auto_init; 858 codec->patch_ops.init = via_auto_init;
859#ifdef CONFIG_SND_HDA_POWER_SAVE
860 spec->loopback.amplist = vt1708_loopbacks;
861#endif
858 862
859 return 0; 863 return 0;
860} 864}
@@ -895,15 +899,15 @@ static struct hda_verb vt1709_10ch_volume_init_verbs[] = {
895 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 899 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
896 900
897 901
898 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback 902 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
899 * mixer widget 903 * mixer widget
900 */ 904 */
901 /* Amp Indices: AOW0=0, CD = 1, Mic1 = 2, Line = 3, Mic2 = 4 */ 905 /* Amp Indices: AOW0=0, CD = 1, Mic1 = 2, Line = 3, Mic2 = 4 */
902 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 906 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, /* unmute master */
903 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 907 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
904 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 908 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
905 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, 909 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
906 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)}, 910 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
907 911
908 /* 912 /*
909 * Set up output selector (0x1a, 0x1b, 0x29) 913 * Set up output selector (0x1a, 0x1b, 0x29)
@@ -1251,6 +1255,16 @@ static int vt1709_parse_auto_config(struct hda_codec *codec)
1251 return 1; 1255 return 1;
1252} 1256}
1253 1257
1258#ifdef CONFIG_SND_HDA_POWER_SAVE
1259static struct hda_amp_list vt1709_loopbacks[] = {
1260 { 0x18, HDA_INPUT, 1 },
1261 { 0x18, HDA_INPUT, 2 },
1262 { 0x18, HDA_INPUT, 3 },
1263 { 0x18, HDA_INPUT, 4 },
1264 { } /* end */
1265};
1266#endif
1267
1254static int patch_vt1709_10ch(struct hda_codec *codec) 1268static int patch_vt1709_10ch(struct hda_codec *codec)
1255{ 1269{
1256 struct via_spec *spec; 1270 struct via_spec *spec;
@@ -1293,6 +1307,9 @@ static int patch_vt1709_10ch(struct hda_codec *codec)
1293 codec->patch_ops = via_patch_ops; 1307 codec->patch_ops = via_patch_ops;
1294 1308
1295 codec->patch_ops.init = via_auto_init; 1309 codec->patch_ops.init = via_auto_init;
1310#ifdef CONFIG_SND_HDA_POWER_SAVE
1311 spec->loopback.amplist = vt1709_loopbacks;
1312#endif
1296 1313
1297 return 0; 1314 return 0;
1298} 1315}
@@ -1383,6 +1400,9 @@ static int patch_vt1709_6ch(struct hda_codec *codec)
1383 codec->patch_ops = via_patch_ops; 1400 codec->patch_ops = via_patch_ops;
1384 1401
1385 codec->patch_ops.init = via_auto_init; 1402 codec->patch_ops.init = via_auto_init;
1403#ifdef CONFIG_SND_HDA_POWER_SAVE
1404 spec->loopback.amplist = vt1709_loopbacks;
1405#endif
1386 1406
1387 return 0; 1407 return 0;
1388} 1408}