OSDN Git Service

ALSA: hda/realtek - Add the fixup codes for ALC260 model=will
[android-x86/kernel.git] / sound / pci / hda / alc260_quirks.c
1 /*
2  * ALC260 quirk models
3  * included by patch_realtek.c
4  */
5
6 /* ALC260 models */
7 enum {
8         ALC260_AUTO,
9         ALC260_BASIC,
10         ALC260_FUJITSU_S702X,
11         ALC260_ACER,
12         ALC260_REPLACER_672V,
13         ALC260_FAVORIT100,
14 #ifdef CONFIG_SND_DEBUG
15         ALC260_TEST,
16 #endif
17         ALC260_MODEL_LAST /* last tag */
18 };
19
20 static const hda_nid_t alc260_dac_nids[1] = {
21         /* front */
22         0x02,
23 };
24
25 static const hda_nid_t alc260_adc_nids[1] = {
26         /* ADC0 */
27         0x04,
28 };
29
30 static const hda_nid_t alc260_adc_nids_alt[1] = {
31         /* ADC1 */
32         0x05,
33 };
34
35 /* NIDs used when simultaneous access to both ADCs makes sense.  Note that
36  * alc260_capture_mixer assumes ADC0 (nid 0x04) is the first ADC.
37  */
38 static const hda_nid_t alc260_dual_adc_nids[2] = {
39         /* ADC0, ADC1 */
40         0x04, 0x05
41 };
42
43 #define ALC260_DIGOUT_NID       0x03
44 #define ALC260_DIGIN_NID        0x06
45
46 static const struct hda_input_mux alc260_capture_source = {
47         .num_items = 4,
48         .items = {
49                 { "Mic", 0x0 },
50                 { "Front Mic", 0x1 },
51                 { "Line", 0x2 },
52                 { "CD", 0x4 },
53         },
54 };
55
56 /* On Fujitsu S702x laptops capture only makes sense from Mic/LineIn jack,
57  * headphone jack and the internal CD lines since these are the only pins at
58  * which audio can appear.  For flexibility, also allow the option of
59  * recording the mixer output on the second ADC (ADC0 doesn't have a
60  * connection to the mixer output).
61  */
62 static const struct hda_input_mux alc260_fujitsu_capture_sources[2] = {
63         {
64                 .num_items = 3,
65                 .items = {
66                         { "Mic/Line", 0x0 },
67                         { "CD", 0x4 },
68                         { "Headphone", 0x2 },
69                 },
70         },
71         {
72                 .num_items = 4,
73                 .items = {
74                         { "Mic/Line", 0x0 },
75                         { "CD", 0x4 },
76                         { "Headphone", 0x2 },
77                         { "Mixer", 0x5 },
78                 },
79         },
80
81 };
82
83 /* Acer TravelMate(/Extensa/Aspire) notebooks have similar configuration to
84  * the Fujitsu S702x, but jacks are marked differently.
85  */
86 static const struct hda_input_mux alc260_acer_capture_sources[2] = {
87         {
88                 .num_items = 4,
89                 .items = {
90                         { "Mic", 0x0 },
91                         { "Line", 0x2 },
92                         { "CD", 0x4 },
93                         { "Headphone", 0x5 },
94                 },
95         },
96         {
97                 .num_items = 5,
98                 .items = {
99                         { "Mic", 0x0 },
100                         { "Line", 0x2 },
101                         { "CD", 0x4 },
102                         { "Headphone", 0x6 },
103                         { "Mixer", 0x5 },
104                 },
105         },
106 };
107
108 /* Maxdata Favorit 100XS */
109 static const struct hda_input_mux alc260_favorit100_capture_sources[2] = {
110         {
111                 .num_items = 2,
112                 .items = {
113                         { "Line/Mic", 0x0 },
114                         { "CD", 0x4 },
115                 },
116         },
117         {
118                 .num_items = 3,
119                 .items = {
120                         { "Line/Mic", 0x0 },
121                         { "CD", 0x4 },
122                         { "Mixer", 0x5 },
123                 },
124         },
125 };
126
127 /*
128  * This is just place-holder, so there's something for alc_build_pcms to look
129  * at when it calculates the maximum number of channels. ALC260 has no mixer
130  * element which allows changing the channel mode, so the verb list is
131  * never used.
132  */
133 static const struct hda_channel_mode alc260_modes[1] = {
134         { 2, NULL },
135 };
136
137
138 /* Mixer combinations
139  *
140  * basic: base_output + input + pc_beep + capture
141  * fujitsu: fujitsu + capture
142  * acer: acer + capture
143  */
144
145 static const struct snd_kcontrol_new alc260_base_output_mixer[] = {
146         HDA_CODEC_VOLUME("Front Playback Volume", 0x08, 0x0, HDA_OUTPUT),
147         HDA_BIND_MUTE("Front Playback Switch", 0x08, 2, HDA_INPUT),
148         HDA_CODEC_VOLUME("Headphone Playback Volume", 0x09, 0x0, HDA_OUTPUT),
149         HDA_BIND_MUTE("Headphone Playback Switch", 0x09, 2, HDA_INPUT),
150         HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT),
151         HDA_BIND_MUTE_MONO("Mono Playback Switch", 0x0a, 1, 2, HDA_INPUT),
152         { } /* end */
153 };
154
155 static const struct snd_kcontrol_new alc260_input_mixer[] = {
156         HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT),
157         HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT),
158         HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT),
159         HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT),
160         HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT),
161         HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT),
162         HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x07, 0x01, HDA_INPUT),
163         HDA_CODEC_MUTE("Front Mic Playback Switch", 0x07, 0x01, HDA_INPUT),
164         { } /* end */
165 };
166
167 /* Fujitsu S702x series laptops.  ALC260 pin usage: Mic/Line jack = 0x12,
168  * HP jack = 0x14, CD audio =  0x16, internal speaker = 0x10.
169  */
170 static const struct snd_kcontrol_new alc260_fujitsu_mixer[] = {
171         HDA_CODEC_VOLUME("Headphone Playback Volume", 0x08, 0x0, HDA_OUTPUT),
172         HDA_BIND_MUTE("Headphone Playback Switch", 0x08, 2, HDA_INPUT),
173         ALC_PIN_MODE("Headphone Jack Mode", 0x14, ALC_PIN_DIR_INOUT),
174         HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT),
175         HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT),
176         HDA_CODEC_VOLUME("Mic/Line Playback Volume", 0x07, 0x0, HDA_INPUT),
177         HDA_CODEC_MUTE("Mic/Line Playback Switch", 0x07, 0x0, HDA_INPUT),
178         ALC_PIN_MODE("Mic/Line Jack Mode", 0x12, ALC_PIN_DIR_IN),
179         HDA_CODEC_VOLUME("Speaker Playback Volume", 0x09, 0x0, HDA_OUTPUT),
180         HDA_BIND_MUTE("Speaker Playback Switch", 0x09, 2, HDA_INPUT),
181         { } /* end */
182 };
183
184 /* Mixer for Acer TravelMate(/Extensa/Aspire) notebooks.  Note that current
185  * versions of the ALC260 don't act on requests to enable mic bias from NID
186  * 0x0f (used to drive the headphone jack in these laptops).  The ALC260
187  * datasheet doesn't mention this restriction.  At this stage it's not clear
188  * whether this behaviour is intentional or is a hardware bug in chip
189  * revisions available in early 2006.  Therefore for now allow the
190  * "Headphone Jack Mode" control to span all choices, but if it turns out
191  * that the lack of mic bias for this NID is intentional we could change the
192  * mode from ALC_PIN_DIR_INOUT to ALC_PIN_DIR_INOUT_NOMICBIAS.
193  *
194  * In addition, Acer TravelMate(/Extensa/Aspire) notebooks in early 2006
195  * don't appear to make the mic bias available from the "line" jack, even
196  * though the NID used for this jack (0x14) can supply it.  The theory is
197  * that perhaps Acer have included blocking capacitors between the ALC260
198  * and the output jack.  If this turns out to be the case for all such
199  * models the "Line Jack Mode" mode could be changed from ALC_PIN_DIR_INOUT
200  * to ALC_PIN_DIR_INOUT_NOMICBIAS.
201  *
202  * The C20x Tablet series have a mono internal speaker which is controlled
203  * via the chip's Mono sum widget and pin complex, so include the necessary
204  * controls for such models.  On models without a "mono speaker" the control
205  * won't do anything.
206  */
207 static const struct snd_kcontrol_new alc260_acer_mixer[] = {
208         HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT),
209         HDA_BIND_MUTE("Master Playback Switch", 0x08, 2, HDA_INPUT),
210         ALC_PIN_MODE("Headphone Jack Mode", 0x0f, ALC_PIN_DIR_INOUT),
211         HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0a, 1, 0x0,
212                               HDA_OUTPUT),
213         HDA_BIND_MUTE_MONO("Speaker Playback Switch", 0x0a, 1, 2,
214                            HDA_INPUT),
215         HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT),
216         HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT),
217         HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT),
218         HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT),
219         ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN),
220         HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT),
221         HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT),
222         ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT),
223         { } /* end */
224 };
225
226 /* Maxdata Favorit 100XS: one output and one input (0x12) jack
227  */
228 static const struct snd_kcontrol_new alc260_favorit100_mixer[] = {
229         HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT),
230         HDA_BIND_MUTE("Master Playback Switch", 0x08, 2, HDA_INPUT),
231         ALC_PIN_MODE("Output Jack Mode", 0x0f, ALC_PIN_DIR_INOUT),
232         HDA_CODEC_VOLUME("Line/Mic Playback Volume", 0x07, 0x0, HDA_INPUT),
233         HDA_CODEC_MUTE("Line/Mic Playback Switch", 0x07, 0x0, HDA_INPUT),
234         ALC_PIN_MODE("Line/Mic Jack Mode", 0x12, ALC_PIN_DIR_IN),
235         { } /* end */
236 };
237
238 /* Replacer 672V ALC260 pin usage: Mic jack = 0x12,
239  * Line In jack = 0x14, ATAPI Mic = 0x13, speaker = 0x0f.
240  */
241 static const struct snd_kcontrol_new alc260_replacer_672v_mixer[] = {
242         HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT),
243         HDA_BIND_MUTE("Master Playback Switch", 0x08, 0x2, HDA_INPUT),
244         HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT),
245         HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT),
246         ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN),
247         HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x07, 0x1, HDA_INPUT),
248         HDA_CODEC_MUTE("ATATI Mic Playback Switch", 0x07, 0x1, HDA_INPUT),
249         HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT),
250         HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT),
251         ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT),
252         { } /* end */
253 };
254
255 /*
256  * initialization verbs
257  */
258 static const struct hda_verb alc260_init_verbs[] = {
259         /* Line In pin widget for input */
260         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
261         /* CD pin widget for input */
262         {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
263         /* Mic1 (rear panel) pin widget for input and vref at 80% */
264         {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
265         /* Mic2 (front panel) pin widget for input and vref at 80% */
266         {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
267         /* LINE-2 is used for line-out in rear */
268         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
269         /* select line-out */
270         {0x0e, AC_VERB_SET_CONNECT_SEL, 0x00},
271         /* LINE-OUT pin */
272         {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
273         /* enable HP */
274         {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
275         /* enable Mono */
276         {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
277         /* mute capture amp left and right */
278         {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
279         /* set connection select to line in (default select for this ADC) */
280         {0x04, AC_VERB_SET_CONNECT_SEL, 0x02},
281         /* mute capture amp left and right */
282         {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
283         /* set connection select to line in (default select for this ADC) */
284         {0x05, AC_VERB_SET_CONNECT_SEL, 0x02},
285         /* set vol=0 Line-Out mixer amp left and right */
286         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
287         /* unmute pin widget amp left and right (no gain on this amp) */
288         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
289         /* set vol=0 HP mixer amp left and right */
290         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
291         /* unmute pin widget amp left and right (no gain on this amp) */
292         {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
293         /* set vol=0 Mono mixer amp left and right */
294         {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
295         /* unmute pin widget amp left and right (no gain on this amp) */
296         {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
297         /* unmute LINE-2 out pin */
298         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
299         /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
300          * Line In 2 = 0x03
301          */
302         /* mute analog inputs */
303         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
304         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
305         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
306         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
307         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
308         /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
309         /* mute Front out path */
310         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
311         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
312         /* mute Headphone out path */
313         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
314         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
315         /* mute Mono out path */
316         {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
317         {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
318         { }
319 };
320
321 /* Initialisation sequence for ALC260 as configured in Fujitsu S702x
322  * laptops.  ALC260 pin usage: Mic/Line jack = 0x12, HP jack = 0x14, CD
323  * audio = 0x16, internal speaker = 0x10.
324  */
325 static const struct hda_verb alc260_fujitsu_init_verbs[] = {
326         /* Disable all GPIOs */
327         {0x01, AC_VERB_SET_GPIO_MASK, 0},
328         /* Internal speaker is connected to headphone pin */
329         {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
330         /* Headphone/Line-out jack connects to Line1 pin; make it an output */
331         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
332         /* Mic/Line-in jack is connected to mic1 pin, so make it an input */
333         {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
334         /* Ensure all other unused pins are disabled and muted. */
335         {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
336         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
337         {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
338         {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
339         {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
340         {0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
341         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
342         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
343
344         /* Disable digital (SPDIF) pins */
345         {0x03, AC_VERB_SET_DIGI_CONVERT_1, 0},
346         {0x06, AC_VERB_SET_DIGI_CONVERT_1, 0},
347
348         /* Ensure Line1 pin widget takes its input from the OUT1 sum bus
349          * when acting as an output.
350          */
351         {0x0d, AC_VERB_SET_CONNECT_SEL, 0},
352
353         /* Start with output sum widgets muted and their output gains at min */
354         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
355         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
356         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
357         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
358         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
359         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
360         {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
361         {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
362         {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
363
364         /* Unmute HP pin widget amp left and right (no equiv mixer ctrl) */
365         {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
366         /* Unmute Line1 pin widget output buffer since it starts as an output.
367          * If the pin mode is changed by the user the pin mode control will
368          * take care of enabling the pin's input/output buffers as needed.
369          * Therefore there's no need to enable the input buffer at this
370          * stage.
371          */
372         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
373         /* Unmute input buffer of pin widget used for Line-in (no equiv
374          * mixer ctrl)
375          */
376         {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
377
378         /* Mute capture amp left and right */
379         {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
380         /* Set ADC connection select to match default mixer setting - line
381          * in (on mic1 pin)
382          */
383         {0x04, AC_VERB_SET_CONNECT_SEL, 0x00},
384
385         /* Do the same for the second ADC: mute capture input amp and
386          * set ADC connection to line in (on mic1 pin)
387          */
388         {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
389         {0x05, AC_VERB_SET_CONNECT_SEL, 0x00},
390
391         /* Mute all inputs to mixer widget (even unconnected ones) */
392         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* mic1 pin */
393         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* mic2 pin */
394         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* line1 pin */
395         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* line2 pin */
396         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* CD pin */
397         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, /* Beep-gen pin */
398         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, /* Line-out pin */
399         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, /* HP-pin pin */
400
401         { }
402 };
403
404 /* Initialisation sequence for ALC260 as configured in Acer TravelMate and
405  * similar laptops (adapted from Fujitsu init verbs).
406  */
407 static const struct hda_verb alc260_acer_init_verbs[] = {
408         /* On TravelMate laptops, GPIO 0 enables the internal speaker and
409          * the headphone jack.  Turn this on and rely on the standard mute
410          * methods whenever the user wants to turn these outputs off.
411          */
412         {0x01, AC_VERB_SET_GPIO_MASK, 0x01},
413         {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01},
414         {0x01, AC_VERB_SET_GPIO_DATA, 0x01},
415         /* Internal speaker/Headphone jack is connected to Line-out pin */
416         {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
417         /* Internal microphone/Mic jack is connected to Mic1 pin */
418         {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
419         /* Line In jack is connected to Line1 pin */
420         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
421         /* Some Acers (eg: C20x Tablets) use Mono pin for internal speaker */
422         {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
423         /* Ensure all other unused pins are disabled and muted. */
424         {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
425         {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
426         {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
427         {0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
428         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
429         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
430         /* Disable digital (SPDIF) pins */
431         {0x03, AC_VERB_SET_DIGI_CONVERT_1, 0},
432         {0x06, AC_VERB_SET_DIGI_CONVERT_1, 0},
433
434         /* Ensure Mic1 and Line1 pin widgets take input from the OUT1 sum
435          * bus when acting as outputs.
436          */
437         {0x0b, AC_VERB_SET_CONNECT_SEL, 0},
438         {0x0d, AC_VERB_SET_CONNECT_SEL, 0},
439
440         /* Start with output sum widgets muted and their output gains at min */
441         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
442         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
443         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
444         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
445         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
446         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
447         {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
448         {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
449         {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
450
451         /* Unmute Line-out pin widget amp left and right
452          * (no equiv mixer ctrl)
453          */
454         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
455         /* Unmute mono pin widget amp output (no equiv mixer ctrl) */
456         {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
457         /* Unmute Mic1 and Line1 pin widget input buffers since they start as
458          * inputs. If the pin mode is changed by the user the pin mode control
459          * will take care of enabling the pin's input/output buffers as needed.
460          * Therefore there's no need to enable the input buffer at this
461          * stage.
462          */
463         {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
464         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
465
466         /* Mute capture amp left and right */
467         {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
468         /* Set ADC connection select to match default mixer setting - mic
469          * (on mic1 pin)
470          */
471         {0x04, AC_VERB_SET_CONNECT_SEL, 0x00},
472
473         /* Do similar with the second ADC: mute capture input amp and
474          * set ADC connection to mic to match ALSA's default state.
475          */
476         {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
477         {0x05, AC_VERB_SET_CONNECT_SEL, 0x00},
478
479         /* Mute all inputs to mixer widget (even unconnected ones) */
480         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* mic1 pin */
481         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* mic2 pin */
482         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* line1 pin */
483         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* line2 pin */
484         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* CD pin */
485         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, /* Beep-gen pin */
486         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, /* Line-out pin */
487         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, /* HP-pin pin */
488
489         { }
490 };
491
492 /* Initialisation sequence for Maxdata Favorit 100XS
493  * (adapted from Acer init verbs).
494  */
495 static const struct hda_verb alc260_favorit100_init_verbs[] = {
496         /* GPIO 0 enables the output jack.
497          * Turn this on and rely on the standard mute
498          * methods whenever the user wants to turn these outputs off.
499          */
500         {0x01, AC_VERB_SET_GPIO_MASK, 0x01},
501         {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01},
502         {0x01, AC_VERB_SET_GPIO_DATA, 0x01},
503         /* Line/Mic input jack is connected to Mic1 pin */
504         {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
505         /* Ensure all other unused pins are disabled and muted. */
506         {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
507         {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
508         {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
509         {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
510         {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
511         {0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
512         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
513         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
514         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
515         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
516         /* Disable digital (SPDIF) pins */
517         {0x03, AC_VERB_SET_DIGI_CONVERT_1, 0},
518         {0x06, AC_VERB_SET_DIGI_CONVERT_1, 0},
519
520         /* Ensure Mic1 and Line1 pin widgets take input from the OUT1 sum
521          * bus when acting as outputs.
522          */
523         {0x0b, AC_VERB_SET_CONNECT_SEL, 0},
524         {0x0d, AC_VERB_SET_CONNECT_SEL, 0},
525
526         /* Start with output sum widgets muted and their output gains at min */
527         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
528         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
529         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
530         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
531         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
532         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
533         {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
534         {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
535         {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
536
537         /* Unmute Line-out pin widget amp left and right
538          * (no equiv mixer ctrl)
539          */
540         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
541         /* Unmute Mic1 and Line1 pin widget input buffers since they start as
542          * inputs. If the pin mode is changed by the user the pin mode control
543          * will take care of enabling the pin's input/output buffers as needed.
544          * Therefore there's no need to enable the input buffer at this
545          * stage.
546          */
547         {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
548
549         /* Mute capture amp left and right */
550         {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
551         /* Set ADC connection select to match default mixer setting - mic
552          * (on mic1 pin)
553          */
554         {0x04, AC_VERB_SET_CONNECT_SEL, 0x00},
555
556         /* Do similar with the second ADC: mute capture input amp and
557          * set ADC connection to mic to match ALSA's default state.
558          */
559         {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
560         {0x05, AC_VERB_SET_CONNECT_SEL, 0x00},
561
562         /* Mute all inputs to mixer widget (even unconnected ones) */
563         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* mic1 pin */
564         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* mic2 pin */
565         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* line1 pin */
566         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* line2 pin */
567         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* CD pin */
568         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, /* Beep-gen pin */
569         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, /* Line-out pin */
570         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, /* HP-pin pin */
571
572         { }
573 };
574
575 static const struct hda_verb alc260_replacer_672v_verbs[] = {
576         {0x0f, AC_VERB_SET_EAPD_BTLENABLE, 0x02},
577         {0x1a, AC_VERB_SET_COEF_INDEX, 0x07},
578         {0x1a, AC_VERB_SET_PROC_COEF, 0x3050},
579
580         {0x01, AC_VERB_SET_GPIO_MASK, 0x01},
581         {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01},
582         {0x01, AC_VERB_SET_GPIO_DATA, 0x00},
583
584         {0x0f, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
585         {}
586 };
587
588 /* toggle speaker-output according to the hp-jack state */
589 static void alc260_replacer_672v_automute(struct hda_codec *codec)
590 {
591         unsigned int present;
592
593         /* speaker --> GPIO Data 0, hp or spdif --> GPIO data 1 */
594         present = snd_hda_jack_detect(codec, 0x0f);
595         if (present) {
596                 snd_hda_codec_write_cache(codec, 0x01, 0,
597                                           AC_VERB_SET_GPIO_DATA, 1);
598                 snd_hda_codec_write_cache(codec, 0x0f, 0,
599                                           AC_VERB_SET_PIN_WIDGET_CONTROL,
600                                           PIN_HP);
601         } else {
602                 snd_hda_codec_write_cache(codec, 0x01, 0,
603                                           AC_VERB_SET_GPIO_DATA, 0);
604                 snd_hda_codec_write_cache(codec, 0x0f, 0,
605                                           AC_VERB_SET_PIN_WIDGET_CONTROL,
606                                           PIN_OUT);
607         }
608 }
609
610 static void alc260_replacer_672v_unsol_event(struct hda_codec *codec,
611                                        unsigned int res)
612 {
613         if ((res >> 26) == ALC_HP_EVENT)
614                 alc260_replacer_672v_automute(codec);
615 }
616
617 static const struct hda_verb alc260_hp_dc7600_verbs[] = {
618         {0x05, AC_VERB_SET_CONNECT_SEL, 0x01},
619         {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
620         {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
621         {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
622         {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
623         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
624         {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
625         {0x10, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
626         {0x11, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
627         {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
628         {}
629 };
630
631 /* Test configuration for debugging, modelled after the ALC880 test
632  * configuration.
633  */
634 #ifdef CONFIG_SND_DEBUG
635 static const hda_nid_t alc260_test_dac_nids[1] = {
636         0x02,
637 };
638 static const hda_nid_t alc260_test_adc_nids[2] = {
639         0x04, 0x05,
640 };
641 /* For testing the ALC260, each input MUX needs its own definition since
642  * the signal assignments are different.  This assumes that the first ADC
643  * is NID 0x04.
644  */
645 static const struct hda_input_mux alc260_test_capture_sources[2] = {
646         {
647                 .num_items = 7,
648                 .items = {
649                         { "MIC1 pin", 0x0 },
650                         { "MIC2 pin", 0x1 },
651                         { "LINE1 pin", 0x2 },
652                         { "LINE2 pin", 0x3 },
653                         { "CD pin", 0x4 },
654                         { "LINE-OUT pin", 0x5 },
655                         { "HP-OUT pin", 0x6 },
656                 },
657         },
658         {
659                 .num_items = 8,
660                 .items = {
661                         { "MIC1 pin", 0x0 },
662                         { "MIC2 pin", 0x1 },
663                         { "LINE1 pin", 0x2 },
664                         { "LINE2 pin", 0x3 },
665                         { "CD pin", 0x4 },
666                         { "Mixer", 0x5 },
667                         { "LINE-OUT pin", 0x6 },
668                         { "HP-OUT pin", 0x7 },
669                 },
670         },
671 };
672 static const struct snd_kcontrol_new alc260_test_mixer[] = {
673         /* Output driver widgets */
674         HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT),
675         HDA_BIND_MUTE_MONO("Mono Playback Switch", 0x0a, 1, 2, HDA_INPUT),
676         HDA_CODEC_VOLUME("LOUT2 Playback Volume", 0x09, 0x0, HDA_OUTPUT),
677         HDA_BIND_MUTE("LOUT2 Playback Switch", 0x09, 2, HDA_INPUT),
678         HDA_CODEC_VOLUME("LOUT1 Playback Volume", 0x08, 0x0, HDA_OUTPUT),
679         HDA_BIND_MUTE("LOUT1 Playback Switch", 0x08, 2, HDA_INPUT),
680
681         /* Modes for retasking pin widgets
682          * Note: the ALC260 doesn't seem to act on requests to enable mic
683          * bias from NIDs 0x0f and 0x10.  The ALC260 datasheet doesn't
684          * mention this restriction.  At this stage it's not clear whether
685          * this behaviour is intentional or is a hardware bug in chip
686          * revisions available at least up until early 2006.  Therefore for
687          * now allow the "HP-OUT" and "LINE-OUT" Mode controls to span all
688          * choices, but if it turns out that the lack of mic bias for these
689          * NIDs is intentional we could change their modes from
690          * ALC_PIN_DIR_INOUT to ALC_PIN_DIR_INOUT_NOMICBIAS.
691          */
692         ALC_PIN_MODE("HP-OUT pin mode", 0x10, ALC_PIN_DIR_INOUT),
693         ALC_PIN_MODE("LINE-OUT pin mode", 0x0f, ALC_PIN_DIR_INOUT),
694         ALC_PIN_MODE("LINE2 pin mode", 0x15, ALC_PIN_DIR_INOUT),
695         ALC_PIN_MODE("LINE1 pin mode", 0x14, ALC_PIN_DIR_INOUT),
696         ALC_PIN_MODE("MIC2 pin mode", 0x13, ALC_PIN_DIR_INOUT),
697         ALC_PIN_MODE("MIC1 pin mode", 0x12, ALC_PIN_DIR_INOUT),
698
699         /* Loopback mixer controls */
700         HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x07, 0x00, HDA_INPUT),
701         HDA_CODEC_MUTE("MIC1 Playback Switch", 0x07, 0x00, HDA_INPUT),
702         HDA_CODEC_VOLUME("MIC2 Playback Volume", 0x07, 0x01, HDA_INPUT),
703         HDA_CODEC_MUTE("MIC2 Playback Switch", 0x07, 0x01, HDA_INPUT),
704         HDA_CODEC_VOLUME("LINE1 Playback Volume", 0x07, 0x02, HDA_INPUT),
705         HDA_CODEC_MUTE("LINE1 Playback Switch", 0x07, 0x02, HDA_INPUT),
706         HDA_CODEC_VOLUME("LINE2 Playback Volume", 0x07, 0x03, HDA_INPUT),
707         HDA_CODEC_MUTE("LINE2 Playback Switch", 0x07, 0x03, HDA_INPUT),
708         HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT),
709         HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT),
710         HDA_CODEC_VOLUME("LINE-OUT loopback Playback Volume", 0x07, 0x06, HDA_INPUT),
711         HDA_CODEC_MUTE("LINE-OUT loopback Playback Switch", 0x07, 0x06, HDA_INPUT),
712         HDA_CODEC_VOLUME("HP-OUT loopback Playback Volume", 0x07, 0x7, HDA_INPUT),
713         HDA_CODEC_MUTE("HP-OUT loopback Playback Switch", 0x07, 0x7, HDA_INPUT),
714
715         /* Controls for GPIO pins, assuming they are configured as outputs */
716         ALC_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
717         ALC_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
718         ALC_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
719         ALC_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
720
721         /* Switches to allow the digital IO pins to be enabled.  The datasheet
722          * is ambigious as to which NID is which; testing on laptops which
723          * make this output available should provide clarification.
724          */
725         ALC_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x03, 0x01),
726         ALC_SPDIF_CTRL_SWITCH("SPDIF Capture Switch", 0x06, 0x01),
727
728         /* A switch allowing EAPD to be enabled.  Some laptops seem to use
729          * this output to turn on an external amplifier.
730          */
731         ALC_EAPD_CTRL_SWITCH("LINE-OUT EAPD Enable Switch", 0x0f, 0x02),
732         ALC_EAPD_CTRL_SWITCH("HP-OUT EAPD Enable Switch", 0x10, 0x02),
733
734         { } /* end */
735 };
736 static const struct hda_verb alc260_test_init_verbs[] = {
737         /* Enable all GPIOs as outputs with an initial value of 0 */
738         {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x0f},
739         {0x01, AC_VERB_SET_GPIO_DATA, 0x00},
740         {0x01, AC_VERB_SET_GPIO_MASK, 0x0f},
741
742         /* Enable retasking pins as output, initially without power amp */
743         {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
744         {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
745         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
746         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
747         {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
748         {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
749
750         /* Disable digital (SPDIF) pins initially, but users can enable
751          * them via a mixer switch.  In the case of SPDIF-out, this initverb
752          * payload also sets the generation to 0, output to be in "consumer"
753          * PCM format, copyright asserted, no pre-emphasis and no validity
754          * control.
755          */
756         {0x03, AC_VERB_SET_DIGI_CONVERT_1, 0},
757         {0x06, AC_VERB_SET_DIGI_CONVERT_1, 0},
758
759         /* Ensure mic1, mic2, line1 and line2 pin widgets take input from the
760          * OUT1 sum bus when acting as an output.
761          */
762         {0x0b, AC_VERB_SET_CONNECT_SEL, 0},
763         {0x0c, AC_VERB_SET_CONNECT_SEL, 0},
764         {0x0d, AC_VERB_SET_CONNECT_SEL, 0},
765         {0x0e, AC_VERB_SET_CONNECT_SEL, 0},
766
767         /* Start with output sum widgets muted and their output gains at min */
768         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
769         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
770         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
771         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
772         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
773         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
774         {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
775         {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
776         {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
777
778         /* Unmute retasking pin widget output buffers since the default
779          * state appears to be output.  As the pin mode is changed by the
780          * user the pin mode control will take care of enabling the pin's
781          * input/output buffers as needed.
782          */
783         {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
784         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
785         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
786         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
787         {0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
788         {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
789         /* Also unmute the mono-out pin widget */
790         {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
791
792         /* Mute capture amp left and right */
793         {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
794         /* Set ADC connection select to match default mixer setting (mic1
795          * pin)
796          */
797         {0x04, AC_VERB_SET_CONNECT_SEL, 0x00},
798
799         /* Do the same for the second ADC: mute capture input amp and
800          * set ADC connection to mic1 pin
801          */
802         {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
803         {0x05, AC_VERB_SET_CONNECT_SEL, 0x00},
804
805         /* Mute all inputs to mixer widget (even unconnected ones) */
806         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* mic1 pin */
807         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* mic2 pin */
808         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* line1 pin */
809         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* line2 pin */
810         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* CD pin */
811         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, /* Beep-gen pin */
812         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, /* Line-out pin */
813         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, /* HP-pin pin */
814
815         { }
816 };
817 #endif
818
819 /*
820  * ALC260 configurations
821  */
822 static const char * const alc260_models[ALC260_MODEL_LAST] = {
823         [ALC260_BASIC]          = "basic",
824         [ALC260_FUJITSU_S702X]  = "fujitsu",
825         [ALC260_ACER]           = "acer",
826         [ALC260_REPLACER_672V]  = "replacer",
827         [ALC260_FAVORIT100]     = "favorit100",
828 #ifdef CONFIG_SND_DEBUG
829         [ALC260_TEST]           = "test",
830 #endif
831         [ALC260_AUTO]           = "auto",
832 };
833
834 static const struct snd_pci_quirk alc260_cfg_tbl[] = {
835         SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_ACER),
836         SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER),
837         SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FAVORIT100),
838         SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_BASIC),
839         SND_PCI_QUIRK(0x104d, 0x81cc, "Sony VAIO", ALC260_BASIC),
840         SND_PCI_QUIRK(0x104d, 0x81cd, "Sony VAIO", ALC260_BASIC),
841         SND_PCI_QUIRK(0x10cf, 0x1326, "Fujitsu S702X", ALC260_FUJITSU_S702X),
842         SND_PCI_QUIRK(0x152d, 0x0729, "CTL U553W", ALC260_BASIC),
843         SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_REPLACER_672V),
844         {}
845 };
846
847 static const struct alc_config_preset alc260_presets[] = {
848         [ALC260_BASIC] = {
849                 .mixers = { alc260_base_output_mixer,
850                             alc260_input_mixer },
851                 .init_verbs = { alc260_init_verbs },
852                 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
853                 .dac_nids = alc260_dac_nids,
854                 .num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids),
855                 .adc_nids = alc260_dual_adc_nids,
856                 .num_channel_mode = ARRAY_SIZE(alc260_modes),
857                 .channel_mode = alc260_modes,
858                 .input_mux = &alc260_capture_source,
859         },
860         [ALC260_FUJITSU_S702X] = {
861                 .mixers = { alc260_fujitsu_mixer },
862                 .init_verbs = { alc260_fujitsu_init_verbs },
863                 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
864                 .dac_nids = alc260_dac_nids,
865                 .num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids),
866                 .adc_nids = alc260_dual_adc_nids,
867                 .num_channel_mode = ARRAY_SIZE(alc260_modes),
868                 .channel_mode = alc260_modes,
869                 .num_mux_defs = ARRAY_SIZE(alc260_fujitsu_capture_sources),
870                 .input_mux = alc260_fujitsu_capture_sources,
871         },
872         [ALC260_ACER] = {
873                 .mixers = { alc260_acer_mixer },
874                 .init_verbs = { alc260_acer_init_verbs },
875                 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
876                 .dac_nids = alc260_dac_nids,
877                 .num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids),
878                 .adc_nids = alc260_dual_adc_nids,
879                 .num_channel_mode = ARRAY_SIZE(alc260_modes),
880                 .channel_mode = alc260_modes,
881                 .num_mux_defs = ARRAY_SIZE(alc260_acer_capture_sources),
882                 .input_mux = alc260_acer_capture_sources,
883         },
884         [ALC260_FAVORIT100] = {
885                 .mixers = { alc260_favorit100_mixer },
886                 .init_verbs = { alc260_favorit100_init_verbs },
887                 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
888                 .dac_nids = alc260_dac_nids,
889                 .num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids),
890                 .adc_nids = alc260_dual_adc_nids,
891                 .num_channel_mode = ARRAY_SIZE(alc260_modes),
892                 .channel_mode = alc260_modes,
893                 .num_mux_defs = ARRAY_SIZE(alc260_favorit100_capture_sources),
894                 .input_mux = alc260_favorit100_capture_sources,
895         },
896         [ALC260_REPLACER_672V] = {
897                 .mixers = { alc260_replacer_672v_mixer },
898                 .init_verbs = { alc260_init_verbs, alc260_replacer_672v_verbs },
899                 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
900                 .dac_nids = alc260_dac_nids,
901                 .num_adc_nids = ARRAY_SIZE(alc260_adc_nids),
902                 .adc_nids = alc260_adc_nids,
903                 .dig_out_nid = ALC260_DIGOUT_NID,
904                 .num_channel_mode = ARRAY_SIZE(alc260_modes),
905                 .channel_mode = alc260_modes,
906                 .input_mux = &alc260_capture_source,
907                 .unsol_event = alc260_replacer_672v_unsol_event,
908                 .init_hook = alc260_replacer_672v_automute,
909         },
910 #ifdef CONFIG_SND_DEBUG
911         [ALC260_TEST] = {
912                 .mixers = { alc260_test_mixer },
913                 .init_verbs = { alc260_test_init_verbs },
914                 .num_dacs = ARRAY_SIZE(alc260_test_dac_nids),
915                 .dac_nids = alc260_test_dac_nids,
916                 .num_adc_nids = ARRAY_SIZE(alc260_test_adc_nids),
917                 .adc_nids = alc260_test_adc_nids,
918                 .num_channel_mode = ARRAY_SIZE(alc260_modes),
919                 .channel_mode = alc260_modes,
920                 .num_mux_defs = ARRAY_SIZE(alc260_test_capture_sources),
921                 .input_mux = alc260_test_capture_sources,
922         },
923 #endif
924 };
925