diff options
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/patch_via.c | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index fab875a21726..30260e259181 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -22,26 +22,26 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | /* * * * * * * * * * * * * * Release History * * * * * * * * * * * * * * * * */ | 24 | /* * * * * * * * * * * * * * Release History * * * * * * * * * * * * * * * * */ |
25 | /* */ | 25 | /* */ |
26 | /* 2006-03-03 Lydia Wang Create the basic patch to support VT1708 codec */ | 26 | /* 2006-03-03 Lydia Wang Create the basic patch to support VT1708 codec */ |
27 | /* 2006-03-14 Lydia Wang Modify hard code for some pin widget nid */ | 27 | /* 2006-03-14 Lydia Wang Modify hard code for some pin widget nid */ |
28 | /* 2006-08-02 Lydia Wang Add support to VT1709 codec */ | 28 | /* 2006-08-02 Lydia Wang Add support to VT1709 codec */ |
29 | /* 2006-09-08 Lydia Wang Fix internal loopback recording source select bug */ | 29 | /* 2006-09-08 Lydia Wang Fix internal loopback recording source select bug */ |
30 | /* 2007-09-12 Lydia Wang Add EAPD enable during driver initialization */ | 30 | /* 2007-09-12 Lydia Wang Add EAPD enable during driver initialization */ |
31 | /* 2007-09-17 Lydia Wang Add VT1708B codec support */ | 31 | /* 2007-09-17 Lydia Wang Add VT1708B codec support */ |
32 | /* 2007-11-14 Lydia Wang Add VT1708A codec HP and CD pin connect config */ | 32 | /* 2007-11-14 Lydia Wang Add VT1708A codec HP and CD pin connect config */ |
33 | /* 2008-02-03 Lydia Wang Fix Rear channels and Back channels inverse issue */ | 33 | /* 2008-02-03 Lydia Wang Fix Rear channels and Back channels inverse issue */ |
34 | /* 2008-03-06 Lydia Wang Add VT1702 codec and VT1708S codec support */ | 34 | /* 2008-03-06 Lydia Wang Add VT1702 codec and VT1708S codec support */ |
35 | /* 2008-04-09 Lydia Wang Add mute front speaker when HP plugin */ | 35 | /* 2008-04-09 Lydia Wang Add mute front speaker when HP plugin */ |
36 | /* 2008-04-09 Lydia Wang Add Independent HP feature */ | 36 | /* 2008-04-09 Lydia Wang Add Independent HP feature */ |
37 | /* 2008-05-28 Lydia Wang Add second S/PDIF Out support for VT1702 */ | 37 | /* 2008-05-28 Lydia Wang Add second S/PDIF Out support for VT1702 */ |
38 | /* 2008-09-15 Logan Li Add VT1708S Mic Boost workaround/backdoor */ | 38 | /* 2008-09-15 Logan Li Add VT1708S Mic Boost workaround/backdoor */ |
39 | /* 2009-02-16 Logan Li Add support for VT1718S */ | 39 | /* 2009-02-16 Logan Li Add support for VT1718S */ |
40 | /* 2009-03-13 Logan Li Add support for VT1716S */ | 40 | /* 2009-03-13 Logan Li Add support for VT1716S */ |
41 | /* 2009-04-14 Lydai Wang Add support for VT1828S and VT2020 */ | 41 | /* 2009-04-14 Lydai Wang Add support for VT1828S and VT2020 */ |
42 | /* 2009-07-08 Lydia Wang Add support for VT2002P */ | 42 | /* 2009-07-08 Lydia Wang Add support for VT2002P */ |
43 | /* 2009-07-21 Lydia Wang Add support for VT1812 */ | 43 | /* 2009-07-21 Lydia Wang Add support for VT1812 */ |
44 | /* */ | 44 | /* */ |
45 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | 45 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
46 | 46 | ||
47 | 47 | ||
@@ -486,7 +486,7 @@ static void via_auto_set_output_and_unmute(struct hda_codec *codec, | |||
486 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, | 486 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, |
487 | AMP_OUT_UNMUTE); | 487 | AMP_OUT_UNMUTE); |
488 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) | 488 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) |
489 | snd_hda_codec_write(codec, nid, 0, | 489 | snd_hda_codec_write(codec, nid, 0, |
490 | AC_VERB_SET_EAPD_BTLENABLE, 0x02); | 490 | AC_VERB_SET_EAPD_BTLENABLE, 0x02); |
491 | } | 491 | } |
492 | 492 | ||
@@ -1545,7 +1545,7 @@ static struct hda_verb vt1708_volume_init_verbs[] = { | |||
1545 | {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | 1545 | {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, |
1546 | {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | 1546 | {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, |
1547 | {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | 1547 | {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, |
1548 | 1548 | ||
1549 | /* Setup default input MW0 to PW4 */ | 1549 | /* Setup default input MW0 to PW4 */ |
1550 | {0x20, AC_VERB_SET_CONNECT_SEL, 0}, | 1550 | {0x20, AC_VERB_SET_CONNECT_SEL, 0}, |
1551 | /* PW9 Output enable */ | 1551 | /* PW9 Output enable */ |
@@ -1865,8 +1865,10 @@ static int via_build_pcms(struct hda_codec *codec) | |||
1865 | codec->pcm_info = info; | 1865 | codec->pcm_info = info; |
1866 | 1866 | ||
1867 | info->name = spec->stream_name_analog; | 1867 | info->name = spec->stream_name_analog; |
1868 | info->stream[SNDRV_PCM_STREAM_PLAYBACK] = *(spec->stream_analog_playback); | 1868 | info->stream[SNDRV_PCM_STREAM_PLAYBACK] = |
1869 | info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->multiout.dac_nids[0]; | 1869 | *(spec->stream_analog_playback); |
1870 | info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = | ||
1871 | spec->multiout.dac_nids[0]; | ||
1870 | info->stream[SNDRV_PCM_STREAM_CAPTURE] = *(spec->stream_analog_capture); | 1872 | info->stream[SNDRV_PCM_STREAM_CAPTURE] = *(spec->stream_analog_capture); |
1871 | info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adc_nids[0]; | 1873 | info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adc_nids[0]; |
1872 | 1874 | ||
@@ -2116,7 +2118,7 @@ static int via_init(struct hda_codec *codec) | |||
2116 | if (spec->slave_dig_outs[0]) | 2118 | if (spec->slave_dig_outs[0]) |
2117 | codec->slave_dig_outs = spec->slave_dig_outs; | 2119 | codec->slave_dig_outs = spec->slave_dig_outs; |
2118 | 2120 | ||
2119 | return 0; | 2121 | return 0; |
2120 | } | 2122 | } |
2121 | 2123 | ||
2122 | #ifdef SND_HDA_NEEDS_RESUME | 2124 | #ifdef SND_HDA_NEEDS_RESUME |
@@ -2161,8 +2163,8 @@ static int vt1708_auto_fill_dac_nids(struct via_spec *spec, | |||
2161 | spec->multiout.num_dacs = cfg->line_outs; | 2163 | spec->multiout.num_dacs = cfg->line_outs; |
2162 | 2164 | ||
2163 | spec->multiout.dac_nids = spec->private_dac_nids; | 2165 | spec->multiout.dac_nids = spec->private_dac_nids; |
2164 | 2166 | ||
2165 | for(i = 0; i < 4; i++) { | 2167 | for (i = 0; i < 4; i++) { |
2166 | nid = cfg->line_out_pins[i]; | 2168 | nid = cfg->line_out_pins[i]; |
2167 | if (nid) { | 2169 | if (nid) { |
2168 | /* config dac list */ | 2170 | /* config dac list */ |
@@ -2200,7 +2202,7 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec, | |||
2200 | 2202 | ||
2201 | if (!nid) | 2203 | if (!nid) |
2202 | continue; | 2204 | continue; |
2203 | 2205 | ||
2204 | nid_vol = nid_vols[i]; | 2206 | nid_vol = nid_vols[i]; |
2205 | 2207 | ||
2206 | if (i == AUTO_SEQ_CENLFE) { | 2208 | if (i == AUTO_SEQ_CENLFE) { |
@@ -2229,7 +2231,7 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec, | |||
2229 | HDA_OUTPUT)); | 2231 | HDA_OUTPUT)); |
2230 | if (err < 0) | 2232 | if (err < 0) |
2231 | return err; | 2233 | return err; |
2232 | } else if (i == AUTO_SEQ_FRONT){ | 2234 | } else if (i == AUTO_SEQ_FRONT) { |
2233 | /* add control to mixer index 0 */ | 2235 | /* add control to mixer index 0 */ |
2234 | err = via_add_control(spec, VIA_CTL_WIDGET_VOL, | 2236 | err = via_add_control(spec, VIA_CTL_WIDGET_VOL, |
2235 | "Master Front Playback Volume", | 2237 | "Master Front Playback Volume", |
@@ -2243,7 +2245,7 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec, | |||
2243 | HDA_INPUT)); | 2245 | HDA_INPUT)); |
2244 | if (err < 0) | 2246 | if (err < 0) |
2245 | return err; | 2247 | return err; |
2246 | 2248 | ||
2247 | /* add control to PW3 */ | 2249 | /* add control to PW3 */ |
2248 | sprintf(name, "%s Playback Volume", chname[i]); | 2250 | sprintf(name, "%s Playback Volume", chname[i]); |
2249 | err = via_add_control(spec, VIA_CTL_WIDGET_VOL, name, | 2251 | err = via_add_control(spec, VIA_CTL_WIDGET_VOL, name, |
@@ -2343,7 +2345,7 @@ static int vt1708_auto_create_analog_input_ctls(struct via_spec *spec, | |||
2343 | case 0x1d: /* Mic */ | 2345 | case 0x1d: /* Mic */ |
2344 | idx = 2; | 2346 | idx = 2; |
2345 | break; | 2347 | break; |
2346 | 2348 | ||
2347 | case 0x1e: /* Line In */ | 2349 | case 0x1e: /* Line In */ |
2348 | idx = 3; | 2350 | idx = 3; |
2349 | break; | 2351 | break; |
@@ -2576,7 +2578,7 @@ static int patch_vt1708(struct hda_codec *codec) | |||
2576 | "from BIOS. Using genenic mode...\n"); | 2578 | "from BIOS. Using genenic mode...\n"); |
2577 | } | 2579 | } |
2578 | 2580 | ||
2579 | 2581 | ||
2580 | spec->stream_name_analog = "VT1708 Analog"; | 2582 | spec->stream_name_analog = "VT1708 Analog"; |
2581 | spec->stream_analog_playback = &vt1708_pcm_analog_playback; | 2583 | spec->stream_analog_playback = &vt1708_pcm_analog_playback; |
2582 | /* disable 32bit format on VT1708 */ | 2584 | /* disable 32bit format on VT1708 */ |
@@ -2588,7 +2590,7 @@ static int patch_vt1708(struct hda_codec *codec) | |||
2588 | spec->stream_digital_playback = &vt1708_pcm_digital_playback; | 2590 | spec->stream_digital_playback = &vt1708_pcm_digital_playback; |
2589 | spec->stream_digital_capture = &vt1708_pcm_digital_capture; | 2591 | spec->stream_digital_capture = &vt1708_pcm_digital_capture; |
2590 | 2592 | ||
2591 | 2593 | ||
2592 | if (!spec->adc_nids && spec->input_mux) { | 2594 | if (!spec->adc_nids && spec->input_mux) { |
2593 | spec->adc_nids = vt1708_adc_nids; | 2595 | spec->adc_nids = vt1708_adc_nids; |
2594 | spec->num_adc_nids = ARRAY_SIZE(vt1708_adc_nids); | 2596 | spec->num_adc_nids = ARRAY_SIZE(vt1708_adc_nids); |
@@ -2775,11 +2777,11 @@ static int vt1709_auto_fill_dac_nids(struct via_spec *spec, | |||
2775 | spec->multiout.dac_nids[cfg->line_outs] = 0x28; /* AOW4 */ | 2777 | spec->multiout.dac_nids[cfg->line_outs] = 0x28; /* AOW4 */ |
2776 | 2778 | ||
2777 | } else if (cfg->line_outs == 3) { /* 6 channels */ | 2779 | } else if (cfg->line_outs == 3) { /* 6 channels */ |
2778 | for(i = 0; i < cfg->line_outs; i++) { | 2780 | for (i = 0; i < cfg->line_outs; i++) { |
2779 | nid = cfg->line_out_pins[i]; | 2781 | nid = cfg->line_out_pins[i]; |
2780 | if (nid) { | 2782 | if (nid) { |
2781 | /* config dac list */ | 2783 | /* config dac list */ |
2782 | switch(i) { | 2784 | switch (i) { |
2783 | case AUTO_SEQ_FRONT: | 2785 | case AUTO_SEQ_FRONT: |
2784 | /* AOW0 */ | 2786 | /* AOW0 */ |
2785 | spec->multiout.dac_nids[i] = 0x10; | 2787 | spec->multiout.dac_nids[i] = 0x10; |
@@ -2814,7 +2816,7 @@ static int vt1709_auto_create_multi_out_ctls(struct via_spec *spec, | |||
2814 | for (i = 0; i <= AUTO_SEQ_SIDE; i++) { | 2816 | for (i = 0; i <= AUTO_SEQ_SIDE; i++) { |
2815 | nid = cfg->line_out_pins[i]; | 2817 | nid = cfg->line_out_pins[i]; |
2816 | 2818 | ||
2817 | if (!nid) | 2819 | if (!nid) |
2818 | continue; | 2820 | continue; |
2819 | 2821 | ||
2820 | nid_vol = nid_vols[i]; | 2822 | nid_vol = nid_vols[i]; |
@@ -2845,7 +2847,7 @@ static int vt1709_auto_create_multi_out_ctls(struct via_spec *spec, | |||
2845 | HDA_OUTPUT)); | 2847 | HDA_OUTPUT)); |
2846 | if (err < 0) | 2848 | if (err < 0) |
2847 | return err; | 2849 | return err; |
2848 | } else if (i == AUTO_SEQ_FRONT){ | 2850 | } else if (i == AUTO_SEQ_FRONT) { |
2849 | /* ADD control to mixer index 0 */ | 2851 | /* ADD control to mixer index 0 */ |
2850 | err = via_add_control(spec, VIA_CTL_WIDGET_VOL, | 2852 | err = via_add_control(spec, VIA_CTL_WIDGET_VOL, |
2851 | "Master Front Playback Volume", | 2853 | "Master Front Playback Volume", |
@@ -2859,7 +2861,7 @@ static int vt1709_auto_create_multi_out_ctls(struct via_spec *spec, | |||
2859 | HDA_INPUT)); | 2861 | HDA_INPUT)); |
2860 | if (err < 0) | 2862 | if (err < 0) |
2861 | return err; | 2863 | return err; |
2862 | 2864 | ||
2863 | /* add control to PW3 */ | 2865 | /* add control to PW3 */ |
2864 | sprintf(name, "%s Playback Volume", chname[i]); | 2866 | sprintf(name, "%s Playback Volume", chname[i]); |
2865 | err = via_add_control(spec, VIA_CTL_WIDGET_VOL, name, | 2867 | err = via_add_control(spec, VIA_CTL_WIDGET_VOL, name, |
@@ -2955,7 +2957,7 @@ static int vt1709_auto_create_analog_input_ctls(struct via_spec *spec, | |||
2955 | case 0x1d: /* Mic */ | 2957 | case 0x1d: /* Mic */ |
2956 | idx = 2; | 2958 | idx = 2; |
2957 | break; | 2959 | break; |
2958 | 2960 | ||
2959 | case 0x1e: /* Line In */ | 2961 | case 0x1e: /* Line In */ |
2960 | idx = 3; | 2962 | idx = 3; |
2961 | break; | 2963 | break; |
@@ -3064,7 +3066,7 @@ static int patch_vt1709_10ch(struct hda_codec *codec) | |||
3064 | spec->stream_digital_playback = &vt1709_pcm_digital_playback; | 3066 | spec->stream_digital_playback = &vt1709_pcm_digital_playback; |
3065 | spec->stream_digital_capture = &vt1709_pcm_digital_capture; | 3067 | spec->stream_digital_capture = &vt1709_pcm_digital_capture; |
3066 | 3068 | ||
3067 | 3069 | ||
3068 | if (!spec->adc_nids && spec->input_mux) { | 3070 | if (!spec->adc_nids && spec->input_mux) { |
3069 | spec->adc_nids = vt1709_adc_nids; | 3071 | spec->adc_nids = vt1709_adc_nids; |
3070 | spec->num_adc_nids = ARRAY_SIZE(vt1709_adc_nids); | 3072 | spec->num_adc_nids = ARRAY_SIZE(vt1709_adc_nids); |
@@ -3158,7 +3160,7 @@ static int patch_vt1709_6ch(struct hda_codec *codec) | |||
3158 | spec->stream_digital_playback = &vt1709_pcm_digital_playback; | 3160 | spec->stream_digital_playback = &vt1709_pcm_digital_playback; |
3159 | spec->stream_digital_capture = &vt1709_pcm_digital_capture; | 3161 | spec->stream_digital_capture = &vt1709_pcm_digital_capture; |
3160 | 3162 | ||
3161 | 3163 | ||
3162 | if (!spec->adc_nids && spec->input_mux) { | 3164 | if (!spec->adc_nids && spec->input_mux) { |
3163 | spec->adc_nids = vt1709_adc_nids; | 3165 | spec->adc_nids = vt1709_adc_nids; |
3164 | spec->num_adc_nids = ARRAY_SIZE(vt1709_adc_nids); | 3166 | spec->num_adc_nids = ARRAY_SIZE(vt1709_adc_nids); |