2 * ALC660-VD/ALC861-VD quirk models
3 * included by patch_realtek.c
17 #define ALC861VD_DIGOUT_NID 0x06
19 static const hda_nid_t alc861vd_dac_nids
[4] = {
20 /* front, surr, clfe, side surr */
21 0x02, 0x03, 0x04, 0x05
24 /* dac_nids for ALC660vd are in a different order - according to
26 * This should probably result in a different mixer for 6stack models
27 * of ALC660vd codecs, but for now there is only 3stack mixer
28 * - and it is the same as in 861vd.
29 * adc_nids in ALC660vd are (is) the same as in 861vd
31 static const hda_nid_t alc660vd_dac_nids
[3] = {
32 /* front, rear, clfe, rear_surr */
36 static const hda_nid_t alc861vd_adc_nids
[1] = {
41 static const hda_nid_t alc861vd_capsrc_nids
[1] = { 0x22 };
44 /* FIXME: should be a matrix-type input source selection */
45 static const struct hda_input_mux alc861vd_capture_source
= {
58 static const struct hda_channel_mode alc861vd_3stack_2ch_modes
[1] = {
65 static const struct hda_verb alc861vd_6stack_ch6_init
[] = {
66 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
67 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
68 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
69 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
76 static const struct hda_verb alc861vd_6stack_ch8_init
[] = {
77 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
78 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
79 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
80 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
84 static const struct hda_channel_mode alc861vd_6stack_modes
[2] = {
85 { 6, alc861vd_6stack_ch6_init
},
86 { 8, alc861vd_6stack_ch8_init
},
89 static const struct snd_kcontrol_new alc861vd_chmode_mixer
[] = {
91 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
92 .name
= "Channel Mode",
93 .info
= alc_ch_mode_info
,
94 .get
= alc_ch_mode_get
,
95 .put
= alc_ch_mode_put
,
100 /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
101 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
103 static const struct snd_kcontrol_new alc861vd_6st_mixer
[] = {
104 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
105 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
107 HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
108 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
110 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0,
112 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0,
114 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
115 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
117 HDA_CODEC_VOLUME("Side Playback Volume", 0x05, 0x0, HDA_OUTPUT
),
118 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
120 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
122 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
123 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
124 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
126 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
127 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
128 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
130 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
131 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
133 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
134 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
139 static const struct snd_kcontrol_new alc861vd_3st_mixer
[] = {
140 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
141 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
143 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
145 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
146 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
147 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
149 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
150 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
151 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
153 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
154 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
156 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
157 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
163 * generic initialization of ADC, input mixers and output mixers
165 static const struct hda_verb alc861vd_volume_init_verbs
[] = {
167 * Unmute ADC0 and set the default input to mic-in
169 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
170 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
172 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of
173 * the analog-loopback mixer widget
175 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
176 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
177 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
178 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
179 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
180 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
182 /* Capture mixer: unmute Mic, F-Mic, Line, CD inputs */
183 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
184 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
185 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
186 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(4)},
189 * Set up output mixers (0x02 - 0x05)
191 /* set vol=0 to output mixers */
192 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
193 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
194 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
195 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
197 /* set up input amps for analog loopback */
198 /* Amp Indices: DAC = 0, mixer = 1 */
199 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
200 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
201 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
202 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
203 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
204 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
205 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
206 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
212 * 3-stack pin configuration:
213 * front = 0x14, mic/clfe = 0x18, HP = 0x19, line/surr = 0x1a, f-mic = 0x1b
215 static const struct hda_verb alc861vd_3stack_init_verbs
[] = {
217 * Set pin mode and muting
219 /* set front pin widgets 0x14 for output */
220 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
221 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
222 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
224 /* Mic (rear) pin: input vref at 80% */
225 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
226 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
227 /* Front Mic pin: input vref at 80% */
228 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
229 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
230 /* Line In pin: input */
231 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
232 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
233 /* Line-2 In: Headphone output (output 0 - 0x0c) */
234 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
235 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
236 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
237 /* CD pin widget for input */
238 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
244 * 6-stack pin configuration:
246 static const struct hda_verb alc861vd_6stack_init_verbs
[] = {
248 * Set pin mode and muting
250 /* set front pin widgets 0x14 for output */
251 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
252 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
253 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
255 /* Rear Pin: output 1 (0x0d) */
256 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
257 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
258 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
259 /* CLFE Pin: output 2 (0x0e) */
260 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
261 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
262 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x02},
263 /* Side Pin: output 3 (0x0f) */
264 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
265 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
266 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
268 /* Mic (rear) pin: input vref at 80% */
269 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
270 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
271 /* Front Mic pin: input vref at 80% */
272 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
273 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
274 /* Line In pin: input */
275 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
276 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
277 /* Line-2 In: Headphone output (output 0 - 0x0c) */
278 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
279 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
280 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
281 /* CD pin widget for input */
282 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
288 * configuration and preset
290 static const char * const alc861vd_models
[ALC861VD_MODEL_LAST
] = {
291 [ALC660VD_3ST
] = "3stack-660",
292 [ALC660VD_3ST_DIG
] = "3stack-660-digout",
293 [ALC861VD_3ST
] = "3stack",
294 [ALC861VD_3ST_DIG
] = "3stack-digout",
295 [ALC861VD_6ST_DIG
] = "6stack-digout",
296 [ALC861VD_AUTO
] = "auto",
299 static const struct snd_pci_quirk alc861vd_cfg_tbl
[] = {
300 SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST
),
301 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST
),
302 SND_PCI_QUIRK(0x1565, 0x820d, "Biostar NF61S SE", ALC861VD_6ST_DIG
),
303 SND_PCI_QUIRK(0x1849, 0x0862, "ASRock K8NF6G-VSTA", ALC861VD_6ST_DIG
),
307 static const struct alc_config_preset alc861vd_presets
[] = {
309 .mixers
= { alc861vd_3st_mixer
},
310 .init_verbs
= { alc861vd_volume_init_verbs
,
311 alc861vd_3stack_init_verbs
},
312 .num_dacs
= ARRAY_SIZE(alc660vd_dac_nids
),
313 .dac_nids
= alc660vd_dac_nids
,
314 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
315 .channel_mode
= alc861vd_3stack_2ch_modes
,
316 .input_mux
= &alc861vd_capture_source
,
318 [ALC660VD_3ST_DIG
] = {
319 .mixers
= { alc861vd_3st_mixer
},
320 .init_verbs
= { alc861vd_volume_init_verbs
,
321 alc861vd_3stack_init_verbs
},
322 .num_dacs
= ARRAY_SIZE(alc660vd_dac_nids
),
323 .dac_nids
= alc660vd_dac_nids
,
324 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
325 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
326 .channel_mode
= alc861vd_3stack_2ch_modes
,
327 .input_mux
= &alc861vd_capture_source
,
330 .mixers
= { alc861vd_3st_mixer
},
331 .init_verbs
= { alc861vd_volume_init_verbs
,
332 alc861vd_3stack_init_verbs
},
333 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
334 .dac_nids
= alc861vd_dac_nids
,
335 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
336 .channel_mode
= alc861vd_3stack_2ch_modes
,
337 .input_mux
= &alc861vd_capture_source
,
339 [ALC861VD_3ST_DIG
] = {
340 .mixers
= { alc861vd_3st_mixer
},
341 .init_verbs
= { alc861vd_volume_init_verbs
,
342 alc861vd_3stack_init_verbs
},
343 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
344 .dac_nids
= alc861vd_dac_nids
,
345 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
346 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
347 .channel_mode
= alc861vd_3stack_2ch_modes
,
348 .input_mux
= &alc861vd_capture_source
,
350 [ALC861VD_6ST_DIG
] = {
351 .mixers
= { alc861vd_6st_mixer
, alc861vd_chmode_mixer
},
352 .init_verbs
= { alc861vd_volume_init_verbs
,
353 alc861vd_6stack_init_verbs
},
354 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
355 .dac_nids
= alc861vd_dac_nids
,
356 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
357 .num_channel_mode
= ARRAY_SIZE(alc861vd_6stack_modes
),
358 .channel_mode
= alc861vd_6stack_modes
,
359 .input_mux
= &alc861vd_capture_source
,