/[linux-patches]/genpatches-2.6/trunk/2.6.16/2700_alsa-hda-ad1986a.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.16/2700_alsa-hda-ad1986a.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 442 - (show annotations) (download) (as text)
Wed Apr 26 16:51:57 2006 UTC (14 years, 7 months ago) by dsd
File MIME type: text/x-diff
File size: 7023 byte(s)
Fix lack of sound on certain HDA-based sound setups, thanks to Keith Amidon in bug #131226
1 From: Takashi Iwai <tiwai@suse.de>
2 Date: Mon, 13 Mar 2006 12:49:49 +0000 (+0100)
3 Subject: [ALSA] hda-codec - Fix support of laptops with AD1986A codec
4 X-Git-Tag: v2.6.17-rc1
5 X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9230d2148a0c53188c216b446cf17ea213ebca8a
6
7 [ALSA] hda-codec - Fix support of laptops with AD1986A codec
8
9 Modules: Documentation,HDA Codec driver
10
11 Fix the support of laptops with AD1986A HD-audio codec.
12 Added new models '3stack' and 'laptop'. Currently, fixed for FSC V2060
13 and Samsung M50.
14
15 Also fixed the description of missing models in ALSA-Configuration.txt.
16
17 Signed-off-by: Takashi Iwai <tiwai@suse.de>
18 ---
19
20 --- a/Documentation/sound/alsa/ALSA-Configuration.txt
21 +++ b/Documentation/sound/alsa/ALSA-Configuration.txt
22 @@ -737,6 +737,24 @@ Prior to version 0.9.0rc4 options had a
23 allout 5-jack in back, 2-jack in front, SPDIF out
24 auto auto-config reading BIOS (default)
25
26 + AD1981
27 + basic 3-jack (default)
28 + hp HP nx6320
29 +
30 + AD1986A
31 + 6stack 6-jack, separate surrounds (default)
32 + 3stack 3-stack, shared surrounds
33 + laptop 2-channel only (FSC V2060, Samsung M50)
34 +
35 + AD1988
36 + 6stack 6-jack
37 + 6stack-dig ditto with SPDIF
38 + 3stack 3-jack
39 + 3stack-dig ditto with SPDIF
40 + laptop 3-jack with hp-jack automute
41 + laptop-dig ditto with SPDIF
42 + auto auto-confgi reading BIOS (default)
43 +
44 If the default configuration doesn't work and one of the above
45 matches with your device, report it together with the PCI
46 subsystem ID (output of "lspci -nv") to ALSA BTS or alsa-devel
47 --- a/sound/pci/hda/patch_analog.c
48 +++ b/sound/pci/hda/patch_analog.c
49 @@ -379,6 +379,14 @@ static int ad198x_eapd_put(struct snd_kc
50 return 1;
51 }
52
53 +static int ad198x_ch_mode_info(struct snd_kcontrol *kcontrol,
54 + struct snd_ctl_elem_info *uinfo);
55 +static int ad198x_ch_mode_get(struct snd_kcontrol *kcontrol,
56 + struct snd_ctl_elem_value *ucontrol);
57 +static int ad198x_ch_mode_put(struct snd_kcontrol *kcontrol,
58 + struct snd_ctl_elem_value *ucontrol);
59 +
60 +
61 /*
62 * AD1986A specific
63 */
64 @@ -527,6 +535,52 @@ static struct snd_kcontrol_new ad1986a_m
65 { } /* end */
66 };
67
68 +/* additional mixers for 3stack mode */
69 +static struct snd_kcontrol_new ad1986a_3st_mixers[] = {
70 + {
71 + .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
72 + .name = "Channel Mode",
73 + .info = ad198x_ch_mode_info,
74 + .get = ad198x_ch_mode_get,
75 + .put = ad198x_ch_mode_put,
76 + },
77 + { } /* end */
78 +};
79 +
80 +/* laptop model - 2ch only */
81 +static hda_nid_t ad1986a_laptop_dac_nids[1] = { AD1986A_FRONT_DAC };
82 +
83 +static struct snd_kcontrol_new ad1986a_laptop_mixers[] = {
84 + HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
85 + HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
86 + HDA_CODEC_VOLUME("Master Playback Volume", 0x1b, 0x0, HDA_OUTPUT),
87 + HDA_CODEC_MUTE("Master Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
88 + /* HDA_CODEC_VOLUME("Headphone Playback Volume", 0x1a, 0x0, HDA_OUTPUT),
89 + HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x0, HDA_OUTPUT), */
90 + HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_OUTPUT),
91 + HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_OUTPUT),
92 + HDA_CODEC_VOLUME("Line Playback Volume", 0x17, 0x0, HDA_OUTPUT),
93 + HDA_CODEC_MUTE("Line Playback Switch", 0x17, 0x0, HDA_OUTPUT),
94 + HDA_CODEC_VOLUME("Aux Playback Volume", 0x16, 0x0, HDA_OUTPUT),
95 + HDA_CODEC_MUTE("Aux Playback Switch", 0x16, 0x0, HDA_OUTPUT),
96 + HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
97 + HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
98 + /* HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x18, 0x0, HDA_OUTPUT),
99 + HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x18, 0x0, HDA_OUTPUT),
100 + HDA_CODEC_VOLUME("Mono Playback Volume", 0x1e, 0x0, HDA_OUTPUT),
101 + HDA_CODEC_MUTE("Mono Playback Switch", 0x1e, 0x0, HDA_OUTPUT), */
102 + HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT),
103 + HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_OUTPUT),
104 + {
105 + .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
106 + .name = "Capture Source",
107 + .info = ad198x_mux_enum_info,
108 + .get = ad198x_mux_enum_get,
109 + .put = ad198x_mux_enum_put,
110 + },
111 + { } /* end */
112 +};
113 +
114 /*
115 * initialization verbs
116 */
117 @@ -585,10 +639,68 @@ static struct hda_verb ad1986a_init_verb
118 { } /* end */
119 };
120
121 +/* additional verbs for 3-stack model */
122 +static struct hda_verb ad1986a_3st_init_verbs[] = {
123 + /* Mic and line-in selectors */
124 + {0x0f, AC_VERB_SET_CONNECT_SEL, 0x2},
125 + {0x10, AC_VERB_SET_CONNECT_SEL, 0x1},
126 + { } /* end */
127 +};
128 +
129 +static struct hda_verb ad1986a_ch2_init[] = {
130 + /* Surround out -> Line In */
131 + { 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
132 + { 0x1c, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
133 + /* CLFE -> Mic in */
134 + { 0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
135 + { 0x1d, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
136 + { } /* end */
137 +};
138 +
139 +static struct hda_verb ad1986a_ch4_init[] = {
140 + /* Surround out -> Surround */
141 + { 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
142 + { 0x1c, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
143 + /* CLFE -> Mic in */
144 + { 0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
145 + { 0x1d, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
146 + { } /* end */
147 +};
148 +
149 +static struct hda_verb ad1986a_ch6_init[] = {
150 + /* Surround out -> Surround out */
151 + { 0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
152 + { 0x1c, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
153 + /* CLFE -> CLFE */
154 + { 0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
155 + { 0x1d, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
156 + { } /* end */
157 +};
158 +
159 +static struct hda_channel_mode ad1986a_modes[3] = {
160 + { 2, ad1986a_ch2_init },
161 + { 4, ad1986a_ch4_init },
162 + { 6, ad1986a_ch6_init },
163 +};
164 +
165 +/* models */
166 +enum { AD1986A_6STACK, AD1986A_3STACK, AD1986A_LAPTOP };
167 +
168 +static struct hda_board_config ad1986a_cfg_tbl[] = {
169 + { .modelname = "6stack", .config = AD1986A_6STACK },
170 + { .modelname = "3stack", .config = AD1986A_3STACK },
171 + { .modelname = "laptop", .config = AD1986A_LAPTOP },
172 + { .pci_subvendor = 0x144d, .pci_subdevice = 0xc01e,
173 + .config = AD1986A_LAPTOP }, /* FSC V2060 */
174 + { .pci_subvendor = 0x17c0, .pci_subdevice = 0x2017,
175 + .config = AD1986A_LAPTOP }, /* Samsung M50 */
176 + {}
177 +};
178
179 static int patch_ad1986a(struct hda_codec *codec)
180 {
181 struct ad198x_spec *spec;
182 + int board_config;
183
184 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
185 if (spec == NULL)
186 @@ -612,6 +724,25 @@ static int patch_ad1986a(struct hda_code
187
188 codec->patch_ops = ad198x_patch_ops;
189
190 + /* override some parameters */
191 + board_config = snd_hda_check_board_config(codec, ad1986a_cfg_tbl);
192 + switch (board_config) {
193 + case AD1986A_3STACK:
194 + spec->num_mixers = 2;
195 + spec->mixers[1] = ad1986a_3st_mixers;
196 + spec->num_init_verbs = 2;
197 + spec->init_verbs[1] = ad1986a_3st_init_verbs;
198 + spec->channel_mode = ad1986a_modes;
199 + spec->num_channel_mode = ARRAY_SIZE(ad1986a_modes);
200 + break;
201 + case AD1986A_LAPTOP:
202 + spec->mixers[0] = ad1986a_laptop_mixers;
203 + spec->multiout.max_channels = 2;
204 + spec->multiout.num_dacs = 1;
205 + spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
206 + break;
207 + }
208 +
209 return 0;
210 }
211

  ViewVC Help
Powered by ViewVC 1.1.20