2 * Universal Interface for Intel High Definition Audio Codec
4 * HD audio interface patch for ALC 260/880/882 codecs
6 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
7 * PeiSen Hou <pshou@realtek.com.tw>
8 * Takashi Iwai <tiwai@suse.de>
9 * Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
11 * This driver is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This driver is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include <linux/init.h>
27 #include <linux/delay.h>
28 #include <linux/slab.h>
29 #include <linux/pci.h>
30 #include <sound/core.h>
31 #include "hda_codec.h"
32 #include "hda_local.h"
35 #define ALC880_FRONT_EVENT 0x01
36 #define ALC880_DCVOL_EVENT 0x02
37 #define ALC880_HP_EVENT 0x04
38 #define ALC880_MIC_EVENT 0x08
40 /* ALC880 board config type */
64 #ifdef CONFIG_SND_DEBUG
68 ALC880_MODEL_LAST
/* last tag */
82 #ifdef CONFIG_SND_DEBUG
86 ALC260_MODEL_LAST
/* last tag */
96 ALC262_HP_BPC_D7000_WL
,
97 ALC262_HP_BPC_D7000_WF
,
110 ALC262_MODEL_LAST
/* last tag */
120 ALC268_ACER_ASPIRE_ONE
,
123 #ifdef CONFIG_SND_DEBUG
127 ALC268_MODEL_LAST
/* last tag */
134 ALC269_ASUS_EEEPC_P703
,
135 ALC269_ASUS_EEEPC_P901
,
139 ALC269_MODEL_LAST
/* last tag */
156 /* ALC861-VD models */
178 ALC662_ASUS_EEEPC_P701
,
179 ALC662_ASUS_EEEPC_EP20
,
216 ALC883_TARGA_2ch_DIG
,
217 ALC883_TARGA_8ch_DIG
,
220 ALC888_ACER_ASPIRE_4930G
,
221 ALC888_ACER_ASPIRE_6530G
,
222 ALC888_ACER_ASPIRE_8930G
,
223 ALC888_ACER_ASPIRE_7730G
,
227 ALC883_LENOVO_101E_2ch
,
228 ALC883_LENOVO_NB0763
,
229 ALC888_LENOVO_MS7195_DIG
,
237 ALC883_FUJITSU_PI2515
,
238 ALC888_FUJITSU_XA3530
,
239 ALC883_3ST_6ch_INTEL
,
252 #define GPIO_MASK 0x03
254 /* extra amp-initialization sequence types */
263 struct alc_mic_route
{
265 unsigned char mux_idx
;
266 unsigned char amix_idx
;
269 #define MUX_IDX_UNDEF ((unsigned char)-1)
272 /* codec parameterization */
273 struct snd_kcontrol_new
*mixers
[5]; /* mixer arrays */
274 unsigned int num_mixers
;
275 struct snd_kcontrol_new
*cap_mixer
; /* capture mixer */
276 unsigned int beep_amp
; /* beep amp value, set via set_beep_amp() */
278 const struct hda_verb
*init_verbs
[10]; /* initialization verbs
282 unsigned int num_init_verbs
;
284 char stream_name_analog
[32]; /* analog PCM stream */
285 struct hda_pcm_stream
*stream_analog_playback
;
286 struct hda_pcm_stream
*stream_analog_capture
;
287 struct hda_pcm_stream
*stream_analog_alt_playback
;
288 struct hda_pcm_stream
*stream_analog_alt_capture
;
290 char stream_name_digital
[32]; /* digital PCM stream */
291 struct hda_pcm_stream
*stream_digital_playback
;
292 struct hda_pcm_stream
*stream_digital_capture
;
295 struct hda_multi_out multiout
; /* playback set-up
296 * max_channels, dacs must be set
297 * dig_out_nid and hp_nid are optional
299 hda_nid_t alt_dac_nid
;
300 hda_nid_t slave_dig_outs
[3]; /* optional - for auto-parsing */
304 unsigned int num_adc_nids
;
306 hda_nid_t
*capsrc_nids
;
307 hda_nid_t dig_in_nid
; /* digital-in NID; optional */
310 unsigned int num_mux_defs
;
311 const struct hda_input_mux
*input_mux
;
312 unsigned int cur_mux
[3];
313 struct alc_mic_route ext_mic
;
314 struct alc_mic_route int_mic
;
317 const struct hda_channel_mode
*channel_mode
;
318 int num_channel_mode
;
320 int const_channel_count
;
321 int ext_channel_count
;
323 /* PCM information */
324 struct hda_pcm pcm_rec
[3]; /* used in alc_build_pcms() */
326 /* dynamic controls, init_verbs and input_mux */
327 struct auto_pin_cfg autocfg
;
328 struct snd_array kctls
;
329 struct hda_input_mux private_imux
[3];
330 hda_nid_t private_dac_nids
[AUTO_CFG_MAX_OUTS
];
331 hda_nid_t private_adc_nids
[AUTO_CFG_MAX_OUTS
];
332 hda_nid_t private_capsrc_nids
[AUTO_CFG_MAX_OUTS
];
335 void (*init_hook
)(struct hda_codec
*codec
);
336 void (*unsol_event
)(struct hda_codec
*codec
, unsigned int res
);
338 /* for pin sensing */
339 unsigned int sense_updated
: 1;
340 unsigned int jack_present
: 1;
341 unsigned int master_sw
: 1;
342 unsigned int auto_mic
:1;
345 unsigned int no_analog
:1; /* digital I/O only */
348 /* for virtual master */
349 hda_nid_t vmaster_nid
;
350 #ifdef CONFIG_SND_HDA_POWER_SAVE
351 struct hda_loopback_check loopback
;
356 unsigned int pll_coef_idx
, pll_coef_bit
;
360 * configuration template - to be copied to the spec instance
362 struct alc_config_preset
{
363 struct snd_kcontrol_new
*mixers
[5]; /* should be identical size
366 struct snd_kcontrol_new
*cap_mixer
; /* capture mixer */
367 const struct hda_verb
*init_verbs
[5];
368 unsigned int num_dacs
;
370 hda_nid_t dig_out_nid
; /* optional */
371 hda_nid_t hp_nid
; /* optional */
372 hda_nid_t
*slave_dig_outs
;
373 unsigned int num_adc_nids
;
375 hda_nid_t
*capsrc_nids
;
376 hda_nid_t dig_in_nid
;
377 unsigned int num_channel_mode
;
378 const struct hda_channel_mode
*channel_mode
;
380 int const_channel_count
;
381 unsigned int num_mux_defs
;
382 const struct hda_input_mux
*input_mux
;
383 void (*unsol_event
)(struct hda_codec
*, unsigned int);
384 void (*setup
)(struct hda_codec
*);
385 void (*init_hook
)(struct hda_codec
*);
386 #ifdef CONFIG_SND_HDA_POWER_SAVE
387 struct hda_amp_list
*loopbacks
;
395 static int alc_mux_enum_info(struct snd_kcontrol
*kcontrol
,
396 struct snd_ctl_elem_info
*uinfo
)
398 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
399 struct alc_spec
*spec
= codec
->spec
;
400 unsigned int mux_idx
= snd_ctl_get_ioffidx(kcontrol
, &uinfo
->id
);
401 if (mux_idx
>= spec
->num_mux_defs
)
403 return snd_hda_input_mux_info(&spec
->input_mux
[mux_idx
], uinfo
);
406 static int alc_mux_enum_get(struct snd_kcontrol
*kcontrol
,
407 struct snd_ctl_elem_value
*ucontrol
)
409 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
410 struct alc_spec
*spec
= codec
->spec
;
411 unsigned int adc_idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
413 ucontrol
->value
.enumerated
.item
[0] = spec
->cur_mux
[adc_idx
];
417 static int alc_mux_enum_put(struct snd_kcontrol
*kcontrol
,
418 struct snd_ctl_elem_value
*ucontrol
)
420 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
421 struct alc_spec
*spec
= codec
->spec
;
422 const struct hda_input_mux
*imux
;
423 unsigned int adc_idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
424 unsigned int mux_idx
;
425 hda_nid_t nid
= spec
->capsrc_nids
?
426 spec
->capsrc_nids
[adc_idx
] : spec
->adc_nids
[adc_idx
];
429 mux_idx
= adc_idx
>= spec
->num_mux_defs
? 0 : adc_idx
;
430 imux
= &spec
->input_mux
[mux_idx
];
432 type
= get_wcaps_type(get_wcaps(codec
, nid
));
433 if (type
== AC_WID_AUD_MIX
) {
434 /* Matrix-mixer style (e.g. ALC882) */
435 unsigned int *cur_val
= &spec
->cur_mux
[adc_idx
];
438 idx
= ucontrol
->value
.enumerated
.item
[0];
439 if (idx
>= imux
->num_items
)
440 idx
= imux
->num_items
- 1;
443 for (i
= 0; i
< imux
->num_items
; i
++) {
444 unsigned int v
= (i
== idx
) ? 0 : HDA_AMP_MUTE
;
445 snd_hda_codec_amp_stereo(codec
, nid
, HDA_INPUT
,
446 imux
->items
[i
].index
,
452 /* MUX style (e.g. ALC880) */
453 return snd_hda_input_mux_put(codec
, imux
, ucontrol
, nid
,
454 &spec
->cur_mux
[adc_idx
]);
459 * channel mode setting
461 static int alc_ch_mode_info(struct snd_kcontrol
*kcontrol
,
462 struct snd_ctl_elem_info
*uinfo
)
464 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
465 struct alc_spec
*spec
= codec
->spec
;
466 return snd_hda_ch_mode_info(codec
, uinfo
, spec
->channel_mode
,
467 spec
->num_channel_mode
);
470 static int alc_ch_mode_get(struct snd_kcontrol
*kcontrol
,
471 struct snd_ctl_elem_value
*ucontrol
)
473 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
474 struct alc_spec
*spec
= codec
->spec
;
475 return snd_hda_ch_mode_get(codec
, ucontrol
, spec
->channel_mode
,
476 spec
->num_channel_mode
,
477 spec
->ext_channel_count
);
480 static int alc_ch_mode_put(struct snd_kcontrol
*kcontrol
,
481 struct snd_ctl_elem_value
*ucontrol
)
483 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
484 struct alc_spec
*spec
= codec
->spec
;
485 int err
= snd_hda_ch_mode_put(codec
, ucontrol
, spec
->channel_mode
,
486 spec
->num_channel_mode
,
487 &spec
->ext_channel_count
);
488 if (err
>= 0 && !spec
->const_channel_count
) {
489 spec
->multiout
.max_channels
= spec
->ext_channel_count
;
490 if (spec
->need_dac_fix
)
491 spec
->multiout
.num_dacs
= spec
->multiout
.max_channels
/ 2;
497 * Control the mode of pin widget settings via the mixer. "pc" is used
498 * instead of "%" to avoid consequences of accidently treating the % as
499 * being part of a format specifier. Maximum allowed length of a value is
500 * 63 characters plus NULL terminator.
502 * Note: some retasking pin complexes seem to ignore requests for input
503 * states other than HiZ (eg: PIN_VREFxx) and revert to HiZ if any of these
504 * are requested. Therefore order this list so that this behaviour will not
505 * cause problems when mixer clients move through the enum sequentially.
506 * NIDs 0x0f and 0x10 have been observed to have this behaviour as of
509 static char *alc_pin_mode_names
[] = {
510 "Mic 50pc bias", "Mic 80pc bias",
511 "Line in", "Line out", "Headphone out",
513 static unsigned char alc_pin_mode_values
[] = {
514 PIN_VREF50
, PIN_VREF80
, PIN_IN
, PIN_OUT
, PIN_HP
,
516 /* The control can present all 5 options, or it can limit the options based
517 * in the pin being assumed to be exclusively an input or an output pin. In
518 * addition, "input" pins may or may not process the mic bias option
519 * depending on actual widget capability (NIDs 0x0f and 0x10 don't seem to
520 * accept requests for bias as of chip versions up to March 2006) and/or
521 * wiring in the computer.
523 #define ALC_PIN_DIR_IN 0x00
524 #define ALC_PIN_DIR_OUT 0x01
525 #define ALC_PIN_DIR_INOUT 0x02
526 #define ALC_PIN_DIR_IN_NOMICBIAS 0x03
527 #define ALC_PIN_DIR_INOUT_NOMICBIAS 0x04
529 /* Info about the pin modes supported by the different pin direction modes.
530 * For each direction the minimum and maximum values are given.
532 static signed char alc_pin_mode_dir_info
[5][2] = {
533 { 0, 2 }, /* ALC_PIN_DIR_IN */
534 { 3, 4 }, /* ALC_PIN_DIR_OUT */
535 { 0, 4 }, /* ALC_PIN_DIR_INOUT */
536 { 2, 2 }, /* ALC_PIN_DIR_IN_NOMICBIAS */
537 { 2, 4 }, /* ALC_PIN_DIR_INOUT_NOMICBIAS */
539 #define alc_pin_mode_min(_dir) (alc_pin_mode_dir_info[_dir][0])
540 #define alc_pin_mode_max(_dir) (alc_pin_mode_dir_info[_dir][1])
541 #define alc_pin_mode_n_items(_dir) \
542 (alc_pin_mode_max(_dir)-alc_pin_mode_min(_dir)+1)
544 static int alc_pin_mode_info(struct snd_kcontrol
*kcontrol
,
545 struct snd_ctl_elem_info
*uinfo
)
547 unsigned int item_num
= uinfo
->value
.enumerated
.item
;
548 unsigned char dir
= (kcontrol
->private_value
>> 16) & 0xff;
550 uinfo
->type
= SNDRV_CTL_ELEM_TYPE_ENUMERATED
;
552 uinfo
->value
.enumerated
.items
= alc_pin_mode_n_items(dir
);
554 if (item_num
<alc_pin_mode_min(dir
) || item_num
>alc_pin_mode_max(dir
))
555 item_num
= alc_pin_mode_min(dir
);
556 strcpy(uinfo
->value
.enumerated
.name
, alc_pin_mode_names
[item_num
]);
560 static int alc_pin_mode_get(struct snd_kcontrol
*kcontrol
,
561 struct snd_ctl_elem_value
*ucontrol
)
564 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
565 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
566 unsigned char dir
= (kcontrol
->private_value
>> 16) & 0xff;
567 long *valp
= ucontrol
->value
.integer
.value
;
568 unsigned int pinctl
= snd_hda_codec_read(codec
, nid
, 0,
569 AC_VERB_GET_PIN_WIDGET_CONTROL
,
572 /* Find enumerated value for current pinctl setting */
573 i
= alc_pin_mode_min(dir
);
574 while (i
<= alc_pin_mode_max(dir
) && alc_pin_mode_values
[i
] != pinctl
)
576 *valp
= i
<= alc_pin_mode_max(dir
) ? i
: alc_pin_mode_min(dir
);
580 static int alc_pin_mode_put(struct snd_kcontrol
*kcontrol
,
581 struct snd_ctl_elem_value
*ucontrol
)
584 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
585 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
586 unsigned char dir
= (kcontrol
->private_value
>> 16) & 0xff;
587 long val
= *ucontrol
->value
.integer
.value
;
588 unsigned int pinctl
= snd_hda_codec_read(codec
, nid
, 0,
589 AC_VERB_GET_PIN_WIDGET_CONTROL
,
592 if (val
< alc_pin_mode_min(dir
) || val
> alc_pin_mode_max(dir
))
593 val
= alc_pin_mode_min(dir
);
595 change
= pinctl
!= alc_pin_mode_values
[val
];
597 /* Set pin mode to that requested */
598 snd_hda_codec_write_cache(codec
, nid
, 0,
599 AC_VERB_SET_PIN_WIDGET_CONTROL
,
600 alc_pin_mode_values
[val
]);
602 /* Also enable the retasking pin's input/output as required
603 * for the requested pin mode. Enum values of 2 or less are
606 * Dynamically switching the input/output buffers probably
607 * reduces noise slightly (particularly on input) so we'll
608 * do it. However, having both input and output buffers
609 * enabled simultaneously doesn't seem to be problematic if
610 * this turns out to be necessary in the future.
613 snd_hda_codec_amp_stereo(codec
, nid
, HDA_OUTPUT
, 0,
614 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
615 snd_hda_codec_amp_stereo(codec
, nid
, HDA_INPUT
, 0,
618 snd_hda_codec_amp_stereo(codec
, nid
, HDA_INPUT
, 0,
619 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
620 snd_hda_codec_amp_stereo(codec
, nid
, HDA_OUTPUT
, 0,
627 #define ALC_PIN_MODE(xname, nid, dir) \
628 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
629 .info = alc_pin_mode_info, \
630 .get = alc_pin_mode_get, \
631 .put = alc_pin_mode_put, \
632 .private_value = nid | (dir<<16) }
634 /* A switch control for ALC260 GPIO pins. Multiple GPIOs can be ganged
635 * together using a mask with more than one bit set. This control is
636 * currently used only by the ALC260 test model. At this stage they are not
637 * needed for any "production" models.
639 #ifdef CONFIG_SND_DEBUG
640 #define alc_gpio_data_info snd_ctl_boolean_mono_info
642 static int alc_gpio_data_get(struct snd_kcontrol
*kcontrol
,
643 struct snd_ctl_elem_value
*ucontrol
)
645 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
646 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
647 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
648 long *valp
= ucontrol
->value
.integer
.value
;
649 unsigned int val
= snd_hda_codec_read(codec
, nid
, 0,
650 AC_VERB_GET_GPIO_DATA
, 0x00);
652 *valp
= (val
& mask
) != 0;
655 static int alc_gpio_data_put(struct snd_kcontrol
*kcontrol
,
656 struct snd_ctl_elem_value
*ucontrol
)
659 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
660 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
661 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
662 long val
= *ucontrol
->value
.integer
.value
;
663 unsigned int gpio_data
= snd_hda_codec_read(codec
, nid
, 0,
664 AC_VERB_GET_GPIO_DATA
,
667 /* Set/unset the masked GPIO bit(s) as needed */
668 change
= (val
== 0 ? 0 : mask
) != (gpio_data
& mask
);
673 snd_hda_codec_write_cache(codec
, nid
, 0,
674 AC_VERB_SET_GPIO_DATA
, gpio_data
);
678 #define ALC_GPIO_DATA_SWITCH(xname, nid, mask) \
679 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
680 .info = alc_gpio_data_info, \
681 .get = alc_gpio_data_get, \
682 .put = alc_gpio_data_put, \
683 .private_value = nid | (mask<<16) }
684 #endif /* CONFIG_SND_DEBUG */
686 /* A switch control to allow the enabling of the digital IO pins on the
687 * ALC260. This is incredibly simplistic; the intention of this control is
688 * to provide something in the test model allowing digital outputs to be
689 * identified if present. If models are found which can utilise these
690 * outputs a more complete mixer control can be devised for those models if
693 #ifdef CONFIG_SND_DEBUG
694 #define alc_spdif_ctrl_info snd_ctl_boolean_mono_info
696 static int alc_spdif_ctrl_get(struct snd_kcontrol
*kcontrol
,
697 struct snd_ctl_elem_value
*ucontrol
)
699 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
700 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
701 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
702 long *valp
= ucontrol
->value
.integer
.value
;
703 unsigned int val
= snd_hda_codec_read(codec
, nid
, 0,
704 AC_VERB_GET_DIGI_CONVERT_1
, 0x00);
706 *valp
= (val
& mask
) != 0;
709 static int alc_spdif_ctrl_put(struct snd_kcontrol
*kcontrol
,
710 struct snd_ctl_elem_value
*ucontrol
)
713 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
714 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
715 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
716 long val
= *ucontrol
->value
.integer
.value
;
717 unsigned int ctrl_data
= snd_hda_codec_read(codec
, nid
, 0,
718 AC_VERB_GET_DIGI_CONVERT_1
,
721 /* Set/unset the masked control bit(s) as needed */
722 change
= (val
== 0 ? 0 : mask
) != (ctrl_data
& mask
);
727 snd_hda_codec_write_cache(codec
, nid
, 0, AC_VERB_SET_DIGI_CONVERT_1
,
732 #define ALC_SPDIF_CTRL_SWITCH(xname, nid, mask) \
733 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
734 .info = alc_spdif_ctrl_info, \
735 .get = alc_spdif_ctrl_get, \
736 .put = alc_spdif_ctrl_put, \
737 .private_value = nid | (mask<<16) }
738 #endif /* CONFIG_SND_DEBUG */
740 /* A switch control to allow the enabling EAPD digital outputs on the ALC26x.
741 * Again, this is only used in the ALC26x test models to help identify when
742 * the EAPD line must be asserted for features to work.
744 #ifdef CONFIG_SND_DEBUG
745 #define alc_eapd_ctrl_info snd_ctl_boolean_mono_info
747 static int alc_eapd_ctrl_get(struct snd_kcontrol
*kcontrol
,
748 struct snd_ctl_elem_value
*ucontrol
)
750 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
751 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
752 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
753 long *valp
= ucontrol
->value
.integer
.value
;
754 unsigned int val
= snd_hda_codec_read(codec
, nid
, 0,
755 AC_VERB_GET_EAPD_BTLENABLE
, 0x00);
757 *valp
= (val
& mask
) != 0;
761 static int alc_eapd_ctrl_put(struct snd_kcontrol
*kcontrol
,
762 struct snd_ctl_elem_value
*ucontrol
)
765 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
766 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
767 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
768 long val
= *ucontrol
->value
.integer
.value
;
769 unsigned int ctrl_data
= snd_hda_codec_read(codec
, nid
, 0,
770 AC_VERB_GET_EAPD_BTLENABLE
,
773 /* Set/unset the masked control bit(s) as needed */
774 change
= (!val
? 0 : mask
) != (ctrl_data
& mask
);
779 snd_hda_codec_write_cache(codec
, nid
, 0, AC_VERB_SET_EAPD_BTLENABLE
,
785 #define ALC_EAPD_CTRL_SWITCH(xname, nid, mask) \
786 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
787 .info = alc_eapd_ctrl_info, \
788 .get = alc_eapd_ctrl_get, \
789 .put = alc_eapd_ctrl_put, \
790 .private_value = nid | (mask<<16) }
791 #endif /* CONFIG_SND_DEBUG */
794 * set up the input pin config (depending on the given auto-pin type)
796 static void alc_set_input_pin(struct hda_codec
*codec
, hda_nid_t nid
,
799 unsigned int val
= PIN_IN
;
801 if (auto_pin_type
<= AUTO_PIN_FRONT_MIC
) {
803 pincap
= snd_hda_query_pin_caps(codec
, nid
);
804 pincap
= (pincap
& AC_PINCAP_VREF
) >> AC_PINCAP_VREF_SHIFT
;
805 if (pincap
& AC_PINCAP_VREF_80
)
807 else if (pincap
& AC_PINCAP_VREF_50
)
809 else if (pincap
& AC_PINCAP_VREF_100
)
811 else if (pincap
& AC_PINCAP_VREF_GRD
)
814 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
, val
);
819 static void add_mixer(struct alc_spec
*spec
, struct snd_kcontrol_new
*mix
)
821 if (snd_BUG_ON(spec
->num_mixers
>= ARRAY_SIZE(spec
->mixers
)))
823 spec
->mixers
[spec
->num_mixers
++] = mix
;
826 static void add_verb(struct alc_spec
*spec
, const struct hda_verb
*verb
)
828 if (snd_BUG_ON(spec
->num_init_verbs
>= ARRAY_SIZE(spec
->init_verbs
)))
830 spec
->init_verbs
[spec
->num_init_verbs
++] = verb
;
833 #ifdef CONFIG_PROC_FS
837 static void print_realtek_coef(struct snd_info_buffer
*buffer
,
838 struct hda_codec
*codec
, hda_nid_t nid
)
844 coeff
= snd_hda_codec_read(codec
, nid
, 0, AC_VERB_GET_PROC_COEF
, 0);
845 snd_iprintf(buffer
, " Processing Coefficient: 0x%02x\n", coeff
);
846 coeff
= snd_hda_codec_read(codec
, nid
, 0,
847 AC_VERB_GET_COEF_INDEX
, 0);
848 snd_iprintf(buffer
, " Coefficient Index: 0x%02x\n", coeff
);
851 #define print_realtek_coef NULL
855 * set up from the preset table
857 static void setup_preset(struct hda_codec
*codec
,
858 const struct alc_config_preset
*preset
)
860 struct alc_spec
*spec
= codec
->spec
;
863 for (i
= 0; i
< ARRAY_SIZE(preset
->mixers
) && preset
->mixers
[i
]; i
++)
864 add_mixer(spec
, preset
->mixers
[i
]);
865 spec
->cap_mixer
= preset
->cap_mixer
;
866 for (i
= 0; i
< ARRAY_SIZE(preset
->init_verbs
) && preset
->init_verbs
[i
];
868 add_verb(spec
, preset
->init_verbs
[i
]);
870 spec
->channel_mode
= preset
->channel_mode
;
871 spec
->num_channel_mode
= preset
->num_channel_mode
;
872 spec
->need_dac_fix
= preset
->need_dac_fix
;
873 spec
->const_channel_count
= preset
->const_channel_count
;
875 if (preset
->const_channel_count
)
876 spec
->multiout
.max_channels
= preset
->const_channel_count
;
878 spec
->multiout
.max_channels
= spec
->channel_mode
[0].channels
;
879 spec
->ext_channel_count
= spec
->channel_mode
[0].channels
;
881 spec
->multiout
.num_dacs
= preset
->num_dacs
;
882 spec
->multiout
.dac_nids
= preset
->dac_nids
;
883 spec
->multiout
.dig_out_nid
= preset
->dig_out_nid
;
884 spec
->multiout
.slave_dig_outs
= preset
->slave_dig_outs
;
885 spec
->multiout
.hp_nid
= preset
->hp_nid
;
887 spec
->num_mux_defs
= preset
->num_mux_defs
;
888 if (!spec
->num_mux_defs
)
889 spec
->num_mux_defs
= 1;
890 spec
->input_mux
= preset
->input_mux
;
892 spec
->num_adc_nids
= preset
->num_adc_nids
;
893 spec
->adc_nids
= preset
->adc_nids
;
894 spec
->capsrc_nids
= preset
->capsrc_nids
;
895 spec
->dig_in_nid
= preset
->dig_in_nid
;
897 spec
->unsol_event
= preset
->unsol_event
;
898 spec
->init_hook
= preset
->init_hook
;
899 #ifdef CONFIG_SND_HDA_POWER_SAVE
900 spec
->loopback
.amplist
= preset
->loopbacks
;
904 preset
->setup(codec
);
907 /* Enable GPIO mask and set output */
908 static struct hda_verb alc_gpio1_init_verbs
[] = {
909 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
910 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
911 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
915 static struct hda_verb alc_gpio2_init_verbs
[] = {
916 {0x01, AC_VERB_SET_GPIO_MASK
, 0x02},
917 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x02},
918 {0x01, AC_VERB_SET_GPIO_DATA
, 0x02},
922 static struct hda_verb alc_gpio3_init_verbs
[] = {
923 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
924 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x03},
925 {0x01, AC_VERB_SET_GPIO_DATA
, 0x03},
930 * Fix hardware PLL issue
931 * On some codecs, the analog PLL gating control must be off while
932 * the default value is 1.
934 static void alc_fix_pll(struct hda_codec
*codec
)
936 struct alc_spec
*spec
= codec
->spec
;
941 snd_hda_codec_write(codec
, spec
->pll_nid
, 0, AC_VERB_SET_COEF_INDEX
,
943 val
= snd_hda_codec_read(codec
, spec
->pll_nid
, 0,
944 AC_VERB_GET_PROC_COEF
, 0);
945 snd_hda_codec_write(codec
, spec
->pll_nid
, 0, AC_VERB_SET_COEF_INDEX
,
947 snd_hda_codec_write(codec
, spec
->pll_nid
, 0, AC_VERB_SET_PROC_COEF
,
948 val
& ~(1 << spec
->pll_coef_bit
));
951 static void alc_fix_pll_init(struct hda_codec
*codec
, hda_nid_t nid
,
952 unsigned int coef_idx
, unsigned int coef_bit
)
954 struct alc_spec
*spec
= codec
->spec
;
956 spec
->pll_coef_idx
= coef_idx
;
957 spec
->pll_coef_bit
= coef_bit
;
961 static void alc_automute_pin(struct hda_codec
*codec
)
963 struct alc_spec
*spec
= codec
->spec
;
964 unsigned int present
, pincap
;
965 unsigned int nid
= spec
->autocfg
.hp_pins
[0];
970 pincap
= snd_hda_query_pin_caps(codec
, nid
);
971 if (pincap
& AC_PINCAP_TRIG_REQ
) /* need trigger? */
972 snd_hda_codec_read(codec
, nid
, 0, AC_VERB_SET_PIN_SENSE
, 0);
973 present
= snd_hda_codec_read(codec
, nid
, 0,
974 AC_VERB_GET_PIN_SENSE
, 0);
975 spec
->jack_present
= (present
& AC_PINSENSE_PRESENCE
) != 0;
976 for (i
= 0; i
< ARRAY_SIZE(spec
->autocfg
.speaker_pins
); i
++) {
977 nid
= spec
->autocfg
.speaker_pins
[i
];
980 snd_hda_codec_write(codec
, nid
, 0,
981 AC_VERB_SET_PIN_WIDGET_CONTROL
,
982 spec
->jack_present
? 0 : PIN_OUT
);
986 static int get_connection_index(struct hda_codec
*codec
, hda_nid_t mux
,
989 hda_nid_t conn
[HDA_MAX_NUM_INPUTS
];
992 nums
= snd_hda_get_connections(codec
, mux
, conn
, ARRAY_SIZE(conn
));
993 for (i
= 0; i
< nums
; i
++)
999 static void alc_mic_automute(struct hda_codec
*codec
)
1001 struct alc_spec
*spec
= codec
->spec
;
1002 struct alc_mic_route
*dead
, *alive
;
1003 unsigned int present
, type
;
1006 if (!spec
->auto_mic
)
1008 if (!spec
->int_mic
.pin
|| !spec
->ext_mic
.pin
)
1010 if (snd_BUG_ON(!spec
->adc_nids
))
1013 cap_nid
= spec
->capsrc_nids
? spec
->capsrc_nids
[0] : spec
->adc_nids
[0];
1015 present
= snd_hda_codec_read(codec
, spec
->ext_mic
.pin
, 0,
1016 AC_VERB_GET_PIN_SENSE
, 0);
1017 present
&= AC_PINSENSE_PRESENCE
;
1019 alive
= &spec
->ext_mic
;
1020 dead
= &spec
->int_mic
;
1022 alive
= &spec
->int_mic
;
1023 dead
= &spec
->ext_mic
;
1026 type
= get_wcaps_type(get_wcaps(codec
, cap_nid
));
1027 if (type
== AC_WID_AUD_MIX
) {
1028 /* Matrix-mixer style (e.g. ALC882) */
1029 snd_hda_codec_amp_stereo(codec
, cap_nid
, HDA_INPUT
,
1032 snd_hda_codec_amp_stereo(codec
, cap_nid
, HDA_INPUT
,
1034 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
1036 /* MUX style (e.g. ALC880) */
1037 snd_hda_codec_write_cache(codec
, cap_nid
, 0,
1038 AC_VERB_SET_CONNECT_SEL
,
1042 /* FIXME: analog mixer */
1045 /* unsolicited event for HP jack sensing */
1046 static void alc_sku_unsol_event(struct hda_codec
*codec
, unsigned int res
)
1048 if (codec
->vendor_id
== 0x10ec0880)
1053 case ALC880_HP_EVENT
:
1054 alc_automute_pin(codec
);
1056 case ALC880_MIC_EVENT
:
1057 alc_mic_automute(codec
);
1062 static void alc_inithook(struct hda_codec
*codec
)
1064 alc_automute_pin(codec
);
1065 alc_mic_automute(codec
);
1068 /* additional initialization for ALC888 variants */
1069 static void alc888_coef_init(struct hda_codec
*codec
)
1073 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 0);
1074 tmp
= snd_hda_codec_read(codec
, 0x20, 0, AC_VERB_GET_PROC_COEF
, 0);
1075 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 7);
1076 if ((tmp
& 0xf0) == 0x20)
1078 snd_hda_codec_read(codec
, 0x20, 0,
1079 AC_VERB_SET_PROC_COEF
, 0x830);
1082 snd_hda_codec_read(codec
, 0x20, 0,
1083 AC_VERB_SET_PROC_COEF
, 0x3030);
1086 static void alc889_coef_init(struct hda_codec
*codec
)
1090 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 7);
1091 tmp
= snd_hda_codec_read(codec
, 0x20, 0, AC_VERB_GET_PROC_COEF
, 0);
1092 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 7);
1093 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_PROC_COEF
, tmp
|0x2010);
1096 static void alc_auto_init_amp(struct hda_codec
*codec
, int type
)
1101 case ALC_INIT_GPIO1
:
1102 snd_hda_sequence_write(codec
, alc_gpio1_init_verbs
);
1104 case ALC_INIT_GPIO2
:
1105 snd_hda_sequence_write(codec
, alc_gpio2_init_verbs
);
1107 case ALC_INIT_GPIO3
:
1108 snd_hda_sequence_write(codec
, alc_gpio3_init_verbs
);
1110 case ALC_INIT_DEFAULT
:
1111 switch (codec
->vendor_id
) {
1113 snd_hda_codec_write(codec
, 0x0f, 0,
1114 AC_VERB_SET_EAPD_BTLENABLE
, 2);
1115 snd_hda_codec_write(codec
, 0x10, 0,
1116 AC_VERB_SET_EAPD_BTLENABLE
, 2);
1128 snd_hda_codec_write(codec
, 0x14, 0,
1129 AC_VERB_SET_EAPD_BTLENABLE
, 2);
1130 snd_hda_codec_write(codec
, 0x15, 0,
1131 AC_VERB_SET_EAPD_BTLENABLE
, 2);
1134 switch (codec
->vendor_id
) {
1136 snd_hda_codec_write(codec
, 0x1a, 0,
1137 AC_VERB_SET_COEF_INDEX
, 7);
1138 tmp
= snd_hda_codec_read(codec
, 0x1a, 0,
1139 AC_VERB_GET_PROC_COEF
, 0);
1140 snd_hda_codec_write(codec
, 0x1a, 0,
1141 AC_VERB_SET_COEF_INDEX
, 7);
1142 snd_hda_codec_write(codec
, 0x1a, 0,
1143 AC_VERB_SET_PROC_COEF
,
1153 alc889_coef_init(codec
);
1156 alc888_coef_init(codec
);
1160 snd_hda_codec_write(codec
, 0x20, 0,
1161 AC_VERB_SET_COEF_INDEX
, 7);
1162 tmp
= snd_hda_codec_read(codec
, 0x20, 0,
1163 AC_VERB_GET_PROC_COEF
, 0);
1164 snd_hda_codec_write(codec
, 0x20, 0,
1165 AC_VERB_SET_COEF_INDEX
, 7);
1166 snd_hda_codec_write(codec
, 0x20, 0,
1167 AC_VERB_SET_PROC_COEF
,
1175 static void alc_init_auto_hp(struct hda_codec
*codec
)
1177 struct alc_spec
*spec
= codec
->spec
;
1179 if (!spec
->autocfg
.hp_pins
[0])
1182 if (!spec
->autocfg
.speaker_pins
[0]) {
1183 if (spec
->autocfg
.line_out_pins
[0] &&
1184 spec
->autocfg
.line_out_type
== AUTO_PIN_SPEAKER_OUT
)
1185 spec
->autocfg
.speaker_pins
[0] =
1186 spec
->autocfg
.line_out_pins
[0];
1191 snd_printdd("realtek: Enable HP auto-muting on NID 0x%x\n",
1192 spec
->autocfg
.hp_pins
[0]);
1193 snd_hda_codec_write_cache(codec
, spec
->autocfg
.hp_pins
[0], 0,
1194 AC_VERB_SET_UNSOLICITED_ENABLE
,
1195 AC_USRSP_EN
| ALC880_HP_EVENT
);
1196 spec
->unsol_event
= alc_sku_unsol_event
;
1199 static void alc_init_auto_mic(struct hda_codec
*codec
)
1201 struct alc_spec
*spec
= codec
->spec
;
1202 struct auto_pin_cfg
*cfg
= &spec
->autocfg
;
1203 hda_nid_t fixed
, ext
;
1206 /* there must be only two mic inputs exclusively */
1207 for (i
= AUTO_PIN_LINE
; i
< AUTO_PIN_LAST
; i
++)
1208 if (cfg
->input_pins
[i
])
1212 for (i
= AUTO_PIN_MIC
; i
<= AUTO_PIN_FRONT_MIC
; i
++) {
1213 hda_nid_t nid
= cfg
->input_pins
[i
];
1214 unsigned int defcfg
;
1217 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
1218 switch (get_defcfg_connect(defcfg
)) {
1219 case AC_JACK_PORT_FIXED
:
1221 return; /* already occupied */
1224 case AC_JACK_PORT_COMPLEX
:
1226 return; /* already occupied */
1230 return; /* invalid entry */
1233 if (!(get_wcaps(codec
, ext
) & AC_WCAP_UNSOL_CAP
))
1234 return; /* no unsol support */
1235 snd_printdd("realtek: Enable auto-mic switch on NID 0x%x/0x%x\n",
1237 spec
->ext_mic
.pin
= ext
;
1238 spec
->int_mic
.pin
= fixed
;
1239 spec
->ext_mic
.mux_idx
= MUX_IDX_UNDEF
; /* set later */
1240 spec
->int_mic
.mux_idx
= MUX_IDX_UNDEF
; /* set later */
1242 snd_hda_codec_write_cache(codec
, spec
->ext_mic
.pin
, 0,
1243 AC_VERB_SET_UNSOLICITED_ENABLE
,
1244 AC_USRSP_EN
| ALC880_MIC_EVENT
);
1245 spec
->unsol_event
= alc_sku_unsol_event
;
1248 /* check subsystem ID and set up device-specific initialization;
1249 * return 1 if initialized, 0 if invalid SSID
1251 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
1252 * 31 ~ 16 : Manufacture ID
1254 * 7 ~ 0 : Assembly ID
1255 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
1257 static int alc_subsystem_id(struct hda_codec
*codec
,
1258 hda_nid_t porta
, hda_nid_t porte
,
1261 unsigned int ass
, tmp
, i
;
1263 struct alc_spec
*spec
= codec
->spec
;
1265 ass
= codec
->subsystem_id
& 0xffff;
1266 if ((ass
!= codec
->bus
->pci
->subsystem_device
) && (ass
& 1))
1269 /* invalid SSID, check the special NID pin defcfg instead */
1271 * 31~30 : port connectivity
1274 * 19~16 : Check sum (15:1)
1279 if (codec
->vendor_id
== 0x10ec0260)
1281 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
1282 snd_printd("realtek: No valid SSID, "
1283 "checking pincfg 0x%08x for NID 0x%x\n",
1285 if (!(ass
& 1) && !(ass
& 0x100000))
1287 if ((ass
>> 30) != 1) /* no physical connection */
1292 for (i
= 1; i
< 16; i
++) {
1296 if (((ass
>> 16) & 0xf) != tmp
)
1299 snd_printd("realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
1300 ass
& 0xffff, codec
->vendor_id
);
1304 * 2 : 0 --> Desktop, 1 --> Laptop
1305 * 3~5 : External Amplifier control
1308 tmp
= (ass
& 0x38) >> 3; /* external Amp control */
1311 spec
->init_amp
= ALC_INIT_GPIO1
;
1314 spec
->init_amp
= ALC_INIT_GPIO2
;
1317 spec
->init_amp
= ALC_INIT_GPIO3
;
1320 spec
->init_amp
= ALC_INIT_DEFAULT
;
1324 /* is laptop or Desktop and enable the function "Mute internal speaker
1325 * when the external headphone out jack is plugged"
1327 if (!(ass
& 0x8000))
1330 * 10~8 : Jack location
1331 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
1333 * 15 : 1 --> enable the function "Mute internal speaker
1334 * when the external headphone out jack is plugged"
1336 if (!spec
->autocfg
.hp_pins
[0]) {
1338 tmp
= (ass
>> 11) & 0x3; /* HP to chassis */
1347 for (i
= 0; i
< spec
->autocfg
.line_outs
; i
++)
1348 if (spec
->autocfg
.line_out_pins
[i
] == nid
)
1350 spec
->autocfg
.hp_pins
[0] = nid
;
1353 alc_init_auto_hp(codec
);
1354 alc_init_auto_mic(codec
);
1358 static void alc_ssid_check(struct hda_codec
*codec
,
1359 hda_nid_t porta
, hda_nid_t porte
, hda_nid_t portd
)
1361 if (!alc_subsystem_id(codec
, porta
, porte
, portd
)) {
1362 struct alc_spec
*spec
= codec
->spec
;
1363 snd_printd("realtek: "
1364 "Enable default setup for auto mode as fallback\n");
1365 spec
->init_amp
= ALC_INIT_DEFAULT
;
1366 alc_init_auto_hp(codec
);
1367 alc_init_auto_mic(codec
);
1372 * Fix-up pin default configurations and add default verbs
1381 const struct alc_pincfg
*pins
;
1382 const struct hda_verb
*verbs
;
1385 static void alc_pick_fixup(struct hda_codec
*codec
,
1386 const struct snd_pci_quirk
*quirk
,
1387 const struct alc_fixup
*fix
)
1389 const struct alc_pincfg
*cfg
;
1391 quirk
= snd_pci_quirk_lookup(codec
->bus
->pci
, quirk
);
1395 fix
+= quirk
->value
;
1398 for (; cfg
->nid
; cfg
++)
1399 snd_hda_codec_set_pincfg(codec
, cfg
->nid
, cfg
->val
);
1402 add_verb(codec
->spec
, fix
->verbs
);
1412 static struct hda_verb alc888_4ST_ch2_intel_init
[] = {
1413 /* Mic-in jack as mic in */
1414 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
1415 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
1416 /* Line-in jack as Line in */
1417 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
1418 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
1419 /* Line-Out as Front */
1420 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x00},
1427 static struct hda_verb alc888_4ST_ch4_intel_init
[] = {
1428 /* Mic-in jack as mic in */
1429 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
1430 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
1431 /* Line-in jack as Surround */
1432 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1433 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1434 /* Line-Out as Front */
1435 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x00},
1442 static struct hda_verb alc888_4ST_ch6_intel_init
[] = {
1443 /* Mic-in jack as CLFE */
1444 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1445 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1446 /* Line-in jack as Surround */
1447 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1448 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1449 /* Line-Out as CLFE (workaround because Mic-in is not loud enough) */
1450 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
1457 static struct hda_verb alc888_4ST_ch8_intel_init
[] = {
1458 /* Mic-in jack as CLFE */
1459 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1460 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1461 /* Line-in jack as Surround */
1462 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1463 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1464 /* Line-Out as Side */
1465 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
1469 static struct hda_channel_mode alc888_4ST_8ch_intel_modes
[4] = {
1470 { 2, alc888_4ST_ch2_intel_init
},
1471 { 4, alc888_4ST_ch4_intel_init
},
1472 { 6, alc888_4ST_ch6_intel_init
},
1473 { 8, alc888_4ST_ch8_intel_init
},
1477 * ALC888 Fujitsu Siemens Amillo xa3530
1480 static struct hda_verb alc888_fujitsu_xa3530_verbs
[] = {
1481 /* Front Mic: set to PIN_IN (empty by default) */
1482 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
1483 /* Connect Internal HP to Front */
1484 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1485 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1486 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
1487 /* Connect Bass HP to Front */
1488 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1489 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1490 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
1491 /* Connect Line-Out side jack (SPDIF) to Side */
1492 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1493 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1494 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
1495 /* Connect Mic jack to CLFE */
1496 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1497 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1498 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02},
1499 /* Connect Line-in jack to Surround */
1500 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1501 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1502 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01},
1503 /* Connect HP out jack to Front */
1504 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1505 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1506 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
1507 /* Enable unsolicited event for HP jack and Line-out jack */
1508 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
1509 {0x17, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
1513 static void alc_automute_amp(struct hda_codec
*codec
)
1515 struct alc_spec
*spec
= codec
->spec
;
1516 unsigned int val
, mute
, pincap
;
1520 spec
->jack_present
= 0;
1521 for (i
= 0; i
< ARRAY_SIZE(spec
->autocfg
.hp_pins
); i
++) {
1522 nid
= spec
->autocfg
.hp_pins
[i
];
1525 pincap
= snd_hda_query_pin_caps(codec
, nid
);
1526 if (pincap
& AC_PINCAP_TRIG_REQ
) /* need trigger? */
1527 snd_hda_codec_read(codec
, nid
, 0,
1528 AC_VERB_SET_PIN_SENSE
, 0);
1529 val
= snd_hda_codec_read(codec
, nid
, 0,
1530 AC_VERB_GET_PIN_SENSE
, 0);
1531 if (val
& AC_PINSENSE_PRESENCE
) {
1532 spec
->jack_present
= 1;
1537 mute
= spec
->jack_present
? HDA_AMP_MUTE
: 0;
1538 /* Toggle internal speakers muting */
1539 for (i
= 0; i
< ARRAY_SIZE(spec
->autocfg
.speaker_pins
); i
++) {
1540 nid
= spec
->autocfg
.speaker_pins
[i
];
1543 snd_hda_codec_amp_stereo(codec
, nid
, HDA_OUTPUT
, 0,
1544 HDA_AMP_MUTE
, mute
);
1548 static void alc_automute_amp_unsol_event(struct hda_codec
*codec
,
1551 if (codec
->vendor_id
== 0x10ec0880)
1555 if (res
== ALC880_HP_EVENT
)
1556 alc_automute_amp(codec
);
1559 static void alc889_automute_setup(struct hda_codec
*codec
)
1561 struct alc_spec
*spec
= codec
->spec
;
1563 spec
->autocfg
.hp_pins
[0] = 0x15;
1564 spec
->autocfg
.speaker_pins
[0] = 0x14;
1565 spec
->autocfg
.speaker_pins
[1] = 0x16;
1566 spec
->autocfg
.speaker_pins
[2] = 0x17;
1567 spec
->autocfg
.speaker_pins
[3] = 0x19;
1568 spec
->autocfg
.speaker_pins
[4] = 0x1a;
1571 static void alc889_intel_init_hook(struct hda_codec
*codec
)
1573 alc889_coef_init(codec
);
1574 alc_automute_amp(codec
);
1577 static void alc888_fujitsu_xa3530_setup(struct hda_codec
*codec
)
1579 struct alc_spec
*spec
= codec
->spec
;
1581 spec
->autocfg
.hp_pins
[0] = 0x17; /* line-out */
1582 spec
->autocfg
.hp_pins
[1] = 0x1b; /* hp */
1583 spec
->autocfg
.speaker_pins
[0] = 0x14; /* speaker */
1584 spec
->autocfg
.speaker_pins
[1] = 0x15; /* bass */
1588 * ALC888 Acer Aspire 4930G model
1591 static struct hda_verb alc888_acer_aspire_4930g_verbs
[] = {
1592 /* Front Mic: set to PIN_IN (empty by default) */
1593 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
1594 /* Unselect Front Mic by default in input mixer 3 */
1595 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0xb)},
1596 /* Enable unsolicited event for HP jack */
1597 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
1598 /* Connect Internal HP to front */
1599 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1600 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1601 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
1602 /* Connect HP out to front */
1603 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1604 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1605 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
1610 * ALC888 Acer Aspire 6530G model
1613 static struct hda_verb alc888_acer_aspire_6530g_verbs
[] = {
1614 /* Bias voltage on for external mic port */
1615 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
| PIN_VREF80
},
1616 /* Front Mic: set to PIN_IN (empty by default) */
1617 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
1618 /* Unselect Front Mic by default in input mixer 3 */
1619 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0xb)},
1620 /* Enable unsolicited event for HP jack */
1621 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
1622 /* Enable speaker output */
1623 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1624 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1625 /* Enable headphone output */
1626 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
| PIN_HP
},
1627 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1628 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
1633 * ALC889 Acer Aspire 8930G model
1636 static struct hda_verb alc889_acer_aspire_8930g_verbs
[] = {
1637 /* Front Mic: set to PIN_IN (empty by default) */
1638 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
1639 /* Unselect Front Mic by default in input mixer 3 */
1640 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0xb)},
1641 /* Enable unsolicited event for HP jack */
1642 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
1643 /* Connect Internal Front to Front */
1644 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1645 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1646 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
1647 /* Connect Internal Rear to Rear */
1648 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1649 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1650 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x01},
1651 /* Connect Internal CLFE to CLFE */
1652 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1653 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1654 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x02},
1655 /* Connect HP out to Front */
1656 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
| PIN_HP
},
1657 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1658 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
1659 /* Enable all DACs */
1660 /* DAC DISABLE/MUTE 1? */
1661 /* setting bits 1-5 disables DAC nids 0x02-0x06 apparently. Init=0x38 */
1662 {0x20, AC_VERB_SET_COEF_INDEX
, 0x03},
1663 {0x20, AC_VERB_SET_PROC_COEF
, 0x0000},
1664 /* DAC DISABLE/MUTE 2? */
1665 /* some bit here disables the other DACs. Init=0x4900 */
1666 {0x20, AC_VERB_SET_COEF_INDEX
, 0x08},
1667 {0x20, AC_VERB_SET_PROC_COEF
, 0x0000},
1668 /* Enable amplifiers */
1669 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0x02},
1670 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 0x02},
1672 * This laptop has a stereo digital microphone. The mics are only 1cm apart
1673 * which makes the stereo useless. However, either the mic or the ALC889
1674 * makes the signal become a difference/sum signal instead of standard
1675 * stereo, which is annoying. So instead we flip this bit which makes the
1676 * codec replicate the sum signal to both channels, turning it into a
1679 /* DMIC_CONTROL? Init value = 0x0001 */
1680 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0b},
1681 {0x20, AC_VERB_SET_PROC_COEF
, 0x0003},
1685 static struct hda_input_mux alc888_2_capture_sources
[2] = {
1686 /* Front mic only available on one ADC */
1693 { "Front Mic", 0xb },
1706 static struct hda_input_mux alc888_acer_aspire_6530_sources
[2] = {
1707 /* Interal mic only available on one ADC */
1714 { "Input Mix", 0xa },
1724 { "Input Mix", 0xa },
1729 static struct hda_input_mux alc889_capture_sources
[3] = {
1730 /* Digital mic only available on first "ADC" */
1737 { "Front Mic", 0xb },
1738 { "Input Mix", 0xa },
1747 { "Input Mix", 0xa },
1756 { "Input Mix", 0xa },
1761 static struct snd_kcontrol_new alc888_base_mixer
[] = {
1762 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
1763 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
1764 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
1765 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
1766 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
1768 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
1769 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
1770 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
1771 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
1772 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
1773 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
1774 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
1775 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
1776 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
1777 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
1778 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
1779 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
1783 static void alc888_acer_aspire_4930g_setup(struct hda_codec
*codec
)
1785 struct alc_spec
*spec
= codec
->spec
;
1787 spec
->autocfg
.hp_pins
[0] = 0x15;
1788 spec
->autocfg
.speaker_pins
[0] = 0x14;
1791 static void alc888_acer_aspire_6530g_setup(struct hda_codec
*codec
)
1793 struct alc_spec
*spec
= codec
->spec
;
1795 spec
->autocfg
.hp_pins
[0] = 0x15;
1796 spec
->autocfg
.speaker_pins
[0] = 0x14;
1797 spec
->autocfg
.speaker_pins
[1] = 0x16;
1798 spec
->autocfg
.speaker_pins
[2] = 0x17;
1801 static void alc889_acer_aspire_8930g_setup(struct hda_codec
*codec
)
1803 struct alc_spec
*spec
= codec
->spec
;
1805 spec
->autocfg
.hp_pins
[0] = 0x15;
1806 spec
->autocfg
.speaker_pins
[0] = 0x14;
1807 spec
->autocfg
.speaker_pins
[1] = 0x16;
1808 spec
->autocfg
.speaker_pins
[2] = 0x1b;
1812 * ALC880 3-stack model
1814 * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0e)
1815 * Pin assignment: Front = 0x14, Line-In/Surr = 0x1a, Mic/CLFE = 0x18,
1816 * F-Mic = 0x1b, HP = 0x19
1819 static hda_nid_t alc880_dac_nids
[4] = {
1820 /* front, rear, clfe, rear_surr */
1821 0x02, 0x05, 0x04, 0x03
1824 static hda_nid_t alc880_adc_nids
[3] = {
1829 /* The datasheet says the node 0x07 is connected from inputs,
1830 * but it shows zero connection in the real implementation on some devices.
1831 * Note: this is a 915GAV bug, fixed on 915GLV
1833 static hda_nid_t alc880_adc_nids_alt
[2] = {
1838 #define ALC880_DIGOUT_NID 0x06
1839 #define ALC880_DIGIN_NID 0x0a
1841 static struct hda_input_mux alc880_capture_source
= {
1845 { "Front Mic", 0x3 },
1851 /* channel source setting (2/6 channel selection for 3-stack) */
1853 static struct hda_verb alc880_threestack_ch2_init
[] = {
1854 /* set line-in to input, mute it */
1855 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
1856 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
1857 /* set mic-in to input vref 80%, mute it */
1858 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
1859 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
1864 static struct hda_verb alc880_threestack_ch6_init
[] = {
1865 /* set line-in to output, unmute it */
1866 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1867 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1868 /* set mic-in to output, unmute it */
1869 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1870 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1874 static struct hda_channel_mode alc880_threestack_modes
[2] = {
1875 { 2, alc880_threestack_ch2_init
},
1876 { 6, alc880_threestack_ch6_init
},
1879 static struct snd_kcontrol_new alc880_three_stack_mixer
[] = {
1880 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
1881 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
1882 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
1883 HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT
),
1884 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
1885 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
1886 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
1887 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
1888 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
1889 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
1890 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
1891 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
1892 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
1893 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
1894 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x3, HDA_INPUT
),
1895 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x3, HDA_INPUT
),
1896 HDA_CODEC_MUTE("Headphone Playback Switch", 0x19, 0x0, HDA_OUTPUT
),
1898 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
1899 .name
= "Channel Mode",
1900 .info
= alc_ch_mode_info
,
1901 .get
= alc_ch_mode_get
,
1902 .put
= alc_ch_mode_put
,
1907 /* capture mixer elements */
1908 static int alc_cap_vol_info(struct snd_kcontrol
*kcontrol
,
1909 struct snd_ctl_elem_info
*uinfo
)
1911 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
1912 struct alc_spec
*spec
= codec
->spec
;
1915 mutex_lock(&codec
->control_mutex
);
1916 kcontrol
->private_value
= HDA_COMPOSE_AMP_VAL(spec
->adc_nids
[0], 3, 0,
1918 err
= snd_hda_mixer_amp_volume_info(kcontrol
, uinfo
);
1919 mutex_unlock(&codec
->control_mutex
);
1923 static int alc_cap_vol_tlv(struct snd_kcontrol
*kcontrol
, int op_flag
,
1924 unsigned int size
, unsigned int __user
*tlv
)
1926 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
1927 struct alc_spec
*spec
= codec
->spec
;
1930 mutex_lock(&codec
->control_mutex
);
1931 kcontrol
->private_value
= HDA_COMPOSE_AMP_VAL(spec
->adc_nids
[0], 3, 0,
1933 err
= snd_hda_mixer_amp_tlv(kcontrol
, op_flag
, size
, tlv
);
1934 mutex_unlock(&codec
->control_mutex
);
1938 typedef int (*getput_call_t
)(struct snd_kcontrol
*kcontrol
,
1939 struct snd_ctl_elem_value
*ucontrol
);
1941 static int alc_cap_getput_caller(struct snd_kcontrol
*kcontrol
,
1942 struct snd_ctl_elem_value
*ucontrol
,
1945 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
1946 struct alc_spec
*spec
= codec
->spec
;
1947 unsigned int adc_idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
1950 mutex_lock(&codec
->control_mutex
);
1951 kcontrol
->private_value
= HDA_COMPOSE_AMP_VAL(spec
->adc_nids
[adc_idx
],
1953 err
= func(kcontrol
, ucontrol
);
1954 mutex_unlock(&codec
->control_mutex
);
1958 static int alc_cap_vol_get(struct snd_kcontrol
*kcontrol
,
1959 struct snd_ctl_elem_value
*ucontrol
)
1961 return alc_cap_getput_caller(kcontrol
, ucontrol
,
1962 snd_hda_mixer_amp_volume_get
);
1965 static int alc_cap_vol_put(struct snd_kcontrol
*kcontrol
,
1966 struct snd_ctl_elem_value
*ucontrol
)
1968 return alc_cap_getput_caller(kcontrol
, ucontrol
,
1969 snd_hda_mixer_amp_volume_put
);
1972 /* capture mixer elements */
1973 #define alc_cap_sw_info snd_ctl_boolean_stereo_info
1975 static int alc_cap_sw_get(struct snd_kcontrol
*kcontrol
,
1976 struct snd_ctl_elem_value
*ucontrol
)
1978 return alc_cap_getput_caller(kcontrol
, ucontrol
,
1979 snd_hda_mixer_amp_switch_get
);
1982 static int alc_cap_sw_put(struct snd_kcontrol
*kcontrol
,
1983 struct snd_ctl_elem_value
*ucontrol
)
1985 return alc_cap_getput_caller(kcontrol
, ucontrol
,
1986 snd_hda_mixer_amp_switch_put
);
1989 #define _DEFINE_CAPMIX(num) \
1991 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
1992 .name = "Capture Switch", \
1993 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
1995 .info = alc_cap_sw_info, \
1996 .get = alc_cap_sw_get, \
1997 .put = alc_cap_sw_put, \
2000 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
2001 .name = "Capture Volume", \
2002 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | \
2003 SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
2004 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK), \
2006 .info = alc_cap_vol_info, \
2007 .get = alc_cap_vol_get, \
2008 .put = alc_cap_vol_put, \
2009 .tlv = { .c = alc_cap_vol_tlv }, \
2012 #define _DEFINE_CAPSRC(num) \
2014 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
2015 /* .name = "Capture Source", */ \
2016 .name = "Input Source", \
2018 .info = alc_mux_enum_info, \
2019 .get = alc_mux_enum_get, \
2020 .put = alc_mux_enum_put, \
2023 #define DEFINE_CAPMIX(num) \
2024 static struct snd_kcontrol_new alc_capture_mixer ## num[] = { \
2025 _DEFINE_CAPMIX(num), \
2026 _DEFINE_CAPSRC(num), \
2030 #define DEFINE_CAPMIX_NOSRC(num) \
2031 static struct snd_kcontrol_new alc_capture_mixer_nosrc ## num[] = { \
2032 _DEFINE_CAPMIX(num), \
2036 /* up to three ADCs */
2040 DEFINE_CAPMIX_NOSRC(1);
2041 DEFINE_CAPMIX_NOSRC(2);
2042 DEFINE_CAPMIX_NOSRC(3);
2045 * ALC880 5-stack model
2047 * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0d),
2049 * Pin assignment: Front = 0x14, Surr = 0x17, CLFE = 0x16
2050 * Line-In/Side = 0x1a, Mic = 0x18, F-Mic = 0x1b, HP = 0x19
2053 /* additional mixers to alc880_three_stack_mixer */
2054 static struct snd_kcontrol_new alc880_five_stack_mixer
[] = {
2055 HDA_CODEC_VOLUME("Side Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2056 HDA_BIND_MUTE("Side Playback Switch", 0x0d, 2, HDA_INPUT
),
2060 /* channel source setting (6/8 channel selection for 5-stack) */
2062 static struct hda_verb alc880_fivestack_ch6_init
[] = {
2063 /* set line-in to input, mute it */
2064 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2065 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2070 static struct hda_verb alc880_fivestack_ch8_init
[] = {
2071 /* set line-in to output, unmute it */
2072 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2073 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2077 static struct hda_channel_mode alc880_fivestack_modes
[2] = {
2078 { 6, alc880_fivestack_ch6_init
},
2079 { 8, alc880_fivestack_ch8_init
},
2084 * ALC880 6-stack model
2086 * DAC: Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e),
2087 * Side = 0x05 (0x0f)
2088 * Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, Side = 0x17,
2089 * Mic = 0x18, F-Mic = 0x19, Line = 0x1a, HP = 0x1b
2092 static hda_nid_t alc880_6st_dac_nids
[4] = {
2093 /* front, rear, clfe, rear_surr */
2094 0x02, 0x03, 0x04, 0x05
2097 static struct hda_input_mux alc880_6stack_capture_source
= {
2101 { "Front Mic", 0x1 },
2107 /* fixed 8-channels */
2108 static struct hda_channel_mode alc880_sixstack_modes
[1] = {
2112 static struct snd_kcontrol_new alc880_six_stack_mixer
[] = {
2113 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2114 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2115 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2116 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
2117 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
2118 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2119 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2120 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2121 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
2122 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
2123 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2124 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2125 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
2126 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
2127 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2128 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2129 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
2130 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
2132 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2133 .name
= "Channel Mode",
2134 .info
= alc_ch_mode_info
,
2135 .get
= alc_ch_mode_get
,
2136 .put
= alc_ch_mode_put
,
2145 * W810 has rear IO for:
2148 * Center/LFE (DAC 04)
2151 * The system also has a pair of internal speakers, and a headphone jack.
2152 * These are both connected to Line2 on the codec, hence to DAC 02.
2154 * There is a variable resistor to control the speaker or headphone
2155 * volume. This is a hardware-only device without a software API.
2157 * Plugging headphones in will disable the internal speakers. This is
2158 * implemented in hardware, not via the driver using jack sense. In
2159 * a similar fashion, plugging into the rear socket marked "front" will
2160 * disable both the speakers and headphones.
2162 * For input, there's a microphone jack, and an "audio in" jack.
2163 * These may not do anything useful with this driver yet, because I
2164 * haven't setup any initialization verbs for these yet...
2167 static hda_nid_t alc880_w810_dac_nids
[3] = {
2168 /* front, rear/surround, clfe */
2172 /* fixed 6 channels */
2173 static struct hda_channel_mode alc880_w810_modes
[1] = {
2177 /* Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, HP = 0x1b */
2178 static struct snd_kcontrol_new alc880_w810_base_mixer
[] = {
2179 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2180 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2181 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2182 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
2183 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
2184 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2185 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2186 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2187 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
2195 * DAC: Front = 0x02 (0x0c), HP = 0x03 (0x0d)
2196 * Pin assignment: Front = 0x14, HP = 0x15, Mic = 0x18, Mic2 = 0x19(?),
2200 static hda_nid_t alc880_z71v_dac_nids
[1] = {
2203 #define ALC880_Z71V_HP_DAC 0x03
2205 /* fixed 2 channels */
2206 static struct hda_channel_mode alc880_2_jack_modes
[1] = {
2210 static struct snd_kcontrol_new alc880_z71v_mixer
[] = {
2211 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2212 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2213 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2214 HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT
),
2215 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2216 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2217 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2218 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2224 * ALC880 F1734 model
2226 * DAC: HP = 0x02 (0x0c), Front = 0x03 (0x0d)
2227 * Pin assignment: HP = 0x14, Front = 0x15, Mic = 0x18
2230 static hda_nid_t alc880_f1734_dac_nids
[1] = {
2233 #define ALC880_F1734_HP_DAC 0x02
2235 static struct snd_kcontrol_new alc880_f1734_mixer
[] = {
2236 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2237 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
2238 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2239 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
2240 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2241 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2242 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
2243 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
2247 static struct hda_input_mux alc880_f1734_capture_source
= {
2259 * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
2260 * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
2261 * Mic = 0x18, Line = 0x1a
2264 #define alc880_asus_dac_nids alc880_w810_dac_nids /* identical with w810 */
2265 #define alc880_asus_modes alc880_threestack_modes /* 2/6 channel mode */
2267 static struct snd_kcontrol_new alc880_asus_mixer
[] = {
2268 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2269 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2270 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2271 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
2272 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
2273 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2274 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2275 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2276 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2277 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2278 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
2279 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
2280 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2281 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2283 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2284 .name
= "Channel Mode",
2285 .info
= alc_ch_mode_info
,
2286 .get
= alc_ch_mode_get
,
2287 .put
= alc_ch_mode_put
,
2293 * ALC880 ASUS W1V model
2295 * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
2296 * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
2297 * Mic = 0x18, Line = 0x1a, Line2 = 0x1b
2300 /* additional mixers to alc880_asus_mixer */
2301 static struct snd_kcontrol_new alc880_asus_w1v_mixer
[] = {
2302 HDA_CODEC_VOLUME("Line2 Playback Volume", 0x0b, 0x03, HDA_INPUT
),
2303 HDA_CODEC_MUTE("Line2 Playback Switch", 0x0b, 0x03, HDA_INPUT
),
2308 static struct snd_kcontrol_new alc880_tcl_s700_mixer
[] = {
2309 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2310 HDA_CODEC_MUTE("Front Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
2311 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
2312 HDA_CODEC_VOLUME("CD Playback Volume", 0x0B, 0x04, HDA_INPUT
),
2313 HDA_CODEC_MUTE("CD Playback Switch", 0x0B, 0x04, HDA_INPUT
),
2314 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0B, 0x0, HDA_INPUT
),
2315 HDA_CODEC_MUTE("Mic Playback Switch", 0x0B, 0x0, HDA_INPUT
),
2316 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT
),
2317 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT
),
2322 static struct snd_kcontrol_new alc880_uniwill_mixer
[] = {
2323 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2324 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
2325 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2326 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
2327 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
2328 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2329 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2330 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2331 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2332 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2333 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
2334 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
2335 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2336 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2337 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
2338 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
2340 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2341 .name
= "Channel Mode",
2342 .info
= alc_ch_mode_info
,
2343 .get
= alc_ch_mode_get
,
2344 .put
= alc_ch_mode_put
,
2349 static struct snd_kcontrol_new alc880_fujitsu_mixer
[] = {
2350 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2351 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
2352 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2353 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
2354 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2355 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2356 HDA_CODEC_VOLUME("Ext Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2357 HDA_CODEC_MUTE("Ext Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2358 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
2359 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
2363 static struct snd_kcontrol_new alc880_uniwill_p53_mixer
[] = {
2364 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2365 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
2366 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2367 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
2368 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2369 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2374 * virtual master controls
2378 * slave controls for virtual master
2380 static const char *alc_slave_vols
[] = {
2381 "Front Playback Volume",
2382 "Surround Playback Volume",
2383 "Center Playback Volume",
2384 "LFE Playback Volume",
2385 "Side Playback Volume",
2386 "Headphone Playback Volume",
2387 "Speaker Playback Volume",
2388 "Mono Playback Volume",
2389 "Line-Out Playback Volume",
2390 "PCM Playback Volume",
2394 static const char *alc_slave_sws
[] = {
2395 "Front Playback Switch",
2396 "Surround Playback Switch",
2397 "Center Playback Switch",
2398 "LFE Playback Switch",
2399 "Side Playback Switch",
2400 "Headphone Playback Switch",
2401 "Speaker Playback Switch",
2402 "Mono Playback Switch",
2403 "IEC958 Playback Switch",
2408 * build control elements
2411 static void alc_free_kctls(struct hda_codec
*codec
);
2413 /* additional beep mixers; the actual parameters are overwritten at build */
2414 static struct snd_kcontrol_new alc_beep_mixer
[] = {
2415 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT
),
2416 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT
),
2420 static int alc_build_controls(struct hda_codec
*codec
)
2422 struct alc_spec
*spec
= codec
->spec
;
2426 for (i
= 0; i
< spec
->num_mixers
; i
++) {
2427 err
= snd_hda_add_new_ctls(codec
, spec
->mixers
[i
]);
2431 if (spec
->cap_mixer
) {
2432 err
= snd_hda_add_new_ctls(codec
, spec
->cap_mixer
);
2436 if (spec
->multiout
.dig_out_nid
) {
2437 err
= snd_hda_create_spdif_out_ctls(codec
,
2438 spec
->multiout
.dig_out_nid
);
2441 if (!spec
->no_analog
) {
2442 err
= snd_hda_create_spdif_share_sw(codec
,
2446 spec
->multiout
.share_spdif
= 1;
2449 if (spec
->dig_in_nid
) {
2450 err
= snd_hda_create_spdif_in_ctls(codec
, spec
->dig_in_nid
);
2455 /* create beep controls if needed */
2456 if (spec
->beep_amp
) {
2457 struct snd_kcontrol_new
*knew
;
2458 for (knew
= alc_beep_mixer
; knew
->name
; knew
++) {
2459 struct snd_kcontrol
*kctl
;
2460 kctl
= snd_ctl_new1(knew
, codec
);
2463 kctl
->private_value
= spec
->beep_amp
;
2464 err
= snd_hda_ctl_add(codec
,
2465 get_amp_nid_(spec
->beep_amp
), kctl
);
2471 /* if we have no master control, let's create it */
2472 if (!spec
->no_analog
&&
2473 !snd_hda_find_mixer_ctl(codec
, "Master Playback Volume")) {
2474 unsigned int vmaster_tlv
[4];
2475 snd_hda_set_vmaster_tlv(codec
, spec
->vmaster_nid
,
2476 HDA_OUTPUT
, vmaster_tlv
);
2477 err
= snd_hda_add_vmaster(codec
, "Master Playback Volume",
2478 vmaster_tlv
, alc_slave_vols
);
2482 if (!spec
->no_analog
&&
2483 !snd_hda_find_mixer_ctl(codec
, "Master Playback Switch")) {
2484 err
= snd_hda_add_vmaster(codec
, "Master Playback Switch",
2485 NULL
, alc_slave_sws
);
2490 alc_free_kctls(codec
); /* no longer needed */
2496 * initialize the codec volumes, etc
2500 * generic initialization of ADC, input mixers and output mixers
2502 static struct hda_verb alc880_volume_init_verbs
[] = {
2504 * Unmute ADC0-2 and set the default input to mic-in
2506 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
2507 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2508 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
2509 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2510 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
2511 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2513 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
2515 * Note: PASD motherboards uses the Line In 2 as the input for front
2518 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
2519 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
2520 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2521 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
2522 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
2523 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
2524 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)},
2525 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)},
2528 * Set up output mixers (0x0c - 0x0f)
2530 /* set vol=0 to output mixers */
2531 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
2532 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
2533 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
2534 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
2535 /* set up input amps for analog loopback */
2536 /* Amp Indices: DAC = 0, mixer = 1 */
2537 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
2538 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2539 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
2540 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2541 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
2542 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2543 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
2544 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2550 * 3-stack pin configuration:
2551 * front = 0x14, mic/clfe = 0x18, HP = 0x19, line/surr = 0x1a, f-mic = 0x1b
2553 static struct hda_verb alc880_pin_3stack_init_verbs
[] = {
2555 * preset connection lists of input pins
2556 * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
2558 {0x10, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* mic/clfe */
2559 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
2560 {0x12, AC_VERB_SET_CONNECT_SEL
, 0x03}, /* line/surround */
2563 * Set pin mode and muting
2565 /* set front pin widgets 0x14 for output */
2566 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2567 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2568 /* Mic1 (rear panel) pin widget for input and vref at 80% */
2569 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2570 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2571 /* Mic2 (as headphone out) for HP output */
2572 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2573 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2574 /* Line In pin widget for input */
2575 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2576 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2577 /* Line2 (as front mic) pin widget for input and vref at 80% */
2578 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2579 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2580 /* CD pin widget for input */
2581 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2587 * 5-stack pin configuration:
2588 * front = 0x14, surround = 0x17, clfe = 0x16, mic = 0x18, HP = 0x19,
2589 * line-in/side = 0x1a, f-mic = 0x1b
2591 static struct hda_verb alc880_pin_5stack_init_verbs
[] = {
2593 * preset connection lists of input pins
2594 * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
2596 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
2597 {0x12, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* line/side */
2600 * Set pin mode and muting
2602 /* set pin widgets 0x14-0x17 for output */
2603 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2604 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2605 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2606 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2607 /* unmute pins for output (no gain on this amp) */
2608 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2609 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2610 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2611 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2613 /* Mic1 (rear panel) pin widget for input and vref at 80% */
2614 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2615 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2616 /* Mic2 (as headphone out) for HP output */
2617 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2618 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2619 /* Line In pin widget for input */
2620 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2621 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2622 /* Line2 (as front mic) pin widget for input and vref at 80% */
2623 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2624 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2625 /* CD pin widget for input */
2626 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2632 * W810 pin configuration:
2633 * front = 0x14, surround = 0x15, clfe = 0x16, HP = 0x1b
2635 static struct hda_verb alc880_pin_w810_init_verbs
[] = {
2636 /* hphone/speaker input selector: front DAC */
2637 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x0},
2639 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2640 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2641 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2642 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2643 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2644 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2646 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2647 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2653 * Z71V pin configuration:
2654 * Speaker-out = 0x14, HP = 0x15, Mic = 0x18, Line-in = 0x1a, Mic2 = 0x1b (?)
2656 static struct hda_verb alc880_pin_z71v_init_verbs
[] = {
2657 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2658 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2659 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2660 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2662 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2663 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2664 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2665 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2671 * 6-stack pin configuration:
2672 * front = 0x14, surr = 0x15, clfe = 0x16, side = 0x17, mic = 0x18,
2673 * f-mic = 0x19, line = 0x1a, HP = 0x1b
2675 static struct hda_verb alc880_pin_6stack_init_verbs
[] = {
2676 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
2678 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2679 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2680 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2681 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2682 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2683 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2684 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2685 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2687 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2688 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2689 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2690 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2691 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2692 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2693 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2694 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2695 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2701 * Uniwill pin configuration:
2702 * HP = 0x14, InternalSpeaker = 0x15, mic = 0x18, internal mic = 0x19,
2705 static struct hda_verb alc880_uniwill_init_verbs
[] = {
2706 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
2708 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2709 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2710 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2711 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2712 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2713 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2714 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2715 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2716 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
2717 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
2718 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
2719 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
2720 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
2721 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
2723 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2724 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2725 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2726 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2727 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2728 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2729 /* {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, */
2730 /* {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, */
2731 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2733 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
2734 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
2741 * HP = 0x14, InternalSpeaker = 0x15, mic = 0x19,
2743 static struct hda_verb alc880_uniwill_p53_init_verbs
[] = {
2744 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
2746 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2747 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2748 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2749 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2750 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2751 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2752 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
2753 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
2754 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
2755 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
2756 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
2757 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
2759 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2760 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2761 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2762 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2763 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2764 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2766 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
2767 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_DCVOL_EVENT
},
2772 static struct hda_verb alc880_beep_init_verbs
[] = {
2773 { 0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(5) },
2777 /* auto-toggle front mic */
2778 static void alc880_uniwill_mic_automute(struct hda_codec
*codec
)
2780 unsigned int present
;
2783 present
= snd_hda_codec_read(codec
, 0x18, 0,
2784 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
2785 bits
= present
? HDA_AMP_MUTE
: 0;
2786 snd_hda_codec_amp_stereo(codec
, 0x0b, HDA_INPUT
, 1, HDA_AMP_MUTE
, bits
);
2789 static void alc880_uniwill_setup(struct hda_codec
*codec
)
2791 struct alc_spec
*spec
= codec
->spec
;
2793 spec
->autocfg
.hp_pins
[0] = 0x14;
2794 spec
->autocfg
.speaker_pins
[0] = 0x15;
2795 spec
->autocfg
.speaker_pins
[0] = 0x16;
2798 static void alc880_uniwill_init_hook(struct hda_codec
*codec
)
2800 alc_automute_amp(codec
);
2801 alc880_uniwill_mic_automute(codec
);
2804 static void alc880_uniwill_unsol_event(struct hda_codec
*codec
,
2807 /* Looks like the unsol event is incompatible with the standard
2808 * definition. 4bit tag is placed at 28 bit!
2810 switch (res
>> 28) {
2811 case ALC880_MIC_EVENT
:
2812 alc880_uniwill_mic_automute(codec
);
2815 alc_automute_amp_unsol_event(codec
, res
);
2820 static void alc880_uniwill_p53_setup(struct hda_codec
*codec
)
2822 struct alc_spec
*spec
= codec
->spec
;
2824 spec
->autocfg
.hp_pins
[0] = 0x14;
2825 spec
->autocfg
.speaker_pins
[0] = 0x15;
2828 static void alc880_uniwill_p53_dcvol_automute(struct hda_codec
*codec
)
2830 unsigned int present
;
2832 present
= snd_hda_codec_read(codec
, 0x21, 0,
2833 AC_VERB_GET_VOLUME_KNOB_CONTROL
, 0);
2834 present
&= HDA_AMP_VOLMASK
;
2835 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_OUTPUT
, 0,
2836 HDA_AMP_VOLMASK
, present
);
2837 snd_hda_codec_amp_stereo(codec
, 0x0d, HDA_OUTPUT
, 0,
2838 HDA_AMP_VOLMASK
, present
);
2841 static void alc880_uniwill_p53_unsol_event(struct hda_codec
*codec
,
2844 /* Looks like the unsol event is incompatible with the standard
2845 * definition. 4bit tag is placed at 28 bit!
2847 if ((res
>> 28) == ALC880_DCVOL_EVENT
)
2848 alc880_uniwill_p53_dcvol_automute(codec
);
2850 alc_automute_amp_unsol_event(codec
, res
);
2854 * F1734 pin configuration:
2855 * HP = 0x14, speaker-out = 0x15, mic = 0x18
2857 static struct hda_verb alc880_pin_f1734_init_verbs
[] = {
2858 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x01},
2859 {0x10, AC_VERB_SET_CONNECT_SEL
, 0x02},
2860 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x00},
2861 {0x12, AC_VERB_SET_CONNECT_SEL
, 0x01},
2862 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00},
2864 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2865 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2866 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2867 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2869 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2870 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2871 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
2872 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2873 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2874 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2875 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2876 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2877 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2879 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_HP_EVENT
},
2880 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_DCVOL_EVENT
},
2886 * ASUS pin configuration:
2887 * HP/front = 0x14, surr = 0x15, clfe = 0x16, mic = 0x18, line = 0x1a
2889 static struct hda_verb alc880_pin_asus_init_verbs
[] = {
2890 {0x10, AC_VERB_SET_CONNECT_SEL
, 0x02},
2891 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x00},
2892 {0x12, AC_VERB_SET_CONNECT_SEL
, 0x01},
2893 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00},
2895 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2896 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2897 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2898 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2899 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2900 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2901 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2902 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2904 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2905 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2906 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2907 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2908 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2909 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2910 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2911 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2912 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2917 /* Enable GPIO mask and set output */
2918 #define alc880_gpio1_init_verbs alc_gpio1_init_verbs
2919 #define alc880_gpio2_init_verbs alc_gpio2_init_verbs
2920 #define alc880_gpio3_init_verbs alc_gpio3_init_verbs
2922 /* Clevo m520g init */
2923 static struct hda_verb alc880_pin_clevo_init_verbs
[] = {
2924 /* headphone output */
2925 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x01},
2927 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2928 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2930 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2931 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2933 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2934 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2935 /* Mic1 (rear panel) */
2936 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2937 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2938 /* Mic2 (front panel) */
2939 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2940 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2942 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2943 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2944 /* change to EAPD mode */
2945 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
2946 {0x20, AC_VERB_SET_PROC_COEF
, 0x3060},
2951 static struct hda_verb alc880_pin_tcl_S700_init_verbs
[] = {
2952 /* change to EAPD mode */
2953 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
2954 {0x20, AC_VERB_SET_PROC_COEF
, 0x3060},
2956 /* Headphone output */
2957 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2959 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2960 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
2962 /* Line In pin widget for input */
2963 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2964 /* CD pin widget for input */
2965 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2966 /* Mic1 (rear panel) pin widget for input and vref at 80% */
2967 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2969 /* change to EAPD mode */
2970 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
2971 {0x20, AC_VERB_SET_PROC_COEF
, 0x3070},
2977 * LG m1 express dual
2980 * Rear Line-In/Out (blue): 0x14
2981 * Build-in Mic-In: 0x15
2983 * HP-Out (green): 0x1b
2984 * Mic-In/Out (red): 0x19
2988 /* To make 5.1 output working (green=Front, blue=Surr, red=CLFE) */
2989 static hda_nid_t alc880_lg_dac_nids
[3] = {
2993 /* seems analog CD is not working */
2994 static struct hda_input_mux alc880_lg_capture_source
= {
2999 { "Internal Mic", 0x6 },
3003 /* 2,4,6 channel modes */
3004 static struct hda_verb alc880_lg_ch2_init
[] = {
3005 /* set line-in and mic-in to input */
3006 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3007 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3011 static struct hda_verb alc880_lg_ch4_init
[] = {
3012 /* set line-in to out and mic-in to input */
3013 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3014 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3018 static struct hda_verb alc880_lg_ch6_init
[] = {
3019 /* set line-in and mic-in to output */
3020 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3021 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3025 static struct hda_channel_mode alc880_lg_ch_modes
[3] = {
3026 { 2, alc880_lg_ch2_init
},
3027 { 4, alc880_lg_ch4_init
},
3028 { 6, alc880_lg_ch6_init
},
3031 static struct snd_kcontrol_new alc880_lg_mixer
[] = {
3032 HDA_CODEC_VOLUME("Front Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
3033 HDA_BIND_MUTE("Front Playback Switch", 0x0f, 2, HDA_INPUT
),
3034 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
3035 HDA_BIND_MUTE("Surround Playback Switch", 0x0c, 2, HDA_INPUT
),
3036 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0d, 1, 0x0, HDA_OUTPUT
),
3037 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT
),
3038 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT
),
3039 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT
),
3040 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
3041 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
3042 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x06, HDA_INPUT
),
3043 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x06, HDA_INPUT
),
3044 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x07, HDA_INPUT
),
3045 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x07, HDA_INPUT
),
3047 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
3048 .name
= "Channel Mode",
3049 .info
= alc_ch_mode_info
,
3050 .get
= alc_ch_mode_get
,
3051 .put
= alc_ch_mode_put
,
3056 static struct hda_verb alc880_lg_init_verbs
[] = {
3057 /* set capture source to mic-in */
3058 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3059 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3060 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3061 /* mute all amp mixer inputs */
3062 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(5)},
3063 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)},
3064 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)},
3065 /* line-in to input */
3066 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3067 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3069 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3070 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3072 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3073 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3074 /* mic-in to input */
3075 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x01},
3076 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3077 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3079 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x03},
3080 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3081 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3083 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
3087 /* toggle speaker-output according to the hp-jack state */
3088 static void alc880_lg_setup(struct hda_codec
*codec
)
3090 struct alc_spec
*spec
= codec
->spec
;
3092 spec
->autocfg
.hp_pins
[0] = 0x1b;
3093 spec
->autocfg
.speaker_pins
[0] = 0x17;
3102 * Built-in Mic-In: 0x19
3108 static struct hda_input_mux alc880_lg_lw_capture_source
= {
3112 { "Internal Mic", 0x1 },
3117 #define alc880_lg_lw_modes alc880_threestack_modes
3119 static struct snd_kcontrol_new alc880_lg_lw_mixer
[] = {
3120 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
3121 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
3122 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
3123 HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT
),
3124 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
3125 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
3126 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
3127 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
3128 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
3129 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
3130 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
3131 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
3132 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
3133 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
3135 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
3136 .name
= "Channel Mode",
3137 .info
= alc_ch_mode_info
,
3138 .get
= alc_ch_mode_get
,
3139 .put
= alc_ch_mode_put
,
3144 static struct hda_verb alc880_lg_lw_init_verbs
[] = {
3145 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
3146 {0x10, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* mic/clfe */
3147 {0x12, AC_VERB_SET_CONNECT_SEL
, 0x03}, /* line/surround */
3149 /* set capture source to mic-in */
3150 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3151 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3152 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3153 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)},
3155 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3156 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3158 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3159 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3160 /* mic-in to input */
3161 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3162 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3164 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3165 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3167 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
3171 /* toggle speaker-output according to the hp-jack state */
3172 static void alc880_lg_lw_setup(struct hda_codec
*codec
)
3174 struct alc_spec
*spec
= codec
->spec
;
3176 spec
->autocfg
.hp_pins
[0] = 0x1b;
3177 spec
->autocfg
.speaker_pins
[0] = 0x14;
3180 static struct snd_kcontrol_new alc880_medion_rim_mixer
[] = {
3181 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
3182 HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT
),
3183 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
3184 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
3185 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
3186 HDA_CODEC_MUTE("Internal Playback Switch", 0x0b, 0x1, HDA_INPUT
),
3190 static struct hda_input_mux alc880_medion_rim_capture_source
= {
3194 { "Internal Mic", 0x1 },
3198 static struct hda_verb alc880_medion_rim_init_verbs
[] = {
3199 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
3201 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3202 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3204 /* Mic1 (rear panel) pin widget for input and vref at 80% */
3205 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3206 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3207 /* Mic2 (as headphone out) for HP output */
3208 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3209 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3210 /* Internal Speaker */
3211 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3212 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3214 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
3215 {0x20, AC_VERB_SET_PROC_COEF
, 0x3060},
3217 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
3221 /* toggle speaker-output according to the hp-jack state */
3222 static void alc880_medion_rim_automute(struct hda_codec
*codec
)
3224 struct alc_spec
*spec
= codec
->spec
;
3225 alc_automute_amp(codec
);
3227 if (spec
->jack_present
)
3228 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
, 0);
3230 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
, 2);
3233 static void alc880_medion_rim_unsol_event(struct hda_codec
*codec
,
3236 /* Looks like the unsol event is incompatible with the standard
3237 * definition. 4bit tag is placed at 28 bit!
3239 if ((res
>> 28) == ALC880_HP_EVENT
)
3240 alc880_medion_rim_automute(codec
);
3243 static void alc880_medion_rim_setup(struct hda_codec
*codec
)
3245 struct alc_spec
*spec
= codec
->spec
;
3247 spec
->autocfg
.hp_pins
[0] = 0x14;
3248 spec
->autocfg
.speaker_pins
[0] = 0x1b;
3251 #ifdef CONFIG_SND_HDA_POWER_SAVE
3252 static struct hda_amp_list alc880_loopbacks
[] = {
3253 { 0x0b, HDA_INPUT
, 0 },
3254 { 0x0b, HDA_INPUT
, 1 },
3255 { 0x0b, HDA_INPUT
, 2 },
3256 { 0x0b, HDA_INPUT
, 3 },
3257 { 0x0b, HDA_INPUT
, 4 },
3261 static struct hda_amp_list alc880_lg_loopbacks
[] = {
3262 { 0x0b, HDA_INPUT
, 1 },
3263 { 0x0b, HDA_INPUT
, 6 },
3264 { 0x0b, HDA_INPUT
, 7 },
3273 static int alc_init(struct hda_codec
*codec
)
3275 struct alc_spec
*spec
= codec
->spec
;
3279 alc_auto_init_amp(codec
, spec
->init_amp
);
3281 for (i
= 0; i
< spec
->num_init_verbs
; i
++)
3282 snd_hda_sequence_write(codec
, spec
->init_verbs
[i
]);
3284 if (spec
->init_hook
)
3285 spec
->init_hook(codec
);
3290 static void alc_unsol_event(struct hda_codec
*codec
, unsigned int res
)
3292 struct alc_spec
*spec
= codec
->spec
;
3294 if (spec
->unsol_event
)
3295 spec
->unsol_event(codec
, res
);
3298 #ifdef CONFIG_SND_HDA_POWER_SAVE
3299 static int alc_check_power_status(struct hda_codec
*codec
, hda_nid_t nid
)
3301 struct alc_spec
*spec
= codec
->spec
;
3302 return snd_hda_check_amp_list_power(codec
, &spec
->loopback
, nid
);
3307 * Analog playback callbacks
3309 static int alc880_playback_pcm_open(struct hda_pcm_stream
*hinfo
,
3310 struct hda_codec
*codec
,
3311 struct snd_pcm_substream
*substream
)
3313 struct alc_spec
*spec
= codec
->spec
;
3314 return snd_hda_multi_out_analog_open(codec
, &spec
->multiout
, substream
,
3318 static int alc880_playback_pcm_prepare(struct hda_pcm_stream
*hinfo
,
3319 struct hda_codec
*codec
,
3320 unsigned int stream_tag
,
3321 unsigned int format
,
3322 struct snd_pcm_substream
*substream
)
3324 struct alc_spec
*spec
= codec
->spec
;
3325 return snd_hda_multi_out_analog_prepare(codec
, &spec
->multiout
,
3326 stream_tag
, format
, substream
);
3329 static int alc880_playback_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
3330 struct hda_codec
*codec
,
3331 struct snd_pcm_substream
*substream
)
3333 struct alc_spec
*spec
= codec
->spec
;
3334 return snd_hda_multi_out_analog_cleanup(codec
, &spec
->multiout
);
3340 static int alc880_dig_playback_pcm_open(struct hda_pcm_stream
*hinfo
,
3341 struct hda_codec
*codec
,
3342 struct snd_pcm_substream
*substream
)
3344 struct alc_spec
*spec
= codec
->spec
;
3345 return snd_hda_multi_out_dig_open(codec
, &spec
->multiout
);
3348 static int alc880_dig_playback_pcm_prepare(struct hda_pcm_stream
*hinfo
,
3349 struct hda_codec
*codec
,
3350 unsigned int stream_tag
,
3351 unsigned int format
,
3352 struct snd_pcm_substream
*substream
)
3354 struct alc_spec
*spec
= codec
->spec
;
3355 return snd_hda_multi_out_dig_prepare(codec
, &spec
->multiout
,
3356 stream_tag
, format
, substream
);
3359 static int alc880_dig_playback_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
3360 struct hda_codec
*codec
,
3361 struct snd_pcm_substream
*substream
)
3363 struct alc_spec
*spec
= codec
->spec
;
3364 return snd_hda_multi_out_dig_cleanup(codec
, &spec
->multiout
);
3367 static int alc880_dig_playback_pcm_close(struct hda_pcm_stream
*hinfo
,
3368 struct hda_codec
*codec
,
3369 struct snd_pcm_substream
*substream
)
3371 struct alc_spec
*spec
= codec
->spec
;
3372 return snd_hda_multi_out_dig_close(codec
, &spec
->multiout
);
3378 static int alc880_alt_capture_pcm_prepare(struct hda_pcm_stream
*hinfo
,
3379 struct hda_codec
*codec
,
3380 unsigned int stream_tag
,
3381 unsigned int format
,
3382 struct snd_pcm_substream
*substream
)
3384 struct alc_spec
*spec
= codec
->spec
;
3386 snd_hda_codec_setup_stream(codec
, spec
->adc_nids
[substream
->number
+ 1],
3387 stream_tag
, 0, format
);
3391 static int alc880_alt_capture_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
3392 struct hda_codec
*codec
,
3393 struct snd_pcm_substream
*substream
)
3395 struct alc_spec
*spec
= codec
->spec
;
3397 snd_hda_codec_cleanup_stream(codec
,
3398 spec
->adc_nids
[substream
->number
+ 1]);
3405 static struct hda_pcm_stream alc880_pcm_analog_playback
= {
3409 /* NID is set in alc_build_pcms */
3411 .open
= alc880_playback_pcm_open
,
3412 .prepare
= alc880_playback_pcm_prepare
,
3413 .cleanup
= alc880_playback_pcm_cleanup
3417 static struct hda_pcm_stream alc880_pcm_analog_capture
= {
3421 /* NID is set in alc_build_pcms */
3424 static struct hda_pcm_stream alc880_pcm_analog_alt_playback
= {
3428 /* NID is set in alc_build_pcms */
3431 static struct hda_pcm_stream alc880_pcm_analog_alt_capture
= {
3432 .substreams
= 2, /* can be overridden */
3435 /* NID is set in alc_build_pcms */
3437 .prepare
= alc880_alt_capture_pcm_prepare
,
3438 .cleanup
= alc880_alt_capture_pcm_cleanup
3442 static struct hda_pcm_stream alc880_pcm_digital_playback
= {
3446 /* NID is set in alc_build_pcms */
3448 .open
= alc880_dig_playback_pcm_open
,
3449 .close
= alc880_dig_playback_pcm_close
,
3450 .prepare
= alc880_dig_playback_pcm_prepare
,
3451 .cleanup
= alc880_dig_playback_pcm_cleanup
3455 static struct hda_pcm_stream alc880_pcm_digital_capture
= {
3459 /* NID is set in alc_build_pcms */
3462 /* Used by alc_build_pcms to flag that a PCM has no playback stream */
3463 static struct hda_pcm_stream alc_pcm_null_stream
= {
3469 static int alc_build_pcms(struct hda_codec
*codec
)
3471 struct alc_spec
*spec
= codec
->spec
;
3472 struct hda_pcm
*info
= spec
->pcm_rec
;
3475 codec
->num_pcms
= 1;
3476 codec
->pcm_info
= info
;
3478 if (spec
->no_analog
)
3481 snprintf(spec
->stream_name_analog
, sizeof(spec
->stream_name_analog
),
3482 "%s Analog", codec
->chip_name
);
3483 info
->name
= spec
->stream_name_analog
;
3485 if (spec
->stream_analog_playback
) {
3486 if (snd_BUG_ON(!spec
->multiout
.dac_nids
))
3488 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] = *(spec
->stream_analog_playback
);
3489 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].nid
= spec
->multiout
.dac_nids
[0];
3491 if (spec
->stream_analog_capture
) {
3492 if (snd_BUG_ON(!spec
->adc_nids
))
3494 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] = *(spec
->stream_analog_capture
);
3495 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].nid
= spec
->adc_nids
[0];
3498 if (spec
->channel_mode
) {
3499 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].channels_max
= 0;
3500 for (i
= 0; i
< spec
->num_channel_mode
; i
++) {
3501 if (spec
->channel_mode
[i
].channels
> info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].channels_max
) {
3502 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].channels_max
= spec
->channel_mode
[i
].channels
;
3508 /* SPDIF for stream index #1 */
3509 if (spec
->multiout
.dig_out_nid
|| spec
->dig_in_nid
) {
3510 snprintf(spec
->stream_name_digital
,
3511 sizeof(spec
->stream_name_digital
),
3512 "%s Digital", codec
->chip_name
);
3513 codec
->num_pcms
= 2;
3514 codec
->slave_dig_outs
= spec
->multiout
.slave_dig_outs
;
3515 info
= spec
->pcm_rec
+ 1;
3516 info
->name
= spec
->stream_name_digital
;
3517 if (spec
->dig_out_type
)
3518 info
->pcm_type
= spec
->dig_out_type
;
3520 info
->pcm_type
= HDA_PCM_TYPE_SPDIF
;
3521 if (spec
->multiout
.dig_out_nid
&&
3522 spec
->stream_digital_playback
) {
3523 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] = *(spec
->stream_digital_playback
);
3524 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].nid
= spec
->multiout
.dig_out_nid
;
3526 if (spec
->dig_in_nid
&&
3527 spec
->stream_digital_capture
) {
3528 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] = *(spec
->stream_digital_capture
);
3529 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].nid
= spec
->dig_in_nid
;
3531 /* FIXME: do we need this for all Realtek codec models? */
3532 codec
->spdif_status_reset
= 1;
3535 if (spec
->no_analog
)
3538 /* If the use of more than one ADC is requested for the current
3539 * model, configure a second analog capture-only PCM.
3541 /* Additional Analaog capture for index #2 */
3542 if ((spec
->alt_dac_nid
&& spec
->stream_analog_alt_playback
) ||
3543 (spec
->num_adc_nids
> 1 && spec
->stream_analog_alt_capture
)) {
3544 codec
->num_pcms
= 3;
3545 info
= spec
->pcm_rec
+ 2;
3546 info
->name
= spec
->stream_name_analog
;
3547 if (spec
->alt_dac_nid
) {
3548 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] =
3549 *spec
->stream_analog_alt_playback
;
3550 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].nid
=
3553 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] =
3554 alc_pcm_null_stream
;
3555 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].nid
= 0;
3557 if (spec
->num_adc_nids
> 1) {
3558 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] =
3559 *spec
->stream_analog_alt_capture
;
3560 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].nid
=
3562 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].substreams
=
3563 spec
->num_adc_nids
- 1;
3565 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] =
3566 alc_pcm_null_stream
;
3567 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].nid
= 0;
3574 static void alc_free_kctls(struct hda_codec
*codec
)
3576 struct alc_spec
*spec
= codec
->spec
;
3578 if (spec
->kctls
.list
) {
3579 struct snd_kcontrol_new
*kctl
= spec
->kctls
.list
;
3581 for (i
= 0; i
< spec
->kctls
.used
; i
++)
3582 kfree(kctl
[i
].name
);
3584 snd_array_free(&spec
->kctls
);
3587 static void alc_free(struct hda_codec
*codec
)
3589 struct alc_spec
*spec
= codec
->spec
;
3594 alc_free_kctls(codec
);
3596 snd_hda_detach_beep_device(codec
);
3599 #ifdef SND_HDA_NEEDS_RESUME
3600 static int alc_resume(struct hda_codec
*codec
)
3602 codec
->patch_ops
.init(codec
);
3603 snd_hda_codec_resume_amp(codec
);
3604 snd_hda_codec_resume_cache(codec
);
3611 static struct hda_codec_ops alc_patch_ops
= {
3612 .build_controls
= alc_build_controls
,
3613 .build_pcms
= alc_build_pcms
,
3616 .unsol_event
= alc_unsol_event
,
3617 #ifdef SND_HDA_NEEDS_RESUME
3618 .resume
= alc_resume
,
3620 #ifdef CONFIG_SND_HDA_POWER_SAVE
3621 .check_power_status
= alc_check_power_status
,
3627 * Test configuration for debugging
3629 * Almost all inputs/outputs are enabled. I/O pins can be configured via
3632 #ifdef CONFIG_SND_DEBUG
3633 static hda_nid_t alc880_test_dac_nids
[4] = {
3634 0x02, 0x03, 0x04, 0x05
3637 static struct hda_input_mux alc880_test_capture_source
= {
3646 { "Surround", 0x6 },
3650 static struct hda_channel_mode alc880_test_modes
[4] = {
3657 static int alc_test_pin_ctl_info(struct snd_kcontrol
*kcontrol
,
3658 struct snd_ctl_elem_info
*uinfo
)
3660 static char *texts
[] = {
3661 "N/A", "Line Out", "HP Out",
3662 "In Hi-Z", "In 50%", "In Grd", "In 80%", "In 100%"
3664 uinfo
->type
= SNDRV_CTL_ELEM_TYPE_ENUMERATED
;
3666 uinfo
->value
.enumerated
.items
= 8;
3667 if (uinfo
->value
.enumerated
.item
>= 8)
3668 uinfo
->value
.enumerated
.item
= 7;
3669 strcpy(uinfo
->value
.enumerated
.name
, texts
[uinfo
->value
.enumerated
.item
]);
3673 static int alc_test_pin_ctl_get(struct snd_kcontrol
*kcontrol
,
3674 struct snd_ctl_elem_value
*ucontrol
)
3676 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
3677 hda_nid_t nid
= (hda_nid_t
)kcontrol
->private_value
;
3678 unsigned int pin_ctl
, item
= 0;
3680 pin_ctl
= snd_hda_codec_read(codec
, nid
, 0,
3681 AC_VERB_GET_PIN_WIDGET_CONTROL
, 0);
3682 if (pin_ctl
& AC_PINCTL_OUT_EN
) {
3683 if (pin_ctl
& AC_PINCTL_HP_EN
)
3687 } else if (pin_ctl
& AC_PINCTL_IN_EN
) {
3688 switch (pin_ctl
& AC_PINCTL_VREFEN
) {
3689 case AC_PINCTL_VREF_HIZ
: item
= 3; break;
3690 case AC_PINCTL_VREF_50
: item
= 4; break;
3691 case AC_PINCTL_VREF_GRD
: item
= 5; break;
3692 case AC_PINCTL_VREF_80
: item
= 6; break;
3693 case AC_PINCTL_VREF_100
: item
= 7; break;
3696 ucontrol
->value
.enumerated
.item
[0] = item
;
3700 static int alc_test_pin_ctl_put(struct snd_kcontrol
*kcontrol
,
3701 struct snd_ctl_elem_value
*ucontrol
)
3703 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
3704 hda_nid_t nid
= (hda_nid_t
)kcontrol
->private_value
;
3705 static unsigned int ctls
[] = {
3706 0, AC_PINCTL_OUT_EN
, AC_PINCTL_OUT_EN
| AC_PINCTL_HP_EN
,
3707 AC_PINCTL_IN_EN
| AC_PINCTL_VREF_HIZ
,
3708 AC_PINCTL_IN_EN
| AC_PINCTL_VREF_50
,
3709 AC_PINCTL_IN_EN
| AC_PINCTL_VREF_GRD
,
3710 AC_PINCTL_IN_EN
| AC_PINCTL_VREF_80
,
3711 AC_PINCTL_IN_EN
| AC_PINCTL_VREF_100
,
3713 unsigned int old_ctl
, new_ctl
;
3715 old_ctl
= snd_hda_codec_read(codec
, nid
, 0,
3716 AC_VERB_GET_PIN_WIDGET_CONTROL
, 0);
3717 new_ctl
= ctls
[ucontrol
->value
.enumerated
.item
[0]];
3718 if (old_ctl
!= new_ctl
) {
3720 snd_hda_codec_write_cache(codec
, nid
, 0,
3721 AC_VERB_SET_PIN_WIDGET_CONTROL
,
3723 val
= ucontrol
->value
.enumerated
.item
[0] >= 3 ?
3725 snd_hda_codec_amp_stereo(codec
, nid
, HDA_OUTPUT
, 0,
3732 static int alc_test_pin_src_info(struct snd_kcontrol
*kcontrol
,
3733 struct snd_ctl_elem_info
*uinfo
)
3735 static char *texts
[] = {
3736 "Front", "Surround", "CLFE", "Side"
3738 uinfo
->type
= SNDRV_CTL_ELEM_TYPE_ENUMERATED
;
3740 uinfo
->value
.enumerated
.items
= 4;
3741 if (uinfo
->value
.enumerated
.item
>= 4)
3742 uinfo
->value
.enumerated
.item
= 3;
3743 strcpy(uinfo
->value
.enumerated
.name
, texts
[uinfo
->value
.enumerated
.item
]);
3747 static int alc_test_pin_src_get(struct snd_kcontrol
*kcontrol
,
3748 struct snd_ctl_elem_value
*ucontrol
)
3750 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
3751 hda_nid_t nid
= (hda_nid_t
)kcontrol
->private_value
;
3754 sel
= snd_hda_codec_read(codec
, nid
, 0, AC_VERB_GET_CONNECT_SEL
, 0);
3755 ucontrol
->value
.enumerated
.item
[0] = sel
& 3;
3759 static int alc_test_pin_src_put(struct snd_kcontrol
*kcontrol
,
3760 struct snd_ctl_elem_value
*ucontrol
)
3762 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
3763 hda_nid_t nid
= (hda_nid_t
)kcontrol
->private_value
;
3766 sel
= snd_hda_codec_read(codec
, nid
, 0, AC_VERB_GET_CONNECT_SEL
, 0) & 3;
3767 if (ucontrol
->value
.enumerated
.item
[0] != sel
) {
3768 sel
= ucontrol
->value
.enumerated
.item
[0] & 3;
3769 snd_hda_codec_write_cache(codec
, nid
, 0,
3770 AC_VERB_SET_CONNECT_SEL
, sel
);
3776 #define PIN_CTL_TEST(xname,nid) { \
3777 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
3779 .info = alc_test_pin_ctl_info, \
3780 .get = alc_test_pin_ctl_get, \
3781 .put = alc_test_pin_ctl_put, \
3782 .private_value = nid \
3785 #define PIN_SRC_TEST(xname,nid) { \
3786 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
3788 .info = alc_test_pin_src_info, \
3789 .get = alc_test_pin_src_get, \
3790 .put = alc_test_pin_src_put, \
3791 .private_value = nid \
3794 static struct snd_kcontrol_new alc880_test_mixer
[] = {
3795 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
3796 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
3797 HDA_CODEC_VOLUME("CLFE Playback Volume", 0x0e, 0x0, HDA_OUTPUT
),
3798 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
3799 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
3800 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
3801 HDA_BIND_MUTE("CLFE Playback Switch", 0x0e, 2, HDA_INPUT
),
3802 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
3803 PIN_CTL_TEST("Front Pin Mode", 0x14),
3804 PIN_CTL_TEST("Surround Pin Mode", 0x15),
3805 PIN_CTL_TEST("CLFE Pin Mode", 0x16),
3806 PIN_CTL_TEST("Side Pin Mode", 0x17),
3807 PIN_CTL_TEST("In-1 Pin Mode", 0x18),
3808 PIN_CTL_TEST("In-2 Pin Mode", 0x19),
3809 PIN_CTL_TEST("In-3 Pin Mode", 0x1a),
3810 PIN_CTL_TEST("In-4 Pin Mode", 0x1b),
3811 PIN_SRC_TEST("In-1 Pin Source", 0x18),
3812 PIN_SRC_TEST("In-2 Pin Source", 0x19),
3813 PIN_SRC_TEST("In-3 Pin Source", 0x1a),
3814 PIN_SRC_TEST("In-4 Pin Source", 0x1b),
3815 HDA_CODEC_VOLUME("In-1 Playback Volume", 0x0b, 0x0, HDA_INPUT
),
3816 HDA_CODEC_MUTE("In-1 Playback Switch", 0x0b, 0x0, HDA_INPUT
),
3817 HDA_CODEC_VOLUME("In-2 Playback Volume", 0x0b, 0x1, HDA_INPUT
),
3818 HDA_CODEC_MUTE("In-2 Playback Switch", 0x0b, 0x1, HDA_INPUT
),
3819 HDA_CODEC_VOLUME("In-3 Playback Volume", 0x0b, 0x2, HDA_INPUT
),
3820 HDA_CODEC_MUTE("In-3 Playback Switch", 0x0b, 0x2, HDA_INPUT
),
3821 HDA_CODEC_VOLUME("In-4 Playback Volume", 0x0b, 0x3, HDA_INPUT
),
3822 HDA_CODEC_MUTE("In-4 Playback Switch", 0x0b, 0x3, HDA_INPUT
),
3823 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x4, HDA_INPUT
),
3824 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x4, HDA_INPUT
),
3826 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
3827 .name
= "Channel Mode",
3828 .info
= alc_ch_mode_info
,
3829 .get
= alc_ch_mode_get
,
3830 .put
= alc_ch_mode_put
,
3835 static struct hda_verb alc880_test_init_verbs
[] = {
3836 /* Unmute inputs of 0x0c - 0x0f */
3837 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3838 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3839 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3840 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3841 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3842 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3843 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3844 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3845 /* Vol output for 0x0c-0x0f */
3846 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
3847 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
3848 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
3849 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
3850 /* Set output pins 0x14-0x17 */
3851 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3852 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3853 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3854 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3855 /* Unmute output pins 0x14-0x17 */
3856 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3857 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3858 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3859 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3860 /* Set input pins 0x18-0x1c */
3861 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3862 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3863 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3864 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3865 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3866 /* Mute input pins 0x18-0x1b */
3867 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3868 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3869 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3870 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3872 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
3873 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
3874 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
3875 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
3876 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
3877 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
3878 /* Analog input/passthru */
3879 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
3880 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
3881 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
3882 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
3883 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
3891 static const char *alc880_models
[ALC880_MODEL_LAST
] = {
3892 [ALC880_3ST
] = "3stack",
3893 [ALC880_TCL_S700
] = "tcl",
3894 [ALC880_3ST_DIG
] = "3stack-digout",
3895 [ALC880_CLEVO
] = "clevo",
3896 [ALC880_5ST
] = "5stack",
3897 [ALC880_5ST_DIG
] = "5stack-digout",
3898 [ALC880_W810
] = "w810",
3899 [ALC880_Z71V
] = "z71v",
3900 [ALC880_6ST
] = "6stack",
3901 [ALC880_6ST_DIG
] = "6stack-digout",
3902 [ALC880_ASUS
] = "asus",
3903 [ALC880_ASUS_W1V
] = "asus-w1v",
3904 [ALC880_ASUS_DIG
] = "asus-dig",
3905 [ALC880_ASUS_DIG2
] = "asus-dig2",
3906 [ALC880_UNIWILL_DIG
] = "uniwill",
3907 [ALC880_UNIWILL_P53
] = "uniwill-p53",
3908 [ALC880_FUJITSU
] = "fujitsu",
3909 [ALC880_F1734
] = "F1734",
3911 [ALC880_LG_LW
] = "lg-lw",
3912 [ALC880_MEDION_RIM
] = "medion",
3913 #ifdef CONFIG_SND_DEBUG
3914 [ALC880_TEST
] = "test",
3916 [ALC880_AUTO
] = "auto",
3919 static struct snd_pci_quirk alc880_cfg_tbl
[] = {
3920 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_W810
),
3921 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_5ST_DIG
),
3922 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_6ST
),
3923 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_3ST_DIG
),
3924 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_6ST_DIG
),
3925 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_6ST_DIG
),
3926 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_6ST_DIG
),
3927 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG
),
3928 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST
),
3929 SND_PCI_QUIRK(0x1039, 0x1234, NULL
, ALC880_6ST_DIG
),
3930 SND_PCI_QUIRK(0x103c, 0x2a09, "HP", ALC880_5ST
),
3931 SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V
),
3932 SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG
),
3933 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG
),
3934 SND_PCI_QUIRK(0x1043, 0x1113, "ASUS", ALC880_ASUS_DIG
),
3935 SND_PCI_QUIRK(0x1043, 0x1123, "ASUS", ALC880_ASUS_DIG
),
3936 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS", ALC880_ASUS_DIG
),
3937 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_Z71V
),
3938 /* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */
3939 SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG
),
3940 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG
),
3941 SND_PCI_QUIRK(0x1043, 0x814e, "ASUS P5GD1 w/SPDIF", ALC880_6ST_DIG
),
3942 SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG
),
3943 SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST
),
3944 SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST
),
3945 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_ASUS
), /* default ASUS */
3946 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_3ST
),
3947 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_3ST
),
3948 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_5ST
),
3949 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_5ST
),
3950 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_5ST
),
3951 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_6ST_DIG
),
3952 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_6ST_DIG
),
3953 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_6ST_DIG
),
3954 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_6ST_DIG
),
3955 SND_PCI_QUIRK(0x1558, 0x0520, "Clevo m520G", ALC880_CLEVO
),
3956 SND_PCI_QUIRK(0x1558, 0x0660, "Clevo m655n", ALC880_CLEVO
),
3957 SND_PCI_QUIRK(0x1558, 0x5401, "ASUS", ALC880_ASUS_DIG2
),
3958 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_5ST_DIG
),
3959 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_UNIWILL_DIG
),
3960 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwlll", ALC880_F1734
),
3961 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_UNIWILL
),
3962 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_UNIWILL_P53
),
3963 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_W810
),
3964 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_MEDION_RIM
),
3965 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_5ST_DIG
),
3966 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG
),
3967 SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_F1734
),
3968 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FUJITSU
),
3969 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC", ALC880_UNIWILL
),
3970 SND_PCI_QUIRK(0x1734, 0x10b0, "Fujitsu", ALC880_FUJITSU
),
3971 SND_PCI_QUIRK(0x1854, 0x0018, "LG LW20", ALC880_LG_LW
),
3972 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG
),
3973 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_LG
),
3974 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_LG_LW
),
3975 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_TCL_S700
),
3976 SND_PCI_QUIRK(0x2668, 0x8086, NULL
, ALC880_6ST_DIG
), /* broken BIOS */
3977 SND_PCI_QUIRK(0x8086, 0x2668, NULL
, ALC880_6ST_DIG
),
3978 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_5ST_DIG
),
3979 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_5ST_DIG
),
3980 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_5ST_DIG
),
3981 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_3ST_DIG
),
3982 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_5ST_DIG
),
3983 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_3ST_DIG
),
3984 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_3ST_DIG
),
3985 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_5ST_DIG
),
3986 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_5ST_DIG
),
3987 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_5ST_DIG
),
3989 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_3ST
),
3990 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_5ST_DIG
),
3991 SND_PCI_QUIRK(0xe803, 0x1019, NULL
, ALC880_6ST_DIG
),
3996 * ALC880 codec presets
3998 static struct alc_config_preset alc880_presets
[] = {
4000 .mixers
= { alc880_three_stack_mixer
},
4001 .init_verbs
= { alc880_volume_init_verbs
,
4002 alc880_pin_3stack_init_verbs
},
4003 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4004 .dac_nids
= alc880_dac_nids
,
4005 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
4006 .channel_mode
= alc880_threestack_modes
,
4008 .input_mux
= &alc880_capture_source
,
4010 [ALC880_3ST_DIG
] = {
4011 .mixers
= { alc880_three_stack_mixer
},
4012 .init_verbs
= { alc880_volume_init_verbs
,
4013 alc880_pin_3stack_init_verbs
},
4014 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4015 .dac_nids
= alc880_dac_nids
,
4016 .dig_out_nid
= ALC880_DIGOUT_NID
,
4017 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
4018 .channel_mode
= alc880_threestack_modes
,
4020 .input_mux
= &alc880_capture_source
,
4022 [ALC880_TCL_S700
] = {
4023 .mixers
= { alc880_tcl_s700_mixer
},
4024 .init_verbs
= { alc880_volume_init_verbs
,
4025 alc880_pin_tcl_S700_init_verbs
,
4026 alc880_gpio2_init_verbs
},
4027 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4028 .dac_nids
= alc880_dac_nids
,
4029 .adc_nids
= alc880_adc_nids_alt
, /* FIXME: correct? */
4030 .num_adc_nids
= 1, /* single ADC */
4032 .num_channel_mode
= ARRAY_SIZE(alc880_2_jack_modes
),
4033 .channel_mode
= alc880_2_jack_modes
,
4034 .input_mux
= &alc880_capture_source
,
4037 .mixers
= { alc880_three_stack_mixer
,
4038 alc880_five_stack_mixer
},
4039 .init_verbs
= { alc880_volume_init_verbs
,
4040 alc880_pin_5stack_init_verbs
},
4041 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4042 .dac_nids
= alc880_dac_nids
,
4043 .num_channel_mode
= ARRAY_SIZE(alc880_fivestack_modes
),
4044 .channel_mode
= alc880_fivestack_modes
,
4045 .input_mux
= &alc880_capture_source
,
4047 [ALC880_5ST_DIG
] = {
4048 .mixers
= { alc880_three_stack_mixer
,
4049 alc880_five_stack_mixer
},
4050 .init_verbs
= { alc880_volume_init_verbs
,
4051 alc880_pin_5stack_init_verbs
},
4052 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4053 .dac_nids
= alc880_dac_nids
,
4054 .dig_out_nid
= ALC880_DIGOUT_NID
,
4055 .num_channel_mode
= ARRAY_SIZE(alc880_fivestack_modes
),
4056 .channel_mode
= alc880_fivestack_modes
,
4057 .input_mux
= &alc880_capture_source
,
4060 .mixers
= { alc880_six_stack_mixer
},
4061 .init_verbs
= { alc880_volume_init_verbs
,
4062 alc880_pin_6stack_init_verbs
},
4063 .num_dacs
= ARRAY_SIZE(alc880_6st_dac_nids
),
4064 .dac_nids
= alc880_6st_dac_nids
,
4065 .num_channel_mode
= ARRAY_SIZE(alc880_sixstack_modes
),
4066 .channel_mode
= alc880_sixstack_modes
,
4067 .input_mux
= &alc880_6stack_capture_source
,
4069 [ALC880_6ST_DIG
] = {
4070 .mixers
= { alc880_six_stack_mixer
},
4071 .init_verbs
= { alc880_volume_init_verbs
,
4072 alc880_pin_6stack_init_verbs
},
4073 .num_dacs
= ARRAY_SIZE(alc880_6st_dac_nids
),
4074 .dac_nids
= alc880_6st_dac_nids
,
4075 .dig_out_nid
= ALC880_DIGOUT_NID
,
4076 .num_channel_mode
= ARRAY_SIZE(alc880_sixstack_modes
),
4077 .channel_mode
= alc880_sixstack_modes
,
4078 .input_mux
= &alc880_6stack_capture_source
,
4081 .mixers
= { alc880_w810_base_mixer
},
4082 .init_verbs
= { alc880_volume_init_verbs
,
4083 alc880_pin_w810_init_verbs
,
4084 alc880_gpio2_init_verbs
},
4085 .num_dacs
= ARRAY_SIZE(alc880_w810_dac_nids
),
4086 .dac_nids
= alc880_w810_dac_nids
,
4087 .dig_out_nid
= ALC880_DIGOUT_NID
,
4088 .num_channel_mode
= ARRAY_SIZE(alc880_w810_modes
),
4089 .channel_mode
= alc880_w810_modes
,
4090 .input_mux
= &alc880_capture_source
,
4093 .mixers
= { alc880_z71v_mixer
},
4094 .init_verbs
= { alc880_volume_init_verbs
,
4095 alc880_pin_z71v_init_verbs
},
4096 .num_dacs
= ARRAY_SIZE(alc880_z71v_dac_nids
),
4097 .dac_nids
= alc880_z71v_dac_nids
,
4098 .dig_out_nid
= ALC880_DIGOUT_NID
,
4100 .num_channel_mode
= ARRAY_SIZE(alc880_2_jack_modes
),
4101 .channel_mode
= alc880_2_jack_modes
,
4102 .input_mux
= &alc880_capture_source
,
4105 .mixers
= { alc880_f1734_mixer
},
4106 .init_verbs
= { alc880_volume_init_verbs
,
4107 alc880_pin_f1734_init_verbs
},
4108 .num_dacs
= ARRAY_SIZE(alc880_f1734_dac_nids
),
4109 .dac_nids
= alc880_f1734_dac_nids
,
4111 .num_channel_mode
= ARRAY_SIZE(alc880_2_jack_modes
),
4112 .channel_mode
= alc880_2_jack_modes
,
4113 .input_mux
= &alc880_f1734_capture_source
,
4114 .unsol_event
= alc880_uniwill_p53_unsol_event
,
4115 .setup
= alc880_uniwill_p53_setup
,
4116 .init_hook
= alc_automute_amp
,
4119 .mixers
= { alc880_asus_mixer
},
4120 .init_verbs
= { alc880_volume_init_verbs
,
4121 alc880_pin_asus_init_verbs
,
4122 alc880_gpio1_init_verbs
},
4123 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4124 .dac_nids
= alc880_asus_dac_nids
,
4125 .num_channel_mode
= ARRAY_SIZE(alc880_asus_modes
),
4126 .channel_mode
= alc880_asus_modes
,
4128 .input_mux
= &alc880_capture_source
,
4130 [ALC880_ASUS_DIG
] = {
4131 .mixers
= { alc880_asus_mixer
},
4132 .init_verbs
= { alc880_volume_init_verbs
,
4133 alc880_pin_asus_init_verbs
,
4134 alc880_gpio1_init_verbs
},
4135 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4136 .dac_nids
= alc880_asus_dac_nids
,
4137 .dig_out_nid
= ALC880_DIGOUT_NID
,
4138 .num_channel_mode
= ARRAY_SIZE(alc880_asus_modes
),
4139 .channel_mode
= alc880_asus_modes
,
4141 .input_mux
= &alc880_capture_source
,
4143 [ALC880_ASUS_DIG2
] = {
4144 .mixers
= { alc880_asus_mixer
},
4145 .init_verbs
= { alc880_volume_init_verbs
,
4146 alc880_pin_asus_init_verbs
,
4147 alc880_gpio2_init_verbs
}, /* use GPIO2 */
4148 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4149 .dac_nids
= alc880_asus_dac_nids
,
4150 .dig_out_nid
= ALC880_DIGOUT_NID
,
4151 .num_channel_mode
= ARRAY_SIZE(alc880_asus_modes
),
4152 .channel_mode
= alc880_asus_modes
,
4154 .input_mux
= &alc880_capture_source
,
4156 [ALC880_ASUS_W1V
] = {
4157 .mixers
= { alc880_asus_mixer
, alc880_asus_w1v_mixer
},
4158 .init_verbs
= { alc880_volume_init_verbs
,
4159 alc880_pin_asus_init_verbs
,
4160 alc880_gpio1_init_verbs
},
4161 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4162 .dac_nids
= alc880_asus_dac_nids
,
4163 .dig_out_nid
= ALC880_DIGOUT_NID
,
4164 .num_channel_mode
= ARRAY_SIZE(alc880_asus_modes
),
4165 .channel_mode
= alc880_asus_modes
,
4167 .input_mux
= &alc880_capture_source
,
4169 [ALC880_UNIWILL_DIG
] = {
4170 .mixers
= { alc880_asus_mixer
},
4171 .init_verbs
= { alc880_volume_init_verbs
,
4172 alc880_pin_asus_init_verbs
},
4173 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4174 .dac_nids
= alc880_asus_dac_nids
,
4175 .dig_out_nid
= ALC880_DIGOUT_NID
,
4176 .num_channel_mode
= ARRAY_SIZE(alc880_asus_modes
),
4177 .channel_mode
= alc880_asus_modes
,
4179 .input_mux
= &alc880_capture_source
,
4181 [ALC880_UNIWILL
] = {
4182 .mixers
= { alc880_uniwill_mixer
},
4183 .init_verbs
= { alc880_volume_init_verbs
,
4184 alc880_uniwill_init_verbs
},
4185 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4186 .dac_nids
= alc880_asus_dac_nids
,
4187 .dig_out_nid
= ALC880_DIGOUT_NID
,
4188 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
4189 .channel_mode
= alc880_threestack_modes
,
4191 .input_mux
= &alc880_capture_source
,
4192 .unsol_event
= alc880_uniwill_unsol_event
,
4193 .setup
= alc880_uniwill_setup
,
4194 .init_hook
= alc880_uniwill_init_hook
,
4196 [ALC880_UNIWILL_P53
] = {
4197 .mixers
= { alc880_uniwill_p53_mixer
},
4198 .init_verbs
= { alc880_volume_init_verbs
,
4199 alc880_uniwill_p53_init_verbs
},
4200 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4201 .dac_nids
= alc880_asus_dac_nids
,
4202 .num_channel_mode
= ARRAY_SIZE(alc880_w810_modes
),
4203 .channel_mode
= alc880_threestack_modes
,
4204 .input_mux
= &alc880_capture_source
,
4205 .unsol_event
= alc880_uniwill_p53_unsol_event
,
4206 .setup
= alc880_uniwill_p53_setup
,
4207 .init_hook
= alc_automute_amp
,
4209 [ALC880_FUJITSU
] = {
4210 .mixers
= { alc880_fujitsu_mixer
},
4211 .init_verbs
= { alc880_volume_init_verbs
,
4212 alc880_uniwill_p53_init_verbs
,
4213 alc880_beep_init_verbs
},
4214 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4215 .dac_nids
= alc880_dac_nids
,
4216 .dig_out_nid
= ALC880_DIGOUT_NID
,
4217 .num_channel_mode
= ARRAY_SIZE(alc880_2_jack_modes
),
4218 .channel_mode
= alc880_2_jack_modes
,
4219 .input_mux
= &alc880_capture_source
,
4220 .unsol_event
= alc880_uniwill_p53_unsol_event
,
4221 .setup
= alc880_uniwill_p53_setup
,
4222 .init_hook
= alc_automute_amp
,
4225 .mixers
= { alc880_three_stack_mixer
},
4226 .init_verbs
= { alc880_volume_init_verbs
,
4227 alc880_pin_clevo_init_verbs
},
4228 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4229 .dac_nids
= alc880_dac_nids
,
4231 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
4232 .channel_mode
= alc880_threestack_modes
,
4234 .input_mux
= &alc880_capture_source
,
4237 .mixers
= { alc880_lg_mixer
},
4238 .init_verbs
= { alc880_volume_init_verbs
,
4239 alc880_lg_init_verbs
},
4240 .num_dacs
= ARRAY_SIZE(alc880_lg_dac_nids
),
4241 .dac_nids
= alc880_lg_dac_nids
,
4242 .dig_out_nid
= ALC880_DIGOUT_NID
,
4243 .num_channel_mode
= ARRAY_SIZE(alc880_lg_ch_modes
),
4244 .channel_mode
= alc880_lg_ch_modes
,
4246 .input_mux
= &alc880_lg_capture_source
,
4247 .unsol_event
= alc_automute_amp_unsol_event
,
4248 .setup
= alc880_lg_setup
,
4249 .init_hook
= alc_automute_amp
,
4250 #ifdef CONFIG_SND_HDA_POWER_SAVE
4251 .loopbacks
= alc880_lg_loopbacks
,
4255 .mixers
= { alc880_lg_lw_mixer
},
4256 .init_verbs
= { alc880_volume_init_verbs
,
4257 alc880_lg_lw_init_verbs
},
4258 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4259 .dac_nids
= alc880_dac_nids
,
4260 .dig_out_nid
= ALC880_DIGOUT_NID
,
4261 .num_channel_mode
= ARRAY_SIZE(alc880_lg_lw_modes
),
4262 .channel_mode
= alc880_lg_lw_modes
,
4263 .input_mux
= &alc880_lg_lw_capture_source
,
4264 .unsol_event
= alc_automute_amp_unsol_event
,
4265 .setup
= alc880_lg_lw_setup
,
4266 .init_hook
= alc_automute_amp
,
4268 [ALC880_MEDION_RIM
] = {
4269 .mixers
= { alc880_medion_rim_mixer
},
4270 .init_verbs
= { alc880_volume_init_verbs
,
4271 alc880_medion_rim_init_verbs
,
4272 alc_gpio2_init_verbs
},
4273 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4274 .dac_nids
= alc880_dac_nids
,
4275 .dig_out_nid
= ALC880_DIGOUT_NID
,
4276 .num_channel_mode
= ARRAY_SIZE(alc880_2_jack_modes
),
4277 .channel_mode
= alc880_2_jack_modes
,
4278 .input_mux
= &alc880_medion_rim_capture_source
,
4279 .unsol_event
= alc880_medion_rim_unsol_event
,
4280 .setup
= alc880_medion_rim_setup
,
4281 .init_hook
= alc880_medion_rim_automute
,
4283 #ifdef CONFIG_SND_DEBUG
4285 .mixers
= { alc880_test_mixer
},
4286 .init_verbs
= { alc880_test_init_verbs
},
4287 .num_dacs
= ARRAY_SIZE(alc880_test_dac_nids
),
4288 .dac_nids
= alc880_test_dac_nids
,
4289 .dig_out_nid
= ALC880_DIGOUT_NID
,
4290 .num_channel_mode
= ARRAY_SIZE(alc880_test_modes
),
4291 .channel_mode
= alc880_test_modes
,
4292 .input_mux
= &alc880_test_capture_source
,
4298 * Automatic parse of I/O pins from the BIOS configuration
4303 ALC_CTL_WIDGET_MUTE
,
4306 static struct snd_kcontrol_new alc880_control_templates
[] = {
4307 HDA_CODEC_VOLUME(NULL
, 0, 0, 0),
4308 HDA_CODEC_MUTE(NULL
, 0, 0, 0),
4309 HDA_BIND_MUTE(NULL
, 0, 0, 0),
4312 /* add dynamic controls */
4313 static int add_control(struct alc_spec
*spec
, int type
, const char *name
,
4316 struct snd_kcontrol_new
*knew
;
4318 snd_array_init(&spec
->kctls
, sizeof(*knew
), 32);
4319 knew
= snd_array_new(&spec
->kctls
);
4322 *knew
= alc880_control_templates
[type
];
4323 knew
->name
= kstrdup(name
, GFP_KERNEL
);
4326 knew
->private_value
= val
;
4330 static int add_control_with_pfx(struct alc_spec
*spec
, int type
,
4331 const char *pfx
, const char *dir
,
4332 const char *sfx
, unsigned long val
)
4335 snprintf(name
, sizeof(name
), "%s %s %s", pfx
, dir
, sfx
);
4336 return add_control(spec
, type
, name
, val
);
4339 #define add_pb_vol_ctrl(spec, type, pfx, val) \
4340 add_control_with_pfx(spec, type, pfx, "Playback", "Volume", val)
4341 #define add_pb_sw_ctrl(spec, type, pfx, val) \
4342 add_control_with_pfx(spec, type, pfx, "Playback", "Switch", val)
4344 #define alc880_is_fixed_pin(nid) ((nid) >= 0x14 && (nid) <= 0x17)
4345 #define alc880_fixed_pin_idx(nid) ((nid) - 0x14)
4346 #define alc880_is_multi_pin(nid) ((nid) >= 0x18)
4347 #define alc880_multi_pin_idx(nid) ((nid) - 0x18)
4348 #define alc880_idx_to_dac(nid) ((nid) + 0x02)
4349 #define alc880_dac_to_idx(nid) ((nid) - 0x02)
4350 #define alc880_idx_to_mixer(nid) ((nid) + 0x0c)
4351 #define alc880_idx_to_selector(nid) ((nid) + 0x10)
4352 #define ALC880_PIN_CD_NID 0x1c
4354 /* fill in the dac_nids table from the parsed pin configuration */
4355 static int alc880_auto_fill_dac_nids(struct alc_spec
*spec
,
4356 const struct auto_pin_cfg
*cfg
)
4362 memset(assigned
, 0, sizeof(assigned
));
4363 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
4365 /* check the pins hardwired to audio widget */
4366 for (i
= 0; i
< cfg
->line_outs
; i
++) {
4367 nid
= cfg
->line_out_pins
[i
];
4368 if (alc880_is_fixed_pin(nid
)) {
4369 int idx
= alc880_fixed_pin_idx(nid
);
4370 spec
->multiout
.dac_nids
[i
] = alc880_idx_to_dac(idx
);
4374 /* left pins can be connect to any audio widget */
4375 for (i
= 0; i
< cfg
->line_outs
; i
++) {
4376 nid
= cfg
->line_out_pins
[i
];
4377 if (alc880_is_fixed_pin(nid
))
4379 /* search for an empty channel */
4380 for (j
= 0; j
< cfg
->line_outs
; j
++) {
4382 spec
->multiout
.dac_nids
[i
] =
4383 alc880_idx_to_dac(j
);
4389 spec
->multiout
.num_dacs
= cfg
->line_outs
;
4393 /* add playback controls from the parsed DAC table */
4394 static int alc880_auto_create_multi_out_ctls(struct alc_spec
*spec
,
4395 const struct auto_pin_cfg
*cfg
)
4397 static const char *chname
[4] = {
4398 "Front", "Surround", NULL
/*CLFE*/, "Side"
4403 for (i
= 0; i
< cfg
->line_outs
; i
++) {
4404 if (!spec
->multiout
.dac_nids
[i
])
4406 nid
= alc880_idx_to_mixer(alc880_dac_to_idx(spec
->multiout
.dac_nids
[i
]));
4409 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
,
4411 HDA_COMPOSE_AMP_VAL(nid
, 1, 0,
4415 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
,
4417 HDA_COMPOSE_AMP_VAL(nid
, 2, 0,
4421 err
= add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
,
4423 HDA_COMPOSE_AMP_VAL(nid
, 1, 2,
4427 err
= add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
,
4429 HDA_COMPOSE_AMP_VAL(nid
, 2, 2,
4435 if (cfg
->line_outs
== 1 &&
4436 cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
4440 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, pfx
,
4441 HDA_COMPOSE_AMP_VAL(nid
, 3, 0,
4445 err
= add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
, pfx
,
4446 HDA_COMPOSE_AMP_VAL(nid
, 3, 2,
4455 /* add playback controls for speaker and HP outputs */
4456 static int alc880_auto_create_extra_out(struct alc_spec
*spec
, hda_nid_t pin
,
4465 if (alc880_is_fixed_pin(pin
)) {
4466 nid
= alc880_idx_to_dac(alc880_fixed_pin_idx(pin
));
4467 /* specify the DAC as the extra output */
4468 if (!spec
->multiout
.hp_nid
)
4469 spec
->multiout
.hp_nid
= nid
;
4471 spec
->multiout
.extra_out_nid
[0] = nid
;
4472 /* control HP volume/switch on the output mixer amp */
4473 nid
= alc880_idx_to_mixer(alc880_fixed_pin_idx(pin
));
4474 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, pfx
,
4475 HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_OUTPUT
));
4478 err
= add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
, pfx
,
4479 HDA_COMPOSE_AMP_VAL(nid
, 3, 2, HDA_INPUT
));
4482 } else if (alc880_is_multi_pin(pin
)) {
4483 /* set manual connection */
4484 /* we have only a switch on HP-out PIN */
4485 err
= add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, pfx
,
4486 HDA_COMPOSE_AMP_VAL(pin
, 3, 0, HDA_OUTPUT
));
4493 /* create input playback/capture controls for the given pin */
4494 static int new_analog_input(struct alc_spec
*spec
, hda_nid_t pin
,
4495 const char *ctlname
,
4496 int idx
, hda_nid_t mix_nid
)
4500 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, ctlname
,
4501 HDA_COMPOSE_AMP_VAL(mix_nid
, 3, idx
, HDA_INPUT
));
4504 err
= add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, ctlname
,
4505 HDA_COMPOSE_AMP_VAL(mix_nid
, 3, idx
, HDA_INPUT
));
4511 static int alc_is_input_pin(struct hda_codec
*codec
, hda_nid_t nid
)
4513 unsigned int pincap
= snd_hda_query_pin_caps(codec
, nid
);
4514 return (pincap
& AC_PINCAP_IN
) != 0;
4517 /* create playback/capture controls for input pins */
4518 static int alc_auto_create_input_ctls(struct hda_codec
*codec
,
4519 const struct auto_pin_cfg
*cfg
,
4521 hda_nid_t cap1
, hda_nid_t cap2
)
4523 struct alc_spec
*spec
= codec
->spec
;
4524 struct hda_input_mux
*imux
= &spec
->private_imux
[0];
4527 for (i
= 0; i
< AUTO_PIN_LAST
; i
++) {
4530 pin
= cfg
->input_pins
[i
];
4531 if (!alc_is_input_pin(codec
, pin
))
4535 idx
= get_connection_index(codec
, mixer
, pin
);
4537 err
= new_analog_input(spec
, pin
,
4538 auto_pin_cfg_labels
[i
],
4547 idx
= get_connection_index(codec
, cap1
, pin
);
4548 if (idx
< 0 && cap2
)
4549 idx
= get_connection_index(codec
, cap2
, pin
);
4551 imux
->items
[imux
->num_items
].label
=
4552 auto_pin_cfg_labels
[i
];
4553 imux
->items
[imux
->num_items
].index
= idx
;
4560 static int alc880_auto_create_input_ctls(struct hda_codec
*codec
,
4561 const struct auto_pin_cfg
*cfg
)
4563 return alc_auto_create_input_ctls(codec
, cfg
, 0x0b, 0x08, 0x09);
4566 static void alc_set_pin_output(struct hda_codec
*codec
, hda_nid_t nid
,
4567 unsigned int pin_type
)
4569 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
4572 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_AMP_GAIN_MUTE
,
4576 static void alc880_auto_set_output_and_unmute(struct hda_codec
*codec
,
4577 hda_nid_t nid
, int pin_type
,
4580 alc_set_pin_output(codec
, nid
, pin_type
);
4581 /* need the manual connection? */
4582 if (alc880_is_multi_pin(nid
)) {
4583 struct alc_spec
*spec
= codec
->spec
;
4584 int idx
= alc880_multi_pin_idx(nid
);
4585 snd_hda_codec_write(codec
, alc880_idx_to_selector(idx
), 0,
4586 AC_VERB_SET_CONNECT_SEL
,
4587 alc880_dac_to_idx(spec
->multiout
.dac_nids
[dac_idx
]));
4591 static int get_pin_type(int line_out_type
)
4593 if (line_out_type
== AUTO_PIN_HP_OUT
)
4599 static void alc880_auto_init_multi_out(struct hda_codec
*codec
)
4601 struct alc_spec
*spec
= codec
->spec
;
4604 for (i
= 0; i
< spec
->autocfg
.line_outs
; i
++) {
4605 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
4606 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
4607 alc880_auto_set_output_and_unmute(codec
, nid
, pin_type
, i
);
4611 static void alc880_auto_init_extra_out(struct hda_codec
*codec
)
4613 struct alc_spec
*spec
= codec
->spec
;
4616 pin
= spec
->autocfg
.speaker_pins
[0];
4617 if (pin
) /* connect to front */
4618 alc880_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
, 0);
4619 pin
= spec
->autocfg
.hp_pins
[0];
4620 if (pin
) /* connect to front */
4621 alc880_auto_set_output_and_unmute(codec
, pin
, PIN_HP
, 0);
4624 static void alc880_auto_init_analog_input(struct hda_codec
*codec
)
4626 struct alc_spec
*spec
= codec
->spec
;
4629 for (i
= 0; i
< AUTO_PIN_LAST
; i
++) {
4630 hda_nid_t nid
= spec
->autocfg
.input_pins
[i
];
4631 if (alc_is_input_pin(codec
, nid
)) {
4632 alc_set_input_pin(codec
, nid
, i
);
4633 if (nid
!= ALC880_PIN_CD_NID
&&
4634 (get_wcaps(codec
, nid
) & AC_WCAP_OUT_AMP
))
4635 snd_hda_codec_write(codec
, nid
, 0,
4636 AC_VERB_SET_AMP_GAIN_MUTE
,
4642 /* parse the BIOS configuration and set up the alc_spec */
4643 /* return 1 if successful, 0 if the proper config is not found,
4644 * or a negative error code
4646 static int alc880_parse_auto_config(struct hda_codec
*codec
)
4648 struct alc_spec
*spec
= codec
->spec
;
4650 static hda_nid_t alc880_ignore
[] = { 0x1d, 0 };
4652 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
4656 if (!spec
->autocfg
.line_outs
)
4657 return 0; /* can't find valid BIOS pin config */
4659 err
= alc880_auto_fill_dac_nids(spec
, &spec
->autocfg
);
4662 err
= alc880_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
4665 err
= alc880_auto_create_extra_out(spec
,
4666 spec
->autocfg
.speaker_pins
[0],
4670 err
= alc880_auto_create_extra_out(spec
, spec
->autocfg
.hp_pins
[0],
4674 err
= alc880_auto_create_input_ctls(codec
, &spec
->autocfg
);
4678 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
4680 /* check multiple SPDIF-out (for recent codecs) */
4681 for (i
= 0; i
< spec
->autocfg
.dig_outs
; i
++) {
4683 err
= snd_hda_get_connections(codec
,
4684 spec
->autocfg
.dig_out_pins
[i
],
4689 spec
->multiout
.dig_out_nid
= dig_nid
;
4691 spec
->multiout
.slave_dig_outs
= spec
->slave_dig_outs
;
4692 if (i
>= ARRAY_SIZE(spec
->slave_dig_outs
) - 1)
4694 spec
->slave_dig_outs
[i
- 1] = dig_nid
;
4697 if (spec
->autocfg
.dig_in_pin
)
4698 spec
->dig_in_nid
= ALC880_DIGIN_NID
;
4700 if (spec
->kctls
.list
)
4701 add_mixer(spec
, spec
->kctls
.list
);
4703 add_verb(spec
, alc880_volume_init_verbs
);
4705 spec
->num_mux_defs
= 1;
4706 spec
->input_mux
= &spec
->private_imux
[0];
4708 alc_ssid_check(codec
, 0x15, 0x1b, 0x14);
4713 /* additional initialization for auto-configuration model */
4714 static void alc880_auto_init(struct hda_codec
*codec
)
4716 struct alc_spec
*spec
= codec
->spec
;
4717 alc880_auto_init_multi_out(codec
);
4718 alc880_auto_init_extra_out(codec
);
4719 alc880_auto_init_analog_input(codec
);
4720 if (spec
->unsol_event
)
4721 alc_inithook(codec
);
4724 /* check the ADC/MUX contains all input pins; some ADC/MUX contains only
4725 * one of two digital mic pins, e.g. on ALC272
4727 static void fixup_automic_adc(struct hda_codec
*codec
)
4729 struct alc_spec
*spec
= codec
->spec
;
4732 for (i
= 0; i
< spec
->num_adc_nids
; i
++) {
4733 hda_nid_t cap
= spec
->capsrc_nids
?
4734 spec
->capsrc_nids
[i
] : spec
->adc_nids
[i
];
4737 iidx
= get_connection_index(codec
, cap
, spec
->int_mic
.pin
);
4740 eidx
= get_connection_index(codec
, cap
, spec
->ext_mic
.pin
);
4743 spec
->int_mic
.mux_idx
= iidx
;
4744 spec
->ext_mic
.mux_idx
= eidx
;
4745 if (spec
->capsrc_nids
)
4746 spec
->capsrc_nids
+= i
;
4747 spec
->adc_nids
+= i
;
4748 spec
->num_adc_nids
= 1;
4751 snd_printd(KERN_INFO
"hda_codec: %s: "
4752 "No ADC/MUX containing both 0x%x and 0x%x pins\n",
4753 codec
->chip_name
, spec
->int_mic
.pin
, spec
->ext_mic
.pin
);
4754 spec
->auto_mic
= 0; /* disable auto-mic to be sure */
4757 static void set_capture_mixer(struct hda_codec
*codec
)
4759 struct alc_spec
*spec
= codec
->spec
;
4760 static struct snd_kcontrol_new
*caps
[2][3] = {
4761 { alc_capture_mixer_nosrc1
,
4762 alc_capture_mixer_nosrc2
,
4763 alc_capture_mixer_nosrc3
},
4764 { alc_capture_mixer1
,
4766 alc_capture_mixer3
},
4768 if (spec
->num_adc_nids
> 0 && spec
->num_adc_nids
<= 3) {
4770 if (spec
->auto_mic
) {
4772 fixup_automic_adc(codec
);
4773 } else if (spec
->input_mux
&& spec
->input_mux
->num_items
> 1)
4777 spec
->cap_mixer
= caps
[mux
][spec
->num_adc_nids
- 1];
4781 #define set_beep_amp(spec, nid, idx, dir) \
4782 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
4785 * OK, here we have finally the patch for ALC880
4788 static int patch_alc880(struct hda_codec
*codec
)
4790 struct alc_spec
*spec
;
4794 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
4800 board_config
= snd_hda_check_board_config(codec
, ALC880_MODEL_LAST
,
4803 if (board_config
< 0) {
4804 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
4806 board_config
= ALC880_AUTO
;
4809 if (board_config
== ALC880_AUTO
) {
4810 /* automatic parse from the BIOS config */
4811 err
= alc880_parse_auto_config(codec
);
4817 "hda_codec: Cannot set up configuration "
4818 "from BIOS. Using 3-stack mode...\n");
4819 board_config
= ALC880_3ST
;
4823 err
= snd_hda_attach_beep_device(codec
, 0x1);
4829 if (board_config
!= ALC880_AUTO
)
4830 setup_preset(codec
, &alc880_presets
[board_config
]);
4832 spec
->stream_analog_playback
= &alc880_pcm_analog_playback
;
4833 spec
->stream_analog_capture
= &alc880_pcm_analog_capture
;
4834 spec
->stream_analog_alt_capture
= &alc880_pcm_analog_alt_capture
;
4836 spec
->stream_digital_playback
= &alc880_pcm_digital_playback
;
4837 spec
->stream_digital_capture
= &alc880_pcm_digital_capture
;
4839 if (!spec
->adc_nids
&& spec
->input_mux
) {
4840 /* check whether NID 0x07 is valid */
4841 unsigned int wcap
= get_wcaps(codec
, alc880_adc_nids
[0]);
4843 wcap
= get_wcaps_type(wcap
);
4844 if (wcap
!= AC_WID_AUD_IN
) {
4845 spec
->adc_nids
= alc880_adc_nids_alt
;
4846 spec
->num_adc_nids
= ARRAY_SIZE(alc880_adc_nids_alt
);
4848 spec
->adc_nids
= alc880_adc_nids
;
4849 spec
->num_adc_nids
= ARRAY_SIZE(alc880_adc_nids
);
4852 set_capture_mixer(codec
);
4853 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
4855 spec
->vmaster_nid
= 0x0c;
4857 codec
->patch_ops
= alc_patch_ops
;
4858 if (board_config
== ALC880_AUTO
)
4859 spec
->init_hook
= alc880_auto_init
;
4860 #ifdef CONFIG_SND_HDA_POWER_SAVE
4861 if (!spec
->loopback
.amplist
)
4862 spec
->loopback
.amplist
= alc880_loopbacks
;
4864 codec
->proc_widget_hook
= print_realtek_coef
;
4874 static hda_nid_t alc260_dac_nids
[1] = {
4879 static hda_nid_t alc260_adc_nids
[1] = {
4884 static hda_nid_t alc260_adc_nids_alt
[1] = {
4889 /* NIDs used when simultaneous access to both ADCs makes sense. Note that
4890 * alc260_capture_mixer assumes ADC0 (nid 0x04) is the first ADC.
4892 static hda_nid_t alc260_dual_adc_nids
[2] = {
4897 #define ALC260_DIGOUT_NID 0x03
4898 #define ALC260_DIGIN_NID 0x06
4900 static struct hda_input_mux alc260_capture_source
= {
4904 { "Front Mic", 0x1 },
4910 /* On Fujitsu S702x laptops capture only makes sense from Mic/LineIn jack,
4911 * headphone jack and the internal CD lines since these are the only pins at
4912 * which audio can appear. For flexibility, also allow the option of
4913 * recording the mixer output on the second ADC (ADC0 doesn't have a
4914 * connection to the mixer output).
4916 static struct hda_input_mux alc260_fujitsu_capture_sources
[2] = {
4920 { "Mic/Line", 0x0 },
4922 { "Headphone", 0x2 },
4928 { "Mic/Line", 0x0 },
4930 { "Headphone", 0x2 },
4937 /* Acer TravelMate(/Extensa/Aspire) notebooks have similar configuration to
4938 * the Fujitsu S702x, but jacks are marked differently.
4940 static struct hda_input_mux alc260_acer_capture_sources
[2] = {
4947 { "Headphone", 0x5 },
4956 { "Headphone", 0x6 },
4962 /* Maxdata Favorit 100XS */
4963 static struct hda_input_mux alc260_favorit100_capture_sources
[2] = {
4967 { "Line/Mic", 0x0 },
4974 { "Line/Mic", 0x0 },
4982 * This is just place-holder, so there's something for alc_build_pcms to look
4983 * at when it calculates the maximum number of channels. ALC260 has no mixer
4984 * element which allows changing the channel mode, so the verb list is
4987 static struct hda_channel_mode alc260_modes
[1] = {
4992 /* Mixer combinations
4994 * basic: base_output + input + pc_beep + capture
4995 * HP: base_output + input + capture_alt
4996 * HP_3013: hp_3013 + input + capture
4997 * fujitsu: fujitsu + capture
4998 * acer: acer + capture
5001 static struct snd_kcontrol_new alc260_base_output_mixer
[] = {
5002 HDA_CODEC_VOLUME("Front Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5003 HDA_BIND_MUTE("Front Playback Switch", 0x08, 2, HDA_INPUT
),
5004 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x09, 0x0, HDA_OUTPUT
),
5005 HDA_BIND_MUTE("Headphone Playback Switch", 0x09, 2, HDA_INPUT
),
5006 HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT
),
5007 HDA_BIND_MUTE_MONO("Mono Playback Switch", 0x0a, 1, 2, HDA_INPUT
),
5011 static struct snd_kcontrol_new alc260_input_mixer
[] = {
5012 HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT
),
5013 HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT
),
5014 HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT
),
5015 HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT
),
5016 HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT
),
5017 HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT
),
5018 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x07, 0x01, HDA_INPUT
),
5019 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x07, 0x01, HDA_INPUT
),
5023 /* update HP, line and mono out pins according to the master switch */
5024 static void alc260_hp_master_update(struct hda_codec
*codec
,
5025 hda_nid_t hp
, hda_nid_t line
,
5028 struct alc_spec
*spec
= codec
->spec
;
5029 unsigned int val
= spec
->master_sw
? PIN_HP
: 0;
5030 /* change HP and line-out pins */
5031 snd_hda_codec_write(codec
, hp
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5033 snd_hda_codec_write(codec
, line
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5035 /* mono (speaker) depending on the HP jack sense */
5036 val
= (val
&& !spec
->jack_present
) ? PIN_OUT
: 0;
5037 snd_hda_codec_write(codec
, mono
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5041 static int alc260_hp_master_sw_get(struct snd_kcontrol
*kcontrol
,
5042 struct snd_ctl_elem_value
*ucontrol
)
5044 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
5045 struct alc_spec
*spec
= codec
->spec
;
5046 *ucontrol
->value
.integer
.value
= spec
->master_sw
;
5050 static int alc260_hp_master_sw_put(struct snd_kcontrol
*kcontrol
,
5051 struct snd_ctl_elem_value
*ucontrol
)
5053 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
5054 struct alc_spec
*spec
= codec
->spec
;
5055 int val
= !!*ucontrol
->value
.integer
.value
;
5056 hda_nid_t hp
, line
, mono
;
5058 if (val
== spec
->master_sw
)
5060 spec
->master_sw
= val
;
5061 hp
= (kcontrol
->private_value
>> 16) & 0xff;
5062 line
= (kcontrol
->private_value
>> 8) & 0xff;
5063 mono
= kcontrol
->private_value
& 0xff;
5064 alc260_hp_master_update(codec
, hp
, line
, mono
);
5068 static struct snd_kcontrol_new alc260_hp_output_mixer
[] = {
5070 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
5071 .name
= "Master Playback Switch",
5072 .info
= snd_ctl_boolean_mono_info
,
5073 .get
= alc260_hp_master_sw_get
,
5074 .put
= alc260_hp_master_sw_put
,
5075 .private_value
= (0x0f << 16) | (0x10 << 8) | 0x11
5077 HDA_CODEC_VOLUME("Front Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5078 HDA_BIND_MUTE("Front Playback Switch", 0x08, 2, HDA_INPUT
),
5079 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x09, 0x0, HDA_OUTPUT
),
5080 HDA_BIND_MUTE("Headphone Playback Switch", 0x09, 2, HDA_INPUT
),
5081 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0a, 1, 0x0,
5083 HDA_BIND_MUTE_MONO("Speaker Playback Switch", 0x0a, 1, 2, HDA_INPUT
),
5087 static struct hda_verb alc260_hp_unsol_verbs
[] = {
5088 {0x10, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
5092 static void alc260_hp_automute(struct hda_codec
*codec
)
5094 struct alc_spec
*spec
= codec
->spec
;
5095 unsigned int present
;
5097 present
= snd_hda_codec_read(codec
, 0x10, 0,
5098 AC_VERB_GET_PIN_SENSE
, 0);
5099 spec
->jack_present
= (present
& AC_PINSENSE_PRESENCE
) != 0;
5100 alc260_hp_master_update(codec
, 0x0f, 0x10, 0x11);
5103 static void alc260_hp_unsol_event(struct hda_codec
*codec
, unsigned int res
)
5105 if ((res
>> 26) == ALC880_HP_EVENT
)
5106 alc260_hp_automute(codec
);
5109 static struct snd_kcontrol_new alc260_hp_3013_mixer
[] = {
5111 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
5112 .name
= "Master Playback Switch",
5113 .info
= snd_ctl_boolean_mono_info
,
5114 .get
= alc260_hp_master_sw_get
,
5115 .put
= alc260_hp_master_sw_put
,
5116 .private_value
= (0x15 << 16) | (0x10 << 8) | 0x11
5118 HDA_CODEC_VOLUME("Front Playback Volume", 0x09, 0x0, HDA_OUTPUT
),
5119 HDA_CODEC_MUTE("Front Playback Switch", 0x10, 0x0, HDA_OUTPUT
),
5120 HDA_CODEC_VOLUME("Aux-In Playback Volume", 0x07, 0x06, HDA_INPUT
),
5121 HDA_CODEC_MUTE("Aux-In Playback Switch", 0x07, 0x06, HDA_INPUT
),
5122 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5123 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
5124 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT
),
5125 HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x11, 1, 0x0, HDA_OUTPUT
),
5129 static struct hda_bind_ctls alc260_dc7600_bind_master_vol
= {
5130 .ops
= &snd_hda_bind_vol
,
5132 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_OUTPUT
),
5133 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_OUTPUT
),
5134 HDA_COMPOSE_AMP_VAL(0x0a, 3, 0, HDA_OUTPUT
),
5139 static struct hda_bind_ctls alc260_dc7600_bind_switch
= {
5140 .ops
= &snd_hda_bind_sw
,
5142 HDA_COMPOSE_AMP_VAL(0x11, 3, 0, HDA_OUTPUT
),
5143 HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT
),
5148 static struct snd_kcontrol_new alc260_hp_dc7600_mixer
[] = {
5149 HDA_BIND_VOL("Master Playback Volume", &alc260_dc7600_bind_master_vol
),
5150 HDA_BIND_SW("LineOut Playback Switch", &alc260_dc7600_bind_switch
),
5151 HDA_CODEC_MUTE("Speaker Playback Switch", 0x0f, 0x0, HDA_OUTPUT
),
5152 HDA_CODEC_MUTE("Headphone Playback Switch", 0x10, 0x0, HDA_OUTPUT
),
5156 static struct hda_verb alc260_hp_3013_unsol_verbs
[] = {
5157 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
5161 static void alc260_hp_3013_automute(struct hda_codec
*codec
)
5163 struct alc_spec
*spec
= codec
->spec
;
5164 unsigned int present
;
5166 present
= snd_hda_codec_read(codec
, 0x15, 0,
5167 AC_VERB_GET_PIN_SENSE
, 0);
5168 spec
->jack_present
= (present
& AC_PINSENSE_PRESENCE
) != 0;
5169 alc260_hp_master_update(codec
, 0x15, 0x10, 0x11);
5172 static void alc260_hp_3013_unsol_event(struct hda_codec
*codec
,
5175 if ((res
>> 26) == ALC880_HP_EVENT
)
5176 alc260_hp_3013_automute(codec
);
5179 static void alc260_hp_3012_automute(struct hda_codec
*codec
)
5181 unsigned int present
, bits
;
5183 present
= snd_hda_codec_read(codec
, 0x10, 0,
5184 AC_VERB_GET_PIN_SENSE
, 0) & AC_PINSENSE_PRESENCE
;
5186 bits
= present
? 0 : PIN_OUT
;
5187 snd_hda_codec_write(codec
, 0x0f, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5189 snd_hda_codec_write(codec
, 0x11, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5191 snd_hda_codec_write(codec
, 0x15, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5195 static void alc260_hp_3012_unsol_event(struct hda_codec
*codec
,
5198 if ((res
>> 26) == ALC880_HP_EVENT
)
5199 alc260_hp_3012_automute(codec
);
5202 /* Fujitsu S702x series laptops. ALC260 pin usage: Mic/Line jack = 0x12,
5203 * HP jack = 0x14, CD audio = 0x16, internal speaker = 0x10.
5205 static struct snd_kcontrol_new alc260_fujitsu_mixer
[] = {
5206 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5207 HDA_BIND_MUTE("Headphone Playback Switch", 0x08, 2, HDA_INPUT
),
5208 ALC_PIN_MODE("Headphone Jack Mode", 0x14, ALC_PIN_DIR_INOUT
),
5209 HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT
),
5210 HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT
),
5211 HDA_CODEC_VOLUME("Mic/Line Playback Volume", 0x07, 0x0, HDA_INPUT
),
5212 HDA_CODEC_MUTE("Mic/Line Playback Switch", 0x07, 0x0, HDA_INPUT
),
5213 ALC_PIN_MODE("Mic/Line Jack Mode", 0x12, ALC_PIN_DIR_IN
),
5214 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x09, 0x0, HDA_OUTPUT
),
5215 HDA_BIND_MUTE("Speaker Playback Switch", 0x09, 2, HDA_INPUT
),
5219 /* Mixer for Acer TravelMate(/Extensa/Aspire) notebooks. Note that current
5220 * versions of the ALC260 don't act on requests to enable mic bias from NID
5221 * 0x0f (used to drive the headphone jack in these laptops). The ALC260
5222 * datasheet doesn't mention this restriction. At this stage it's not clear
5223 * whether this behaviour is intentional or is a hardware bug in chip
5224 * revisions available in early 2006. Therefore for now allow the
5225 * "Headphone Jack Mode" control to span all choices, but if it turns out
5226 * that the lack of mic bias for this NID is intentional we could change the
5227 * mode from ALC_PIN_DIR_INOUT to ALC_PIN_DIR_INOUT_NOMICBIAS.
5229 * In addition, Acer TravelMate(/Extensa/Aspire) notebooks in early 2006
5230 * don't appear to make the mic bias available from the "line" jack, even
5231 * though the NID used for this jack (0x14) can supply it. The theory is
5232 * that perhaps Acer have included blocking capacitors between the ALC260
5233 * and the output jack. If this turns out to be the case for all such
5234 * models the "Line Jack Mode" mode could be changed from ALC_PIN_DIR_INOUT
5235 * to ALC_PIN_DIR_INOUT_NOMICBIAS.
5237 * The C20x Tablet series have a mono internal speaker which is controlled
5238 * via the chip's Mono sum widget and pin complex, so include the necessary
5239 * controls for such models. On models without a "mono speaker" the control
5240 * won't do anything.
5242 static struct snd_kcontrol_new alc260_acer_mixer
[] = {
5243 HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5244 HDA_BIND_MUTE("Master Playback Switch", 0x08, 2, HDA_INPUT
),
5245 ALC_PIN_MODE("Headphone Jack Mode", 0x0f, ALC_PIN_DIR_INOUT
),
5246 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0a, 1, 0x0,
5248 HDA_BIND_MUTE_MONO("Speaker Playback Switch", 0x0a, 1, 2,
5250 HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT
),
5251 HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT
),
5252 HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT
),
5253 HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT
),
5254 ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN
),
5255 HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT
),
5256 HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT
),
5257 ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT
),
5261 /* Maxdata Favorit 100XS: one output and one input (0x12) jack
5263 static struct snd_kcontrol_new alc260_favorit100_mixer
[] = {
5264 HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5265 HDA_BIND_MUTE("Master Playback Switch", 0x08, 2, HDA_INPUT
),
5266 ALC_PIN_MODE("Output Jack Mode", 0x0f, ALC_PIN_DIR_INOUT
),
5267 HDA_CODEC_VOLUME("Line/Mic Playback Volume", 0x07, 0x0, HDA_INPUT
),
5268 HDA_CODEC_MUTE("Line/Mic Playback Switch", 0x07, 0x0, HDA_INPUT
),
5269 ALC_PIN_MODE("Line/Mic Jack Mode", 0x12, ALC_PIN_DIR_IN
),
5273 /* Packard bell V7900 ALC260 pin usage: HP = 0x0f, Mic jack = 0x12,
5274 * Line In jack = 0x14, CD audio = 0x16, pc beep = 0x17.
5276 static struct snd_kcontrol_new alc260_will_mixer
[] = {
5277 HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5278 HDA_BIND_MUTE("Master Playback Switch", 0x08, 0x2, HDA_INPUT
),
5279 HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT
),
5280 HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT
),
5281 ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN
),
5282 HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT
),
5283 HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT
),
5284 ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT
),
5285 HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT
),
5286 HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT
),
5290 /* Replacer 672V ALC260 pin usage: Mic jack = 0x12,
5291 * Line In jack = 0x14, ATAPI Mic = 0x13, speaker = 0x0f.
5293 static struct snd_kcontrol_new alc260_replacer_672v_mixer
[] = {
5294 HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5295 HDA_BIND_MUTE("Master Playback Switch", 0x08, 0x2, HDA_INPUT
),
5296 HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT
),
5297 HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT
),
5298 ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN
),
5299 HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x07, 0x1, HDA_INPUT
),
5300 HDA_CODEC_MUTE("ATATI Mic Playback Switch", 0x07, 0x1, HDA_INPUT
),
5301 HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT
),
5302 HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT
),
5303 ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT
),
5308 * initialization verbs
5310 static struct hda_verb alc260_init_verbs
[] = {
5311 /* Line In pin widget for input */
5312 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
5313 /* CD pin widget for input */
5314 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
5315 /* Mic1 (rear panel) pin widget for input and vref at 80% */
5316 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
5317 /* Mic2 (front panel) pin widget for input and vref at 80% */
5318 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
5319 /* LINE-2 is used for line-out in rear */
5320 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5321 /* select line-out */
5322 {0x0e, AC_VERB_SET_CONNECT_SEL
, 0x00},
5324 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5326 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
5328 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5329 /* mute capture amp left and right */
5330 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
5331 /* set connection select to line in (default select for this ADC) */
5332 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x02},
5333 /* mute capture amp left and right */
5334 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
5335 /* set connection select to line in (default select for this ADC) */
5336 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x02},
5337 /* set vol=0 Line-Out mixer amp left and right */
5338 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5339 /* unmute pin widget amp left and right (no gain on this amp) */
5340 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5341 /* set vol=0 HP mixer amp left and right */
5342 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5343 /* unmute pin widget amp left and right (no gain on this amp) */
5344 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5345 /* set vol=0 Mono mixer amp left and right */
5346 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5347 /* unmute pin widget amp left and right (no gain on this amp) */
5348 {0x11, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5349 /* unmute LINE-2 out pin */
5350 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5351 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
5354 /* mute analog inputs */
5355 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5356 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5357 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
5358 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
5359 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
5360 /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
5361 /* mute Front out path */
5362 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5363 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5364 /* mute Headphone out path */
5365 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5366 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5367 /* mute Mono out path */
5368 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5369 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5373 #if 0 /* should be identical with alc260_init_verbs? */
5374 static struct hda_verb alc260_hp_init_verbs
[] = {
5375 /* Headphone and output */
5376 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
5378 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
5379 /* Mic1 (rear panel) pin widget for input and vref at 80% */
5380 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
5381 /* Mic2 (front panel) pin widget for input and vref at 80% */
5382 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
5383 /* Line In pin widget for input */
5384 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
5385 /* Line-2 pin widget for output */
5386 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
5387 /* CD pin widget for input */
5388 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
5389 /* unmute amp left and right */
5390 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000},
5391 /* set connection select to line in (default select for this ADC) */
5392 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x02},
5393 /* unmute Line-Out mixer amp left and right (volume = 0) */
5394 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb000},
5395 /* mute pin widget amp left and right (no gain on this amp) */
5396 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
5397 /* unmute HP mixer amp left and right (volume = 0) */
5398 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb000},
5399 /* mute pin widget amp left and right (no gain on this amp) */
5400 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
5401 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
5404 /* mute analog inputs */
5405 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5406 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5407 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
5408 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
5409 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
5410 /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
5411 /* Unmute Front out path */
5412 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
5413 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
5414 /* Unmute Headphone out path */
5415 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
5416 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
5417 /* Unmute Mono out path */
5418 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
5419 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
5424 static struct hda_verb alc260_hp_3013_init_verbs
[] = {
5425 /* Line out and output */
5426 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
5428 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
5429 /* Mic1 (rear panel) pin widget for input and vref at 80% */
5430 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
5431 /* Mic2 (front panel) pin widget for input and vref at 80% */
5432 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
5433 /* Line In pin widget for input */
5434 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
5435 /* Headphone pin widget for output */
5436 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
5437 /* CD pin widget for input */
5438 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
5439 /* unmute amp left and right */
5440 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000},
5441 /* set connection select to line in (default select for this ADC) */
5442 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x02},
5443 /* unmute Line-Out mixer amp left and right (volume = 0) */
5444 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb000},
5445 /* mute pin widget amp left and right (no gain on this amp) */
5446 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
5447 /* unmute HP mixer amp left and right (volume = 0) */
5448 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb000},
5449 /* mute pin widget amp left and right (no gain on this amp) */
5450 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
5451 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
5454 /* mute analog inputs */
5455 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5456 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5457 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
5458 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
5459 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
5460 /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
5461 /* Unmute Front out path */
5462 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
5463 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
5464 /* Unmute Headphone out path */
5465 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
5466 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
5467 /* Unmute Mono out path */
5468 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
5469 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
5473 /* Initialisation sequence for ALC260 as configured in Fujitsu S702x
5474 * laptops. ALC260 pin usage: Mic/Line jack = 0x12, HP jack = 0x14, CD
5475 * audio = 0x16, internal speaker = 0x10.
5477 static struct hda_verb alc260_fujitsu_init_verbs
[] = {
5478 /* Disable all GPIOs */
5479 {0x01, AC_VERB_SET_GPIO_MASK
, 0},
5480 /* Internal speaker is connected to headphone pin */
5481 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
5482 /* Headphone/Line-out jack connects to Line1 pin; make it an output */
5483 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5484 /* Mic/Line-in jack is connected to mic1 pin, so make it an input */
5485 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
5486 /* Ensure all other unused pins are disabled and muted. */
5487 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5488 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5489 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5490 {0x11, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5491 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5492 {0x13, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5493 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5494 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5496 /* Disable digital (SPDIF) pins */
5497 {0x03, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5498 {0x06, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5500 /* Ensure Line1 pin widget takes its input from the OUT1 sum bus
5501 * when acting as an output.
5503 {0x0d, AC_VERB_SET_CONNECT_SEL
, 0},
5505 /* Start with output sum widgets muted and their output gains at min */
5506 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5507 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5508 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5509 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5510 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5511 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5512 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5513 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5514 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5516 /* Unmute HP pin widget amp left and right (no equiv mixer ctrl) */
5517 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5518 /* Unmute Line1 pin widget output buffer since it starts as an output.
5519 * If the pin mode is changed by the user the pin mode control will
5520 * take care of enabling the pin's input/output buffers as needed.
5521 * Therefore there's no need to enable the input buffer at this
5524 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5525 /* Unmute input buffer of pin widget used for Line-in (no equiv
5528 {0x12, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
5530 /* Mute capture amp left and right */
5531 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5532 /* Set ADC connection select to match default mixer setting - line
5535 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x00},
5537 /* Do the same for the second ADC: mute capture input amp and
5538 * set ADC connection to line in (on mic1 pin)
5540 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5541 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x00},
5543 /* Mute all inputs to mixer widget (even unconnected ones) */
5544 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)}, /* mic1 pin */
5545 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)}, /* mic2 pin */
5546 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)}, /* line1 pin */
5547 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)}, /* line2 pin */
5548 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)}, /* CD pin */
5549 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)}, /* Beep-gen pin */
5550 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)}, /* Line-out pin */
5551 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)}, /* HP-pin pin */
5556 /* Initialisation sequence for ALC260 as configured in Acer TravelMate and
5557 * similar laptops (adapted from Fujitsu init verbs).
5559 static struct hda_verb alc260_acer_init_verbs
[] = {
5560 /* On TravelMate laptops, GPIO 0 enables the internal speaker and
5561 * the headphone jack. Turn this on and rely on the standard mute
5562 * methods whenever the user wants to turn these outputs off.
5564 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
5565 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
5566 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
5567 /* Internal speaker/Headphone jack is connected to Line-out pin */
5568 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
5569 /* Internal microphone/Mic jack is connected to Mic1 pin */
5570 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
5571 /* Line In jack is connected to Line1 pin */
5572 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
5573 /* Some Acers (eg: C20x Tablets) use Mono pin for internal speaker */
5574 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
5575 /* Ensure all other unused pins are disabled and muted. */
5576 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5577 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5578 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5579 {0x13, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5580 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5581 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5582 /* Disable digital (SPDIF) pins */
5583 {0x03, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5584 {0x06, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5586 /* Ensure Mic1 and Line1 pin widgets take input from the OUT1 sum
5587 * bus when acting as outputs.
5589 {0x0b, AC_VERB_SET_CONNECT_SEL
, 0},
5590 {0x0d, AC_VERB_SET_CONNECT_SEL
, 0},
5592 /* Start with output sum widgets muted and their output gains at min */
5593 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5594 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5595 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5596 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5597 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5598 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5599 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5600 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5601 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5603 /* Unmute Line-out pin widget amp left and right
5604 * (no equiv mixer ctrl)
5606 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5607 /* Unmute mono pin widget amp output (no equiv mixer ctrl) */
5608 {0x11, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5609 /* Unmute Mic1 and Line1 pin widget input buffers since they start as
5610 * inputs. If the pin mode is changed by the user the pin mode control
5611 * will take care of enabling the pin's input/output buffers as needed.
5612 * Therefore there's no need to enable the input buffer at this
5615 {0x12, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
5616 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
5618 /* Mute capture amp left and right */
5619 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5620 /* Set ADC connection select to match default mixer setting - mic
5623 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x00},
5625 /* Do similar with the second ADC: mute capture input amp and
5626 * set ADC connection to mic to match ALSA's default state.
5628 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5629 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x00},
5631 /* Mute all inputs to mixer widget (even unconnected ones) */
5632 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)}, /* mic1 pin */
5633 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)}, /* mic2 pin */
5634 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)}, /* line1 pin */
5635 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)}, /* line2 pin */
5636 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)}, /* CD pin */
5637 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)}, /* Beep-gen pin */
5638 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)}, /* Line-out pin */
5639 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)}, /* HP-pin pin */
5644 /* Initialisation sequence for Maxdata Favorit 100XS
5645 * (adapted from Acer init verbs).
5647 static struct hda_verb alc260_favorit100_init_verbs
[] = {
5648 /* GPIO 0 enables the output jack.
5649 * Turn this on and rely on the standard mute
5650 * methods whenever the user wants to turn these outputs off.
5652 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
5653 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
5654 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
5655 /* Line/Mic input jack is connected to Mic1 pin */
5656 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
5657 /* Ensure all other unused pins are disabled and muted. */
5658 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5659 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5660 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5661 {0x11, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5662 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5663 {0x13, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5664 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5665 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5666 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5667 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5668 /* Disable digital (SPDIF) pins */
5669 {0x03, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5670 {0x06, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5672 /* Ensure Mic1 and Line1 pin widgets take input from the OUT1 sum
5673 * bus when acting as outputs.
5675 {0x0b, AC_VERB_SET_CONNECT_SEL
, 0},
5676 {0x0d, AC_VERB_SET_CONNECT_SEL
, 0},
5678 /* Start with output sum widgets muted and their output gains at min */
5679 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5680 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5681 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5682 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5683 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5684 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5685 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5686 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5687 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5689 /* Unmute Line-out pin widget amp left and right
5690 * (no equiv mixer ctrl)
5692 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5693 /* Unmute Mic1 and Line1 pin widget input buffers since they start as
5694 * inputs. If the pin mode is changed by the user the pin mode control
5695 * will take care of enabling the pin's input/output buffers as needed.
5696 * Therefore there's no need to enable the input buffer at this
5699 {0x12, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
5701 /* Mute capture amp left and right */
5702 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5703 /* Set ADC connection select to match default mixer setting - mic
5706 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x00},
5708 /* Do similar with the second ADC: mute capture input amp and
5709 * set ADC connection to mic to match ALSA's default state.
5711 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5712 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x00},
5714 /* Mute all inputs to mixer widget (even unconnected ones) */
5715 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)}, /* mic1 pin */
5716 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)}, /* mic2 pin */
5717 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)}, /* line1 pin */
5718 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)}, /* line2 pin */
5719 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)}, /* CD pin */
5720 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)}, /* Beep-gen pin */
5721 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)}, /* Line-out pin */
5722 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)}, /* HP-pin pin */
5727 static struct hda_verb alc260_will_verbs
[] = {
5728 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
5729 {0x0b, AC_VERB_SET_CONNECT_SEL
, 0x00},
5730 {0x0d, AC_VERB_SET_CONNECT_SEL
, 0x00},
5731 {0x0f, AC_VERB_SET_EAPD_BTLENABLE
, 0x02},
5732 {0x1a, AC_VERB_SET_COEF_INDEX
, 0x07},
5733 {0x1a, AC_VERB_SET_PROC_COEF
, 0x3040},
5737 static struct hda_verb alc260_replacer_672v_verbs
[] = {
5738 {0x0f, AC_VERB_SET_EAPD_BTLENABLE
, 0x02},
5739 {0x1a, AC_VERB_SET_COEF_INDEX
, 0x07},
5740 {0x1a, AC_VERB_SET_PROC_COEF
, 0x3050},
5742 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
5743 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
5744 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
5746 {0x0f, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
5750 /* toggle speaker-output according to the hp-jack state */
5751 static void alc260_replacer_672v_automute(struct hda_codec
*codec
)
5753 unsigned int present
;
5755 /* speaker --> GPIO Data 0, hp or spdif --> GPIO data 1 */
5756 present
= snd_hda_codec_read(codec
, 0x0f, 0,
5757 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
5759 snd_hda_codec_write_cache(codec
, 0x01, 0,
5760 AC_VERB_SET_GPIO_DATA
, 1);
5761 snd_hda_codec_write_cache(codec
, 0x0f, 0,
5762 AC_VERB_SET_PIN_WIDGET_CONTROL
,
5765 snd_hda_codec_write_cache(codec
, 0x01, 0,
5766 AC_VERB_SET_GPIO_DATA
, 0);
5767 snd_hda_codec_write_cache(codec
, 0x0f, 0,
5768 AC_VERB_SET_PIN_WIDGET_CONTROL
,
5773 static void alc260_replacer_672v_unsol_event(struct hda_codec
*codec
,
5776 if ((res
>> 26) == ALC880_HP_EVENT
)
5777 alc260_replacer_672v_automute(codec
);
5780 static struct hda_verb alc260_hp_dc7600_verbs
[] = {
5781 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x01},
5782 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
5783 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5784 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
5785 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5786 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5787 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
5788 {0x10, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
5789 {0x11, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
5790 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
5794 /* Test configuration for debugging, modelled after the ALC880 test
5797 #ifdef CONFIG_SND_DEBUG
5798 static hda_nid_t alc260_test_dac_nids
[1] = {
5801 static hda_nid_t alc260_test_adc_nids
[2] = {
5804 /* For testing the ALC260, each input MUX needs its own definition since
5805 * the signal assignments are different. This assumes that the first ADC
5808 static struct hda_input_mux alc260_test_capture_sources
[2] = {
5812 { "MIC1 pin", 0x0 },
5813 { "MIC2 pin", 0x1 },
5814 { "LINE1 pin", 0x2 },
5815 { "LINE2 pin", 0x3 },
5817 { "LINE-OUT pin", 0x5 },
5818 { "HP-OUT pin", 0x6 },
5824 { "MIC1 pin", 0x0 },
5825 { "MIC2 pin", 0x1 },
5826 { "LINE1 pin", 0x2 },
5827 { "LINE2 pin", 0x3 },
5830 { "LINE-OUT pin", 0x6 },
5831 { "HP-OUT pin", 0x7 },
5835 static struct snd_kcontrol_new alc260_test_mixer
[] = {
5836 /* Output driver widgets */
5837 HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT
),
5838 HDA_BIND_MUTE_MONO("Mono Playback Switch", 0x0a, 1, 2, HDA_INPUT
),
5839 HDA_CODEC_VOLUME("LOUT2 Playback Volume", 0x09, 0x0, HDA_OUTPUT
),
5840 HDA_BIND_MUTE("LOUT2 Playback Switch", 0x09, 2, HDA_INPUT
),
5841 HDA_CODEC_VOLUME("LOUT1 Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5842 HDA_BIND_MUTE("LOUT1 Playback Switch", 0x08, 2, HDA_INPUT
),
5844 /* Modes for retasking pin widgets
5845 * Note: the ALC260 doesn't seem to act on requests to enable mic
5846 * bias from NIDs 0x0f and 0x10. The ALC260 datasheet doesn't
5847 * mention this restriction. At this stage it's not clear whether
5848 * this behaviour is intentional or is a hardware bug in chip
5849 * revisions available at least up until early 2006. Therefore for
5850 * now allow the "HP-OUT" and "LINE-OUT" Mode controls to span all
5851 * choices, but if it turns out that the lack of mic bias for these
5852 * NIDs is intentional we could change their modes from
5853 * ALC_PIN_DIR_INOUT to ALC_PIN_DIR_INOUT_NOMICBIAS.
5855 ALC_PIN_MODE("HP-OUT pin mode", 0x10, ALC_PIN_DIR_INOUT
),
5856 ALC_PIN_MODE("LINE-OUT pin mode", 0x0f, ALC_PIN_DIR_INOUT
),
5857 ALC_PIN_MODE("LINE2 pin mode", 0x15, ALC_PIN_DIR_INOUT
),
5858 ALC_PIN_MODE("LINE1 pin mode", 0x14, ALC_PIN_DIR_INOUT
),
5859 ALC_PIN_MODE("MIC2 pin mode", 0x13, ALC_PIN_DIR_INOUT
),
5860 ALC_PIN_MODE("MIC1 pin mode", 0x12, ALC_PIN_DIR_INOUT
),
5862 /* Loopback mixer controls */
5863 HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x07, 0x00, HDA_INPUT
),
5864 HDA_CODEC_MUTE("MIC1 Playback Switch", 0x07, 0x00, HDA_INPUT
),
5865 HDA_CODEC_VOLUME("MIC2 Playback Volume", 0x07, 0x01, HDA_INPUT
),
5866 HDA_CODEC_MUTE("MIC2 Playback Switch", 0x07, 0x01, HDA_INPUT
),
5867 HDA_CODEC_VOLUME("LINE1 Playback Volume", 0x07, 0x02, HDA_INPUT
),
5868 HDA_CODEC_MUTE("LINE1 Playback Switch", 0x07, 0x02, HDA_INPUT
),
5869 HDA_CODEC_VOLUME("LINE2 Playback Volume", 0x07, 0x03, HDA_INPUT
),
5870 HDA_CODEC_MUTE("LINE2 Playback Switch", 0x07, 0x03, HDA_INPUT
),
5871 HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT
),
5872 HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT
),
5873 HDA_CODEC_VOLUME("LINE-OUT loopback Playback Volume", 0x07, 0x06, HDA_INPUT
),
5874 HDA_CODEC_MUTE("LINE-OUT loopback Playback Switch", 0x07, 0x06, HDA_INPUT
),
5875 HDA_CODEC_VOLUME("HP-OUT loopback Playback Volume", 0x07, 0x7, HDA_INPUT
),
5876 HDA_CODEC_MUTE("HP-OUT loopback Playback Switch", 0x07, 0x7, HDA_INPUT
),
5878 /* Controls for GPIO pins, assuming they are configured as outputs */
5879 ALC_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
5880 ALC_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
5881 ALC_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
5882 ALC_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
5884 /* Switches to allow the digital IO pins to be enabled. The datasheet
5885 * is ambigious as to which NID is which; testing on laptops which
5886 * make this output available should provide clarification.
5888 ALC_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x03, 0x01),
5889 ALC_SPDIF_CTRL_SWITCH("SPDIF Capture Switch", 0x06, 0x01),
5891 /* A switch allowing EAPD to be enabled. Some laptops seem to use
5892 * this output to turn on an external amplifier.
5894 ALC_EAPD_CTRL_SWITCH("LINE-OUT EAPD Enable Switch", 0x0f, 0x02),
5895 ALC_EAPD_CTRL_SWITCH("HP-OUT EAPD Enable Switch", 0x10, 0x02),
5899 static struct hda_verb alc260_test_init_verbs
[] = {
5900 /* Enable all GPIOs as outputs with an initial value of 0 */
5901 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x0f},
5902 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
5903 {0x01, AC_VERB_SET_GPIO_MASK
, 0x0f},
5905 /* Enable retasking pins as output, initially without power amp */
5906 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5907 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5908 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5909 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5910 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5911 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5913 /* Disable digital (SPDIF) pins initially, but users can enable
5914 * them via a mixer switch. In the case of SPDIF-out, this initverb
5915 * payload also sets the generation to 0, output to be in "consumer"
5916 * PCM format, copyright asserted, no pre-emphasis and no validity
5919 {0x03, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5920 {0x06, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5922 /* Ensure mic1, mic2, line1 and line2 pin widgets take input from the
5923 * OUT1 sum bus when acting as an output.
5925 {0x0b, AC_VERB_SET_CONNECT_SEL
, 0},
5926 {0x0c, AC_VERB_SET_CONNECT_SEL
, 0},
5927 {0x0d, AC_VERB_SET_CONNECT_SEL
, 0},
5928 {0x0e, AC_VERB_SET_CONNECT_SEL
, 0},
5930 /* Start with output sum widgets muted and their output gains at min */
5931 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5932 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5933 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5934 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5935 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5936 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5937 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5938 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5939 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5941 /* Unmute retasking pin widget output buffers since the default
5942 * state appears to be output. As the pin mode is changed by the
5943 * user the pin mode control will take care of enabling the pin's
5944 * input/output buffers as needed.
5946 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5947 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5948 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5949 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5950 {0x13, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5951 {0x12, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5952 /* Also unmute the mono-out pin widget */
5953 {0x11, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5955 /* Mute capture amp left and right */
5956 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5957 /* Set ADC connection select to match default mixer setting (mic1
5960 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x00},
5962 /* Do the same for the second ADC: mute capture input amp and
5963 * set ADC connection to mic1 pin
5965 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5966 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x00},
5968 /* Mute all inputs to mixer widget (even unconnected ones) */
5969 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)}, /* mic1 pin */
5970 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)}, /* mic2 pin */
5971 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)}, /* line1 pin */
5972 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)}, /* line2 pin */
5973 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)}, /* CD pin */
5974 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)}, /* Beep-gen pin */
5975 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)}, /* Line-out pin */
5976 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)}, /* HP-pin pin */
5982 #define alc260_pcm_analog_playback alc880_pcm_analog_alt_playback
5983 #define alc260_pcm_analog_capture alc880_pcm_analog_capture
5985 #define alc260_pcm_digital_playback alc880_pcm_digital_playback
5986 #define alc260_pcm_digital_capture alc880_pcm_digital_capture
5989 * for BIOS auto-configuration
5992 static int alc260_add_playback_controls(struct alc_spec
*spec
, hda_nid_t nid
,
5993 const char *pfx
, int *vol_bits
)
5996 unsigned long vol_val
, sw_val
;
5999 if (nid
>= 0x0f && nid
< 0x11) {
6000 nid_vol
= nid
- 0x7;
6001 vol_val
= HDA_COMPOSE_AMP_VAL(nid_vol
, 3, 0, HDA_OUTPUT
);
6002 sw_val
= HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_OUTPUT
);
6003 } else if (nid
== 0x11) {
6004 nid_vol
= nid
- 0x7;
6005 vol_val
= HDA_COMPOSE_AMP_VAL(nid_vol
, 2, 0, HDA_OUTPUT
);
6006 sw_val
= HDA_COMPOSE_AMP_VAL(nid
, 2, 0, HDA_OUTPUT
);
6007 } else if (nid
>= 0x12 && nid
<= 0x15) {
6009 vol_val
= HDA_COMPOSE_AMP_VAL(nid_vol
, 3, 0, HDA_OUTPUT
);
6010 sw_val
= HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_OUTPUT
);
6014 if (!(*vol_bits
& (1 << nid_vol
))) {
6015 /* first control for the volume widget */
6016 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, pfx
, vol_val
);
6019 *vol_bits
|= (1 << nid_vol
);
6021 err
= add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, pfx
, sw_val
);
6027 /* add playback controls from the parsed DAC table */
6028 static int alc260_auto_create_multi_out_ctls(struct alc_spec
*spec
,
6029 const struct auto_pin_cfg
*cfg
)
6035 spec
->multiout
.num_dacs
= 1;
6036 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
6037 spec
->multiout
.dac_nids
[0] = 0x02;
6039 nid
= cfg
->line_out_pins
[0];
6042 if (!cfg
->speaker_pins
[0] && !cfg
->hp_pins
[0])
6044 else if (cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
6048 err
= alc260_add_playback_controls(spec
, nid
, pfx
, &vols
);
6053 nid
= cfg
->speaker_pins
[0];
6055 err
= alc260_add_playback_controls(spec
, nid
, "Speaker", &vols
);
6060 nid
= cfg
->hp_pins
[0];
6062 err
= alc260_add_playback_controls(spec
, nid
, "Headphone",
6070 /* create playback/capture controls for input pins */
6071 static int alc260_auto_create_input_ctls(struct hda_codec
*codec
,
6072 const struct auto_pin_cfg
*cfg
)
6074 return alc_auto_create_input_ctls(codec
, cfg
, 0x07, 0x04, 0x05);
6077 static void alc260_auto_set_output_and_unmute(struct hda_codec
*codec
,
6078 hda_nid_t nid
, int pin_type
,
6081 alc_set_pin_output(codec
, nid
, pin_type
);
6082 /* need the manual connection? */
6084 int idx
= nid
- 0x12;
6085 snd_hda_codec_write(codec
, idx
+ 0x0b, 0,
6086 AC_VERB_SET_CONNECT_SEL
, sel_idx
);
6090 static void alc260_auto_init_multi_out(struct hda_codec
*codec
)
6092 struct alc_spec
*spec
= codec
->spec
;
6095 nid
= spec
->autocfg
.line_out_pins
[0];
6097 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
6098 alc260_auto_set_output_and_unmute(codec
, nid
, pin_type
, 0);
6101 nid
= spec
->autocfg
.speaker_pins
[0];
6103 alc260_auto_set_output_and_unmute(codec
, nid
, PIN_OUT
, 0);
6105 nid
= spec
->autocfg
.hp_pins
[0];
6107 alc260_auto_set_output_and_unmute(codec
, nid
, PIN_HP
, 0);
6110 #define ALC260_PIN_CD_NID 0x16
6111 static void alc260_auto_init_analog_input(struct hda_codec
*codec
)
6113 struct alc_spec
*spec
= codec
->spec
;
6116 for (i
= 0; i
< AUTO_PIN_LAST
; i
++) {
6117 hda_nid_t nid
= spec
->autocfg
.input_pins
[i
];
6119 alc_set_input_pin(codec
, nid
, i
);
6120 if (nid
!= ALC260_PIN_CD_NID
&&
6121 (get_wcaps(codec
, nid
) & AC_WCAP_OUT_AMP
))
6122 snd_hda_codec_write(codec
, nid
, 0,
6123 AC_VERB_SET_AMP_GAIN_MUTE
,
6130 * generic initialization of ADC, input mixers and output mixers
6132 static struct hda_verb alc260_volume_init_verbs
[] = {
6134 * Unmute ADC0-1 and set the default input to mic-in
6136 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x00},
6137 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6138 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x00},
6139 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6141 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
6143 * Note: PASD motherboards uses the Line In 2 as the input for
6144 * front panel mic (mic 2)
6146 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
6147 /* mute analog inputs */
6148 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6149 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6150 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
6151 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
6152 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
6155 * Set up output mixers (0x08 - 0x0a)
6157 /* set vol=0 to output mixers */
6158 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6159 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6160 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6161 /* set up input amps for analog loopback */
6162 /* Amp Indices: DAC = 0, mixer = 1 */
6163 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6164 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
6165 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6166 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
6167 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6168 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
6173 static int alc260_parse_auto_config(struct hda_codec
*codec
)
6175 struct alc_spec
*spec
= codec
->spec
;
6177 static hda_nid_t alc260_ignore
[] = { 0x17, 0 };
6179 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
6183 err
= alc260_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
6186 if (!spec
->kctls
.list
)
6187 return 0; /* can't find valid BIOS pin config */
6188 err
= alc260_auto_create_input_ctls(codec
, &spec
->autocfg
);
6192 spec
->multiout
.max_channels
= 2;
6194 if (spec
->autocfg
.dig_outs
)
6195 spec
->multiout
.dig_out_nid
= ALC260_DIGOUT_NID
;
6196 if (spec
->kctls
.list
)
6197 add_mixer(spec
, spec
->kctls
.list
);
6199 add_verb(spec
, alc260_volume_init_verbs
);
6201 spec
->num_mux_defs
= 1;
6202 spec
->input_mux
= &spec
->private_imux
[0];
6204 alc_ssid_check(codec
, 0x10, 0x15, 0x0f);
6209 /* additional initialization for auto-configuration model */
6210 static void alc260_auto_init(struct hda_codec
*codec
)
6212 struct alc_spec
*spec
= codec
->spec
;
6213 alc260_auto_init_multi_out(codec
);
6214 alc260_auto_init_analog_input(codec
);
6215 if (spec
->unsol_event
)
6216 alc_inithook(codec
);
6219 #ifdef CONFIG_SND_HDA_POWER_SAVE
6220 static struct hda_amp_list alc260_loopbacks
[] = {
6221 { 0x07, HDA_INPUT
, 0 },
6222 { 0x07, HDA_INPUT
, 1 },
6223 { 0x07, HDA_INPUT
, 2 },
6224 { 0x07, HDA_INPUT
, 3 },
6225 { 0x07, HDA_INPUT
, 4 },
6231 * ALC260 configurations
6233 static const char *alc260_models
[ALC260_MODEL_LAST
] = {
6234 [ALC260_BASIC
] = "basic",
6236 [ALC260_HP_3013
] = "hp-3013",
6237 [ALC260_HP_DC7600
] = "hp-dc7600",
6238 [ALC260_FUJITSU_S702X
] = "fujitsu",
6239 [ALC260_ACER
] = "acer",
6240 [ALC260_WILL
] = "will",
6241 [ALC260_REPLACER_672V
] = "replacer",
6242 [ALC260_FAVORIT100
] = "favorit100",
6243 #ifdef CONFIG_SND_DEBUG
6244 [ALC260_TEST
] = "test",
6246 [ALC260_AUTO
] = "auto",
6249 static struct snd_pci_quirk alc260_cfg_tbl
[] = {
6250 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_ACER
),
6251 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER
),
6252 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FAVORIT100
),
6253 SND_PCI_QUIRK(0x103c, 0x2808, "HP d5700", ALC260_HP_3013
),
6254 SND_PCI_QUIRK(0x103c, 0x280a, "HP d5750", ALC260_AUTO
), /* no quirk */
6255 SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013
),
6256 SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP_3013
),
6257 SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_DC7600
),
6258 SND_PCI_QUIRK(0x103c, 0x3013, "HP", ALC260_HP_3013
),
6259 SND_PCI_QUIRK(0x103c, 0x3014, "HP", ALC260_HP
),
6260 SND_PCI_QUIRK(0x103c, 0x3015, "HP", ALC260_HP
),
6261 SND_PCI_QUIRK(0x103c, 0x3016, "HP", ALC260_HP
),
6262 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_BASIC
),
6263 SND_PCI_QUIRK(0x104d, 0x81cc, "Sony VAIO", ALC260_BASIC
),
6264 SND_PCI_QUIRK(0x104d, 0x81cd, "Sony VAIO", ALC260_BASIC
),
6265 SND_PCI_QUIRK(0x10cf, 0x1326, "Fujitsu S702X", ALC260_FUJITSU_S702X
),
6266 SND_PCI_QUIRK(0x152d, 0x0729, "CTL U553W", ALC260_BASIC
),
6267 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_REPLACER_672V
),
6268 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_WILL
),
6272 static struct alc_config_preset alc260_presets
[] = {
6274 .mixers
= { alc260_base_output_mixer
,
6275 alc260_input_mixer
},
6276 .init_verbs
= { alc260_init_verbs
},
6277 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6278 .dac_nids
= alc260_dac_nids
,
6279 .num_adc_nids
= ARRAY_SIZE(alc260_dual_adc_nids
),
6280 .adc_nids
= alc260_adc_nids
,
6281 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6282 .channel_mode
= alc260_modes
,
6283 .input_mux
= &alc260_capture_source
,
6286 .mixers
= { alc260_hp_output_mixer
,
6287 alc260_input_mixer
},
6288 .init_verbs
= { alc260_init_verbs
,
6289 alc260_hp_unsol_verbs
},
6290 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6291 .dac_nids
= alc260_dac_nids
,
6292 .num_adc_nids
= ARRAY_SIZE(alc260_adc_nids_alt
),
6293 .adc_nids
= alc260_adc_nids_alt
,
6294 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6295 .channel_mode
= alc260_modes
,
6296 .input_mux
= &alc260_capture_source
,
6297 .unsol_event
= alc260_hp_unsol_event
,
6298 .init_hook
= alc260_hp_automute
,
6300 [ALC260_HP_DC7600
] = {
6301 .mixers
= { alc260_hp_dc7600_mixer
,
6302 alc260_input_mixer
},
6303 .init_verbs
= { alc260_init_verbs
,
6304 alc260_hp_dc7600_verbs
},
6305 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6306 .dac_nids
= alc260_dac_nids
,
6307 .num_adc_nids
= ARRAY_SIZE(alc260_adc_nids_alt
),
6308 .adc_nids
= alc260_adc_nids_alt
,
6309 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6310 .channel_mode
= alc260_modes
,
6311 .input_mux
= &alc260_capture_source
,
6312 .unsol_event
= alc260_hp_3012_unsol_event
,
6313 .init_hook
= alc260_hp_3012_automute
,
6315 [ALC260_HP_3013
] = {
6316 .mixers
= { alc260_hp_3013_mixer
,
6317 alc260_input_mixer
},
6318 .init_verbs
= { alc260_hp_3013_init_verbs
,
6319 alc260_hp_3013_unsol_verbs
},
6320 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6321 .dac_nids
= alc260_dac_nids
,
6322 .num_adc_nids
= ARRAY_SIZE(alc260_adc_nids_alt
),
6323 .adc_nids
= alc260_adc_nids_alt
,
6324 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6325 .channel_mode
= alc260_modes
,
6326 .input_mux
= &alc260_capture_source
,
6327 .unsol_event
= alc260_hp_3013_unsol_event
,
6328 .init_hook
= alc260_hp_3013_automute
,
6330 [ALC260_FUJITSU_S702X
] = {
6331 .mixers
= { alc260_fujitsu_mixer
},
6332 .init_verbs
= { alc260_fujitsu_init_verbs
},
6333 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6334 .dac_nids
= alc260_dac_nids
,
6335 .num_adc_nids
= ARRAY_SIZE(alc260_dual_adc_nids
),
6336 .adc_nids
= alc260_dual_adc_nids
,
6337 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6338 .channel_mode
= alc260_modes
,
6339 .num_mux_defs
= ARRAY_SIZE(alc260_fujitsu_capture_sources
),
6340 .input_mux
= alc260_fujitsu_capture_sources
,
6343 .mixers
= { alc260_acer_mixer
},
6344 .init_verbs
= { alc260_acer_init_verbs
},
6345 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6346 .dac_nids
= alc260_dac_nids
,
6347 .num_adc_nids
= ARRAY_SIZE(alc260_dual_adc_nids
),
6348 .adc_nids
= alc260_dual_adc_nids
,
6349 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6350 .channel_mode
= alc260_modes
,
6351 .num_mux_defs
= ARRAY_SIZE(alc260_acer_capture_sources
),
6352 .input_mux
= alc260_acer_capture_sources
,
6354 [ALC260_FAVORIT100
] = {
6355 .mixers
= { alc260_favorit100_mixer
},
6356 .init_verbs
= { alc260_favorit100_init_verbs
},
6357 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6358 .dac_nids
= alc260_dac_nids
,
6359 .num_adc_nids
= ARRAY_SIZE(alc260_dual_adc_nids
),
6360 .adc_nids
= alc260_dual_adc_nids
,
6361 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6362 .channel_mode
= alc260_modes
,
6363 .num_mux_defs
= ARRAY_SIZE(alc260_favorit100_capture_sources
),
6364 .input_mux
= alc260_favorit100_capture_sources
,
6367 .mixers
= { alc260_will_mixer
},
6368 .init_verbs
= { alc260_init_verbs
, alc260_will_verbs
},
6369 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6370 .dac_nids
= alc260_dac_nids
,
6371 .num_adc_nids
= ARRAY_SIZE(alc260_adc_nids
),
6372 .adc_nids
= alc260_adc_nids
,
6373 .dig_out_nid
= ALC260_DIGOUT_NID
,
6374 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6375 .channel_mode
= alc260_modes
,
6376 .input_mux
= &alc260_capture_source
,
6378 [ALC260_REPLACER_672V
] = {
6379 .mixers
= { alc260_replacer_672v_mixer
},
6380 .init_verbs
= { alc260_init_verbs
, alc260_replacer_672v_verbs
},
6381 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6382 .dac_nids
= alc260_dac_nids
,
6383 .num_adc_nids
= ARRAY_SIZE(alc260_adc_nids
),
6384 .adc_nids
= alc260_adc_nids
,
6385 .dig_out_nid
= ALC260_DIGOUT_NID
,
6386 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6387 .channel_mode
= alc260_modes
,
6388 .input_mux
= &alc260_capture_source
,
6389 .unsol_event
= alc260_replacer_672v_unsol_event
,
6390 .init_hook
= alc260_replacer_672v_automute
,
6392 #ifdef CONFIG_SND_DEBUG
6394 .mixers
= { alc260_test_mixer
},
6395 .init_verbs
= { alc260_test_init_verbs
},
6396 .num_dacs
= ARRAY_SIZE(alc260_test_dac_nids
),
6397 .dac_nids
= alc260_test_dac_nids
,
6398 .num_adc_nids
= ARRAY_SIZE(alc260_test_adc_nids
),
6399 .adc_nids
= alc260_test_adc_nids
,
6400 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6401 .channel_mode
= alc260_modes
,
6402 .num_mux_defs
= ARRAY_SIZE(alc260_test_capture_sources
),
6403 .input_mux
= alc260_test_capture_sources
,
6408 static int patch_alc260(struct hda_codec
*codec
)
6410 struct alc_spec
*spec
;
6411 int err
, board_config
;
6413 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
6419 board_config
= snd_hda_check_board_config(codec
, ALC260_MODEL_LAST
,
6422 if (board_config
< 0) {
6423 snd_printd(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
6425 board_config
= ALC260_AUTO
;
6428 if (board_config
== ALC260_AUTO
) {
6429 /* automatic parse from the BIOS config */
6430 err
= alc260_parse_auto_config(codec
);
6436 "hda_codec: Cannot set up configuration "
6437 "from BIOS. Using base mode...\n");
6438 board_config
= ALC260_BASIC
;
6442 err
= snd_hda_attach_beep_device(codec
, 0x1);
6448 if (board_config
!= ALC260_AUTO
)
6449 setup_preset(codec
, &alc260_presets
[board_config
]);
6451 spec
->stream_analog_playback
= &alc260_pcm_analog_playback
;
6452 spec
->stream_analog_capture
= &alc260_pcm_analog_capture
;
6454 spec
->stream_digital_playback
= &alc260_pcm_digital_playback
;
6455 spec
->stream_digital_capture
= &alc260_pcm_digital_capture
;
6457 if (!spec
->adc_nids
&& spec
->input_mux
) {
6458 /* check whether NID 0x04 is valid */
6459 unsigned int wcap
= get_wcaps(codec
, 0x04);
6460 wcap
= get_wcaps_type(wcap
);
6462 if (wcap
!= AC_WID_AUD_IN
|| spec
->input_mux
->num_items
== 1) {
6463 spec
->adc_nids
= alc260_adc_nids_alt
;
6464 spec
->num_adc_nids
= ARRAY_SIZE(alc260_adc_nids_alt
);
6466 spec
->adc_nids
= alc260_adc_nids
;
6467 spec
->num_adc_nids
= ARRAY_SIZE(alc260_adc_nids
);
6470 set_capture_mixer(codec
);
6471 set_beep_amp(spec
, 0x07, 0x05, HDA_INPUT
);
6473 spec
->vmaster_nid
= 0x08;
6475 codec
->patch_ops
= alc_patch_ops
;
6476 if (board_config
== ALC260_AUTO
)
6477 spec
->init_hook
= alc260_auto_init
;
6478 #ifdef CONFIG_SND_HDA_POWER_SAVE
6479 if (!spec
->loopback
.amplist
)
6480 spec
->loopback
.amplist
= alc260_loopbacks
;
6482 codec
->proc_widget_hook
= print_realtek_coef
;
6489 * ALC882/883/885/888/889 support
6491 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
6492 * configuration. Each pin widget can choose any input DACs and a mixer.
6493 * Each ADC is connected from a mixer of all inputs. This makes possible
6494 * 6-channel independent captures.
6496 * In addition, an independent DAC for the multi-playback (not used in this
6499 #define ALC882_DIGOUT_NID 0x06
6500 #define ALC882_DIGIN_NID 0x0a
6501 #define ALC883_DIGOUT_NID ALC882_DIGOUT_NID
6502 #define ALC883_DIGIN_NID ALC882_DIGIN_NID
6503 #define ALC1200_DIGOUT_NID 0x10
6506 static struct hda_channel_mode alc882_ch_modes
[1] = {
6511 static hda_nid_t alc882_dac_nids
[4] = {
6512 /* front, rear, clfe, rear_surr */
6513 0x02, 0x03, 0x04, 0x05
6515 #define alc883_dac_nids alc882_dac_nids
6518 #define alc882_adc_nids alc880_adc_nids
6519 #define alc882_adc_nids_alt alc880_adc_nids_alt
6520 #define alc883_adc_nids alc882_adc_nids_alt
6521 static hda_nid_t alc883_adc_nids_alt
[1] = { 0x08 };
6522 static hda_nid_t alc883_adc_nids_rev
[2] = { 0x09, 0x08 };
6523 #define alc889_adc_nids alc880_adc_nids
6525 static hda_nid_t alc882_capsrc_nids
[3] = { 0x24, 0x23, 0x22 };
6526 static hda_nid_t alc882_capsrc_nids_alt
[2] = { 0x23, 0x22 };
6527 #define alc883_capsrc_nids alc882_capsrc_nids_alt
6528 static hda_nid_t alc883_capsrc_nids_rev
[2] = { 0x22, 0x23 };
6529 #define alc889_capsrc_nids alc882_capsrc_nids
6532 /* FIXME: should be a matrix-type input source selection */
6534 static struct hda_input_mux alc882_capture_source
= {
6538 { "Front Mic", 0x1 },
6544 #define alc883_capture_source alc882_capture_source
6546 static struct hda_input_mux alc889_capture_source
= {
6549 { "Front Mic", 0x0 },
6555 static struct hda_input_mux mb5_capture_source
= {
6564 static struct hda_input_mux alc883_3stack_6ch_intel
= {
6568 { "Front Mic", 0x0 },
6574 static struct hda_input_mux alc883_lenovo_101e_capture_source
= {
6582 static struct hda_input_mux alc883_lenovo_nb0763_capture_source
= {
6592 static struct hda_input_mux alc883_fujitsu_pi2515_capture_source
= {
6600 static struct hda_input_mux alc883_lenovo_sky_capture_source
= {
6604 { "Front Mic", 0x1 },
6609 static struct hda_input_mux alc883_asus_eee1601_capture_source
= {
6617 static struct hda_input_mux alc889A_mb31_capture_source
= {
6621 /* Front Mic (0x01) unused */
6623 /* Line 2 (0x03) unused */
6624 /* CD (0x04) unsused? */
6631 static struct hda_channel_mode alc883_3ST_2ch_modes
[1] = {
6638 static struct hda_verb alc882_3ST_ch2_init
[] = {
6639 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6640 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6641 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6642 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6649 static struct hda_verb alc882_3ST_ch4_init
[] = {
6650 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6651 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6652 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6653 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6654 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6661 static struct hda_verb alc882_3ST_ch6_init
[] = {
6662 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6663 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6664 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
6665 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6666 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6667 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6671 static struct hda_channel_mode alc882_3ST_6ch_modes
[3] = {
6672 { 2, alc882_3ST_ch2_init
},
6673 { 4, alc882_3ST_ch4_init
},
6674 { 6, alc882_3ST_ch6_init
},
6677 #define alc883_3ST_6ch_modes alc882_3ST_6ch_modes
6682 static struct hda_verb alc883_3ST_ch2_clevo_init
[] = {
6683 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
6684 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6685 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6686 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6687 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6694 static struct hda_verb alc883_3ST_ch4_clevo_init
[] = {
6695 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6696 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6697 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6698 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6699 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6700 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6707 static struct hda_verb alc883_3ST_ch6_clevo_init
[] = {
6708 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6709 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6710 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6711 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
6712 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6713 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6714 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6718 static struct hda_channel_mode alc883_3ST_6ch_clevo_modes
[3] = {
6719 { 2, alc883_3ST_ch2_clevo_init
},
6720 { 4, alc883_3ST_ch4_clevo_init
},
6721 { 6, alc883_3ST_ch6_clevo_init
},
6728 static struct hda_verb alc882_sixstack_ch6_init
[] = {
6729 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
6730 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6731 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6732 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6739 static struct hda_verb alc882_sixstack_ch8_init
[] = {
6740 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6741 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6742 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6743 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6747 static struct hda_channel_mode alc882_sixstack_modes
[2] = {
6748 { 6, alc882_sixstack_ch6_init
},
6749 { 8, alc882_sixstack_ch8_init
},
6753 * macbook pro ALC885 can switch LineIn to LineOut without losing Mic
6759 static struct hda_verb alc885_mbp_ch2_init
[] = {
6760 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6761 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6762 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6769 static struct hda_verb alc885_mbp_ch4_init
[] = {
6770 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6771 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6772 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6773 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6774 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
6778 static struct hda_channel_mode alc885_mbp_4ch_modes
[2] = {
6779 { 2, alc885_mbp_ch2_init
},
6780 { 4, alc885_mbp_ch4_init
},
6785 * Speakers/Woofer/HP = Front
6788 static struct hda_verb alc885_mb5_ch2_init
[] = {
6789 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6790 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6796 * Speakers/HP = Front
6800 static struct hda_verb alc885_mb5_ch6_init
[] = {
6801 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6802 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6803 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
6807 static struct hda_channel_mode alc885_mb5_6ch_modes
[2] = {
6808 { 2, alc885_mb5_ch2_init
},
6809 { 6, alc885_mb5_ch6_init
},
6816 static struct hda_verb alc883_4ST_ch2_init
[] = {
6817 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6818 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6819 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6820 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6821 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6822 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6829 static struct hda_verb alc883_4ST_ch4_init
[] = {
6830 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6831 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6832 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6833 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6834 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6835 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6836 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6843 static struct hda_verb alc883_4ST_ch6_init
[] = {
6844 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6845 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6846 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6847 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6848 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
6849 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6850 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6851 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6858 static struct hda_verb alc883_4ST_ch8_init
[] = {
6859 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6860 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6861 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x03 },
6862 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6863 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6864 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
6865 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6866 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6867 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6871 static struct hda_channel_mode alc883_4ST_8ch_modes
[4] = {
6872 { 2, alc883_4ST_ch2_init
},
6873 { 4, alc883_4ST_ch4_init
},
6874 { 6, alc883_4ST_ch6_init
},
6875 { 8, alc883_4ST_ch8_init
},
6882 static struct hda_verb alc883_3ST_ch2_intel_init
[] = {
6883 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6884 { 0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6885 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6886 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6893 static struct hda_verb alc883_3ST_ch4_intel_init
[] = {
6894 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6895 { 0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6896 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6897 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6898 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6905 static struct hda_verb alc883_3ST_ch6_intel_init
[] = {
6906 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6907 { 0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6908 { 0x19, AC_VERB_SET_CONNECT_SEL
, 0x02 },
6909 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6910 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6911 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6915 static struct hda_channel_mode alc883_3ST_6ch_intel_modes
[3] = {
6916 { 2, alc883_3ST_ch2_intel_init
},
6917 { 4, alc883_3ST_ch4_intel_init
},
6918 { 6, alc883_3ST_ch6_intel_init
},
6924 static struct hda_verb alc889_ch2_intel_init
[] = {
6925 { 0x14, AC_VERB_SET_CONNECT_SEL
, 0x00 },
6926 { 0x19, AC_VERB_SET_CONNECT_SEL
, 0x00 },
6927 { 0x16, AC_VERB_SET_CONNECT_SEL
, 0x00 },
6928 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x00 },
6929 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6930 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6937 static struct hda_verb alc889_ch6_intel_init
[] = {
6938 { 0x14, AC_VERB_SET_CONNECT_SEL
, 0x00 },
6939 { 0x19, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6940 { 0x16, AC_VERB_SET_CONNECT_SEL
, 0x02 },
6941 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x03 },
6942 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6943 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6950 static struct hda_verb alc889_ch8_intel_init
[] = {
6951 { 0x14, AC_VERB_SET_CONNECT_SEL
, 0x00 },
6952 { 0x19, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6953 { 0x16, AC_VERB_SET_CONNECT_SEL
, 0x02 },
6954 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x03 },
6955 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x03 },
6956 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6957 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6961 static struct hda_channel_mode alc889_8ch_intel_modes
[3] = {
6962 { 2, alc889_ch2_intel_init
},
6963 { 6, alc889_ch6_intel_init
},
6964 { 8, alc889_ch8_intel_init
},
6970 static struct hda_verb alc883_sixstack_ch6_init
[] = {
6971 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
6972 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6973 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6974 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6981 static struct hda_verb alc883_sixstack_ch8_init
[] = {
6982 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6983 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6984 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6985 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6989 static struct hda_channel_mode alc883_sixstack_modes
[2] = {
6990 { 6, alc883_sixstack_ch6_init
},
6991 { 8, alc883_sixstack_ch8_init
},
6995 /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
6996 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
6998 static struct snd_kcontrol_new alc882_base_mixer
[] = {
6999 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7000 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7001 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7002 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
7003 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
7004 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
7005 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
7006 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
7007 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
7008 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
7009 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7010 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7011 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7012 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7013 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7014 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7015 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7016 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7017 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7018 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
7019 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7023 static struct snd_kcontrol_new alc885_mbp3_mixer
[] = {
7024 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT
),
7025 HDA_BIND_MUTE ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT
),
7026 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0e, 0x00, HDA_OUTPUT
),
7027 HDA_BIND_MUTE ("Headphone Playback Switch", 0x0e, 0x02, HDA_INPUT
),
7028 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT
),
7029 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7030 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7031 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT
),
7032 HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT
),
7033 HDA_CODEC_VOLUME("Line Boost", 0x1a, 0x00, HDA_INPUT
),
7034 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0x00, HDA_INPUT
),
7038 static struct snd_kcontrol_new alc885_mb5_mixer
[] = {
7039 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT
),
7040 HDA_BIND_MUTE ("Front Playback Switch", 0x0c, 0x02, HDA_INPUT
),
7041 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT
),
7042 HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT
),
7043 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT
),
7044 HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT
),
7045 HDA_CODEC_VOLUME("HP Playback Volume", 0x0f, 0x00, HDA_OUTPUT
),
7046 HDA_BIND_MUTE ("HP Playback Switch", 0x0f, 0x02, HDA_INPUT
),
7047 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7048 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7049 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
7050 HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
7051 HDA_CODEC_VOLUME("Line Boost", 0x15, 0x00, HDA_INPUT
),
7052 HDA_CODEC_VOLUME("Mic Boost", 0x19, 0x00, HDA_INPUT
),
7056 static struct snd_kcontrol_new alc882_w2jc_mixer
[] = {
7057 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7058 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7059 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7060 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7061 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7062 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7063 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7064 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7065 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7069 static struct snd_kcontrol_new alc882_targa_mixer
[] = {
7070 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7071 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7072 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7073 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7074 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7075 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7076 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7077 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7078 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7079 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7080 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7081 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7082 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
7086 /* Pin assignment: Front=0x14, HP = 0x15, Front = 0x16, ???
7087 * Front Mic=0x18, Line In = 0x1a, Line In = 0x1b, CD = 0x1c
7089 static struct snd_kcontrol_new alc882_asus_a7j_mixer
[] = {
7090 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7091 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
7092 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
7093 HDA_CODEC_MUTE("Mobile Front Playback Switch", 0x16, 0x0, HDA_OUTPUT
),
7094 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7095 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7096 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7097 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7098 HDA_CODEC_VOLUME("Mobile Line Playback Volume", 0x0b, 0x03, HDA_INPUT
),
7099 HDA_CODEC_MUTE("Mobile Line Playback Switch", 0x0b, 0x03, HDA_INPUT
),
7100 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7101 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7102 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7106 static struct snd_kcontrol_new alc882_asus_a7m_mixer
[] = {
7107 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7108 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7109 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
7110 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7111 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7112 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7113 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7114 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7115 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7116 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7120 static struct snd_kcontrol_new alc882_chmode_mixer
[] = {
7122 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
7123 .name
= "Channel Mode",
7124 .info
= alc_ch_mode_info
,
7125 .get
= alc_ch_mode_get
,
7126 .put
= alc_ch_mode_put
,
7131 static struct hda_verb alc882_base_init_verbs
[] = {
7132 /* Front mixer: unmute input/output amp left and right (volume = 0) */
7133 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7134 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7135 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7137 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7138 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7139 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7141 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7142 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7143 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7145 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7146 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7147 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7149 /* mute analog input loopbacks */
7150 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7151 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7152 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7153 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7154 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7156 /* Front Pin: output 0 (0x0c) */
7157 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7158 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7159 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
7160 /* Rear Pin: output 1 (0x0d) */
7161 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7162 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7163 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
7164 /* CLFE Pin: output 2 (0x0e) */
7165 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7166 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7167 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x02},
7168 /* Side Pin: output 3 (0x0f) */
7169 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7170 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7171 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
7172 /* Mic (rear) pin: input vref at 80% */
7173 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7174 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7175 /* Front Mic pin: input vref at 80% */
7176 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7177 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7178 /* Line In pin: input */
7179 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7180 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7181 /* Line-2 In: Headphone output (output 0 - 0x0c) */
7182 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7183 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7184 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
7185 /* CD pin widget for input */
7186 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7188 /* FIXME: use matrix-type input source selection */
7189 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
7191 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7192 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7193 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7194 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7196 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7197 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7198 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7199 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7200 /* ADC2: mute amp left and right */
7201 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7202 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
7203 /* ADC3: mute amp left and right */
7204 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7205 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
7210 static struct hda_verb alc882_adc1_init_verbs
[] = {
7211 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
7212 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7213 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7214 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7215 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7216 /* ADC1: mute amp left and right */
7217 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7218 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
7222 static struct hda_verb alc882_eapd_verbs
[] = {
7223 /* change to EAPD mode */
7224 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
7225 {0x20, AC_VERB_SET_PROC_COEF
, 0x3060},
7229 static struct hda_verb alc889_eapd_verbs
[] = {
7230 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
7231 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
7235 static struct hda_verb alc_hp15_unsol_verbs
[] = {
7236 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
7237 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7241 static struct hda_verb alc885_init_verbs
[] = {
7242 /* Front mixer: unmute input/output amp left and right (volume = 0) */
7243 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7244 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7245 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7247 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7248 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7249 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7251 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7252 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7253 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7255 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7256 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7257 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7259 /* mute analog input loopbacks */
7260 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7261 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7262 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7264 /* Front HP Pin: output 0 (0x0c) */
7265 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7266 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7267 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
7268 /* Front Pin: output 0 (0x0c) */
7269 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7270 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7271 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
7272 /* Rear Pin: output 1 (0x0d) */
7273 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7274 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7275 {0x19, AC_VERB_SET_CONNECT_SEL
, 0x01},
7276 /* CLFE Pin: output 2 (0x0e) */
7277 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7278 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7279 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x02},
7280 /* Side Pin: output 3 (0x0f) */
7281 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7282 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7283 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
7284 /* Mic (rear) pin: input vref at 80% */
7285 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7286 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7287 /* Front Mic pin: input vref at 80% */
7288 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7289 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7290 /* Line In pin: input */
7291 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7292 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7294 /* Mixer elements: 0x18, , 0x1a, 0x1b */
7296 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
7297 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7298 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7300 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7301 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7302 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7304 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
7305 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7306 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7307 /* ADC2: mute amp left and right */
7308 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7309 /* ADC3: mute amp left and right */
7310 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7315 static struct hda_verb alc885_init_input_verbs
[] = {
7316 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7317 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
7318 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
7323 /* Unmute Selector 24h and set the default input to front mic */
7324 static struct hda_verb alc889_init_input_verbs
[] = {
7325 {0x24, AC_VERB_SET_CONNECT_SEL
, 0x00},
7326 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7331 #define alc883_init_verbs alc882_base_init_verbs
7334 static struct snd_kcontrol_new alc882_macpro_mixer
[] = {
7335 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7336 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7337 HDA_CODEC_MUTE("Headphone Playback Switch", 0x18, 0x0, HDA_OUTPUT
),
7338 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT
),
7339 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT
),
7340 /* FIXME: this looks suspicious...
7341 HDA_CODEC_VOLUME("Beep Playback Volume", 0x0b, 0x02, HDA_INPUT),
7342 HDA_CODEC_MUTE("Beep Playback Switch", 0x0b, 0x02, HDA_INPUT),
7347 static struct hda_verb alc882_macpro_init_verbs
[] = {
7348 /* Front mixer: unmute input/output amp left and right (volume = 0) */
7349 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7350 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7351 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7352 /* Front Pin: output 0 (0x0c) */
7353 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7354 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7355 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
7356 /* Front Mic pin: input vref at 80% */
7357 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7358 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7359 /* Speaker: output */
7360 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7361 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7362 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x04},
7363 /* Headphone output (output 0 - 0x0c) */
7364 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7365 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7366 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x00},
7368 /* FIXME: use matrix-type input source selection */
7369 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
7370 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
7371 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7372 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7373 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7374 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7376 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7377 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7378 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7379 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7381 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7382 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7383 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7384 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7385 /* ADC1: mute amp left and right */
7386 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7387 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
7388 /* ADC2: mute amp left and right */
7389 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7390 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
7391 /* ADC3: mute amp left and right */
7392 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7393 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
7399 static struct hda_verb alc885_mb5_init_verbs
[] = {
7401 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7402 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7403 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7404 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7406 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7407 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7408 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7409 /* Surround mixer */
7410 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7411 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7412 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7414 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7415 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7416 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7418 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7419 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7420 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7421 /* Front Pin (0x0c) */
7422 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
| 0x01},
7423 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7424 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x00},
7425 /* LFE Pin (0x0e) */
7426 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
| 0x01},
7427 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7428 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x02},
7430 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7431 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7432 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x03},
7433 /* Front Mic pin: input vref at 80% */
7434 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7435 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7437 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7438 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7440 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7441 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7442 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7443 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7447 /* Macbook Pro rev3 */
7448 static struct hda_verb alc885_mbp3_init_verbs
[] = {
7449 /* Front mixer: unmute input/output amp left and right (volume = 0) */
7450 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7451 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7452 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7454 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7455 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7456 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7458 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7459 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7460 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7461 /* Front Pin: output 0 (0x0c) */
7462 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7463 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7464 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
7465 /* HP Pin: output 0 (0x0e) */
7466 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc4},
7467 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7468 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x02},
7469 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
7470 /* Mic (rear) pin: input vref at 80% */
7471 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7472 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7473 /* Front Mic pin: input vref at 80% */
7474 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7475 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7476 /* Line In pin: use output 1 when in LineOut mode */
7477 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7478 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7479 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01},
7481 /* FIXME: use matrix-type input source selection */
7482 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
7483 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
7484 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7485 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7486 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7487 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7489 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7490 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7491 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7492 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7494 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7495 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7496 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7497 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7498 /* ADC1: mute amp left and right */
7499 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7500 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
7501 /* ADC2: mute amp left and right */
7502 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7503 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
7504 /* ADC3: mute amp left and right */
7505 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7506 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
7511 /* iMac 24 mixer. */
7512 static struct snd_kcontrol_new alc885_imac24_mixer
[] = {
7513 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x00, HDA_OUTPUT
),
7514 HDA_CODEC_MUTE("Master Playback Switch", 0x0c, 0x00, HDA_INPUT
),
7518 /* iMac 24 init verbs. */
7519 static struct hda_verb alc885_imac24_init_verbs
[] = {
7520 /* Internal speakers: output 0 (0x0c) */
7521 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7522 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7523 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x00},
7524 /* Internal speakers: output 0 (0x0c) */
7525 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7526 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7527 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x00},
7528 /* Headphone: output 0 (0x0c) */
7529 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7530 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7531 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
7532 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
7533 /* Front Mic: input vref at 80% */
7534 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7535 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7539 /* Toggle speaker-output according to the hp-jack state */
7540 static void alc885_imac24_setup(struct hda_codec
*codec
)
7542 struct alc_spec
*spec
= codec
->spec
;
7544 spec
->autocfg
.hp_pins
[0] = 0x14;
7545 spec
->autocfg
.speaker_pins
[0] = 0x18;
7546 spec
->autocfg
.speaker_pins
[1] = 0x1a;
7549 static void alc885_mbp3_setup(struct hda_codec
*codec
)
7551 struct alc_spec
*spec
= codec
->spec
;
7553 spec
->autocfg
.hp_pins
[0] = 0x15;
7554 spec
->autocfg
.speaker_pins
[0] = 0x14;
7558 static struct hda_verb alc882_targa_verbs
[] = {
7559 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7560 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7562 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7563 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7565 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* mic/clfe */
7566 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* line/surround */
7567 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
7569 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
7573 /* toggle speaker-output according to the hp-jack state */
7574 static void alc882_targa_automute(struct hda_codec
*codec
)
7576 struct alc_spec
*spec
= codec
->spec
;
7577 alc_automute_amp(codec
);
7578 snd_hda_codec_write_cache(codec
, 1, 0, AC_VERB_SET_GPIO_DATA
,
7579 spec
->jack_present
? 1 : 3);
7582 static void alc882_targa_setup(struct hda_codec
*codec
)
7584 struct alc_spec
*spec
= codec
->spec
;
7586 spec
->autocfg
.hp_pins
[0] = 0x14;
7587 spec
->autocfg
.speaker_pins
[0] = 0x1b;
7590 static void alc882_targa_unsol_event(struct hda_codec
*codec
, unsigned int res
)
7592 if ((res
>> 26) == ALC880_HP_EVENT
)
7593 alc882_targa_automute(codec
);
7596 static struct hda_verb alc882_asus_a7j_verbs
[] = {
7597 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7598 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7600 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7601 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7602 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7604 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Front */
7605 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
7606 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Front */
7608 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* mic/clfe */
7609 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* line/surround */
7610 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
7614 static struct hda_verb alc882_asus_a7m_verbs
[] = {
7615 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7616 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7618 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7619 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7620 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7622 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Front */
7623 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
7624 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Front */
7626 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* mic/clfe */
7627 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* line/surround */
7628 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
7632 static void alc882_gpio_mute(struct hda_codec
*codec
, int pin
, int muted
)
7634 unsigned int gpiostate
, gpiomask
, gpiodir
;
7636 gpiostate
= snd_hda_codec_read(codec
, codec
->afg
, 0,
7637 AC_VERB_GET_GPIO_DATA
, 0);
7640 gpiostate
|= (1 << pin
);
7642 gpiostate
&= ~(1 << pin
);
7644 gpiomask
= snd_hda_codec_read(codec
, codec
->afg
, 0,
7645 AC_VERB_GET_GPIO_MASK
, 0);
7646 gpiomask
|= (1 << pin
);
7648 gpiodir
= snd_hda_codec_read(codec
, codec
->afg
, 0,
7649 AC_VERB_GET_GPIO_DIRECTION
, 0);
7650 gpiodir
|= (1 << pin
);
7653 snd_hda_codec_write(codec
, codec
->afg
, 0,
7654 AC_VERB_SET_GPIO_MASK
, gpiomask
);
7655 snd_hda_codec_write(codec
, codec
->afg
, 0,
7656 AC_VERB_SET_GPIO_DIRECTION
, gpiodir
);
7660 snd_hda_codec_write(codec
, codec
->afg
, 0,
7661 AC_VERB_SET_GPIO_DATA
, gpiostate
);
7664 /* set up GPIO at initialization */
7665 static void alc885_macpro_init_hook(struct hda_codec
*codec
)
7667 alc882_gpio_mute(codec
, 0, 0);
7668 alc882_gpio_mute(codec
, 1, 0);
7671 /* set up GPIO and update auto-muting at initialization */
7672 static void alc885_imac24_init_hook(struct hda_codec
*codec
)
7674 alc885_macpro_init_hook(codec
);
7675 alc_automute_amp(codec
);
7679 * generic initialization of ADC, input mixers and output mixers
7681 static struct hda_verb alc883_auto_init_verbs
[] = {
7683 * Unmute ADC0-2 and set the default input to mic-in
7685 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
7686 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7687 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
7688 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7690 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
7692 * Note: PASD motherboards uses the Line In 2 as the input for
7693 * front panel mic (mic 2)
7695 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
7696 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7697 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7698 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7699 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7700 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7703 * Set up output mixers (0x0c - 0x0f)
7705 /* set vol=0 to output mixers */
7706 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7707 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7708 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7709 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7710 /* set up input amps for analog loopback */
7711 /* Amp Indices: DAC = 0, mixer = 1 */
7712 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7713 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7714 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7715 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7716 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7717 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7718 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7719 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7720 {0x26, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7721 {0x26, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7723 /* FIXME: use matrix-type input source selection */
7724 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
7726 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
7727 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
7728 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
7729 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
7731 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
7732 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
7733 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
7734 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
7739 /* 2ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:front) */
7740 static struct hda_verb alc889A_mb31_ch2_init
[] = {
7741 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP as front */
7742 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Subwoofer on */
7743 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* Line as input */
7744 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
}, /* Line off */
7748 /* 4ch mode (Speaker:front, Subwoofer:CLFE, Line:CLFE, Headphones:front) */
7749 static struct hda_verb alc889A_mb31_ch4_init
[] = {
7750 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP as front */
7751 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Subwoofer on */
7752 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
}, /* Line as output */
7753 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Line on */
7757 /* 5ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:rear) */
7758 static struct hda_verb alc889A_mb31_ch5_init
[] = {
7759 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* HP as rear */
7760 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Subwoofer on */
7761 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* Line as input */
7762 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
}, /* Line off */
7766 /* 6ch mode (Speaker:front, Subwoofer:off, Line:CLFE, Headphones:Rear) */
7767 static struct hda_verb alc889A_mb31_ch6_init
[] = {
7768 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* HP as front */
7769 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
}, /* Subwoofer off */
7770 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
}, /* Line as output */
7771 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Line on */
7775 static struct hda_channel_mode alc889A_mb31_6ch_modes
[4] = {
7776 { 2, alc889A_mb31_ch2_init
},
7777 { 4, alc889A_mb31_ch4_init
},
7778 { 5, alc889A_mb31_ch5_init
},
7779 { 6, alc889A_mb31_ch6_init
},
7782 static struct hda_verb alc883_medion_eapd_verbs
[] = {
7783 /* eanable EAPD on medion laptop */
7784 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
7785 {0x20, AC_VERB_SET_PROC_COEF
, 0x3070},
7789 #define alc883_base_mixer alc882_base_mixer
7791 static struct snd_kcontrol_new alc883_mitac_mixer
[] = {
7792 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7793 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7794 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
7795 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
7796 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
7797 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
7798 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
7799 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7800 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7801 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7802 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7803 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
7804 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7808 static struct snd_kcontrol_new alc883_clevo_m720_mixer
[] = {
7809 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7810 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
7811 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7812 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
7813 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7814 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7815 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7816 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7817 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
7818 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7822 static struct snd_kcontrol_new alc883_2ch_fujitsu_pi2515_mixer
[] = {
7823 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7824 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
7825 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7826 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
7827 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7828 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7829 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7830 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7831 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
7832 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7836 static struct snd_kcontrol_new alc883_3ST_2ch_mixer
[] = {
7837 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7838 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7839 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7840 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7841 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7842 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7843 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7844 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7845 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7846 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7847 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7848 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
7849 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7853 static struct snd_kcontrol_new alc883_3ST_6ch_mixer
[] = {
7854 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7855 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7856 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7857 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
7858 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
7859 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
7860 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
7861 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
7862 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7863 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7864 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7865 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7866 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7867 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7868 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7869 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7870 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7871 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
7872 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7876 static struct snd_kcontrol_new alc883_3ST_6ch_intel_mixer
[] = {
7877 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7878 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7879 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7880 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
7881 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
7883 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
7884 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
7885 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
7886 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
7887 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7888 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7889 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7890 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7891 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7892 HDA_CODEC_VOLUME("Mic Boost", 0x19, 0, HDA_INPUT
),
7893 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7894 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7895 HDA_CODEC_VOLUME("Front Mic Boost", 0x18, 0, HDA_INPUT
),
7896 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7900 static struct snd_kcontrol_new alc885_8ch_intel_mixer
[] = {
7901 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7902 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7903 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7904 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
7905 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
7907 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
7908 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
7909 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
7910 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
7911 HDA_BIND_MUTE("Speaker Playback Switch", 0x0f, 2, HDA_INPUT
),
7912 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
7913 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7914 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7915 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x3, HDA_INPUT
),
7916 HDA_CODEC_VOLUME("Mic Boost", 0x1b, 0, HDA_INPUT
),
7917 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x3, HDA_INPUT
),
7918 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7919 HDA_CODEC_VOLUME("Front Mic Boost", 0x18, 0, HDA_INPUT
),
7920 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7924 static struct snd_kcontrol_new alc883_fivestack_mixer
[] = {
7925 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7926 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7927 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7928 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
7929 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
7930 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
7931 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
7932 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
7933 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7934 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7935 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7936 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7937 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7938 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7939 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7940 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7941 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7942 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
7943 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7947 static struct snd_kcontrol_new alc883_targa_mixer
[] = {
7948 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7949 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7950 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
7951 HDA_CODEC_MUTE("Speaker Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7952 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7953 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
7954 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
7955 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
7956 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
7957 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
7958 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7959 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7960 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7961 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7962 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7963 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7964 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7968 static struct snd_kcontrol_new alc883_targa_2ch_mixer
[] = {
7969 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7970 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7971 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
7972 HDA_CODEC_MUTE("Speaker Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7973 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7974 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7975 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7976 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7977 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7978 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7979 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
7980 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7984 static struct snd_kcontrol_new alc883_targa_8ch_mixer
[] = {
7985 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
7986 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
7987 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7988 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
7989 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7993 static struct snd_kcontrol_new alc883_lenovo_101e_2ch_mixer
[] = {
7994 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7995 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7996 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7997 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
7998 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7999 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
8000 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
8001 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
8005 static struct snd_kcontrol_new alc883_lenovo_nb0763_mixer
[] = {
8006 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8007 HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 2, HDA_INPUT
),
8008 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
8009 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8010 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8011 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8012 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8013 HDA_CODEC_VOLUME("iMic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
8014 HDA_CODEC_MUTE("iMic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
8018 static struct snd_kcontrol_new alc883_medion_md2_mixer
[] = {
8019 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8020 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
8021 HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
8022 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8023 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8024 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8025 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8026 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8027 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8031 static struct snd_kcontrol_new alc883_acer_aspire_mixer
[] = {
8032 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8033 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8034 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
8035 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8036 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8037 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8038 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
8039 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8043 static struct snd_kcontrol_new alc888_acer_aspire_6530_mixer
[] = {
8044 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8045 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8046 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
8047 HDA_BIND_MUTE("LFE Playback Switch", 0x0f, 2, HDA_INPUT
),
8048 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8049 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8050 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8051 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8052 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8053 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
8054 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8058 static struct snd_kcontrol_new alc888_lenovo_sky_mixer
[] = {
8059 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8060 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8061 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0e, 0x0, HDA_OUTPUT
),
8062 HDA_BIND_MUTE("Surround Playback Switch", 0x0e, 2, HDA_INPUT
),
8063 HDA_CODEC_VOLUME_MONO("Center Playback Volume",
8064 0x0d, 1, 0x0, HDA_OUTPUT
),
8065 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT
),
8066 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT
),
8067 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT
),
8068 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
8069 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
8070 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8071 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8072 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8073 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8074 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8075 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
8076 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8077 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
8078 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
8079 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
8083 static struct snd_kcontrol_new alc889A_mb31_mixer
[] = {
8085 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT
),
8086 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 0x02, HDA_INPUT
),
8087 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT
),
8088 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT
),
8089 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x00,
8091 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x02, HDA_INPUT
),
8092 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x00, HDA_OUTPUT
),
8093 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x02, HDA_INPUT
),
8094 /* Output switches */
8095 HDA_CODEC_MUTE("Enable Speaker", 0x14, 0x00, HDA_OUTPUT
),
8096 HDA_CODEC_MUTE("Enable Headphones", 0x15, 0x00, HDA_OUTPUT
),
8097 HDA_CODEC_MUTE_MONO("Enable LFE", 0x16, 2, 0x00, HDA_OUTPUT
),
8099 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0x00, HDA_INPUT
),
8100 HDA_CODEC_VOLUME("Line Boost", 0x1a, 0x00, HDA_INPUT
),
8102 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT
),
8103 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT
),
8104 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8105 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8109 static struct snd_kcontrol_new alc883_vaiott_mixer
[] = {
8110 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8111 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8112 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
8113 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
8114 HDA_CODEC_VOLUME("Mic Boost", 0x19, 0, HDA_INPUT
),
8115 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
8119 static struct hda_bind_ctls alc883_bind_cap_vol
= {
8120 .ops
= &snd_hda_bind_vol
,
8122 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT
),
8123 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT
),
8128 static struct hda_bind_ctls alc883_bind_cap_switch
= {
8129 .ops
= &snd_hda_bind_sw
,
8131 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT
),
8132 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT
),
8137 static struct snd_kcontrol_new alc883_asus_eee1601_mixer
[] = {
8138 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8139 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8140 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
8141 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8142 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8143 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8144 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
8145 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8149 static struct snd_kcontrol_new alc883_asus_eee1601_cap_mixer
[] = {
8150 HDA_BIND_VOL("Capture Volume", &alc883_bind_cap_vol
),
8151 HDA_BIND_SW("Capture Switch", &alc883_bind_cap_switch
),
8153 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
8154 /* .name = "Capture Source", */
8155 .name
= "Input Source",
8157 .info
= alc_mux_enum_info
,
8158 .get
= alc_mux_enum_get
,
8159 .put
= alc_mux_enum_put
,
8164 static struct snd_kcontrol_new alc883_chmode_mixer
[] = {
8166 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
8167 .name
= "Channel Mode",
8168 .info
= alc_ch_mode_info
,
8169 .get
= alc_ch_mode_get
,
8170 .put
= alc_ch_mode_put
,
8175 /* toggle speaker-output according to the hp-jack state */
8176 static void alc883_mitac_setup(struct hda_codec
*codec
)
8178 struct alc_spec
*spec
= codec
->spec
;
8180 spec
->autocfg
.hp_pins
[0] = 0x15;
8181 spec
->autocfg
.speaker_pins
[0] = 0x14;
8182 spec
->autocfg
.speaker_pins
[1] = 0x17;
8185 /* auto-toggle front mic */
8187 static void alc883_mitac_mic_automute(struct hda_codec *codec)
8189 unsigned int present;
8192 present = snd_hda_codec_read(codec, 0x18, 0,
8193 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
8194 bits = present ? HDA_AMP_MUTE : 0;
8195 snd_hda_codec_amp_stereo(codec, 0x0b, HDA_INPUT, 1, HDA_AMP_MUTE, bits);
8199 static struct hda_verb alc883_mitac_verbs
[] = {
8201 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8202 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8204 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x02},
8205 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8207 /* enable unsolicited event */
8208 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8209 /* {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_MIC_EVENT | AC_USRSP_EN}, */
8214 static struct hda_verb alc883_clevo_m540r_verbs
[] = {
8216 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8217 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8219 /*{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},*/
8221 /* enable unsolicited event */
8223 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8224 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_MIC_EVENT | AC_USRSP_EN},
8230 static struct hda_verb alc883_clevo_m720_verbs
[] = {
8232 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8233 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8235 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x01},
8236 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8238 /* enable unsolicited event */
8239 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8240 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_MIC_EVENT
| AC_USRSP_EN
},
8245 static struct hda_verb alc883_2ch_fujitsu_pi2515_verbs
[] = {
8247 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
8248 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8250 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
8251 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8253 /* enable unsolicited event */
8254 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8259 static struct hda_verb alc883_targa_verbs
[] = {
8260 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8261 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8263 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8264 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8266 /* Connect Line-Out side jack (SPDIF) to Side */
8267 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8268 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8269 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
8270 /* Connect Mic jack to CLFE */
8271 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8272 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8273 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02},
8274 /* Connect Line-in jack to Surround */
8275 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8276 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8277 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01},
8278 /* Connect HP out jack to Front */
8279 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8280 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8281 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
8283 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8288 static struct hda_verb alc883_lenovo_101e_verbs
[] = {
8289 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8290 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_FRONT_EVENT
|AC_USRSP_EN
},
8291 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
|AC_USRSP_EN
},
8295 static struct hda_verb alc883_lenovo_nb0763_verbs
[] = {
8296 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8297 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8298 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8299 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8303 static struct hda_verb alc888_lenovo_ms7195_verbs
[] = {
8304 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8305 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8306 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8307 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_FRONT_EVENT
| AC_USRSP_EN
},
8308 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8312 static struct hda_verb alc883_haier_w66_verbs
[] = {
8313 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8314 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8316 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8318 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
8319 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8320 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8321 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8325 static struct hda_verb alc888_lenovo_sky_verbs
[] = {
8326 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8327 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8328 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8329 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8330 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8331 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8332 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x00},
8333 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8337 static struct hda_verb alc888_6st_dell_verbs
[] = {
8338 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8342 static struct hda_verb alc883_vaiott_verbs
[] = {
8344 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8345 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8347 /* enable unsolicited event */
8348 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8353 static void alc888_3st_hp_setup(struct hda_codec
*codec
)
8355 struct alc_spec
*spec
= codec
->spec
;
8357 spec
->autocfg
.hp_pins
[0] = 0x1b;
8358 spec
->autocfg
.speaker_pins
[0] = 0x14;
8359 spec
->autocfg
.speaker_pins
[1] = 0x16;
8360 spec
->autocfg
.speaker_pins
[2] = 0x18;
8363 static struct hda_verb alc888_3st_hp_verbs
[] = {
8364 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Front: output 0 (0x0c) */
8365 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Rear : output 1 (0x0d) */
8366 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* CLFE : output 2 (0x0e) */
8367 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8374 static struct hda_verb alc888_3st_hp_2ch_init
[] = {
8375 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
8376 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8377 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
8378 { 0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8385 static struct hda_verb alc888_3st_hp_4ch_init
[] = {
8386 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
8387 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8388 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8389 { 0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8390 { 0x16, AC_VERB_SET_CONNECT_SEL
, 0x01 },
8397 static struct hda_verb alc888_3st_hp_6ch_init
[] = {
8398 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8399 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8400 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
8401 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8402 { 0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8403 { 0x16, AC_VERB_SET_CONNECT_SEL
, 0x01 },
8407 static struct hda_channel_mode alc888_3st_hp_modes
[3] = {
8408 { 2, alc888_3st_hp_2ch_init
},
8409 { 4, alc888_3st_hp_4ch_init
},
8410 { 6, alc888_3st_hp_6ch_init
},
8413 /* toggle front-jack and RCA according to the hp-jack state */
8414 static void alc888_lenovo_ms7195_front_automute(struct hda_codec
*codec
)
8416 unsigned int present
;
8418 present
= snd_hda_codec_read(codec
, 0x1b, 0,
8419 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
8420 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
8421 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
8422 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
8423 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
8426 /* toggle RCA according to the front-jack state */
8427 static void alc888_lenovo_ms7195_rca_automute(struct hda_codec
*codec
)
8429 unsigned int present
;
8431 present
= snd_hda_codec_read(codec
, 0x14, 0,
8432 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
8433 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
8434 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
8437 static void alc883_lenovo_ms7195_unsol_event(struct hda_codec
*codec
,
8440 if ((res
>> 26) == ALC880_HP_EVENT
)
8441 alc888_lenovo_ms7195_front_automute(codec
);
8442 if ((res
>> 26) == ALC880_FRONT_EVENT
)
8443 alc888_lenovo_ms7195_rca_automute(codec
);
8446 static struct hda_verb alc883_medion_md2_verbs
[] = {
8447 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8448 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8450 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8452 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8456 /* toggle speaker-output according to the hp-jack state */
8457 static void alc883_medion_md2_setup(struct hda_codec
*codec
)
8459 struct alc_spec
*spec
= codec
->spec
;
8461 spec
->autocfg
.hp_pins
[0] = 0x14;
8462 spec
->autocfg
.speaker_pins
[0] = 0x15;
8465 /* toggle speaker-output according to the hp-jack state */
8466 #define alc883_targa_init_hook alc882_targa_init_hook
8467 #define alc883_targa_unsol_event alc882_targa_unsol_event
8469 static void alc883_clevo_m720_mic_automute(struct hda_codec
*codec
)
8471 unsigned int present
;
8473 present
= snd_hda_codec_read(codec
, 0x18, 0,
8474 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
8475 snd_hda_codec_amp_stereo(codec
, 0x0b, HDA_INPUT
, 1,
8476 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
8479 static void alc883_clevo_m720_setup(struct hda_codec
*codec
)
8481 struct alc_spec
*spec
= codec
->spec
;
8483 spec
->autocfg
.hp_pins
[0] = 0x15;
8484 spec
->autocfg
.speaker_pins
[0] = 0x14;
8487 static void alc883_clevo_m720_init_hook(struct hda_codec
*codec
)
8489 alc_automute_amp(codec
);
8490 alc883_clevo_m720_mic_automute(codec
);
8493 static void alc883_clevo_m720_unsol_event(struct hda_codec
*codec
,
8496 switch (res
>> 26) {
8497 case ALC880_MIC_EVENT
:
8498 alc883_clevo_m720_mic_automute(codec
);
8501 alc_automute_amp_unsol_event(codec
, res
);
8506 /* toggle speaker-output according to the hp-jack state */
8507 static void alc883_2ch_fujitsu_pi2515_setup(struct hda_codec
*codec
)
8509 struct alc_spec
*spec
= codec
->spec
;
8511 spec
->autocfg
.hp_pins
[0] = 0x14;
8512 spec
->autocfg
.speaker_pins
[0] = 0x15;
8515 static void alc883_haier_w66_setup(struct hda_codec
*codec
)
8517 struct alc_spec
*spec
= codec
->spec
;
8519 spec
->autocfg
.hp_pins
[0] = 0x1b;
8520 spec
->autocfg
.speaker_pins
[0] = 0x14;
8523 static void alc883_lenovo_101e_ispeaker_automute(struct hda_codec
*codec
)
8525 unsigned int present
;
8528 present
= snd_hda_codec_read(codec
, 0x14, 0, AC_VERB_GET_PIN_SENSE
, 0)
8529 & AC_PINSENSE_PRESENCE
;
8530 bits
= present
? HDA_AMP_MUTE
: 0;
8531 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
8532 HDA_AMP_MUTE
, bits
);
8535 static void alc883_lenovo_101e_all_automute(struct hda_codec
*codec
)
8537 unsigned int present
;
8540 present
= snd_hda_codec_read(codec
, 0x1b, 0,
8541 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
8542 bits
= present
? HDA_AMP_MUTE
: 0;
8543 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
8544 HDA_AMP_MUTE
, bits
);
8545 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
8546 HDA_AMP_MUTE
, bits
);
8549 static void alc883_lenovo_101e_unsol_event(struct hda_codec
*codec
,
8552 if ((res
>> 26) == ALC880_HP_EVENT
)
8553 alc883_lenovo_101e_all_automute(codec
);
8554 if ((res
>> 26) == ALC880_FRONT_EVENT
)
8555 alc883_lenovo_101e_ispeaker_automute(codec
);
8558 /* toggle speaker-output according to the hp-jack state */
8559 static void alc883_acer_aspire_setup(struct hda_codec
*codec
)
8561 struct alc_spec
*spec
= codec
->spec
;
8563 spec
->autocfg
.hp_pins
[0] = 0x14;
8564 spec
->autocfg
.speaker_pins
[0] = 0x15;
8565 spec
->autocfg
.speaker_pins
[1] = 0x16;
8568 static struct hda_verb alc883_acer_eapd_verbs
[] = {
8569 /* HP Pin: output 0 (0x0c) */
8570 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8571 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8572 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
8573 /* Front Pin: output 0 (0x0c) */
8574 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8575 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8576 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8577 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x00},
8578 /* eanable EAPD on medion laptop */
8579 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
8580 {0x20, AC_VERB_SET_PROC_COEF
, 0x3050},
8581 /* enable unsolicited event */
8582 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8586 static struct hda_verb alc888_acer_aspire_7730G_verbs
[] = {
8587 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8588 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x02},
8589 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8593 static void alc888_6st_dell_setup(struct hda_codec
*codec
)
8595 struct alc_spec
*spec
= codec
->spec
;
8597 spec
->autocfg
.hp_pins
[0] = 0x1b;
8598 spec
->autocfg
.speaker_pins
[0] = 0x14;
8599 spec
->autocfg
.speaker_pins
[1] = 0x15;
8600 spec
->autocfg
.speaker_pins
[2] = 0x16;
8601 spec
->autocfg
.speaker_pins
[3] = 0x17;
8604 static void alc888_lenovo_sky_setup(struct hda_codec
*codec
)
8606 struct alc_spec
*spec
= codec
->spec
;
8608 spec
->autocfg
.hp_pins
[0] = 0x1b;
8609 spec
->autocfg
.speaker_pins
[0] = 0x14;
8610 spec
->autocfg
.speaker_pins
[1] = 0x15;
8611 spec
->autocfg
.speaker_pins
[2] = 0x16;
8612 spec
->autocfg
.speaker_pins
[3] = 0x17;
8613 spec
->autocfg
.speaker_pins
[4] = 0x1a;
8616 static void alc883_vaiott_setup(struct hda_codec
*codec
)
8618 struct alc_spec
*spec
= codec
->spec
;
8620 spec
->autocfg
.hp_pins
[0] = 0x15;
8621 spec
->autocfg
.speaker_pins
[0] = 0x14;
8622 spec
->autocfg
.speaker_pins
[1] = 0x17;
8625 static struct hda_verb alc888_asus_m90v_verbs
[] = {
8626 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8627 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8628 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8629 /* enable unsolicited event */
8630 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8631 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_MIC_EVENT
| AC_USRSP_EN
},
8635 static void alc883_mode2_setup(struct hda_codec
*codec
)
8637 struct alc_spec
*spec
= codec
->spec
;
8639 spec
->autocfg
.hp_pins
[0] = 0x1b;
8640 spec
->autocfg
.speaker_pins
[0] = 0x14;
8641 spec
->autocfg
.speaker_pins
[1] = 0x15;
8642 spec
->autocfg
.speaker_pins
[2] = 0x16;
8643 spec
->ext_mic
.pin
= 0x18;
8644 spec
->int_mic
.pin
= 0x19;
8645 spec
->ext_mic
.mux_idx
= 0;
8646 spec
->int_mic
.mux_idx
= 1;
8650 static struct hda_verb alc888_asus_eee1601_verbs
[] = {
8651 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8652 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8653 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8654 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8655 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8656 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0b},
8657 {0x20, AC_VERB_SET_PROC_COEF
, 0x0838},
8658 /* enable unsolicited event */
8659 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8663 static void alc883_eee1601_inithook(struct hda_codec
*codec
)
8665 struct alc_spec
*spec
= codec
->spec
;
8667 spec
->autocfg
.hp_pins
[0] = 0x14;
8668 spec
->autocfg
.speaker_pins
[0] = 0x1b;
8669 alc_automute_pin(codec
);
8672 static struct hda_verb alc889A_mb31_verbs
[] = {
8673 /* Init rear pin (used as headphone output) */
8674 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc4}, /* Apple Headphones */
8675 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Connect to front */
8676 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8677 /* Init line pin (used as output in 4ch and 6ch mode) */
8678 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* Connect to CLFE */
8679 /* Init line 2 pin (used as headphone out by default) */
8680 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* Use as input */
8681 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
}, /* Mute output */
8685 /* Mute speakers according to the headphone jack state */
8686 static void alc889A_mb31_automute(struct hda_codec
*codec
)
8688 unsigned int present
;
8690 /* Mute only in 2ch or 4ch mode */
8691 if (snd_hda_codec_read(codec
, 0x15, 0, AC_VERB_GET_CONNECT_SEL
, 0)
8693 present
= snd_hda_codec_read(codec
, 0x15, 0,
8694 AC_VERB_GET_PIN_SENSE
, 0) & AC_PINSENSE_PRESENCE
;
8695 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
8696 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
8697 snd_hda_codec_amp_stereo(codec
, 0x16, HDA_OUTPUT
, 0,
8698 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
8702 static void alc889A_mb31_unsol_event(struct hda_codec
*codec
, unsigned int res
)
8704 if ((res
>> 26) == ALC880_HP_EVENT
)
8705 alc889A_mb31_automute(codec
);
8709 #ifdef CONFIG_SND_HDA_POWER_SAVE
8710 #define alc882_loopbacks alc880_loopbacks
8713 /* pcm configuration: identical with ALC880 */
8714 #define alc882_pcm_analog_playback alc880_pcm_analog_playback
8715 #define alc882_pcm_analog_capture alc880_pcm_analog_capture
8716 #define alc882_pcm_digital_playback alc880_pcm_digital_playback
8717 #define alc882_pcm_digital_capture alc880_pcm_digital_capture
8719 static hda_nid_t alc883_slave_dig_outs
[] = {
8720 ALC1200_DIGOUT_NID
, 0,
8723 static hda_nid_t alc1200_slave_dig_outs
[] = {
8724 ALC883_DIGOUT_NID
, 0,
8728 * configuration and preset
8730 static const char *alc882_models
[ALC882_MODEL_LAST
] = {
8731 [ALC882_3ST_DIG
] = "3stack-dig",
8732 [ALC882_6ST_DIG
] = "6stack-dig",
8733 [ALC882_ARIMA
] = "arima",
8734 [ALC882_W2JC
] = "w2jc",
8735 [ALC882_TARGA
] = "targa",
8736 [ALC882_ASUS_A7J
] = "asus-a7j",
8737 [ALC882_ASUS_A7M
] = "asus-a7m",
8738 [ALC885_MACPRO
] = "macpro",
8739 [ALC885_MB5
] = "mb5",
8740 [ALC885_MBP3
] = "mbp3",
8741 [ALC885_IMAC24
] = "imac24",
8742 [ALC883_3ST_2ch_DIG
] = "3stack-2ch-dig",
8743 [ALC883_3ST_6ch_DIG
] = "3stack-6ch-dig",
8744 [ALC883_3ST_6ch
] = "3stack-6ch",
8745 [ALC883_6ST_DIG
] = "alc883-6stack-dig",
8746 [ALC883_TARGA_DIG
] = "targa-dig",
8747 [ALC883_TARGA_2ch_DIG
] = "targa-2ch-dig",
8748 [ALC883_TARGA_8ch_DIG
] = "targa-8ch-dig",
8749 [ALC883_ACER
] = "acer",
8750 [ALC883_ACER_ASPIRE
] = "acer-aspire",
8751 [ALC888_ACER_ASPIRE_4930G
] = "acer-aspire-4930g",
8752 [ALC888_ACER_ASPIRE_6530G
] = "acer-aspire-6530g",
8753 [ALC888_ACER_ASPIRE_8930G
] = "acer-aspire-8930g",
8754 [ALC888_ACER_ASPIRE_7730G
] = "acer-aspire-7730g",
8755 [ALC883_MEDION
] = "medion",
8756 [ALC883_MEDION_MD2
] = "medion-md2",
8757 [ALC883_LAPTOP_EAPD
] = "laptop-eapd",
8758 [ALC883_LENOVO_101E_2ch
] = "lenovo-101e",
8759 [ALC883_LENOVO_NB0763
] = "lenovo-nb0763",
8760 [ALC888_LENOVO_MS7195_DIG
] = "lenovo-ms7195-dig",
8761 [ALC888_LENOVO_SKY
] = "lenovo-sky",
8762 [ALC883_HAIER_W66
] = "haier-w66",
8763 [ALC888_3ST_HP
] = "3stack-hp",
8764 [ALC888_6ST_DELL
] = "6stack-dell",
8765 [ALC883_MITAC
] = "mitac",
8766 [ALC883_CLEVO_M540R
] = "clevo-m540r",
8767 [ALC883_CLEVO_M720
] = "clevo-m720",
8768 [ALC883_FUJITSU_PI2515
] = "fujitsu-pi2515",
8769 [ALC888_FUJITSU_XA3530
] = "fujitsu-xa3530",
8770 [ALC883_3ST_6ch_INTEL
] = "3stack-6ch-intel",
8771 [ALC889A_INTEL
] = "intel-alc889a",
8772 [ALC889_INTEL
] = "intel-x58",
8773 [ALC1200_ASUS_P5Q
] = "asus-p5q",
8774 [ALC889A_MB31
] = "mb31",
8775 [ALC883_SONY_VAIO_TT
] = "sony-vaio-tt",
8776 [ALC882_AUTO
] = "auto",
8779 static struct snd_pci_quirk alc882_cfg_tbl
[] = {
8780 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG
),
8782 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE
),
8783 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_ACER_ASPIRE
),
8784 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_ACER_ASPIRE
),
8785 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE
),
8786 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE
),
8787 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE
),
8788 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
8789 ALC888_ACER_ASPIRE_4930G
),
8790 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
8791 ALC888_ACER_ASPIRE_4930G
),
8792 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
8793 ALC888_ACER_ASPIRE_8930G
),
8794 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
8795 ALC888_ACER_ASPIRE_8930G
),
8796 SND_PCI_QUIRK(0x1025, 0x0157, "Acer X3200", ALC882_AUTO
),
8797 SND_PCI_QUIRK(0x1025, 0x0158, "Acer AX1700-U3700A", ALC882_AUTO
),
8798 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
8799 ALC888_ACER_ASPIRE_6530G
),
8800 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
8801 ALC888_ACER_ASPIRE_6530G
),
8802 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
8803 ALC888_ACER_ASPIRE_7730G
),
8804 /* default Acer -- disabled as it causes more problems.
8805 * model=auto should work fine now
8807 /* SND_PCI_QUIRK_VENDOR(0x1025, "Acer laptop", ALC883_ACER), */
8809 SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL
),
8811 SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG
),
8812 SND_PCI_QUIRK(0x103c, 0x2a4f, "HP Samba", ALC888_3ST_HP
),
8813 SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP
),
8814 SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG
),
8815 SND_PCI_QUIRK(0x103c, 0x2a66, "HP Acacia", ALC888_3ST_HP
),
8816 SND_PCI_QUIRK(0x103c, 0x2a72, "HP Educ.ar", ALC888_3ST_HP
),
8818 SND_PCI_QUIRK(0x1043, 0x060d, "Asus A7J", ALC882_ASUS_A7J
),
8819 SND_PCI_QUIRK(0x1043, 0x1243, "Asus A7J", ALC882_ASUS_A7J
),
8820 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_ASUS_A7M
),
8821 SND_PCI_QUIRK(0x1043, 0x1873, "Asus M90V", ALC888_ASUS_M90V
),
8822 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC
),
8823 SND_PCI_QUIRK(0x1043, 0x817f, "Asus P5LD2", ALC882_6ST_DIG
),
8824 SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG
),
8825 SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG
),
8826 SND_PCI_QUIRK(0x1043, 0x8284, "Asus Z37E", ALC883_6ST_DIG
),
8827 SND_PCI_QUIRK(0x1043, 0x82fe, "Asus P5Q-EM HDMI", ALC1200_ASUS_P5Q
),
8828 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_ASUS_EEE1601
),
8830 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC883_SONY_VAIO_TT
),
8831 SND_PCI_QUIRK(0x105b, 0x0ce8, "Foxconn P35AX-S", ALC883_6ST_DIG
),
8832 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG
),
8833 SND_PCI_QUIRK(0x1071, 0x8227, "Mitac 82801H", ALC883_MITAC
),
8834 SND_PCI_QUIRK(0x1071, 0x8253, "Mitac 8252d", ALC883_MITAC
),
8835 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD
),
8836 SND_PCI_QUIRK(0x10f1, 0x2350, "TYAN-S2350", ALC888_6ST_DELL
),
8837 SND_PCI_QUIRK(0x108e, 0x534d, NULL
, ALC883_3ST_6ch
),
8838 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte P35 DS3R", ALC882_6ST_DIG
),
8840 SND_PCI_QUIRK(0x1462, 0x0349, "MSI", ALC883_TARGA_2ch_DIG
),
8841 SND_PCI_QUIRK(0x1462, 0x040d, "MSI", ALC883_TARGA_2ch_DIG
),
8842 SND_PCI_QUIRK(0x1462, 0x0579, "MSI", ALC883_TARGA_2ch_DIG
),
8843 SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA
), /* MSI-1049 T8 */
8844 SND_PCI_QUIRK(0x1462, 0x2fb3, "MSI", ALC883_TARGA_2ch_DIG
),
8845 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG
),
8846 SND_PCI_QUIRK(0x1462, 0x3729, "MSI S420", ALC883_TARGA_DIG
),
8847 SND_PCI_QUIRK(0x1462, 0x3783, "NEC S970", ALC883_TARGA_DIG
),
8848 SND_PCI_QUIRK(0x1462, 0x3b7f, "MSI", ALC883_TARGA_2ch_DIG
),
8849 SND_PCI_QUIRK(0x1462, 0x3ef9, "MSI", ALC883_TARGA_DIG
),
8850 SND_PCI_QUIRK(0x1462, 0x3fc1, "MSI", ALC883_TARGA_DIG
),
8851 SND_PCI_QUIRK(0x1462, 0x3fc3, "MSI", ALC883_TARGA_DIG
),
8852 SND_PCI_QUIRK(0x1462, 0x3fcc, "MSI", ALC883_TARGA_DIG
),
8853 SND_PCI_QUIRK(0x1462, 0x3fdf, "MSI", ALC883_TARGA_DIG
),
8854 SND_PCI_QUIRK(0x1462, 0x42cd, "MSI", ALC883_TARGA_DIG
),
8855 SND_PCI_QUIRK(0x1462, 0x4314, "MSI", ALC883_TARGA_DIG
),
8856 SND_PCI_QUIRK(0x1462, 0x4319, "MSI", ALC883_TARGA_DIG
),
8857 SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG
),
8858 SND_PCI_QUIRK(0x1462, 0x6510, "MSI GX620", ALC883_TARGA_8ch_DIG
),
8859 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC883_6ST_DIG
),
8860 SND_PCI_QUIRK(0x1462, 0x7187, "MSI", ALC883_6ST_DIG
),
8861 SND_PCI_QUIRK(0x1462, 0x7250, "MSI", ALC883_6ST_DIG
),
8862 SND_PCI_QUIRK(0x1462, 0x7260, "MSI 7260", ALC883_TARGA_DIG
),
8863 SND_PCI_QUIRK(0x1462, 0x7267, "MSI", ALC883_3ST_6ch_DIG
),
8864 SND_PCI_QUIRK(0x1462, 0x7280, "MSI", ALC883_6ST_DIG
),
8865 SND_PCI_QUIRK(0x1462, 0x7327, "MSI", ALC883_6ST_DIG
),
8866 SND_PCI_QUIRK(0x1462, 0x7350, "MSI", ALC883_6ST_DIG
),
8867 SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG
),
8868 SND_PCI_QUIRK(0x1462, 0xaa08, "MSI", ALC883_TARGA_2ch_DIG
),
8870 SND_PCI_QUIRK(0x147b, 0x1083, "Abit IP35-PRO", ALC883_6ST_DIG
),
8871 SND_PCI_QUIRK(0x1558, 0x0721, "Clevo laptop M720R", ALC883_CLEVO_M720
),
8872 SND_PCI_QUIRK(0x1558, 0x0722, "Clevo laptop M720SR", ALC883_CLEVO_M720
),
8873 SND_PCI_QUIRK(0x1558, 0x5409, "Clevo laptop M540R", ALC883_CLEVO_M540R
),
8874 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC883_LAPTOP_EAPD
),
8875 SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch
),
8876 /* SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA), */
8877 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION
),
8878 SND_PCI_QUIRK_MASK(0x1734, 0xfff0, 0x1100, "FSC AMILO Xi/Pi25xx",
8879 ALC883_FUJITSU_PI2515
),
8880 SND_PCI_QUIRK_MASK(0x1734, 0xfff0, 0x1130, "Fujitsu AMILO Xa35xx",
8881 ALC888_FUJITSU_XA3530
),
8882 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch
),
8883 SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763
),
8884 SND_PCI_QUIRK(0x17aa, 0x3bfc, "Lenovo NB0763", ALC883_LENOVO_NB0763
),
8885 SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763
),
8886 SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY
),
8887 SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2
),
8888 SND_PCI_QUIRK(0x17c0, 0x4085, "MEDION MD96630", ALC888_LENOVO_MS7195_DIG
),
8889 SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG
),
8890 SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66
),
8892 SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL
),
8893 SND_PCI_QUIRK(0x8086, 0x0002, "DG33FBC", ALC883_3ST_6ch_INTEL
),
8894 SND_PCI_QUIRK(0x8086, 0x2503, "82801H", ALC883_MITAC
),
8895 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_INTEL
),
8896 SND_PCI_QUIRK(0x8086, 0x0021, "Intel IbexPeak", ALC889A_INTEL
),
8897 SND_PCI_QUIRK(0x8086, 0x3b56, "Intel IbexPeak", ALC889A_INTEL
),
8898 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch
),
8903 /* codec SSID table for Intel Mac */
8904 static struct snd_pci_quirk alc882_ssid_cfg_tbl
[] = {
8905 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC885_MBP3
),
8906 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC885_MBP3
),
8907 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC885_MBP3
),
8908 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC885_MACPRO
),
8909 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_IMAC24
),
8910 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_IMAC24
),
8911 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC885_MBP3
),
8912 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889A_MB31
),
8913 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3
),
8914 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24
),
8915 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5
),
8916 /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2,
8917 * so apparently no perfect solution yet
8919 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC885_MB5
),
8920 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC885_MB5
),
8924 static struct alc_config_preset alc882_presets
[] = {
8925 [ALC882_3ST_DIG
] = {
8926 .mixers
= { alc882_base_mixer
},
8927 .init_verbs
= { alc882_base_init_verbs
,
8928 alc882_adc1_init_verbs
},
8929 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
8930 .dac_nids
= alc882_dac_nids
,
8931 .dig_out_nid
= ALC882_DIGOUT_NID
,
8932 .dig_in_nid
= ALC882_DIGIN_NID
,
8933 .num_channel_mode
= ARRAY_SIZE(alc882_ch_modes
),
8934 .channel_mode
= alc882_ch_modes
,
8936 .input_mux
= &alc882_capture_source
,
8938 [ALC882_6ST_DIG
] = {
8939 .mixers
= { alc882_base_mixer
, alc882_chmode_mixer
},
8940 .init_verbs
= { alc882_base_init_verbs
,
8941 alc882_adc1_init_verbs
},
8942 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
8943 .dac_nids
= alc882_dac_nids
,
8944 .dig_out_nid
= ALC882_DIGOUT_NID
,
8945 .dig_in_nid
= ALC882_DIGIN_NID
,
8946 .num_channel_mode
= ARRAY_SIZE(alc882_sixstack_modes
),
8947 .channel_mode
= alc882_sixstack_modes
,
8948 .input_mux
= &alc882_capture_source
,
8951 .mixers
= { alc882_base_mixer
, alc882_chmode_mixer
},
8952 .init_verbs
= { alc882_base_init_verbs
, alc882_adc1_init_verbs
,
8953 alc882_eapd_verbs
},
8954 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
8955 .dac_nids
= alc882_dac_nids
,
8956 .num_channel_mode
= ARRAY_SIZE(alc882_sixstack_modes
),
8957 .channel_mode
= alc882_sixstack_modes
,
8958 .input_mux
= &alc882_capture_source
,
8961 .mixers
= { alc882_w2jc_mixer
, alc882_chmode_mixer
},
8962 .init_verbs
= { alc882_base_init_verbs
, alc882_adc1_init_verbs
,
8963 alc882_eapd_verbs
, alc880_gpio1_init_verbs
},
8964 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
8965 .dac_nids
= alc882_dac_nids
,
8966 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
8967 .channel_mode
= alc880_threestack_modes
,
8969 .input_mux
= &alc882_capture_source
,
8970 .dig_out_nid
= ALC882_DIGOUT_NID
,
8973 .mixers
= { alc885_mbp3_mixer
, alc882_chmode_mixer
},
8974 .init_verbs
= { alc885_mbp3_init_verbs
,
8975 alc880_gpio1_init_verbs
},
8977 .dac_nids
= alc882_dac_nids
,
8979 .channel_mode
= alc885_mbp_4ch_modes
,
8980 .num_channel_mode
= ARRAY_SIZE(alc885_mbp_4ch_modes
),
8981 .input_mux
= &alc882_capture_source
,
8982 .dig_out_nid
= ALC882_DIGOUT_NID
,
8983 .dig_in_nid
= ALC882_DIGIN_NID
,
8984 .unsol_event
= alc_automute_amp_unsol_event
,
8985 .setup
= alc885_mbp3_setup
,
8986 .init_hook
= alc_automute_amp
,
8989 .mixers
= { alc885_mb5_mixer
, alc882_chmode_mixer
},
8990 .init_verbs
= { alc885_mb5_init_verbs
,
8991 alc880_gpio1_init_verbs
},
8992 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
8993 .dac_nids
= alc882_dac_nids
,
8994 .channel_mode
= alc885_mb5_6ch_modes
,
8995 .num_channel_mode
= ARRAY_SIZE(alc885_mb5_6ch_modes
),
8996 .input_mux
= &mb5_capture_source
,
8997 .dig_out_nid
= ALC882_DIGOUT_NID
,
8998 .dig_in_nid
= ALC882_DIGIN_NID
,
9001 .mixers
= { alc882_macpro_mixer
},
9002 .init_verbs
= { alc882_macpro_init_verbs
},
9003 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
9004 .dac_nids
= alc882_dac_nids
,
9005 .dig_out_nid
= ALC882_DIGOUT_NID
,
9006 .dig_in_nid
= ALC882_DIGIN_NID
,
9007 .num_channel_mode
= ARRAY_SIZE(alc882_ch_modes
),
9008 .channel_mode
= alc882_ch_modes
,
9009 .input_mux
= &alc882_capture_source
,
9010 .init_hook
= alc885_macpro_init_hook
,
9013 .mixers
= { alc885_imac24_mixer
},
9014 .init_verbs
= { alc885_imac24_init_verbs
},
9015 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
9016 .dac_nids
= alc882_dac_nids
,
9017 .dig_out_nid
= ALC882_DIGOUT_NID
,
9018 .dig_in_nid
= ALC882_DIGIN_NID
,
9019 .num_channel_mode
= ARRAY_SIZE(alc882_ch_modes
),
9020 .channel_mode
= alc882_ch_modes
,
9021 .input_mux
= &alc882_capture_source
,
9022 .unsol_event
= alc_automute_amp_unsol_event
,
9023 .setup
= alc885_imac24_setup
,
9024 .init_hook
= alc885_imac24_init_hook
,
9027 .mixers
= { alc882_targa_mixer
, alc882_chmode_mixer
},
9028 .init_verbs
= { alc882_base_init_verbs
, alc882_adc1_init_verbs
,
9029 alc880_gpio3_init_verbs
, alc882_targa_verbs
},
9030 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
9031 .dac_nids
= alc882_dac_nids
,
9032 .dig_out_nid
= ALC882_DIGOUT_NID
,
9033 .num_adc_nids
= ARRAY_SIZE(alc882_adc_nids
),
9034 .adc_nids
= alc882_adc_nids
,
9035 .capsrc_nids
= alc882_capsrc_nids
,
9036 .num_channel_mode
= ARRAY_SIZE(alc882_3ST_6ch_modes
),
9037 .channel_mode
= alc882_3ST_6ch_modes
,
9039 .input_mux
= &alc882_capture_source
,
9040 .unsol_event
= alc882_targa_unsol_event
,
9041 .setup
= alc882_targa_setup
,
9042 .init_hook
= alc882_targa_automute
,
9044 [ALC882_ASUS_A7J
] = {
9045 .mixers
= { alc882_asus_a7j_mixer
, alc882_chmode_mixer
},
9046 .init_verbs
= { alc882_base_init_verbs
, alc882_adc1_init_verbs
,
9047 alc882_asus_a7j_verbs
},
9048 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
9049 .dac_nids
= alc882_dac_nids
,
9050 .dig_out_nid
= ALC882_DIGOUT_NID
,
9051 .num_adc_nids
= ARRAY_SIZE(alc882_adc_nids
),
9052 .adc_nids
= alc882_adc_nids
,
9053 .capsrc_nids
= alc882_capsrc_nids
,
9054 .num_channel_mode
= ARRAY_SIZE(alc882_3ST_6ch_modes
),
9055 .channel_mode
= alc882_3ST_6ch_modes
,
9057 .input_mux
= &alc882_capture_source
,
9059 [ALC882_ASUS_A7M
] = {
9060 .mixers
= { alc882_asus_a7m_mixer
, alc882_chmode_mixer
},
9061 .init_verbs
= { alc882_base_init_verbs
, alc882_adc1_init_verbs
,
9062 alc882_eapd_verbs
, alc880_gpio1_init_verbs
,
9063 alc882_asus_a7m_verbs
},
9064 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
9065 .dac_nids
= alc882_dac_nids
,
9066 .dig_out_nid
= ALC882_DIGOUT_NID
,
9067 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
9068 .channel_mode
= alc880_threestack_modes
,
9070 .input_mux
= &alc882_capture_source
,
9072 [ALC883_3ST_2ch_DIG
] = {
9073 .mixers
= { alc883_3ST_2ch_mixer
},
9074 .init_verbs
= { alc883_init_verbs
},
9075 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9076 .dac_nids
= alc883_dac_nids
,
9077 .dig_out_nid
= ALC883_DIGOUT_NID
,
9078 .dig_in_nid
= ALC883_DIGIN_NID
,
9079 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9080 .channel_mode
= alc883_3ST_2ch_modes
,
9081 .input_mux
= &alc883_capture_source
,
9083 [ALC883_3ST_6ch_DIG
] = {
9084 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
9085 .init_verbs
= { alc883_init_verbs
},
9086 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9087 .dac_nids
= alc883_dac_nids
,
9088 .dig_out_nid
= ALC883_DIGOUT_NID
,
9089 .dig_in_nid
= ALC883_DIGIN_NID
,
9090 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9091 .channel_mode
= alc883_3ST_6ch_modes
,
9093 .input_mux
= &alc883_capture_source
,
9095 [ALC883_3ST_6ch
] = {
9096 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
9097 .init_verbs
= { alc883_init_verbs
},
9098 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9099 .dac_nids
= alc883_dac_nids
,
9100 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9101 .channel_mode
= alc883_3ST_6ch_modes
,
9103 .input_mux
= &alc883_capture_source
,
9105 [ALC883_3ST_6ch_INTEL
] = {
9106 .mixers
= { alc883_3ST_6ch_intel_mixer
, alc883_chmode_mixer
},
9107 .init_verbs
= { alc883_init_verbs
},
9108 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9109 .dac_nids
= alc883_dac_nids
,
9110 .dig_out_nid
= ALC883_DIGOUT_NID
,
9111 .dig_in_nid
= ALC883_DIGIN_NID
,
9112 .slave_dig_outs
= alc883_slave_dig_outs
,
9113 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_intel_modes
),
9114 .channel_mode
= alc883_3ST_6ch_intel_modes
,
9116 .input_mux
= &alc883_3stack_6ch_intel
,
9119 .mixers
= { alc885_8ch_intel_mixer
, alc883_chmode_mixer
},
9120 .init_verbs
= { alc885_init_verbs
, alc885_init_input_verbs
,
9121 alc_hp15_unsol_verbs
},
9122 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9123 .dac_nids
= alc883_dac_nids
,
9124 .num_adc_nids
= ARRAY_SIZE(alc889_adc_nids
),
9125 .adc_nids
= alc889_adc_nids
,
9126 .dig_out_nid
= ALC883_DIGOUT_NID
,
9127 .dig_in_nid
= ALC883_DIGIN_NID
,
9128 .slave_dig_outs
= alc883_slave_dig_outs
,
9129 .num_channel_mode
= ARRAY_SIZE(alc889_8ch_intel_modes
),
9130 .channel_mode
= alc889_8ch_intel_modes
,
9131 .capsrc_nids
= alc889_capsrc_nids
,
9132 .input_mux
= &alc889_capture_source
,
9133 .setup
= alc889_automute_setup
,
9134 .init_hook
= alc_automute_amp
,
9135 .unsol_event
= alc_automute_amp_unsol_event
,
9139 .mixers
= { alc885_8ch_intel_mixer
, alc883_chmode_mixer
},
9140 .init_verbs
= { alc885_init_verbs
, alc889_init_input_verbs
,
9141 alc889_eapd_verbs
, alc_hp15_unsol_verbs
},
9142 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9143 .dac_nids
= alc883_dac_nids
,
9144 .num_adc_nids
= ARRAY_SIZE(alc889_adc_nids
),
9145 .adc_nids
= alc889_adc_nids
,
9146 .dig_out_nid
= ALC883_DIGOUT_NID
,
9147 .dig_in_nid
= ALC883_DIGIN_NID
,
9148 .slave_dig_outs
= alc883_slave_dig_outs
,
9149 .num_channel_mode
= ARRAY_SIZE(alc889_8ch_intel_modes
),
9150 .channel_mode
= alc889_8ch_intel_modes
,
9151 .capsrc_nids
= alc889_capsrc_nids
,
9152 .input_mux
= &alc889_capture_source
,
9153 .setup
= alc889_automute_setup
,
9154 .init_hook
= alc889_intel_init_hook
,
9155 .unsol_event
= alc_automute_amp_unsol_event
,
9158 [ALC883_6ST_DIG
] = {
9159 .mixers
= { alc883_base_mixer
, alc883_chmode_mixer
},
9160 .init_verbs
= { alc883_init_verbs
},
9161 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9162 .dac_nids
= alc883_dac_nids
,
9163 .dig_out_nid
= ALC883_DIGOUT_NID
,
9164 .dig_in_nid
= ALC883_DIGIN_NID
,
9165 .num_channel_mode
= ARRAY_SIZE(alc883_sixstack_modes
),
9166 .channel_mode
= alc883_sixstack_modes
,
9167 .input_mux
= &alc883_capture_source
,
9169 [ALC883_TARGA_DIG
] = {
9170 .mixers
= { alc883_targa_mixer
, alc883_chmode_mixer
},
9171 .init_verbs
= { alc883_init_verbs
, alc880_gpio3_init_verbs
,
9172 alc883_targa_verbs
},
9173 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9174 .dac_nids
= alc883_dac_nids
,
9175 .dig_out_nid
= ALC883_DIGOUT_NID
,
9176 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9177 .channel_mode
= alc883_3ST_6ch_modes
,
9179 .input_mux
= &alc883_capture_source
,
9180 .unsol_event
= alc883_targa_unsol_event
,
9181 .setup
= alc882_targa_setup
,
9182 .init_hook
= alc882_targa_automute
,
9184 [ALC883_TARGA_2ch_DIG
] = {
9185 .mixers
= { alc883_targa_2ch_mixer
},
9186 .init_verbs
= { alc883_init_verbs
, alc880_gpio3_init_verbs
,
9187 alc883_targa_verbs
},
9188 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9189 .dac_nids
= alc883_dac_nids
,
9190 .adc_nids
= alc883_adc_nids_alt
,
9191 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_alt
),
9192 .dig_out_nid
= ALC883_DIGOUT_NID
,
9193 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9194 .channel_mode
= alc883_3ST_2ch_modes
,
9195 .input_mux
= &alc883_capture_source
,
9196 .unsol_event
= alc883_targa_unsol_event
,
9197 .setup
= alc882_targa_setup
,
9198 .init_hook
= alc882_targa_automute
,
9200 [ALC883_TARGA_8ch_DIG
] = {
9201 .mixers
= { alc883_targa_mixer
, alc883_targa_8ch_mixer
,
9202 alc883_chmode_mixer
},
9203 .init_verbs
= { alc883_init_verbs
, alc880_gpio3_init_verbs
,
9204 alc883_targa_verbs
},
9205 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9206 .dac_nids
= alc883_dac_nids
,
9207 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_rev
),
9208 .adc_nids
= alc883_adc_nids_rev
,
9209 .capsrc_nids
= alc883_capsrc_nids_rev
,
9210 .dig_out_nid
= ALC883_DIGOUT_NID
,
9211 .dig_in_nid
= ALC883_DIGIN_NID
,
9212 .num_channel_mode
= ARRAY_SIZE(alc883_4ST_8ch_modes
),
9213 .channel_mode
= alc883_4ST_8ch_modes
,
9215 .input_mux
= &alc883_capture_source
,
9216 .unsol_event
= alc883_targa_unsol_event
,
9217 .setup
= alc882_targa_setup
,
9218 .init_hook
= alc882_targa_automute
,
9221 .mixers
= { alc883_base_mixer
},
9222 /* On TravelMate laptops, GPIO 0 enables the internal speaker
9223 * and the headphone jack. Turn this on and rely on the
9224 * standard mute methods whenever the user wants to turn
9225 * these outputs off.
9227 .init_verbs
= { alc883_init_verbs
, alc880_gpio1_init_verbs
},
9228 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9229 .dac_nids
= alc883_dac_nids
,
9230 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9231 .channel_mode
= alc883_3ST_2ch_modes
,
9232 .input_mux
= &alc883_capture_source
,
9234 [ALC883_ACER_ASPIRE
] = {
9235 .mixers
= { alc883_acer_aspire_mixer
},
9236 .init_verbs
= { alc883_init_verbs
, alc883_acer_eapd_verbs
},
9237 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9238 .dac_nids
= alc883_dac_nids
,
9239 .dig_out_nid
= ALC883_DIGOUT_NID
,
9240 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9241 .channel_mode
= alc883_3ST_2ch_modes
,
9242 .input_mux
= &alc883_capture_source
,
9243 .unsol_event
= alc_automute_amp_unsol_event
,
9244 .setup
= alc883_acer_aspire_setup
,
9245 .init_hook
= alc_automute_amp
,
9247 [ALC888_ACER_ASPIRE_4930G
] = {
9248 .mixers
= { alc888_base_mixer
,
9249 alc883_chmode_mixer
},
9250 .init_verbs
= { alc883_init_verbs
, alc880_gpio1_init_verbs
,
9251 alc888_acer_aspire_4930g_verbs
},
9252 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9253 .dac_nids
= alc883_dac_nids
,
9254 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_rev
),
9255 .adc_nids
= alc883_adc_nids_rev
,
9256 .capsrc_nids
= alc883_capsrc_nids_rev
,
9257 .dig_out_nid
= ALC883_DIGOUT_NID
,
9258 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9259 .channel_mode
= alc883_3ST_6ch_modes
,
9262 ARRAY_SIZE(alc888_2_capture_sources
),
9263 .input_mux
= alc888_2_capture_sources
,
9264 .unsol_event
= alc_automute_amp_unsol_event
,
9265 .setup
= alc888_acer_aspire_4930g_setup
,
9266 .init_hook
= alc_automute_amp
,
9268 [ALC888_ACER_ASPIRE_6530G
] = {
9269 .mixers
= { alc888_acer_aspire_6530_mixer
},
9270 .init_verbs
= { alc883_init_verbs
, alc880_gpio1_init_verbs
,
9271 alc888_acer_aspire_6530g_verbs
},
9272 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9273 .dac_nids
= alc883_dac_nids
,
9274 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_rev
),
9275 .adc_nids
= alc883_adc_nids_rev
,
9276 .capsrc_nids
= alc883_capsrc_nids_rev
,
9277 .dig_out_nid
= ALC883_DIGOUT_NID
,
9278 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9279 .channel_mode
= alc883_3ST_2ch_modes
,
9281 ARRAY_SIZE(alc888_2_capture_sources
),
9282 .input_mux
= alc888_acer_aspire_6530_sources
,
9283 .unsol_event
= alc_automute_amp_unsol_event
,
9284 .setup
= alc888_acer_aspire_6530g_setup
,
9285 .init_hook
= alc_automute_amp
,
9287 [ALC888_ACER_ASPIRE_8930G
] = {
9288 .mixers
= { alc888_base_mixer
,
9289 alc883_chmode_mixer
},
9290 .init_verbs
= { alc883_init_verbs
, alc880_gpio1_init_verbs
,
9291 alc889_acer_aspire_8930g_verbs
},
9292 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9293 .dac_nids
= alc883_dac_nids
,
9294 .num_adc_nids
= ARRAY_SIZE(alc889_adc_nids
),
9295 .adc_nids
= alc889_adc_nids
,
9296 .capsrc_nids
= alc889_capsrc_nids
,
9297 .dig_out_nid
= ALC883_DIGOUT_NID
,
9298 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9299 .channel_mode
= alc883_3ST_6ch_modes
,
9301 .const_channel_count
= 6,
9303 ARRAY_SIZE(alc889_capture_sources
),
9304 .input_mux
= alc889_capture_sources
,
9305 .unsol_event
= alc_automute_amp_unsol_event
,
9306 .setup
= alc889_acer_aspire_8930g_setup
,
9307 .init_hook
= alc_automute_amp
,
9309 [ALC888_ACER_ASPIRE_7730G
] = {
9310 .mixers
= { alc883_3ST_6ch_mixer
,
9311 alc883_chmode_mixer
},
9312 .init_verbs
= { alc883_init_verbs
, alc880_gpio1_init_verbs
,
9313 alc888_acer_aspire_7730G_verbs
},
9314 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9315 .dac_nids
= alc883_dac_nids
,
9316 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_rev
),
9317 .adc_nids
= alc883_adc_nids_rev
,
9318 .capsrc_nids
= alc883_capsrc_nids_rev
,
9319 .dig_out_nid
= ALC883_DIGOUT_NID
,
9320 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9321 .channel_mode
= alc883_3ST_6ch_modes
,
9323 .const_channel_count
= 6,
9324 .input_mux
= &alc883_capture_source
,
9325 .unsol_event
= alc_automute_amp_unsol_event
,
9326 .setup
= alc888_acer_aspire_6530g_setup
,
9327 .init_hook
= alc_automute_amp
,
9330 .mixers
= { alc883_fivestack_mixer
,
9331 alc883_chmode_mixer
},
9332 .init_verbs
= { alc883_init_verbs
,
9333 alc883_medion_eapd_verbs
},
9334 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9335 .dac_nids
= alc883_dac_nids
,
9336 .adc_nids
= alc883_adc_nids_alt
,
9337 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_alt
),
9338 .num_channel_mode
= ARRAY_SIZE(alc883_sixstack_modes
),
9339 .channel_mode
= alc883_sixstack_modes
,
9340 .input_mux
= &alc883_capture_source
,
9342 [ALC883_MEDION_MD2
] = {
9343 .mixers
= { alc883_medion_md2_mixer
},
9344 .init_verbs
= { alc883_init_verbs
, alc883_medion_md2_verbs
},
9345 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9346 .dac_nids
= alc883_dac_nids
,
9347 .dig_out_nid
= ALC883_DIGOUT_NID
,
9348 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9349 .channel_mode
= alc883_3ST_2ch_modes
,
9350 .input_mux
= &alc883_capture_source
,
9351 .unsol_event
= alc_automute_amp_unsol_event
,
9352 .setup
= alc883_medion_md2_setup
,
9353 .init_hook
= alc_automute_amp
,
9355 [ALC883_LAPTOP_EAPD
] = {
9356 .mixers
= { alc883_base_mixer
},
9357 .init_verbs
= { alc883_init_verbs
, alc882_eapd_verbs
},
9358 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9359 .dac_nids
= alc883_dac_nids
,
9360 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9361 .channel_mode
= alc883_3ST_2ch_modes
,
9362 .input_mux
= &alc883_capture_source
,
9364 [ALC883_CLEVO_M540R
] = {
9365 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
9366 .init_verbs
= { alc883_init_verbs
, alc883_clevo_m540r_verbs
},
9367 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9368 .dac_nids
= alc883_dac_nids
,
9369 .dig_out_nid
= ALC883_DIGOUT_NID
,
9370 .dig_in_nid
= ALC883_DIGIN_NID
,
9371 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_clevo_modes
),
9372 .channel_mode
= alc883_3ST_6ch_clevo_modes
,
9374 .input_mux
= &alc883_capture_source
,
9375 /* This machine has the hardware HP auto-muting, thus
9376 * we need no software mute via unsol event
9379 [ALC883_CLEVO_M720
] = {
9380 .mixers
= { alc883_clevo_m720_mixer
},
9381 .init_verbs
= { alc883_init_verbs
, alc883_clevo_m720_verbs
},
9382 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9383 .dac_nids
= alc883_dac_nids
,
9384 .dig_out_nid
= ALC883_DIGOUT_NID
,
9385 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9386 .channel_mode
= alc883_3ST_2ch_modes
,
9387 .input_mux
= &alc883_capture_source
,
9388 .unsol_event
= alc883_clevo_m720_unsol_event
,
9389 .setup
= alc883_clevo_m720_setup
,
9390 .init_hook
= alc883_clevo_m720_init_hook
,
9392 [ALC883_LENOVO_101E_2ch
] = {
9393 .mixers
= { alc883_lenovo_101e_2ch_mixer
},
9394 .init_verbs
= { alc883_init_verbs
, alc883_lenovo_101e_verbs
},
9395 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9396 .dac_nids
= alc883_dac_nids
,
9397 .adc_nids
= alc883_adc_nids_alt
,
9398 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_alt
),
9399 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9400 .channel_mode
= alc883_3ST_2ch_modes
,
9401 .input_mux
= &alc883_lenovo_101e_capture_source
,
9402 .unsol_event
= alc883_lenovo_101e_unsol_event
,
9403 .init_hook
= alc883_lenovo_101e_all_automute
,
9405 [ALC883_LENOVO_NB0763
] = {
9406 .mixers
= { alc883_lenovo_nb0763_mixer
},
9407 .init_verbs
= { alc883_init_verbs
, alc883_lenovo_nb0763_verbs
},
9408 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9409 .dac_nids
= alc883_dac_nids
,
9410 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9411 .channel_mode
= alc883_3ST_2ch_modes
,
9413 .input_mux
= &alc883_lenovo_nb0763_capture_source
,
9414 .unsol_event
= alc_automute_amp_unsol_event
,
9415 .setup
= alc883_medion_md2_setup
,
9416 .init_hook
= alc_automute_amp
,
9418 [ALC888_LENOVO_MS7195_DIG
] = {
9419 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
9420 .init_verbs
= { alc883_init_verbs
, alc888_lenovo_ms7195_verbs
},
9421 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9422 .dac_nids
= alc883_dac_nids
,
9423 .dig_out_nid
= ALC883_DIGOUT_NID
,
9424 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9425 .channel_mode
= alc883_3ST_6ch_modes
,
9427 .input_mux
= &alc883_capture_source
,
9428 .unsol_event
= alc883_lenovo_ms7195_unsol_event
,
9429 .init_hook
= alc888_lenovo_ms7195_front_automute
,
9431 [ALC883_HAIER_W66
] = {
9432 .mixers
= { alc883_targa_2ch_mixer
},
9433 .init_verbs
= { alc883_init_verbs
, alc883_haier_w66_verbs
},
9434 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9435 .dac_nids
= alc883_dac_nids
,
9436 .dig_out_nid
= ALC883_DIGOUT_NID
,
9437 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9438 .channel_mode
= alc883_3ST_2ch_modes
,
9439 .input_mux
= &alc883_capture_source
,
9440 .unsol_event
= alc_automute_amp_unsol_event
,
9441 .setup
= alc883_haier_w66_setup
,
9442 .init_hook
= alc_automute_amp
,
9445 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
9446 .init_verbs
= { alc883_init_verbs
, alc888_3st_hp_verbs
},
9447 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9448 .dac_nids
= alc883_dac_nids
,
9449 .num_channel_mode
= ARRAY_SIZE(alc888_3st_hp_modes
),
9450 .channel_mode
= alc888_3st_hp_modes
,
9452 .input_mux
= &alc883_capture_source
,
9453 .unsol_event
= alc_automute_amp_unsol_event
,
9454 .setup
= alc888_3st_hp_setup
,
9455 .init_hook
= alc_automute_amp
,
9457 [ALC888_6ST_DELL
] = {
9458 .mixers
= { alc883_base_mixer
, alc883_chmode_mixer
},
9459 .init_verbs
= { alc883_init_verbs
, alc888_6st_dell_verbs
},
9460 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9461 .dac_nids
= alc883_dac_nids
,
9462 .dig_out_nid
= ALC883_DIGOUT_NID
,
9463 .dig_in_nid
= ALC883_DIGIN_NID
,
9464 .num_channel_mode
= ARRAY_SIZE(alc883_sixstack_modes
),
9465 .channel_mode
= alc883_sixstack_modes
,
9466 .input_mux
= &alc883_capture_source
,
9467 .unsol_event
= alc_automute_amp_unsol_event
,
9468 .setup
= alc888_6st_dell_setup
,
9469 .init_hook
= alc_automute_amp
,
9472 .mixers
= { alc883_mitac_mixer
},
9473 .init_verbs
= { alc883_init_verbs
, alc883_mitac_verbs
},
9474 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9475 .dac_nids
= alc883_dac_nids
,
9476 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9477 .channel_mode
= alc883_3ST_2ch_modes
,
9478 .input_mux
= &alc883_capture_source
,
9479 .unsol_event
= alc_automute_amp_unsol_event
,
9480 .setup
= alc883_mitac_setup
,
9481 .init_hook
= alc_automute_amp
,
9483 [ALC883_FUJITSU_PI2515
] = {
9484 .mixers
= { alc883_2ch_fujitsu_pi2515_mixer
},
9485 .init_verbs
= { alc883_init_verbs
,
9486 alc883_2ch_fujitsu_pi2515_verbs
},
9487 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9488 .dac_nids
= alc883_dac_nids
,
9489 .dig_out_nid
= ALC883_DIGOUT_NID
,
9490 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9491 .channel_mode
= alc883_3ST_2ch_modes
,
9492 .input_mux
= &alc883_fujitsu_pi2515_capture_source
,
9493 .unsol_event
= alc_automute_amp_unsol_event
,
9494 .setup
= alc883_2ch_fujitsu_pi2515_setup
,
9495 .init_hook
= alc_automute_amp
,
9497 [ALC888_FUJITSU_XA3530
] = {
9498 .mixers
= { alc888_base_mixer
, alc883_chmode_mixer
},
9499 .init_verbs
= { alc883_init_verbs
,
9500 alc888_fujitsu_xa3530_verbs
},
9501 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9502 .dac_nids
= alc883_dac_nids
,
9503 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_rev
),
9504 .adc_nids
= alc883_adc_nids_rev
,
9505 .capsrc_nids
= alc883_capsrc_nids_rev
,
9506 .dig_out_nid
= ALC883_DIGOUT_NID
,
9507 .num_channel_mode
= ARRAY_SIZE(alc888_4ST_8ch_intel_modes
),
9508 .channel_mode
= alc888_4ST_8ch_intel_modes
,
9510 ARRAY_SIZE(alc888_2_capture_sources
),
9511 .input_mux
= alc888_2_capture_sources
,
9512 .unsol_event
= alc_automute_amp_unsol_event
,
9513 .setup
= alc888_fujitsu_xa3530_setup
,
9514 .init_hook
= alc_automute_amp
,
9516 [ALC888_LENOVO_SKY
] = {
9517 .mixers
= { alc888_lenovo_sky_mixer
, alc883_chmode_mixer
},
9518 .init_verbs
= { alc883_init_verbs
, alc888_lenovo_sky_verbs
},
9519 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9520 .dac_nids
= alc883_dac_nids
,
9521 .dig_out_nid
= ALC883_DIGOUT_NID
,
9522 .num_channel_mode
= ARRAY_SIZE(alc883_sixstack_modes
),
9523 .channel_mode
= alc883_sixstack_modes
,
9525 .input_mux
= &alc883_lenovo_sky_capture_source
,
9526 .unsol_event
= alc_automute_amp_unsol_event
,
9527 .setup
= alc888_lenovo_sky_setup
,
9528 .init_hook
= alc_automute_amp
,
9530 [ALC888_ASUS_M90V
] = {
9531 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
9532 .init_verbs
= { alc883_init_verbs
, alc888_asus_m90v_verbs
},
9533 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9534 .dac_nids
= alc883_dac_nids
,
9535 .dig_out_nid
= ALC883_DIGOUT_NID
,
9536 .dig_in_nid
= ALC883_DIGIN_NID
,
9537 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9538 .channel_mode
= alc883_3ST_6ch_modes
,
9540 .input_mux
= &alc883_fujitsu_pi2515_capture_source
,
9541 .unsol_event
= alc_sku_unsol_event
,
9542 .setup
= alc883_mode2_setup
,
9543 .init_hook
= alc_inithook
,
9545 [ALC888_ASUS_EEE1601
] = {
9546 .mixers
= { alc883_asus_eee1601_mixer
},
9547 .cap_mixer
= alc883_asus_eee1601_cap_mixer
,
9548 .init_verbs
= { alc883_init_verbs
, alc888_asus_eee1601_verbs
},
9549 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9550 .dac_nids
= alc883_dac_nids
,
9551 .dig_out_nid
= ALC883_DIGOUT_NID
,
9552 .dig_in_nid
= ALC883_DIGIN_NID
,
9553 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9554 .channel_mode
= alc883_3ST_2ch_modes
,
9556 .input_mux
= &alc883_asus_eee1601_capture_source
,
9557 .unsol_event
= alc_sku_unsol_event
,
9558 .init_hook
= alc883_eee1601_inithook
,
9560 [ALC1200_ASUS_P5Q
] = {
9561 .mixers
= { alc883_base_mixer
, alc883_chmode_mixer
},
9562 .init_verbs
= { alc883_init_verbs
},
9563 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9564 .dac_nids
= alc883_dac_nids
,
9565 .dig_out_nid
= ALC1200_DIGOUT_NID
,
9566 .dig_in_nid
= ALC883_DIGIN_NID
,
9567 .slave_dig_outs
= alc1200_slave_dig_outs
,
9568 .num_channel_mode
= ARRAY_SIZE(alc883_sixstack_modes
),
9569 .channel_mode
= alc883_sixstack_modes
,
9570 .input_mux
= &alc883_capture_source
,
9573 .mixers
= { alc889A_mb31_mixer
, alc883_chmode_mixer
},
9574 .init_verbs
= { alc883_init_verbs
, alc889A_mb31_verbs
,
9575 alc880_gpio1_init_verbs
},
9576 .adc_nids
= alc883_adc_nids
,
9577 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids
),
9578 .dac_nids
= alc883_dac_nids
,
9579 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9580 .channel_mode
= alc889A_mb31_6ch_modes
,
9581 .num_channel_mode
= ARRAY_SIZE(alc889A_mb31_6ch_modes
),
9582 .input_mux
= &alc889A_mb31_capture_source
,
9583 .dig_out_nid
= ALC883_DIGOUT_NID
,
9584 .unsol_event
= alc889A_mb31_unsol_event
,
9585 .init_hook
= alc889A_mb31_automute
,
9587 [ALC883_SONY_VAIO_TT
] = {
9588 .mixers
= { alc883_vaiott_mixer
},
9589 .init_verbs
= { alc883_init_verbs
, alc883_vaiott_verbs
},
9590 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9591 .dac_nids
= alc883_dac_nids
,
9592 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9593 .channel_mode
= alc883_3ST_2ch_modes
,
9594 .input_mux
= &alc883_capture_source
,
9595 .unsol_event
= alc_automute_amp_unsol_event
,
9596 .setup
= alc883_vaiott_setup
,
9597 .init_hook
= alc_automute_amp
,
9606 PINFIX_ABIT_AW9D_MAX
9609 static struct alc_pincfg alc882_abit_aw9d_pinfix
[] = {
9610 { 0x15, 0x01080104 }, /* side */
9611 { 0x16, 0x01011012 }, /* rear */
9612 { 0x17, 0x01016011 }, /* clfe */
9616 static const struct alc_fixup alc882_fixups
[] = {
9617 [PINFIX_ABIT_AW9D_MAX
] = {
9618 .pins
= alc882_abit_aw9d_pinfix
9622 static struct snd_pci_quirk alc882_fixup_tbl
[] = {
9623 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX
),
9628 * BIOS auto configuration
9630 static int alc882_auto_create_input_ctls(struct hda_codec
*codec
,
9631 const struct auto_pin_cfg
*cfg
)
9633 return alc_auto_create_input_ctls(codec
, cfg
, 0x0b, 0x23, 0x22);
9636 static void alc882_auto_set_output_and_unmute(struct hda_codec
*codec
,
9637 hda_nid_t nid
, int pin_type
,
9641 struct alc_spec
*spec
= codec
->spec
;
9644 alc_set_pin_output(codec
, nid
, pin_type
);
9645 if (spec
->multiout
.dac_nids
[dac_idx
] == 0x25)
9648 idx
= spec
->multiout
.dac_nids
[dac_idx
] - 2;
9649 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_CONNECT_SEL
, idx
);
9653 static void alc882_auto_init_multi_out(struct hda_codec
*codec
)
9655 struct alc_spec
*spec
= codec
->spec
;
9658 for (i
= 0; i
<= HDA_SIDE
; i
++) {
9659 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
9660 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
9662 alc882_auto_set_output_and_unmute(codec
, nid
, pin_type
,
9667 static void alc882_auto_init_hp_out(struct hda_codec
*codec
)
9669 struct alc_spec
*spec
= codec
->spec
;
9672 pin
= spec
->autocfg
.hp_pins
[0];
9673 if (pin
) /* connect to front */
9675 alc882_auto_set_output_and_unmute(codec
, pin
, PIN_HP
, 0);
9676 pin
= spec
->autocfg
.speaker_pins
[0];
9678 alc882_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
, 0);
9681 static void alc882_auto_init_analog_input(struct hda_codec
*codec
)
9683 struct alc_spec
*spec
= codec
->spec
;
9686 for (i
= 0; i
< AUTO_PIN_LAST
; i
++) {
9687 hda_nid_t nid
= spec
->autocfg
.input_pins
[i
];
9690 alc_set_input_pin(codec
, nid
, i
);
9691 if (get_wcaps(codec
, nid
) & AC_WCAP_OUT_AMP
)
9692 snd_hda_codec_write(codec
, nid
, 0,
9693 AC_VERB_SET_AMP_GAIN_MUTE
,
9698 static void alc882_auto_init_input_src(struct hda_codec
*codec
)
9700 struct alc_spec
*spec
= codec
->spec
;
9703 for (c
= 0; c
< spec
->num_adc_nids
; c
++) {
9704 hda_nid_t conn_list
[HDA_MAX_NUM_INPUTS
];
9705 hda_nid_t nid
= spec
->capsrc_nids
[c
];
9706 unsigned int mux_idx
;
9707 const struct hda_input_mux
*imux
;
9708 int conns
, mute
, idx
, item
;
9710 conns
= snd_hda_get_connections(codec
, nid
, conn_list
,
9711 ARRAY_SIZE(conn_list
));
9714 mux_idx
= c
>= spec
->num_mux_defs
? 0 : c
;
9715 imux
= &spec
->input_mux
[mux_idx
];
9716 for (idx
= 0; idx
< conns
; idx
++) {
9717 /* if the current connection is the selected one,
9718 * unmute it as default - otherwise mute it
9720 mute
= AMP_IN_MUTE(idx
);
9721 for (item
= 0; item
< imux
->num_items
; item
++) {
9722 if (imux
->items
[item
].index
== idx
) {
9723 if (spec
->cur_mux
[c
] == item
)
9724 mute
= AMP_IN_UNMUTE(idx
);
9728 /* check if we have a selector or mixer
9729 * we could check for the widget type instead, but
9730 * just check for Amp-In presence (in case of mixer
9731 * without amp-in there is something wrong, this
9732 * function shouldn't be used or capsrc nid is wrong)
9734 if (get_wcaps(codec
, nid
) & AC_WCAP_IN_AMP
)
9735 snd_hda_codec_write(codec
, nid
, 0,
9736 AC_VERB_SET_AMP_GAIN_MUTE
,
9738 else if (mute
!= AMP_IN_MUTE(idx
))
9739 snd_hda_codec_write(codec
, nid
, 0,
9740 AC_VERB_SET_CONNECT_SEL
,
9746 /* add mic boosts if needed */
9747 static int alc_auto_add_mic_boost(struct hda_codec
*codec
)
9749 struct alc_spec
*spec
= codec
->spec
;
9753 nid
= spec
->autocfg
.input_pins
[AUTO_PIN_MIC
];
9754 if (nid
&& (get_wcaps(codec
, nid
) & AC_WCAP_IN_AMP
)) {
9755 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
,
9757 HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_INPUT
));
9761 nid
= spec
->autocfg
.input_pins
[AUTO_PIN_FRONT_MIC
];
9762 if (nid
&& (get_wcaps(codec
, nid
) & AC_WCAP_IN_AMP
)) {
9763 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
,
9765 HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_INPUT
));
9772 /* almost identical with ALC880 parser... */
9773 static int alc882_parse_auto_config(struct hda_codec
*codec
)
9775 struct alc_spec
*spec
= codec
->spec
;
9776 static hda_nid_t alc882_ignore
[] = { 0x1d, 0 };
9779 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
9783 if (!spec
->autocfg
.line_outs
)
9784 return 0; /* can't find valid BIOS pin config */
9786 err
= alc880_auto_fill_dac_nids(spec
, &spec
->autocfg
);
9789 err
= alc880_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
9792 err
= alc880_auto_create_extra_out(spec
,
9793 spec
->autocfg
.speaker_pins
[0],
9797 err
= alc880_auto_create_extra_out(spec
, spec
->autocfg
.hp_pins
[0],
9801 err
= alc882_auto_create_input_ctls(codec
, &spec
->autocfg
);
9805 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
9807 /* check multiple SPDIF-out (for recent codecs) */
9808 for (i
= 0; i
< spec
->autocfg
.dig_outs
; i
++) {
9810 err
= snd_hda_get_connections(codec
,
9811 spec
->autocfg
.dig_out_pins
[i
],
9816 spec
->multiout
.dig_out_nid
= dig_nid
;
9818 spec
->multiout
.slave_dig_outs
= spec
->slave_dig_outs
;
9819 if (i
>= ARRAY_SIZE(spec
->slave_dig_outs
) - 1)
9821 spec
->slave_dig_outs
[i
- 1] = dig_nid
;
9824 if (spec
->autocfg
.dig_in_pin
)
9825 spec
->dig_in_nid
= ALC880_DIGIN_NID
;
9827 if (spec
->kctls
.list
)
9828 add_mixer(spec
, spec
->kctls
.list
);
9830 add_verb(spec
, alc883_auto_init_verbs
);
9831 /* if ADC 0x07 is available, initialize it, too */
9832 if (get_wcaps_type(get_wcaps(codec
, 0x07)) == AC_WID_AUD_IN
)
9833 add_verb(spec
, alc882_adc1_init_verbs
);
9835 spec
->num_mux_defs
= 1;
9836 spec
->input_mux
= &spec
->private_imux
[0];
9838 alc_ssid_check(codec
, 0x15, 0x1b, 0x14);
9840 err
= alc_auto_add_mic_boost(codec
);
9844 return 1; /* config found */
9847 /* additional initialization for auto-configuration model */
9848 static void alc882_auto_init(struct hda_codec
*codec
)
9850 struct alc_spec
*spec
= codec
->spec
;
9851 alc882_auto_init_multi_out(codec
);
9852 alc882_auto_init_hp_out(codec
);
9853 alc882_auto_init_analog_input(codec
);
9854 alc882_auto_init_input_src(codec
);
9855 if (spec
->unsol_event
)
9856 alc_inithook(codec
);
9859 static int patch_alc882(struct hda_codec
*codec
)
9861 struct alc_spec
*spec
;
9862 int err
, board_config
;
9864 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
9870 switch (codec
->vendor_id
) {
9875 /* ALC883 and variants */
9876 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
9880 board_config
= snd_hda_check_board_config(codec
, ALC882_MODEL_LAST
,
9884 if (board_config
< 0 || board_config
>= ALC882_MODEL_LAST
)
9885 board_config
= snd_hda_check_board_codec_sid_config(codec
,
9886 ALC882_MODEL_LAST
, alc882_models
, alc882_ssid_cfg_tbl
);
9888 if (board_config
< 0 || board_config
>= ALC882_MODEL_LAST
) {
9889 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
9891 board_config
= ALC882_AUTO
;
9894 alc_pick_fixup(codec
, alc882_fixup_tbl
, alc882_fixups
);
9896 if (board_config
== ALC882_AUTO
) {
9897 /* automatic parse from the BIOS config */
9898 err
= alc882_parse_auto_config(codec
);
9904 "hda_codec: Cannot set up configuration "
9905 "from BIOS. Using base mode...\n");
9906 board_config
= ALC882_3ST_DIG
;
9910 err
= snd_hda_attach_beep_device(codec
, 0x1);
9916 if (board_config
!= ALC882_AUTO
)
9917 setup_preset(codec
, &alc882_presets
[board_config
]);
9919 spec
->stream_analog_playback
= &alc882_pcm_analog_playback
;
9920 spec
->stream_analog_capture
= &alc882_pcm_analog_capture
;
9921 /* FIXME: setup DAC5 */
9922 /*spec->stream_analog_alt_playback = &alc880_pcm_analog_alt_playback;*/
9923 spec
->stream_analog_alt_capture
= &alc880_pcm_analog_alt_capture
;
9925 spec
->stream_digital_playback
= &alc882_pcm_digital_playback
;
9926 spec
->stream_digital_capture
= &alc882_pcm_digital_capture
;
9928 if (codec
->vendor_id
== 0x10ec0888)
9929 spec
->init_amp
= ALC_INIT_DEFAULT
; /* always initialize */
9931 if (!spec
->adc_nids
&& spec
->input_mux
) {
9933 spec
->num_adc_nids
= 0;
9934 for (i
= 0; i
< ARRAY_SIZE(alc882_adc_nids
); i
++) {
9936 hda_nid_t nid
= alc882_adc_nids
[i
];
9937 unsigned int wcap
= get_wcaps(codec
, nid
);
9939 wcap
= get_wcaps_type(wcap
);
9940 if (wcap
!= AC_WID_AUD_IN
)
9942 spec
->private_adc_nids
[spec
->num_adc_nids
] = nid
;
9943 err
= snd_hda_get_connections(codec
, nid
, &cap
, 1);
9946 spec
->private_capsrc_nids
[spec
->num_adc_nids
] = cap
;
9947 spec
->num_adc_nids
++;
9949 spec
->adc_nids
= spec
->private_adc_nids
;
9950 spec
->capsrc_nids
= spec
->private_capsrc_nids
;
9953 set_capture_mixer(codec
);
9954 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
9956 spec
->vmaster_nid
= 0x0c;
9958 codec
->patch_ops
= alc_patch_ops
;
9959 if (board_config
== ALC882_AUTO
)
9960 spec
->init_hook
= alc882_auto_init
;
9961 #ifdef CONFIG_SND_HDA_POWER_SAVE
9962 if (!spec
->loopback
.amplist
)
9963 spec
->loopback
.amplist
= alc882_loopbacks
;
9965 codec
->proc_widget_hook
= print_realtek_coef
;
9975 #define ALC262_DIGOUT_NID ALC880_DIGOUT_NID
9976 #define ALC262_DIGIN_NID ALC880_DIGIN_NID
9978 #define alc262_dac_nids alc260_dac_nids
9979 #define alc262_adc_nids alc882_adc_nids
9980 #define alc262_adc_nids_alt alc882_adc_nids_alt
9981 #define alc262_capsrc_nids alc882_capsrc_nids
9982 #define alc262_capsrc_nids_alt alc882_capsrc_nids_alt
9984 #define alc262_modes alc260_modes
9985 #define alc262_capture_source alc882_capture_source
9987 static hda_nid_t alc262_dmic_adc_nids
[1] = {
9992 static hda_nid_t alc262_dmic_capsrc_nids
[1] = { 0x22 };
9994 static struct snd_kcontrol_new alc262_base_mixer
[] = {
9995 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
9996 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
9997 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
9998 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
9999 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
10000 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
10001 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10002 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10003 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10004 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10005 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10006 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
10007 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0D, 0x0, HDA_OUTPUT
),
10008 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
10009 HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
10010 HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x16, 2, 0x0, HDA_OUTPUT
),
10014 /* update HP, line and mono-out pins according to the master switch */
10015 static void alc262_hp_master_update(struct hda_codec
*codec
)
10017 struct alc_spec
*spec
= codec
->spec
;
10018 int val
= spec
->master_sw
;
10020 /* HP & line-out */
10021 snd_hda_codec_write_cache(codec
, 0x1b, 0,
10022 AC_VERB_SET_PIN_WIDGET_CONTROL
,
10024 snd_hda_codec_write_cache(codec
, 0x15, 0,
10025 AC_VERB_SET_PIN_WIDGET_CONTROL
,
10027 /* mono (speaker) depending on the HP jack sense */
10028 val
= val
&& !spec
->jack_present
;
10029 snd_hda_codec_write_cache(codec
, 0x16, 0,
10030 AC_VERB_SET_PIN_WIDGET_CONTROL
,
10031 val
? PIN_OUT
: 0);
10034 static void alc262_hp_bpc_automute(struct hda_codec
*codec
)
10036 struct alc_spec
*spec
= codec
->spec
;
10037 unsigned int presence
;
10038 presence
= snd_hda_codec_read(codec
, 0x1b, 0,
10039 AC_VERB_GET_PIN_SENSE
, 0);
10040 spec
->jack_present
= !!(presence
& AC_PINSENSE_PRESENCE
);
10041 alc262_hp_master_update(codec
);
10044 static void alc262_hp_bpc_unsol_event(struct hda_codec
*codec
, unsigned int res
)
10046 if ((res
>> 26) != ALC880_HP_EVENT
)
10048 alc262_hp_bpc_automute(codec
);
10051 static void alc262_hp_wildwest_automute(struct hda_codec
*codec
)
10053 struct alc_spec
*spec
= codec
->spec
;
10054 unsigned int presence
;
10055 presence
= snd_hda_codec_read(codec
, 0x15, 0,
10056 AC_VERB_GET_PIN_SENSE
, 0);
10057 spec
->jack_present
= !!(presence
& AC_PINSENSE_PRESENCE
);
10058 alc262_hp_master_update(codec
);
10061 static void alc262_hp_wildwest_unsol_event(struct hda_codec
*codec
,
10064 if ((res
>> 26) != ALC880_HP_EVENT
)
10066 alc262_hp_wildwest_automute(codec
);
10069 #define alc262_hp_master_sw_get alc260_hp_master_sw_get
10071 static int alc262_hp_master_sw_put(struct snd_kcontrol
*kcontrol
,
10072 struct snd_ctl_elem_value
*ucontrol
)
10074 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
10075 struct alc_spec
*spec
= codec
->spec
;
10076 int val
= !!*ucontrol
->value
.integer
.value
;
10078 if (val
== spec
->master_sw
)
10080 spec
->master_sw
= val
;
10081 alc262_hp_master_update(codec
);
10085 #define ALC262_HP_MASTER_SWITCH \
10087 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
10088 .name = "Master Playback Switch", \
10089 .info = snd_ctl_boolean_mono_info, \
10090 .get = alc262_hp_master_sw_get, \
10091 .put = alc262_hp_master_sw_put, \
10094 static struct snd_kcontrol_new alc262_HP_BPC_mixer
[] = {
10095 ALC262_HP_MASTER_SWITCH
,
10096 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10097 HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
10098 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
10099 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0e, 2, 0x0,
10101 HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x16, 2, 0x0,
10103 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10104 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10105 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10106 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10107 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10108 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
10109 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
10110 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
10111 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
10112 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
10113 HDA_CODEC_VOLUME("AUX IN Playback Volume", 0x0b, 0x06, HDA_INPUT
),
10114 HDA_CODEC_MUTE("AUX IN Playback Switch", 0x0b, 0x06, HDA_INPUT
),
10118 static struct snd_kcontrol_new alc262_HP_BPC_WildWest_mixer
[] = {
10119 ALC262_HP_MASTER_SWITCH
,
10120 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10121 HDA_CODEC_MUTE("Front Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
10122 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
10123 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
10124 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0e, 2, 0x0,
10126 HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x16, 2, 0x0,
10128 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x02, HDA_INPUT
),
10129 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x02, HDA_INPUT
),
10130 HDA_CODEC_VOLUME("Front Mic Boost", 0x1a, 0, HDA_INPUT
),
10131 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10132 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10133 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
10134 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
10138 static struct snd_kcontrol_new alc262_HP_BPC_WildWest_option_mixer
[] = {
10139 HDA_CODEC_VOLUME("Rear Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10140 HDA_CODEC_MUTE("Rear Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10141 HDA_CODEC_VOLUME("Rear Mic Boost", 0x18, 0, HDA_INPUT
),
10145 /* mute/unmute internal speaker according to the hp jack and mute state */
10146 static void alc262_hp_t5735_setup(struct hda_codec
*codec
)
10148 struct alc_spec
*spec
= codec
->spec
;
10150 spec
->autocfg
.hp_pins
[0] = 0x15;
10151 spec
->autocfg
.speaker_pins
[0] = 0x0c; /* HACK: not actually a pin */
10154 static struct snd_kcontrol_new alc262_hp_t5735_mixer
[] = {
10155 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10156 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
10157 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
10158 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
10159 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10160 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10161 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10165 static struct hda_verb alc262_hp_t5735_verbs
[] = {
10166 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
10167 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10169 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
10173 static struct snd_kcontrol_new alc262_hp_rp5700_mixer
[] = {
10174 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10175 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
10176 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0e, 0x0, HDA_OUTPUT
),
10177 HDA_CODEC_MUTE("Speaker Playback Switch", 0x16, 0x0, HDA_OUTPUT
),
10178 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10179 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10183 static struct hda_verb alc262_hp_rp5700_verbs
[] = {
10184 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
10185 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
10186 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
10187 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
10188 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
10189 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
10190 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
10191 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
10192 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x00 << 8))},
10193 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x00 << 8))},
10197 static struct hda_input_mux alc262_hp_rp5700_capture_source
= {
10204 /* bind hp and internal speaker mute (with plug check) as master switch */
10205 static void alc262_hippo_master_update(struct hda_codec
*codec
)
10207 struct alc_spec
*spec
= codec
->spec
;
10208 hda_nid_t hp_nid
= spec
->autocfg
.hp_pins
[0];
10209 hda_nid_t line_nid
= spec
->autocfg
.line_out_pins
[0];
10210 hda_nid_t speaker_nid
= spec
->autocfg
.speaker_pins
[0];
10214 mute
= spec
->master_sw
? 0 : HDA_AMP_MUTE
;
10215 snd_hda_codec_amp_stereo(codec
, hp_nid
, HDA_OUTPUT
, 0,
10216 HDA_AMP_MUTE
, mute
);
10217 /* mute internal speaker per jack sense */
10218 if (spec
->jack_present
)
10219 mute
= HDA_AMP_MUTE
;
10221 snd_hda_codec_amp_stereo(codec
, line_nid
, HDA_OUTPUT
, 0,
10222 HDA_AMP_MUTE
, mute
);
10223 if (speaker_nid
&& speaker_nid
!= line_nid
)
10224 snd_hda_codec_amp_stereo(codec
, speaker_nid
, HDA_OUTPUT
, 0,
10225 HDA_AMP_MUTE
, mute
);
10228 #define alc262_hippo_master_sw_get alc262_hp_master_sw_get
10230 static int alc262_hippo_master_sw_put(struct snd_kcontrol
*kcontrol
,
10231 struct snd_ctl_elem_value
*ucontrol
)
10233 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
10234 struct alc_spec
*spec
= codec
->spec
;
10235 int val
= !!*ucontrol
->value
.integer
.value
;
10237 if (val
== spec
->master_sw
)
10239 spec
->master_sw
= val
;
10240 alc262_hippo_master_update(codec
);
10244 #define ALC262_HIPPO_MASTER_SWITCH \
10246 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
10247 .name = "Master Playback Switch", \
10248 .info = snd_ctl_boolean_mono_info, \
10249 .get = alc262_hippo_master_sw_get, \
10250 .put = alc262_hippo_master_sw_put, \
10253 static struct snd_kcontrol_new alc262_hippo_mixer
[] = {
10254 ALC262_HIPPO_MASTER_SWITCH
,
10255 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10256 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
10257 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
10258 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
10259 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
10260 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10261 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10262 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10263 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10264 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10265 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
10266 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
10270 static struct snd_kcontrol_new alc262_hippo1_mixer
[] = {
10271 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10272 ALC262_HIPPO_MASTER_SWITCH
,
10273 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
10274 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
10275 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
10276 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
10277 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10278 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10279 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10280 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10281 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10282 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
10286 /* mute/unmute internal speaker according to the hp jack and mute state */
10287 static void alc262_hippo_automute(struct hda_codec
*codec
)
10289 struct alc_spec
*spec
= codec
->spec
;
10290 hda_nid_t hp_nid
= spec
->autocfg
.hp_pins
[0];
10291 unsigned int present
;
10293 /* need to execute and sync at first */
10294 snd_hda_codec_read(codec
, hp_nid
, 0, AC_VERB_SET_PIN_SENSE
, 0);
10295 present
= snd_hda_codec_read(codec
, hp_nid
, 0,
10296 AC_VERB_GET_PIN_SENSE
, 0);
10297 spec
->jack_present
= (present
& 0x80000000) != 0;
10298 alc262_hippo_master_update(codec
);
10301 static void alc262_hippo_unsol_event(struct hda_codec
*codec
, unsigned int res
)
10303 if ((res
>> 26) != ALC880_HP_EVENT
)
10305 alc262_hippo_automute(codec
);
10308 static void alc262_hippo_setup(struct hda_codec
*codec
)
10310 struct alc_spec
*spec
= codec
->spec
;
10312 spec
->autocfg
.hp_pins
[0] = 0x15;
10313 spec
->autocfg
.speaker_pins
[0] = 0x14;
10316 static void alc262_hippo1_setup(struct hda_codec
*codec
)
10318 struct alc_spec
*spec
= codec
->spec
;
10320 spec
->autocfg
.hp_pins
[0] = 0x1b;
10321 spec
->autocfg
.speaker_pins
[0] = 0x14;
10325 static struct snd_kcontrol_new alc262_sony_mixer
[] = {
10326 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10327 ALC262_HIPPO_MASTER_SWITCH
,
10328 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10329 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10330 HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10331 HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10335 static struct snd_kcontrol_new alc262_benq_t31_mixer
[] = {
10336 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10337 ALC262_HIPPO_MASTER_SWITCH
,
10338 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
10339 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10340 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10341 HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10342 HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10346 static struct snd_kcontrol_new alc262_tyan_mixer
[] = {
10347 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10348 HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT
),
10349 HDA_CODEC_VOLUME("Aux Playback Volume", 0x0b, 0x06, HDA_INPUT
),
10350 HDA_CODEC_MUTE("Aux Playback Switch", 0x0b, 0x06, HDA_INPUT
),
10351 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
10352 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
10353 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10354 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10355 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10356 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10357 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10358 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
10362 static struct hda_verb alc262_tyan_verbs
[] = {
10363 /* Headphone automute */
10364 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
10365 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10366 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
10368 /* P11 AUX_IN, white 4-pin connector */
10369 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
10370 {0x14, AC_VERB_SET_CONFIG_DEFAULT_BYTES_1
, 0xe1},
10371 {0x14, AC_VERB_SET_CONFIG_DEFAULT_BYTES_2
, 0x93},
10372 {0x14, AC_VERB_SET_CONFIG_DEFAULT_BYTES_3
, 0x19},
10377 /* unsolicited event for HP jack sensing */
10378 static void alc262_tyan_setup(struct hda_codec
*codec
)
10380 struct alc_spec
*spec
= codec
->spec
;
10382 spec
->autocfg
.hp_pins
[0] = 0x1b;
10383 spec
->autocfg
.speaker_pins
[0] = 0x15;
10387 #define alc262_capture_mixer alc882_capture_mixer
10388 #define alc262_capture_alt_mixer alc882_capture_alt_mixer
10391 * generic initialization of ADC, input mixers and output mixers
10393 static struct hda_verb alc262_init_verbs
[] = {
10395 * Unmute ADC0-2 and set the default input to mic-in
10397 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
10398 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10399 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
10400 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10401 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
10402 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10404 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
10406 * Note: PASD motherboards uses the Line In 2 as the input for
10407 * front panel mic (mic 2)
10409 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
10410 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
10411 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
10412 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
10413 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
10414 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
10417 * Set up output mixers (0x0c - 0x0e)
10419 /* set vol=0 to output mixers */
10420 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
10421 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
10422 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
10423 /* set up input amps for analog loopback */
10424 /* Amp Indices: DAC = 0, mixer = 1 */
10425 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10426 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
10427 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10428 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
10429 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10430 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
10432 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
10433 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
10434 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
10435 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
10436 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
10437 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
10439 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
10440 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
10441 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
10442 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
10443 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
10445 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
10446 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
10448 /* FIXME: use matrix-type input source selection */
10449 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
10450 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
10451 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
10452 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
10453 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
10454 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
10456 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
10457 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
10458 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
10459 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
10461 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
10462 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
10463 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
10464 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
10469 static struct hda_verb alc262_eapd_verbs
[] = {
10470 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
10471 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
10475 static struct hda_verb alc262_hippo1_unsol_verbs
[] = {
10476 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
10477 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
10478 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
10480 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
10481 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10485 static struct hda_verb alc262_sony_unsol_verbs
[] = {
10486 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
10487 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
10488 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24}, // Front Mic
10490 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
10491 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10495 static struct snd_kcontrol_new alc262_toshiba_s06_mixer
[] = {
10496 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10497 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
10498 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
10499 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10500 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10504 static struct hda_verb alc262_toshiba_s06_verbs
[] = {
10505 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
10506 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
10507 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10508 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
10509 {0x22, AC_VERB_SET_CONNECT_SEL
, 0x09},
10510 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
10511 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
10512 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
10516 static void alc262_toshiba_s06_setup(struct hda_codec
*codec
)
10518 struct alc_spec
*spec
= codec
->spec
;
10520 spec
->autocfg
.hp_pins
[0] = 0x15;
10521 spec
->autocfg
.speaker_pins
[0] = 0x14;
10522 spec
->ext_mic
.pin
= 0x18;
10523 spec
->ext_mic
.mux_idx
= 0;
10524 spec
->int_mic
.pin
= 0x12;
10525 spec
->int_mic
.mux_idx
= 9;
10526 spec
->auto_mic
= 1;
10532 * 0x16 = internal speaker
10533 * 0x18 = external mic
10536 static struct snd_kcontrol_new alc262_nec_mixer
[] = {
10537 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
10538 HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x16, 0, 0x0, HDA_OUTPUT
),
10540 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10541 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10542 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10544 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
10545 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
10549 static struct hda_verb alc262_nec_verbs
[] = {
10550 /* Unmute Speaker */
10551 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
10554 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
10555 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
10557 /* External mic to headphone */
10558 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
10559 /* External mic to speaker */
10560 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
10566 * 0x14 = headphone/spdif-out, 0x15 = internal speaker,
10567 * 0x1b = port replicator headphone out
10570 #define ALC_HP_EVENT 0x37
10572 static struct hda_verb alc262_fujitsu_unsol_verbs
[] = {
10573 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC_HP_EVENT
},
10574 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10575 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC_HP_EVENT
},
10576 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10580 static struct hda_verb alc262_lenovo_3000_unsol_verbs
[] = {
10581 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC_HP_EVENT
},
10582 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10586 static struct hda_input_mux alc262_fujitsu_capture_source
= {
10590 { "Int Mic", 0x1 },
10595 static struct hda_input_mux alc262_HP_capture_source
= {
10599 { "Front Mic", 0x1 },
10606 static struct hda_input_mux alc262_HP_D7000_capture_source
= {
10610 { "Front Mic", 0x2 },
10616 /* mute/unmute internal speaker according to the hp jacks and mute state */
10617 static void alc262_fujitsu_automute(struct hda_codec
*codec
, int force
)
10619 struct alc_spec
*spec
= codec
->spec
;
10622 if (force
|| !spec
->sense_updated
) {
10623 unsigned int present
;
10624 /* need to execute and sync at first */
10625 snd_hda_codec_read(codec
, 0x14, 0, AC_VERB_SET_PIN_SENSE
, 0);
10626 /* check laptop HP jack */
10627 present
= snd_hda_codec_read(codec
, 0x14, 0,
10628 AC_VERB_GET_PIN_SENSE
, 0);
10629 /* need to execute and sync at first */
10630 snd_hda_codec_read(codec
, 0x1b, 0, AC_VERB_SET_PIN_SENSE
, 0);
10631 /* check docking HP jack */
10632 present
|= snd_hda_codec_read(codec
, 0x1b, 0,
10633 AC_VERB_GET_PIN_SENSE
, 0);
10634 if (present
& AC_PINSENSE_PRESENCE
)
10635 spec
->jack_present
= 1;
10637 spec
->jack_present
= 0;
10638 spec
->sense_updated
= 1;
10640 /* unmute internal speaker only if both HPs are unplugged and
10641 * master switch is on
10643 if (spec
->jack_present
)
10644 mute
= HDA_AMP_MUTE
;
10646 mute
= snd_hda_codec_amp_read(codec
, 0x14, 0, HDA_OUTPUT
, 0);
10647 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
10648 HDA_AMP_MUTE
, mute
);
10651 /* unsolicited event for HP jack sensing */
10652 static void alc262_fujitsu_unsol_event(struct hda_codec
*codec
,
10655 if ((res
>> 26) != ALC_HP_EVENT
)
10657 alc262_fujitsu_automute(codec
, 1);
10660 static void alc262_fujitsu_init_hook(struct hda_codec
*codec
)
10662 alc262_fujitsu_automute(codec
, 1);
10665 /* bind volumes of both NID 0x0c and 0x0d */
10666 static struct hda_bind_ctls alc262_fujitsu_bind_master_vol
= {
10667 .ops
= &snd_hda_bind_vol
,
10669 HDA_COMPOSE_AMP_VAL(0x0c, 3, 0, HDA_OUTPUT
),
10670 HDA_COMPOSE_AMP_VAL(0x0d, 3, 0, HDA_OUTPUT
),
10675 /* mute/unmute internal speaker according to the hp jack and mute state */
10676 static void alc262_lenovo_3000_automute(struct hda_codec
*codec
, int force
)
10678 struct alc_spec
*spec
= codec
->spec
;
10681 if (force
|| !spec
->sense_updated
) {
10682 unsigned int present_int_hp
;
10683 /* need to execute and sync at first */
10684 snd_hda_codec_read(codec
, 0x1b, 0, AC_VERB_SET_PIN_SENSE
, 0);
10685 present_int_hp
= snd_hda_codec_read(codec
, 0x1b, 0,
10686 AC_VERB_GET_PIN_SENSE
, 0);
10687 spec
->jack_present
= (present_int_hp
& 0x80000000) != 0;
10688 spec
->sense_updated
= 1;
10690 if (spec
->jack_present
) {
10691 /* mute internal speaker */
10692 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
10693 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
10694 snd_hda_codec_amp_stereo(codec
, 0x16, HDA_OUTPUT
, 0,
10695 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
10697 /* unmute internal speaker if necessary */
10698 mute
= snd_hda_codec_amp_read(codec
, 0x1b, 0, HDA_OUTPUT
, 0);
10699 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
10700 HDA_AMP_MUTE
, mute
);
10701 snd_hda_codec_amp_stereo(codec
, 0x16, HDA_OUTPUT
, 0,
10702 HDA_AMP_MUTE
, mute
);
10706 /* unsolicited event for HP jack sensing */
10707 static void alc262_lenovo_3000_unsol_event(struct hda_codec
*codec
,
10710 if ((res
>> 26) != ALC_HP_EVENT
)
10712 alc262_lenovo_3000_automute(codec
, 1);
10715 static int amp_stereo_mute_update(struct hda_codec
*codec
, hda_nid_t nid
,
10716 int dir
, int idx
, long *valp
)
10720 for (i
= 0; i
< 2; i
++, valp
++)
10721 change
|= snd_hda_codec_amp_update(codec
, nid
, i
, dir
, idx
,
10723 *valp
? 0 : HDA_AMP_MUTE
);
10727 /* bind hp and internal speaker mute (with plug check) */
10728 static int alc262_fujitsu_master_sw_put(struct snd_kcontrol
*kcontrol
,
10729 struct snd_ctl_elem_value
*ucontrol
)
10731 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
10732 long *valp
= ucontrol
->value
.integer
.value
;
10735 change
= amp_stereo_mute_update(codec
, 0x14, HDA_OUTPUT
, 0, valp
);
10736 change
|= amp_stereo_mute_update(codec
, 0x1b, HDA_OUTPUT
, 0, valp
);
10738 alc262_fujitsu_automute(codec
, 0);
10742 static struct snd_kcontrol_new alc262_fujitsu_mixer
[] = {
10743 HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol
),
10745 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
10746 .name
= "Master Playback Switch",
10747 .info
= snd_hda_mixer_amp_switch_info
,
10748 .get
= snd_hda_mixer_amp_switch_get
,
10749 .put
= alc262_fujitsu_master_sw_put
,
10750 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
10752 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
10753 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
10754 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10755 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10756 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10757 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
10758 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
10759 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
10763 /* bind hp and internal speaker mute (with plug check) */
10764 static int alc262_lenovo_3000_master_sw_put(struct snd_kcontrol
*kcontrol
,
10765 struct snd_ctl_elem_value
*ucontrol
)
10767 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
10768 long *valp
= ucontrol
->value
.integer
.value
;
10771 change
= amp_stereo_mute_update(codec
, 0x1b, HDA_OUTPUT
, 0, valp
);
10773 alc262_lenovo_3000_automute(codec
, 0);
10777 static struct snd_kcontrol_new alc262_lenovo_3000_mixer
[] = {
10778 HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol
),
10780 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
10781 .name
= "Master Playback Switch",
10782 .info
= snd_hda_mixer_amp_switch_info
,
10783 .get
= snd_hda_mixer_amp_switch_get
,
10784 .put
= alc262_lenovo_3000_master_sw_put
,
10785 .private_value
= HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_OUTPUT
),
10787 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
10788 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
10789 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10790 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10791 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10792 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
10793 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
10794 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
10798 static struct snd_kcontrol_new alc262_toshiba_rx1_mixer
[] = {
10799 HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol
),
10800 ALC262_HIPPO_MASTER_SWITCH
,
10801 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10802 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10803 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10804 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10805 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10806 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
10810 /* additional init verbs for Benq laptops */
10811 static struct hda_verb alc262_EAPD_verbs
[] = {
10812 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
10813 {0x20, AC_VERB_SET_PROC_COEF
, 0x3070},
10817 static struct hda_verb alc262_benq_t31_EAPD_verbs
[] = {
10818 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
10819 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
10821 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
10822 {0x20, AC_VERB_SET_PROC_COEF
, 0x3050},
10826 /* Samsung Q1 Ultra Vista model setup */
10827 static struct snd_kcontrol_new alc262_ultra_mixer
[] = {
10828 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10829 HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT
),
10830 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10831 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10832 HDA_CODEC_VOLUME("Mic Boost", 0x19, 0, HDA_INPUT
),
10833 HDA_CODEC_VOLUME("Headphone Mic Boost", 0x15, 0, HDA_INPUT
),
10837 static struct hda_verb alc262_ultra_verbs
[] = {
10839 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
10840 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
10841 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
10843 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
10844 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
10845 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10846 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
10848 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10849 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
10850 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10851 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
10852 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
10854 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
10855 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
10856 /* ADC, choose mic */
10857 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
10858 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
10859 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
10860 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
10861 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
10862 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
10863 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)},
10864 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)},
10865 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)},
10866 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(8)},
10870 /* mute/unmute internal speaker according to the hp jack and mute state */
10871 static void alc262_ultra_automute(struct hda_codec
*codec
)
10873 struct alc_spec
*spec
= codec
->spec
;
10877 /* auto-mute only when HP is used as HP */
10878 if (!spec
->cur_mux
[0]) {
10879 unsigned int present
;
10880 /* need to execute and sync at first */
10881 snd_hda_codec_read(codec
, 0x15, 0, AC_VERB_SET_PIN_SENSE
, 0);
10882 present
= snd_hda_codec_read(codec
, 0x15, 0,
10883 AC_VERB_GET_PIN_SENSE
, 0);
10884 spec
->jack_present
= (present
& AC_PINSENSE_PRESENCE
) != 0;
10885 if (spec
->jack_present
)
10886 mute
= HDA_AMP_MUTE
;
10888 /* mute/unmute internal speaker */
10889 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
10890 HDA_AMP_MUTE
, mute
);
10891 /* mute/unmute HP */
10892 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
10893 HDA_AMP_MUTE
, mute
? 0 : HDA_AMP_MUTE
);
10896 /* unsolicited event for HP jack sensing */
10897 static void alc262_ultra_unsol_event(struct hda_codec
*codec
,
10900 if ((res
>> 26) != ALC880_HP_EVENT
)
10902 alc262_ultra_automute(codec
);
10905 static struct hda_input_mux alc262_ultra_capture_source
= {
10909 { "Headphone", 0x7 },
10913 static int alc262_ultra_mux_enum_put(struct snd_kcontrol
*kcontrol
,
10914 struct snd_ctl_elem_value
*ucontrol
)
10916 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
10917 struct alc_spec
*spec
= codec
->spec
;
10920 ret
= alc_mux_enum_put(kcontrol
, ucontrol
);
10923 /* reprogram the HP pin as mic or HP according to the input source */
10924 snd_hda_codec_write_cache(codec
, 0x15, 0,
10925 AC_VERB_SET_PIN_WIDGET_CONTROL
,
10926 spec
->cur_mux
[0] ? PIN_VREF80
: PIN_HP
);
10927 alc262_ultra_automute(codec
); /* mute/unmute HP */
10931 static struct snd_kcontrol_new alc262_ultra_capture_mixer
[] = {
10932 HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT
),
10933 HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT
),
10935 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
10936 .name
= "Capture Source",
10937 .info
= alc_mux_enum_info
,
10938 .get
= alc_mux_enum_get
,
10939 .put
= alc262_ultra_mux_enum_put
,
10944 /* We use two mixers depending on the output pin; 0x16 is a mono output
10945 * and thus it's bound with a different mixer.
10946 * This function returns which mixer amp should be used.
10948 static int alc262_check_volbit(hda_nid_t nid
)
10952 else if (nid
== 0x16)
10958 static int alc262_add_out_vol_ctl(struct alc_spec
*spec
, hda_nid_t nid
,
10959 const char *pfx
, int *vbits
)
10964 vbit
= alc262_check_volbit(nid
);
10967 if (*vbits
& vbit
) /* a volume control for this mixer already there */
10971 val
= HDA_COMPOSE_AMP_VAL(0x0e, 2, 0, HDA_OUTPUT
);
10973 val
= HDA_COMPOSE_AMP_VAL(0x0c, 3, 0, HDA_OUTPUT
);
10974 return add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, pfx
, val
);
10977 static int alc262_add_out_sw_ctl(struct alc_spec
*spec
, hda_nid_t nid
,
10985 val
= HDA_COMPOSE_AMP_VAL(nid
, 2, 0, HDA_OUTPUT
);
10987 val
= HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_OUTPUT
);
10988 return add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, pfx
, val
);
10991 /* add playback controls from the parsed DAC table */
10992 static int alc262_auto_create_multi_out_ctls(struct alc_spec
*spec
,
10993 const struct auto_pin_cfg
*cfg
)
10999 spec
->multiout
.num_dacs
= 1; /* only use one dac */
11000 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
11001 spec
->multiout
.dac_nids
[0] = 2;
11003 if (!cfg
->speaker_pins
[0] && !cfg
->hp_pins
[0])
11005 else if (cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
11009 err
= alc262_add_out_sw_ctl(spec
, cfg
->line_out_pins
[0], pfx
);
11012 err
= alc262_add_out_sw_ctl(spec
, cfg
->speaker_pins
[0], "Speaker");
11015 err
= alc262_add_out_sw_ctl(spec
, cfg
->hp_pins
[0], "Headphone");
11019 vbits
= alc262_check_volbit(cfg
->line_out_pins
[0]) |
11020 alc262_check_volbit(cfg
->speaker_pins
[0]) |
11021 alc262_check_volbit(cfg
->hp_pins
[0]);
11022 if (vbits
== 1 || vbits
== 2)
11023 pfx
= "Master"; /* only one mixer is used */
11024 else if (cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
11029 err
= alc262_add_out_vol_ctl(spec
, cfg
->line_out_pins
[0], pfx
, &vbits
);
11032 err
= alc262_add_out_vol_ctl(spec
, cfg
->speaker_pins
[0], "Speaker",
11036 err
= alc262_add_out_vol_ctl(spec
, cfg
->hp_pins
[0], "Headphone",
11043 #define alc262_auto_create_input_ctls \
11044 alc880_auto_create_input_ctls
11047 * generic initialization of ADC, input mixers and output mixers
11049 static struct hda_verb alc262_volume_init_verbs
[] = {
11051 * Unmute ADC0-2 and set the default input to mic-in
11053 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
11054 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11055 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
11056 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11057 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
11058 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11060 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
11062 * Note: PASD motherboards uses the Line In 2 as the input for
11063 * front panel mic (mic 2)
11065 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
11066 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
11067 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
11068 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
11069 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
11070 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
11073 * Set up output mixers (0x0c - 0x0f)
11075 /* set vol=0 to output mixers */
11076 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11077 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11078 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11080 /* set up input amps for analog loopback */
11081 /* Amp Indices: DAC = 0, mixer = 1 */
11082 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11083 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11084 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11085 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11086 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11087 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11089 /* FIXME: use matrix-type input source selection */
11090 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
11091 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
11092 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11093 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
11094 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
11095 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
11097 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11098 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
11099 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
11100 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
11102 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11103 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
11104 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
11105 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
11110 static struct hda_verb alc262_HP_BPC_init_verbs
[] = {
11112 * Unmute ADC0-2 and set the default input to mic-in
11114 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
11115 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11116 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
11117 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11118 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
11119 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11121 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
11123 * Note: PASD motherboards uses the Line In 2 as the input for
11124 * front panel mic (mic 2)
11126 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
11127 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
11128 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
11129 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
11130 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
11131 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
11132 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)},
11133 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)},
11136 * Set up output mixers (0x0c - 0x0e)
11138 /* set vol=0 to output mixers */
11139 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11140 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11141 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11143 /* set up input amps for analog loopback */
11144 /* Amp Indices: DAC = 0, mixer = 1 */
11145 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11146 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11147 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11148 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11149 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11150 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11152 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
11153 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
11154 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
11156 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
11157 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
11159 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
11160 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
11162 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
11163 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
11164 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
11165 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
11166 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
11168 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11169 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11170 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11171 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11172 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11173 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11176 /* FIXME: use matrix-type input source selection */
11177 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 0b, 12 */
11178 /* Input mixer1: only unmute Mic */
11179 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11180 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8))},
11181 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
11182 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
11183 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
11184 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x05 << 8))},
11185 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x06 << 8))},
11186 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x07 << 8))},
11187 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x08 << 8))},
11189 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11190 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8))},
11191 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
11192 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
11193 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
11194 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x05 << 8))},
11195 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x06 << 8))},
11196 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x07 << 8))},
11197 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x08 << 8))},
11199 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11200 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8))},
11201 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
11202 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
11203 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
11204 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x05 << 8))},
11205 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x06 << 8))},
11206 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x07 << 8))},
11207 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x08 << 8))},
11209 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
11214 static struct hda_verb alc262_HP_BPC_WildWest_init_verbs
[] = {
11216 * Unmute ADC0-2 and set the default input to mic-in
11218 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
11219 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11220 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
11221 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11222 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
11223 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11225 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
11227 * Note: PASD motherboards uses the Line In 2 as the input for front
11228 * panel mic (mic 2)
11230 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
11231 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
11232 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
11233 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
11234 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
11235 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
11236 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)},
11237 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)},
11238 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)},
11240 * Set up output mixers (0x0c - 0x0e)
11242 /* set vol=0 to output mixers */
11243 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11244 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11245 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11247 /* set up input amps for analog loopback */
11248 /* Amp Indices: DAC = 0, mixer = 1 */
11249 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11250 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11251 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11252 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11253 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11254 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11257 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
}, /* HP */
11258 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
}, /* Mono */
11259 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
}, /* rear MIC */
11260 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* Line in */
11261 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
}, /* Front MIC */
11262 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
}, /* Line out */
11263 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* CD in */
11265 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
11266 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
11268 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
11269 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
11271 /* {0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0x7023 }, */
11272 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11273 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11274 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7023 },
11275 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11276 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11278 /* FIXME: use matrix-type input source selection */
11279 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
11280 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
11281 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))}, /*rear MIC*/
11282 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))}, /*Line in*/
11283 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x02 << 8))}, /*F MIC*/
11284 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x03 << 8))}, /*Front*/
11285 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x04 << 8))}, /*CD*/
11286 /* {0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x06 << 8))}, */
11287 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x07 << 8))}, /*HP*/
11289 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11290 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
11291 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x02 << 8))},
11292 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x03 << 8))},
11293 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x04 << 8))},
11294 /* {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x06 << 8))}, */
11295 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x07 << 8))},
11297 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11298 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
11299 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x02 << 8))},
11300 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x03 << 8))},
11301 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x04 << 8))},
11302 /* {0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x06 << 8))}, */
11303 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x07 << 8))},
11305 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
11310 static struct hda_verb alc262_toshiba_rx1_unsol_verbs
[] = {
11312 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
}, /* Front Speaker */
11313 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
11314 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x01},
11316 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
}, /* MIC jack */
11317 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
}, /* Front MIC */
11318 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0) },
11319 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0) },
11321 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
}, /* HP jack */
11322 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
11323 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
11328 #ifdef CONFIG_SND_HDA_POWER_SAVE
11329 #define alc262_loopbacks alc880_loopbacks
11332 /* pcm configuration: identical with ALC880 */
11333 #define alc262_pcm_analog_playback alc880_pcm_analog_playback
11334 #define alc262_pcm_analog_capture alc880_pcm_analog_capture
11335 #define alc262_pcm_digital_playback alc880_pcm_digital_playback
11336 #define alc262_pcm_digital_capture alc880_pcm_digital_capture
11339 * BIOS auto configuration
11341 static int alc262_parse_auto_config(struct hda_codec
*codec
)
11343 struct alc_spec
*spec
= codec
->spec
;
11345 static hda_nid_t alc262_ignore
[] = { 0x1d, 0 };
11347 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
11351 if (!spec
->autocfg
.line_outs
) {
11352 if (spec
->autocfg
.dig_outs
|| spec
->autocfg
.dig_in_pin
) {
11353 spec
->multiout
.max_channels
= 2;
11354 spec
->no_analog
= 1;
11357 return 0; /* can't find valid BIOS pin config */
11359 err
= alc262_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
11362 err
= alc262_auto_create_input_ctls(codec
, &spec
->autocfg
);
11366 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
11369 if (spec
->autocfg
.dig_outs
) {
11370 spec
->multiout
.dig_out_nid
= ALC262_DIGOUT_NID
;
11371 spec
->dig_out_type
= spec
->autocfg
.dig_out_type
[0];
11373 if (spec
->autocfg
.dig_in_pin
)
11374 spec
->dig_in_nid
= ALC262_DIGIN_NID
;
11376 if (spec
->kctls
.list
)
11377 add_mixer(spec
, spec
->kctls
.list
);
11379 add_verb(spec
, alc262_volume_init_verbs
);
11380 spec
->num_mux_defs
= 1;
11381 spec
->input_mux
= &spec
->private_imux
[0];
11383 err
= alc_auto_add_mic_boost(codec
);
11387 alc_ssid_check(codec
, 0x15, 0x14, 0x1b);
11392 #define alc262_auto_init_multi_out alc882_auto_init_multi_out
11393 #define alc262_auto_init_hp_out alc882_auto_init_hp_out
11394 #define alc262_auto_init_analog_input alc882_auto_init_analog_input
11395 #define alc262_auto_init_input_src alc882_auto_init_input_src
11398 /* init callback for auto-configuration model -- overriding the default init */
11399 static void alc262_auto_init(struct hda_codec
*codec
)
11401 struct alc_spec
*spec
= codec
->spec
;
11402 alc262_auto_init_multi_out(codec
);
11403 alc262_auto_init_hp_out(codec
);
11404 alc262_auto_init_analog_input(codec
);
11405 alc262_auto_init_input_src(codec
);
11406 if (spec
->unsol_event
)
11407 alc_inithook(codec
);
11411 * configuration and preset
11413 static const char *alc262_models
[ALC262_MODEL_LAST
] = {
11414 [ALC262_BASIC
] = "basic",
11415 [ALC262_HIPPO
] = "hippo",
11416 [ALC262_HIPPO_1
] = "hippo_1",
11417 [ALC262_FUJITSU
] = "fujitsu",
11418 [ALC262_HP_BPC
] = "hp-bpc",
11419 [ALC262_HP_BPC_D7000_WL
]= "hp-bpc-d7000",
11420 [ALC262_HP_TC_T5735
] = "hp-tc-t5735",
11421 [ALC262_HP_RP5700
] = "hp-rp5700",
11422 [ALC262_BENQ_ED8
] = "benq",
11423 [ALC262_BENQ_T31
] = "benq-t31",
11424 [ALC262_SONY_ASSAMD
] = "sony-assamd",
11425 [ALC262_TOSHIBA_S06
] = "toshiba-s06",
11426 [ALC262_TOSHIBA_RX1
] = "toshiba-rx1",
11427 [ALC262_ULTRA
] = "ultra",
11428 [ALC262_LENOVO_3000
] = "lenovo-3000",
11429 [ALC262_NEC
] = "nec",
11430 [ALC262_TYAN
] = "tyan",
11431 [ALC262_AUTO
] = "auto",
11434 static struct snd_pci_quirk alc262_cfg_tbl
[] = {
11435 SND_PCI_QUIRK(0x1002, 0x437b, "Hippo", ALC262_HIPPO
),
11436 SND_PCI_QUIRK(0x1033, 0x8895, "NEC Versa S9100", ALC262_NEC
),
11437 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1200, "HP xw series",
11439 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1300, "HP xw series",
11441 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series",
11443 SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL
),
11444 SND_PCI_QUIRK(0x103c, 0x2801, "HP D7000", ALC262_HP_BPC_D7000_WF
),
11445 SND_PCI_QUIRK(0x103c, 0x2802, "HP D7000", ALC262_HP_BPC_D7000_WL
),
11446 SND_PCI_QUIRK(0x103c, 0x2803, "HP D7000", ALC262_HP_BPC_D7000_WF
),
11447 SND_PCI_QUIRK(0x103c, 0x2804, "HP D7000", ALC262_HP_BPC_D7000_WL
),
11448 SND_PCI_QUIRK(0x103c, 0x2805, "HP D7000", ALC262_HP_BPC_D7000_WF
),
11449 SND_PCI_QUIRK(0x103c, 0x2806, "HP D7000", ALC262_HP_BPC_D7000_WL
),
11450 SND_PCI_QUIRK(0x103c, 0x2807, "HP D7000", ALC262_HP_BPC_D7000_WF
),
11451 SND_PCI_QUIRK(0x103c, 0x280c, "HP xw4400", ALC262_HP_BPC
),
11452 SND_PCI_QUIRK(0x103c, 0x3014, "HP xw6400", ALC262_HP_BPC
),
11453 SND_PCI_QUIRK(0x103c, 0x3015, "HP xw8400", ALC262_HP_BPC
),
11454 SND_PCI_QUIRK(0x103c, 0x302f, "HP Thin Client T5735",
11455 ALC262_HP_TC_T5735
),
11456 SND_PCI_QUIRK(0x103c, 0x2817, "HP RP5700", ALC262_HP_RP5700
),
11457 SND_PCI_QUIRK(0x104d, 0x1f00, "Sony ASSAMD", ALC262_SONY_ASSAMD
),
11458 SND_PCI_QUIRK(0x104d, 0x8203, "Sony UX-90", ALC262_HIPPO
),
11459 SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD
),
11460 SND_PCI_QUIRK(0x104d, 0x9016, "Sony VAIO", ALC262_AUTO
), /* dig-only */
11461 SND_PCI_QUIRK(0x104d, 0x9025, "Sony VAIO Z21MN", ALC262_TOSHIBA_S06
),
11462 SND_PCI_QUIRK(0x104d, 0x9035, "Sony VAIO VGN-FW170J", ALC262_AUTO
),
11463 SND_PCI_QUIRK_MASK(0x104d, 0xff00, 0x9000, "Sony VAIO",
11464 ALC262_SONY_ASSAMD
),
11465 SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1",
11466 ALC262_TOSHIBA_RX1
),
11467 SND_PCI_QUIRK(0x1179, 0xff7b, "Toshiba S06", ALC262_TOSHIBA_S06
),
11468 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU
),
11469 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU
),
11470 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_TYAN
),
11471 SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc032, "Samsung Q1",
11473 SND_PCI_QUIRK(0x144d, 0xc510, "Samsung Q45", ALC262_HIPPO
),
11474 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000 y410", ALC262_LENOVO_3000
),
11475 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8
),
11476 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_BENQ_T31
),
11477 SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1
),
11481 static struct alc_config_preset alc262_presets
[] = {
11483 .mixers
= { alc262_base_mixer
},
11484 .init_verbs
= { alc262_init_verbs
},
11485 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11486 .dac_nids
= alc262_dac_nids
,
11488 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11489 .channel_mode
= alc262_modes
,
11490 .input_mux
= &alc262_capture_source
,
11493 .mixers
= { alc262_hippo_mixer
},
11494 .init_verbs
= { alc262_init_verbs
, alc_hp15_unsol_verbs
},
11495 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11496 .dac_nids
= alc262_dac_nids
,
11498 .dig_out_nid
= ALC262_DIGOUT_NID
,
11499 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11500 .channel_mode
= alc262_modes
,
11501 .input_mux
= &alc262_capture_source
,
11502 .unsol_event
= alc262_hippo_unsol_event
,
11503 .setup
= alc262_hippo_setup
,
11504 .init_hook
= alc262_hippo_automute
,
11506 [ALC262_HIPPO_1
] = {
11507 .mixers
= { alc262_hippo1_mixer
},
11508 .init_verbs
= { alc262_init_verbs
, alc262_hippo1_unsol_verbs
},
11509 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11510 .dac_nids
= alc262_dac_nids
,
11512 .dig_out_nid
= ALC262_DIGOUT_NID
,
11513 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11514 .channel_mode
= alc262_modes
,
11515 .input_mux
= &alc262_capture_source
,
11516 .unsol_event
= alc262_hippo_unsol_event
,
11517 .setup
= alc262_hippo1_setup
,
11518 .init_hook
= alc262_hippo_automute
,
11520 [ALC262_FUJITSU
] = {
11521 .mixers
= { alc262_fujitsu_mixer
},
11522 .init_verbs
= { alc262_init_verbs
, alc262_EAPD_verbs
,
11523 alc262_fujitsu_unsol_verbs
},
11524 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11525 .dac_nids
= alc262_dac_nids
,
11527 .dig_out_nid
= ALC262_DIGOUT_NID
,
11528 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11529 .channel_mode
= alc262_modes
,
11530 .input_mux
= &alc262_fujitsu_capture_source
,
11531 .unsol_event
= alc262_fujitsu_unsol_event
,
11532 .init_hook
= alc262_fujitsu_init_hook
,
11534 [ALC262_HP_BPC
] = {
11535 .mixers
= { alc262_HP_BPC_mixer
},
11536 .init_verbs
= { alc262_HP_BPC_init_verbs
},
11537 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11538 .dac_nids
= alc262_dac_nids
,
11540 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11541 .channel_mode
= alc262_modes
,
11542 .input_mux
= &alc262_HP_capture_source
,
11543 .unsol_event
= alc262_hp_bpc_unsol_event
,
11544 .init_hook
= alc262_hp_bpc_automute
,
11546 [ALC262_HP_BPC_D7000_WF
] = {
11547 .mixers
= { alc262_HP_BPC_WildWest_mixer
},
11548 .init_verbs
= { alc262_HP_BPC_WildWest_init_verbs
},
11549 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11550 .dac_nids
= alc262_dac_nids
,
11552 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11553 .channel_mode
= alc262_modes
,
11554 .input_mux
= &alc262_HP_D7000_capture_source
,
11555 .unsol_event
= alc262_hp_wildwest_unsol_event
,
11556 .init_hook
= alc262_hp_wildwest_automute
,
11558 [ALC262_HP_BPC_D7000_WL
] = {
11559 .mixers
= { alc262_HP_BPC_WildWest_mixer
,
11560 alc262_HP_BPC_WildWest_option_mixer
},
11561 .init_verbs
= { alc262_HP_BPC_WildWest_init_verbs
},
11562 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11563 .dac_nids
= alc262_dac_nids
,
11565 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11566 .channel_mode
= alc262_modes
,
11567 .input_mux
= &alc262_HP_D7000_capture_source
,
11568 .unsol_event
= alc262_hp_wildwest_unsol_event
,
11569 .init_hook
= alc262_hp_wildwest_automute
,
11571 [ALC262_HP_TC_T5735
] = {
11572 .mixers
= { alc262_hp_t5735_mixer
},
11573 .init_verbs
= { alc262_init_verbs
, alc262_hp_t5735_verbs
},
11574 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11575 .dac_nids
= alc262_dac_nids
,
11577 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11578 .channel_mode
= alc262_modes
,
11579 .input_mux
= &alc262_capture_source
,
11580 .unsol_event
= alc_automute_amp_unsol_event
,
11581 .setup
= alc262_hp_t5735_setup
,
11582 .init_hook
= alc_automute_amp
,
11584 [ALC262_HP_RP5700
] = {
11585 .mixers
= { alc262_hp_rp5700_mixer
},
11586 .init_verbs
= { alc262_init_verbs
, alc262_hp_rp5700_verbs
},
11587 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11588 .dac_nids
= alc262_dac_nids
,
11589 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11590 .channel_mode
= alc262_modes
,
11591 .input_mux
= &alc262_hp_rp5700_capture_source
,
11593 [ALC262_BENQ_ED8
] = {
11594 .mixers
= { alc262_base_mixer
},
11595 .init_verbs
= { alc262_init_verbs
, alc262_EAPD_verbs
},
11596 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11597 .dac_nids
= alc262_dac_nids
,
11599 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11600 .channel_mode
= alc262_modes
,
11601 .input_mux
= &alc262_capture_source
,
11603 [ALC262_SONY_ASSAMD
] = {
11604 .mixers
= { alc262_sony_mixer
},
11605 .init_verbs
= { alc262_init_verbs
, alc262_sony_unsol_verbs
},
11606 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11607 .dac_nids
= alc262_dac_nids
,
11609 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11610 .channel_mode
= alc262_modes
,
11611 .input_mux
= &alc262_capture_source
,
11612 .unsol_event
= alc262_hippo_unsol_event
,
11613 .setup
= alc262_hippo_setup
,
11614 .init_hook
= alc262_hippo_automute
,
11616 [ALC262_BENQ_T31
] = {
11617 .mixers
= { alc262_benq_t31_mixer
},
11618 .init_verbs
= { alc262_init_verbs
, alc262_benq_t31_EAPD_verbs
,
11619 alc_hp15_unsol_verbs
},
11620 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11621 .dac_nids
= alc262_dac_nids
,
11623 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11624 .channel_mode
= alc262_modes
,
11625 .input_mux
= &alc262_capture_source
,
11626 .unsol_event
= alc262_hippo_unsol_event
,
11627 .setup
= alc262_hippo_setup
,
11628 .init_hook
= alc262_hippo_automute
,
11631 .mixers
= { alc262_ultra_mixer
},
11632 .cap_mixer
= alc262_ultra_capture_mixer
,
11633 .init_verbs
= { alc262_ultra_verbs
},
11634 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11635 .dac_nids
= alc262_dac_nids
,
11636 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11637 .channel_mode
= alc262_modes
,
11638 .input_mux
= &alc262_ultra_capture_source
,
11639 .adc_nids
= alc262_adc_nids
, /* ADC0 */
11640 .capsrc_nids
= alc262_capsrc_nids
,
11641 .num_adc_nids
= 1, /* single ADC */
11642 .unsol_event
= alc262_ultra_unsol_event
,
11643 .init_hook
= alc262_ultra_automute
,
11645 [ALC262_LENOVO_3000
] = {
11646 .mixers
= { alc262_lenovo_3000_mixer
},
11647 .init_verbs
= { alc262_init_verbs
, alc262_EAPD_verbs
,
11648 alc262_lenovo_3000_unsol_verbs
},
11649 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11650 .dac_nids
= alc262_dac_nids
,
11652 .dig_out_nid
= ALC262_DIGOUT_NID
,
11653 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11654 .channel_mode
= alc262_modes
,
11655 .input_mux
= &alc262_fujitsu_capture_source
,
11656 .unsol_event
= alc262_lenovo_3000_unsol_event
,
11659 .mixers
= { alc262_nec_mixer
},
11660 .init_verbs
= { alc262_nec_verbs
},
11661 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11662 .dac_nids
= alc262_dac_nids
,
11664 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11665 .channel_mode
= alc262_modes
,
11666 .input_mux
= &alc262_capture_source
,
11668 [ALC262_TOSHIBA_S06
] = {
11669 .mixers
= { alc262_toshiba_s06_mixer
},
11670 .init_verbs
= { alc262_init_verbs
, alc262_toshiba_s06_verbs
,
11671 alc262_eapd_verbs
},
11672 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11673 .capsrc_nids
= alc262_dmic_capsrc_nids
,
11674 .dac_nids
= alc262_dac_nids
,
11675 .adc_nids
= alc262_dmic_adc_nids
, /* ADC0 */
11676 .num_adc_nids
= 1, /* single ADC */
11677 .dig_out_nid
= ALC262_DIGOUT_NID
,
11678 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11679 .channel_mode
= alc262_modes
,
11680 .unsol_event
= alc_sku_unsol_event
,
11681 .setup
= alc262_toshiba_s06_setup
,
11682 .init_hook
= alc_inithook
,
11684 [ALC262_TOSHIBA_RX1
] = {
11685 .mixers
= { alc262_toshiba_rx1_mixer
},
11686 .init_verbs
= { alc262_init_verbs
, alc262_toshiba_rx1_unsol_verbs
},
11687 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11688 .dac_nids
= alc262_dac_nids
,
11690 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11691 .channel_mode
= alc262_modes
,
11692 .input_mux
= &alc262_capture_source
,
11693 .unsol_event
= alc262_hippo_unsol_event
,
11694 .setup
= alc262_hippo_setup
,
11695 .init_hook
= alc262_hippo_automute
,
11698 .mixers
= { alc262_tyan_mixer
},
11699 .init_verbs
= { alc262_init_verbs
, alc262_tyan_verbs
},
11700 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11701 .dac_nids
= alc262_dac_nids
,
11703 .dig_out_nid
= ALC262_DIGOUT_NID
,
11704 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11705 .channel_mode
= alc262_modes
,
11706 .input_mux
= &alc262_capture_source
,
11707 .unsol_event
= alc_automute_amp_unsol_event
,
11708 .setup
= alc262_tyan_setup
,
11709 .init_hook
= alc_automute_amp
,
11713 static int patch_alc262(struct hda_codec
*codec
)
11715 struct alc_spec
*spec
;
11719 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
11723 codec
->spec
= spec
;
11725 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
11730 snd_hda_codec_write(codec
, 0x1a, 0, AC_VERB_SET_COEF_INDEX
, 7);
11731 tmp
= snd_hda_codec_read(codec
, 0x20, 0, AC_VERB_GET_PROC_COEF
, 0);
11732 snd_hda_codec_write(codec
, 0x1a, 0, AC_VERB_SET_COEF_INDEX
, 7);
11733 snd_hda_codec_write(codec
, 0x1a, 0, AC_VERB_SET_PROC_COEF
, tmp
| 0x80);
11737 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
11739 board_config
= snd_hda_check_board_config(codec
, ALC262_MODEL_LAST
,
11743 if (board_config
< 0) {
11744 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
11746 board_config
= ALC262_AUTO
;
11749 if (board_config
== ALC262_AUTO
) {
11750 /* automatic parse from the BIOS config */
11751 err
= alc262_parse_auto_config(codec
);
11757 "hda_codec: Cannot set up configuration "
11758 "from BIOS. Using base mode...\n");
11759 board_config
= ALC262_BASIC
;
11763 if (!spec
->no_analog
) {
11764 err
= snd_hda_attach_beep_device(codec
, 0x1);
11771 if (board_config
!= ALC262_AUTO
)
11772 setup_preset(codec
, &alc262_presets
[board_config
]);
11774 spec
->stream_analog_playback
= &alc262_pcm_analog_playback
;
11775 spec
->stream_analog_capture
= &alc262_pcm_analog_capture
;
11777 spec
->stream_digital_playback
= &alc262_pcm_digital_playback
;
11778 spec
->stream_digital_capture
= &alc262_pcm_digital_capture
;
11780 if (!spec
->adc_nids
&& spec
->input_mux
) {
11782 /* check whether the digital-mic has to be supported */
11783 for (i
= 0; i
< spec
->input_mux
->num_items
; i
++) {
11784 if (spec
->input_mux
->items
[i
].index
>= 9)
11787 if (i
< spec
->input_mux
->num_items
) {
11788 /* use only ADC0 */
11789 spec
->adc_nids
= alc262_dmic_adc_nids
;
11790 spec
->num_adc_nids
= 1;
11791 spec
->capsrc_nids
= alc262_dmic_capsrc_nids
;
11793 /* all analog inputs */
11794 /* check whether NID 0x07 is valid */
11795 unsigned int wcap
= get_wcaps(codec
, 0x07);
11798 wcap
= get_wcaps_type(wcap
);
11799 if (wcap
!= AC_WID_AUD_IN
) {
11800 spec
->adc_nids
= alc262_adc_nids_alt
;
11801 spec
->num_adc_nids
=
11802 ARRAY_SIZE(alc262_adc_nids_alt
);
11803 spec
->capsrc_nids
= alc262_capsrc_nids_alt
;
11805 spec
->adc_nids
= alc262_adc_nids
;
11806 spec
->num_adc_nids
=
11807 ARRAY_SIZE(alc262_adc_nids
);
11808 spec
->capsrc_nids
= alc262_capsrc_nids
;
11812 if (!spec
->cap_mixer
&& !spec
->no_analog
)
11813 set_capture_mixer(codec
);
11814 if (!spec
->no_analog
)
11815 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
11817 spec
->vmaster_nid
= 0x0c;
11819 codec
->patch_ops
= alc_patch_ops
;
11820 if (board_config
== ALC262_AUTO
)
11821 spec
->init_hook
= alc262_auto_init
;
11822 #ifdef CONFIG_SND_HDA_POWER_SAVE
11823 if (!spec
->loopback
.amplist
)
11824 spec
->loopback
.amplist
= alc262_loopbacks
;
11826 codec
->proc_widget_hook
= print_realtek_coef
;
11832 * ALC268 channel source setting (2 channel)
11834 #define ALC268_DIGOUT_NID ALC880_DIGOUT_NID
11835 #define alc268_modes alc260_modes
11837 static hda_nid_t alc268_dac_nids
[2] = {
11842 static hda_nid_t alc268_adc_nids
[2] = {
11847 static hda_nid_t alc268_adc_nids_alt
[1] = {
11852 static hda_nid_t alc268_capsrc_nids
[2] = { 0x23, 0x24 };
11854 static struct snd_kcontrol_new alc268_base_mixer
[] = {
11855 /* output mixer control */
11856 HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT
),
11857 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
11858 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT
),
11859 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
11860 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
11861 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
11862 HDA_CODEC_VOLUME("Line In Boost", 0x1a, 0, HDA_INPUT
),
11866 static struct snd_kcontrol_new alc268_toshiba_mixer
[] = {
11867 /* output mixer control */
11868 HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT
),
11869 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT
),
11870 ALC262_HIPPO_MASTER_SWITCH
,
11871 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
11872 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
11873 HDA_CODEC_VOLUME("Line In Boost", 0x1a, 0, HDA_INPUT
),
11877 /* bind Beep switches of both NID 0x0f and 0x10 */
11878 static struct hda_bind_ctls alc268_bind_beep_sw
= {
11879 .ops
= &snd_hda_bind_sw
,
11881 HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT
),
11882 HDA_COMPOSE_AMP_VAL(0x10, 3, 1, HDA_INPUT
),
11887 static struct snd_kcontrol_new alc268_beep_mixer
[] = {
11888 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT
),
11889 HDA_BIND_SW("Beep Playback Switch", &alc268_bind_beep_sw
),
11893 static struct hda_verb alc268_eapd_verbs
[] = {
11894 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
11895 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
11899 /* Toshiba specific */
11900 static struct hda_verb alc268_toshiba_verbs
[] = {
11901 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
11905 /* Acer specific */
11906 /* bind volumes of both NID 0x02 and 0x03 */
11907 static struct hda_bind_ctls alc268_acer_bind_master_vol
= {
11908 .ops
= &snd_hda_bind_vol
,
11910 HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT
),
11911 HDA_COMPOSE_AMP_VAL(0x03, 3, 0, HDA_OUTPUT
),
11916 /* mute/unmute internal speaker according to the hp jack and mute state */
11917 static void alc268_acer_automute(struct hda_codec
*codec
, int force
)
11919 struct alc_spec
*spec
= codec
->spec
;
11922 if (force
|| !spec
->sense_updated
) {
11923 unsigned int present
;
11924 present
= snd_hda_codec_read(codec
, 0x14, 0,
11925 AC_VERB_GET_PIN_SENSE
, 0);
11926 spec
->jack_present
= (present
& 0x80000000) != 0;
11927 spec
->sense_updated
= 1;
11929 if (spec
->jack_present
)
11930 mute
= HDA_AMP_MUTE
; /* mute internal speaker */
11931 else /* unmute internal speaker if necessary */
11932 mute
= snd_hda_codec_amp_read(codec
, 0x14, 0, HDA_OUTPUT
, 0);
11933 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
11934 HDA_AMP_MUTE
, mute
);
11938 /* bind hp and internal speaker mute (with plug check) */
11939 static int alc268_acer_master_sw_put(struct snd_kcontrol
*kcontrol
,
11940 struct snd_ctl_elem_value
*ucontrol
)
11942 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
11943 long *valp
= ucontrol
->value
.integer
.value
;
11946 change
= amp_stereo_mute_update(codec
, 0x14, HDA_OUTPUT
, 0, valp
);
11948 alc268_acer_automute(codec
, 0);
11952 static struct snd_kcontrol_new alc268_acer_aspire_one_mixer
[] = {
11953 /* output mixer control */
11954 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol
),
11956 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
11957 .name
= "Master Playback Switch",
11958 .info
= snd_hda_mixer_amp_switch_info
,
11959 .get
= snd_hda_mixer_amp_switch_get
,
11960 .put
= alc268_acer_master_sw_put
,
11961 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
11963 HDA_CODEC_VOLUME("Mic Boost Capture Volume", 0x18, 0, HDA_INPUT
),
11967 static struct snd_kcontrol_new alc268_acer_mixer
[] = {
11968 /* output mixer control */
11969 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol
),
11971 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
11972 .name
= "Master Playback Switch",
11973 .info
= snd_hda_mixer_amp_switch_info
,
11974 .get
= snd_hda_mixer_amp_switch_get
,
11975 .put
= alc268_acer_master_sw_put
,
11976 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
11978 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
11979 HDA_CODEC_VOLUME("Internal Mic Boost", 0x19, 0, HDA_INPUT
),
11980 HDA_CODEC_VOLUME("Line In Boost", 0x1a, 0, HDA_INPUT
),
11984 static struct snd_kcontrol_new alc268_acer_dmic_mixer
[] = {
11985 /* output mixer control */
11986 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol
),
11988 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
11989 .name
= "Master Playback Switch",
11990 .info
= snd_hda_mixer_amp_switch_info
,
11991 .get
= snd_hda_mixer_amp_switch_get
,
11992 .put
= alc268_acer_master_sw_put
,
11993 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
11995 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
11996 HDA_CODEC_VOLUME("Line In Boost", 0x1a, 0, HDA_INPUT
),
12000 static struct hda_verb alc268_acer_aspire_one_verbs
[] = {
12001 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
12002 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
12003 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
12004 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
12005 {0x23, AC_VERB_SET_CONNECT_SEL
, 0x06},
12006 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, 0xa017},
12010 static struct hda_verb alc268_acer_verbs
[] = {
12011 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* internal dmic? */
12012 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
12013 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
12014 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
12015 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
12016 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
12017 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
12021 /* unsolicited event for HP jack sensing */
12022 #define alc268_toshiba_unsol_event alc262_hippo_unsol_event
12023 #define alc268_toshiba_setup alc262_hippo_setup
12024 #define alc268_toshiba_automute alc262_hippo_automute
12026 static void alc268_acer_unsol_event(struct hda_codec
*codec
,
12029 if ((res
>> 26) != ALC880_HP_EVENT
)
12031 alc268_acer_automute(codec
, 1);
12034 static void alc268_acer_init_hook(struct hda_codec
*codec
)
12036 alc268_acer_automute(codec
, 1);
12039 /* toggle speaker-output according to the hp-jack state */
12040 static void alc268_aspire_one_speaker_automute(struct hda_codec
*codec
)
12042 unsigned int present
;
12043 unsigned char bits
;
12045 present
= snd_hda_codec_read(codec
, 0x15, 0,
12046 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
12047 bits
= present
? AMP_IN_MUTE(0) : 0;
12048 snd_hda_codec_amp_stereo(codec
, 0x0f, HDA_INPUT
, 0,
12049 AMP_IN_MUTE(0), bits
);
12050 snd_hda_codec_amp_stereo(codec
, 0x0f, HDA_INPUT
, 1,
12051 AMP_IN_MUTE(0), bits
);
12054 static void alc268_acer_lc_unsol_event(struct hda_codec
*codec
,
12057 switch (res
>> 26) {
12058 case ALC880_HP_EVENT
:
12059 alc268_aspire_one_speaker_automute(codec
);
12061 case ALC880_MIC_EVENT
:
12062 alc_mic_automute(codec
);
12067 static void alc268_acer_lc_setup(struct hda_codec
*codec
)
12069 struct alc_spec
*spec
= codec
->spec
;
12070 spec
->ext_mic
.pin
= 0x18;
12071 spec
->ext_mic
.mux_idx
= 0;
12072 spec
->int_mic
.pin
= 0x12;
12073 spec
->int_mic
.mux_idx
= 6;
12074 spec
->auto_mic
= 1;
12077 static void alc268_acer_lc_init_hook(struct hda_codec
*codec
)
12079 alc268_aspire_one_speaker_automute(codec
);
12080 alc_mic_automute(codec
);
12083 static struct snd_kcontrol_new alc268_dell_mixer
[] = {
12084 /* output mixer control */
12085 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
12086 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
12087 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
12088 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
12089 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
12090 HDA_CODEC_VOLUME("Internal Mic Boost", 0x19, 0, HDA_INPUT
),
12094 static struct hda_verb alc268_dell_verbs
[] = {
12095 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
12096 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
12097 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
12098 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_MIC_EVENT
| AC_USRSP_EN
},
12102 /* mute/unmute internal speaker according to the hp jack and mute state */
12103 static void alc268_dell_setup(struct hda_codec
*codec
)
12105 struct alc_spec
*spec
= codec
->spec
;
12107 spec
->autocfg
.hp_pins
[0] = 0x15;
12108 spec
->autocfg
.speaker_pins
[0] = 0x14;
12109 spec
->ext_mic
.pin
= 0x18;
12110 spec
->ext_mic
.mux_idx
= 0;
12111 spec
->int_mic
.pin
= 0x19;
12112 spec
->int_mic
.mux_idx
= 1;
12113 spec
->auto_mic
= 1;
12116 static struct snd_kcontrol_new alc267_quanta_il1_mixer
[] = {
12117 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x2, 0x0, HDA_OUTPUT
),
12118 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
12119 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT
),
12120 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
12121 HDA_CODEC_VOLUME("Mic Capture Volume", 0x23, 0x0, HDA_OUTPUT
),
12122 HDA_BIND_MUTE("Mic Capture Switch", 0x23, 2, HDA_OUTPUT
),
12123 HDA_CODEC_VOLUME("Ext Mic Boost", 0x18, 0, HDA_INPUT
),
12124 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
12128 static struct hda_verb alc267_quanta_il1_verbs
[] = {
12129 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
12130 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_MIC_EVENT
| AC_USRSP_EN
},
12134 static void alc267_quanta_il1_setup(struct hda_codec
*codec
)
12136 struct alc_spec
*spec
= codec
->spec
;
12137 spec
->autocfg
.hp_pins
[0] = 0x15;
12138 spec
->autocfg
.speaker_pins
[0] = 0x14;
12139 spec
->ext_mic
.pin
= 0x18;
12140 spec
->ext_mic
.mux_idx
= 0;
12141 spec
->int_mic
.pin
= 0x19;
12142 spec
->int_mic
.mux_idx
= 1;
12143 spec
->auto_mic
= 1;
12147 * generic initialization of ADC, input mixers and output mixers
12149 static struct hda_verb alc268_base_init_verbs
[] = {
12150 /* Unmute DAC0-1 and set vol = 0 */
12151 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12152 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12155 * Set up output mixers (0x0c - 0x0e)
12157 /* set vol=0 to output mixers */
12158 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12159 {0x0e, AC_VERB_SET_CONNECT_SEL
, 0x00},
12161 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12162 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12164 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
12165 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
12166 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
12167 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
12168 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
12169 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
12170 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
12171 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
12173 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12174 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12175 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12176 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12177 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12179 /* set PCBEEP vol = 0, mute connections */
12180 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12181 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
12182 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
12184 /* Unmute Selector 23h,24h and set the default input to mic-in */
12186 {0x23, AC_VERB_SET_CONNECT_SEL
, 0x00},
12187 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
12188 {0x24, AC_VERB_SET_CONNECT_SEL
, 0x00},
12189 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
12195 * generic initialization of ADC, input mixers and output mixers
12197 static struct hda_verb alc268_volume_init_verbs
[] = {
12198 /* set output DAC */
12199 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12200 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12202 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
12203 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
12204 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
12205 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
12206 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
12208 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12209 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12210 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12212 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12213 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12215 /* set PCBEEP vol = 0, mute connections */
12216 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12217 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
12218 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
12223 static struct snd_kcontrol_new alc268_capture_nosrc_mixer
[] = {
12224 HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT
),
12225 HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT
),
12229 static struct snd_kcontrol_new alc268_capture_alt_mixer
[] = {
12230 HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT
),
12231 HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT
),
12236 static struct snd_kcontrol_new alc268_capture_mixer
[] = {
12237 HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT
),
12238 HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT
),
12239 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x24, 0x0, HDA_OUTPUT
),
12240 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x24, 0x0, HDA_OUTPUT
),
12245 static struct hda_input_mux alc268_capture_source
= {
12249 { "Front Mic", 0x1 },
12255 static struct hda_input_mux alc268_acer_capture_source
= {
12259 { "Internal Mic", 0x1 },
12264 static struct hda_input_mux alc268_acer_dmic_capture_source
= {
12268 { "Internal Mic", 0x6 },
12273 #ifdef CONFIG_SND_DEBUG
12274 static struct snd_kcontrol_new alc268_test_mixer
[] = {
12275 /* Volume widgets */
12276 HDA_CODEC_VOLUME("LOUT1 Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
12277 HDA_CODEC_VOLUME("LOUT2 Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
12278 HDA_BIND_MUTE_MONO("Mono sum Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
12279 HDA_BIND_MUTE("LINE-OUT sum Playback Switch", 0x0f, 2, HDA_INPUT
),
12280 HDA_BIND_MUTE("HP-OUT sum Playback Switch", 0x10, 2, HDA_INPUT
),
12281 HDA_BIND_MUTE("LINE-OUT Playback Switch", 0x14, 2, HDA_OUTPUT
),
12282 HDA_BIND_MUTE("HP-OUT Playback Switch", 0x15, 2, HDA_OUTPUT
),
12283 HDA_BIND_MUTE("Mono Playback Switch", 0x16, 2, HDA_OUTPUT
),
12284 HDA_CODEC_VOLUME("MIC1 Capture Volume", 0x18, 0x0, HDA_INPUT
),
12285 HDA_BIND_MUTE("MIC1 Capture Switch", 0x18, 2, HDA_OUTPUT
),
12286 HDA_CODEC_VOLUME("MIC2 Capture Volume", 0x19, 0x0, HDA_INPUT
),
12287 HDA_CODEC_VOLUME("LINE1 Capture Volume", 0x1a, 0x0, HDA_INPUT
),
12288 HDA_BIND_MUTE("LINE1 Capture Switch", 0x1a, 2, HDA_OUTPUT
),
12289 /* The below appears problematic on some hardwares */
12290 /*HDA_CODEC_VOLUME("PCBEEP Playback Volume", 0x1d, 0x0, HDA_INPUT),*/
12291 HDA_CODEC_VOLUME("PCM-IN1 Capture Volume", 0x23, 0x0, HDA_OUTPUT
),
12292 HDA_BIND_MUTE("PCM-IN1 Capture Switch", 0x23, 2, HDA_OUTPUT
),
12293 HDA_CODEC_VOLUME("PCM-IN2 Capture Volume", 0x24, 0x0, HDA_OUTPUT
),
12294 HDA_BIND_MUTE("PCM-IN2 Capture Switch", 0x24, 2, HDA_OUTPUT
),
12296 /* Modes for retasking pin widgets */
12297 ALC_PIN_MODE("LINE-OUT pin mode", 0x14, ALC_PIN_DIR_INOUT
),
12298 ALC_PIN_MODE("HP-OUT pin mode", 0x15, ALC_PIN_DIR_INOUT
),
12299 ALC_PIN_MODE("MIC1 pin mode", 0x18, ALC_PIN_DIR_INOUT
),
12300 ALC_PIN_MODE("LINE1 pin mode", 0x1a, ALC_PIN_DIR_INOUT
),
12302 /* Controls for GPIO pins, assuming they are configured as outputs */
12303 ALC_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
12304 ALC_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
12305 ALC_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
12306 ALC_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
12308 /* Switches to allow the digital SPDIF output pin to be enabled.
12309 * The ALC268 does not have an SPDIF input.
12311 ALC_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x06, 0x01),
12313 /* A switch allowing EAPD to be enabled. Some laptops seem to use
12314 * this output to turn on an external amplifier.
12316 ALC_EAPD_CTRL_SWITCH("LINE-OUT EAPD Enable Switch", 0x0f, 0x02),
12317 ALC_EAPD_CTRL_SWITCH("HP-OUT EAPD Enable Switch", 0x10, 0x02),
12323 /* create input playback/capture controls for the given pin */
12324 static int alc268_new_analog_output(struct alc_spec
*spec
, hda_nid_t nid
,
12325 const char *ctlname
, int idx
)
12341 if (spec
->multiout
.dac_nids
[0] != dac
&&
12342 spec
->multiout
.dac_nids
[1] != dac
) {
12343 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, ctlname
,
12344 HDA_COMPOSE_AMP_VAL(dac
, 3, idx
,
12348 spec
->multiout
.dac_nids
[spec
->multiout
.num_dacs
++] = dac
;
12352 err
= add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, ctlname
,
12353 HDA_COMPOSE_AMP_VAL(nid
, 3, idx
, HDA_OUTPUT
));
12355 err
= add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, ctlname
,
12356 HDA_COMPOSE_AMP_VAL(nid
, 2, idx
, HDA_OUTPUT
));
12362 /* add playback controls from the parsed DAC table */
12363 static int alc268_auto_create_multi_out_ctls(struct alc_spec
*spec
,
12364 const struct auto_pin_cfg
*cfg
)
12369 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
12371 nid
= cfg
->line_out_pins
[0];
12374 if (cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
12378 err
= alc268_new_analog_output(spec
, nid
, name
, 0);
12383 nid
= cfg
->speaker_pins
[0];
12385 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, "Speaker",
12386 HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_INPUT
));
12390 err
= alc268_new_analog_output(spec
, nid
, "Speaker", 0);
12394 nid
= cfg
->hp_pins
[0];
12396 err
= alc268_new_analog_output(spec
, nid
, "Headphone", 0);
12401 nid
= cfg
->line_out_pins
[1] | cfg
->line_out_pins
[2];
12403 err
= add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, "Mono",
12404 HDA_COMPOSE_AMP_VAL(nid
, 2, 0, HDA_OUTPUT
));
12411 /* create playback/capture controls for input pins */
12412 static int alc268_auto_create_input_ctls(struct hda_codec
*codec
,
12413 const struct auto_pin_cfg
*cfg
)
12415 return alc_auto_create_input_ctls(codec
, cfg
, 0, 0x23, 0x24);
12418 static void alc268_auto_set_output_and_unmute(struct hda_codec
*codec
,
12419 hda_nid_t nid
, int pin_type
)
12423 alc_set_pin_output(codec
, nid
, pin_type
);
12424 if (nid
== 0x14 || nid
== 0x16)
12428 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_CONNECT_SEL
, idx
);
12431 static void alc268_auto_init_multi_out(struct hda_codec
*codec
)
12433 struct alc_spec
*spec
= codec
->spec
;
12434 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[0];
12436 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
12437 alc268_auto_set_output_and_unmute(codec
, nid
, pin_type
);
12441 static void alc268_auto_init_hp_out(struct hda_codec
*codec
)
12443 struct alc_spec
*spec
= codec
->spec
;
12446 pin
= spec
->autocfg
.hp_pins
[0];
12448 alc268_auto_set_output_and_unmute(codec
, pin
, PIN_HP
);
12449 pin
= spec
->autocfg
.speaker_pins
[0];
12451 alc268_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
);
12454 static void alc268_auto_init_mono_speaker_out(struct hda_codec
*codec
)
12456 struct alc_spec
*spec
= codec
->spec
;
12457 hda_nid_t speaker_nid
= spec
->autocfg
.speaker_pins
[0];
12458 hda_nid_t hp_nid
= spec
->autocfg
.hp_pins
[0];
12459 hda_nid_t line_nid
= spec
->autocfg
.line_out_pins
[0];
12460 unsigned int dac_vol1
, dac_vol2
;
12462 if (line_nid
== 0x1d || speaker_nid
== 0x1d) {
12463 snd_hda_codec_write(codec
, speaker_nid
, 0,
12464 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
12465 /* mute mixer inputs from 0x1d */
12466 snd_hda_codec_write(codec
, 0x0f, 0,
12467 AC_VERB_SET_AMP_GAIN_MUTE
,
12469 snd_hda_codec_write(codec
, 0x10, 0,
12470 AC_VERB_SET_AMP_GAIN_MUTE
,
12473 /* unmute mixer inputs from 0x1d */
12474 snd_hda_codec_write(codec
, 0x0f, 0,
12475 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1));
12476 snd_hda_codec_write(codec
, 0x10, 0,
12477 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1));
12480 dac_vol1
= dac_vol2
= 0xb000 | 0x40; /* set max volume */
12481 if (line_nid
== 0x14)
12482 dac_vol2
= AMP_OUT_ZERO
;
12483 else if (line_nid
== 0x15)
12484 dac_vol1
= AMP_OUT_ZERO
;
12485 if (hp_nid
== 0x14)
12486 dac_vol2
= AMP_OUT_ZERO
;
12487 else if (hp_nid
== 0x15)
12488 dac_vol1
= AMP_OUT_ZERO
;
12489 if (line_nid
!= 0x16 || hp_nid
!= 0x16 ||
12490 spec
->autocfg
.line_out_pins
[1] != 0x16 ||
12491 spec
->autocfg
.line_out_pins
[2] != 0x16)
12492 dac_vol1
= dac_vol2
= AMP_OUT_ZERO
;
12494 snd_hda_codec_write(codec
, 0x02, 0,
12495 AC_VERB_SET_AMP_GAIN_MUTE
, dac_vol1
);
12496 snd_hda_codec_write(codec
, 0x03, 0,
12497 AC_VERB_SET_AMP_GAIN_MUTE
, dac_vol2
);
12500 /* pcm configuration: identical with ALC880 */
12501 #define alc268_pcm_analog_playback alc880_pcm_analog_playback
12502 #define alc268_pcm_analog_capture alc880_pcm_analog_capture
12503 #define alc268_pcm_analog_alt_capture alc880_pcm_analog_alt_capture
12504 #define alc268_pcm_digital_playback alc880_pcm_digital_playback
12507 * BIOS auto configuration
12509 static int alc268_parse_auto_config(struct hda_codec
*codec
)
12511 struct alc_spec
*spec
= codec
->spec
;
12513 static hda_nid_t alc268_ignore
[] = { 0 };
12515 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
12519 if (!spec
->autocfg
.line_outs
) {
12520 if (spec
->autocfg
.dig_outs
|| spec
->autocfg
.dig_in_pin
) {
12521 spec
->multiout
.max_channels
= 2;
12522 spec
->no_analog
= 1;
12525 return 0; /* can't find valid BIOS pin config */
12527 err
= alc268_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
12530 err
= alc268_auto_create_input_ctls(codec
, &spec
->autocfg
);
12534 spec
->multiout
.max_channels
= 2;
12537 /* digital only support output */
12538 if (spec
->autocfg
.dig_outs
) {
12539 spec
->multiout
.dig_out_nid
= ALC268_DIGOUT_NID
;
12540 spec
->dig_out_type
= spec
->autocfg
.dig_out_type
[0];
12542 if (spec
->kctls
.list
)
12543 add_mixer(spec
, spec
->kctls
.list
);
12545 if (!spec
->no_analog
&& spec
->autocfg
.speaker_pins
[0] != 0x1d)
12546 add_mixer(spec
, alc268_beep_mixer
);
12548 add_verb(spec
, alc268_volume_init_verbs
);
12549 spec
->num_mux_defs
= 2;
12550 spec
->input_mux
= &spec
->private_imux
[0];
12552 err
= alc_auto_add_mic_boost(codec
);
12556 alc_ssid_check(codec
, 0x15, 0x1b, 0x14);
12561 #define alc268_auto_init_analog_input alc882_auto_init_analog_input
12563 /* init callback for auto-configuration model -- overriding the default init */
12564 static void alc268_auto_init(struct hda_codec
*codec
)
12566 struct alc_spec
*spec
= codec
->spec
;
12567 alc268_auto_init_multi_out(codec
);
12568 alc268_auto_init_hp_out(codec
);
12569 alc268_auto_init_mono_speaker_out(codec
);
12570 alc268_auto_init_analog_input(codec
);
12571 if (spec
->unsol_event
)
12572 alc_inithook(codec
);
12576 * configuration and preset
12578 static const char *alc268_models
[ALC268_MODEL_LAST
] = {
12579 [ALC267_QUANTA_IL1
] = "quanta-il1",
12580 [ALC268_3ST
] = "3stack",
12581 [ALC268_TOSHIBA
] = "toshiba",
12582 [ALC268_ACER
] = "acer",
12583 [ALC268_ACER_DMIC
] = "acer-dmic",
12584 [ALC268_ACER_ASPIRE_ONE
] = "acer-aspire",
12585 [ALC268_DELL
] = "dell",
12586 [ALC268_ZEPTO
] = "zepto",
12587 #ifdef CONFIG_SND_DEBUG
12588 [ALC268_TEST
] = "test",
12590 [ALC268_AUTO
] = "auto",
12593 static struct snd_pci_quirk alc268_cfg_tbl
[] = {
12594 SND_PCI_QUIRK(0x1025, 0x011e, "Acer Aspire 5720z", ALC268_ACER
),
12595 SND_PCI_QUIRK(0x1025, 0x0126, "Acer", ALC268_ACER
),
12596 SND_PCI_QUIRK(0x1025, 0x012e, "Acer Aspire 5310", ALC268_ACER
),
12597 SND_PCI_QUIRK(0x1025, 0x0130, "Acer Extensa 5210", ALC268_ACER
),
12598 SND_PCI_QUIRK(0x1025, 0x0136, "Acer Aspire 5315", ALC268_ACER
),
12599 SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One",
12600 ALC268_ACER_ASPIRE_ONE
),
12601 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL
),
12602 SND_PCI_QUIRK_MASK(0x1028, 0xfff0, 0x02b0,
12603 "Dell Inspiron Mini9/Vostro A90", ALC268_DELL
),
12604 /* almost compatible with toshiba but with optional digital outs;
12605 * auto-probing seems working fine
12607 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x3000, "HP TX25xx series",
12609 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST
),
12610 SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO
),
12611 SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA
),
12612 SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER
),
12613 SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1
),
12614 SND_PCI_QUIRK(0x1854, 0x1775, "LG R510", ALC268_DELL
),
12618 /* Toshiba laptops have no unique PCI SSID but only codec SSID */
12619 static struct snd_pci_quirk alc268_ssid_cfg_tbl
[] = {
12620 SND_PCI_QUIRK(0x1179, 0xff0a, "TOSHIBA X-200", ALC268_AUTO
),
12621 SND_PCI_QUIRK(0x1179, 0xff0e, "TOSHIBA X-200 HDMI", ALC268_AUTO
),
12622 SND_PCI_QUIRK_MASK(0x1179, 0xff00, 0xff00, "TOSHIBA A/Lx05",
12627 static struct alc_config_preset alc268_presets
[] = {
12628 [ALC267_QUANTA_IL1
] = {
12629 .mixers
= { alc267_quanta_il1_mixer
, alc268_beep_mixer
,
12630 alc268_capture_nosrc_mixer
},
12631 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12632 alc267_quanta_il1_verbs
},
12633 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12634 .dac_nids
= alc268_dac_nids
,
12635 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12636 .adc_nids
= alc268_adc_nids_alt
,
12638 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12639 .channel_mode
= alc268_modes
,
12640 .unsol_event
= alc_sku_unsol_event
,
12641 .setup
= alc267_quanta_il1_setup
,
12642 .init_hook
= alc_inithook
,
12645 .mixers
= { alc268_base_mixer
, alc268_capture_alt_mixer
,
12646 alc268_beep_mixer
},
12647 .init_verbs
= { alc268_base_init_verbs
},
12648 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12649 .dac_nids
= alc268_dac_nids
,
12650 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12651 .adc_nids
= alc268_adc_nids_alt
,
12652 .capsrc_nids
= alc268_capsrc_nids
,
12654 .dig_out_nid
= ALC268_DIGOUT_NID
,
12655 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12656 .channel_mode
= alc268_modes
,
12657 .input_mux
= &alc268_capture_source
,
12659 [ALC268_TOSHIBA
] = {
12660 .mixers
= { alc268_toshiba_mixer
, alc268_capture_alt_mixer
,
12661 alc268_beep_mixer
},
12662 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12663 alc268_toshiba_verbs
},
12664 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12665 .dac_nids
= alc268_dac_nids
,
12666 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12667 .adc_nids
= alc268_adc_nids_alt
,
12668 .capsrc_nids
= alc268_capsrc_nids
,
12670 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12671 .channel_mode
= alc268_modes
,
12672 .input_mux
= &alc268_capture_source
,
12673 .unsol_event
= alc268_toshiba_unsol_event
,
12674 .setup
= alc268_toshiba_setup
,
12675 .init_hook
= alc268_toshiba_automute
,
12678 .mixers
= { alc268_acer_mixer
, alc268_capture_alt_mixer
,
12679 alc268_beep_mixer
},
12680 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12681 alc268_acer_verbs
},
12682 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12683 .dac_nids
= alc268_dac_nids
,
12684 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12685 .adc_nids
= alc268_adc_nids_alt
,
12686 .capsrc_nids
= alc268_capsrc_nids
,
12688 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12689 .channel_mode
= alc268_modes
,
12690 .input_mux
= &alc268_acer_capture_source
,
12691 .unsol_event
= alc268_acer_unsol_event
,
12692 .init_hook
= alc268_acer_init_hook
,
12694 [ALC268_ACER_DMIC
] = {
12695 .mixers
= { alc268_acer_dmic_mixer
, alc268_capture_alt_mixer
,
12696 alc268_beep_mixer
},
12697 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12698 alc268_acer_verbs
},
12699 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12700 .dac_nids
= alc268_dac_nids
,
12701 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12702 .adc_nids
= alc268_adc_nids_alt
,
12703 .capsrc_nids
= alc268_capsrc_nids
,
12705 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12706 .channel_mode
= alc268_modes
,
12707 .input_mux
= &alc268_acer_dmic_capture_source
,
12708 .unsol_event
= alc268_acer_unsol_event
,
12709 .init_hook
= alc268_acer_init_hook
,
12711 [ALC268_ACER_ASPIRE_ONE
] = {
12712 .mixers
= { alc268_acer_aspire_one_mixer
,
12714 alc268_capture_nosrc_mixer
},
12715 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12716 alc268_acer_aspire_one_verbs
},
12717 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12718 .dac_nids
= alc268_dac_nids
,
12719 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12720 .adc_nids
= alc268_adc_nids_alt
,
12721 .capsrc_nids
= alc268_capsrc_nids
,
12723 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12724 .channel_mode
= alc268_modes
,
12725 .unsol_event
= alc268_acer_lc_unsol_event
,
12726 .setup
= alc268_acer_lc_setup
,
12727 .init_hook
= alc268_acer_lc_init_hook
,
12730 .mixers
= { alc268_dell_mixer
, alc268_beep_mixer
,
12731 alc268_capture_nosrc_mixer
},
12732 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12733 alc268_dell_verbs
},
12734 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12735 .dac_nids
= alc268_dac_nids
,
12736 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12737 .adc_nids
= alc268_adc_nids_alt
,
12738 .capsrc_nids
= alc268_capsrc_nids
,
12740 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12741 .channel_mode
= alc268_modes
,
12742 .unsol_event
= alc_sku_unsol_event
,
12743 .setup
= alc268_dell_setup
,
12744 .init_hook
= alc_inithook
,
12747 .mixers
= { alc268_base_mixer
, alc268_capture_alt_mixer
,
12748 alc268_beep_mixer
},
12749 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12750 alc268_toshiba_verbs
},
12751 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12752 .dac_nids
= alc268_dac_nids
,
12753 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12754 .adc_nids
= alc268_adc_nids_alt
,
12755 .capsrc_nids
= alc268_capsrc_nids
,
12757 .dig_out_nid
= ALC268_DIGOUT_NID
,
12758 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12759 .channel_mode
= alc268_modes
,
12760 .input_mux
= &alc268_capture_source
,
12761 .setup
= alc268_toshiba_setup
,
12762 .init_hook
= alc268_toshiba_automute
,
12764 #ifdef CONFIG_SND_DEBUG
12766 .mixers
= { alc268_test_mixer
, alc268_capture_mixer
},
12767 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12768 alc268_volume_init_verbs
},
12769 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12770 .dac_nids
= alc268_dac_nids
,
12771 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12772 .adc_nids
= alc268_adc_nids_alt
,
12773 .capsrc_nids
= alc268_capsrc_nids
,
12775 .dig_out_nid
= ALC268_DIGOUT_NID
,
12776 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12777 .channel_mode
= alc268_modes
,
12778 .input_mux
= &alc268_capture_source
,
12783 static int patch_alc268(struct hda_codec
*codec
)
12785 struct alc_spec
*spec
;
12787 int i
, has_beep
, err
;
12789 spec
= kcalloc(1, sizeof(*spec
), GFP_KERNEL
);
12793 codec
->spec
= spec
;
12795 board_config
= snd_hda_check_board_config(codec
, ALC268_MODEL_LAST
,
12799 if (board_config
< 0 || board_config
>= ALC268_MODEL_LAST
)
12800 board_config
= snd_hda_check_board_codec_sid_config(codec
,
12801 ALC882_MODEL_LAST
, alc268_models
, alc268_ssid_cfg_tbl
);
12803 if (board_config
< 0 || board_config
>= ALC268_MODEL_LAST
) {
12804 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
12806 board_config
= ALC268_AUTO
;
12809 if (board_config
== ALC268_AUTO
) {
12810 /* automatic parse from the BIOS config */
12811 err
= alc268_parse_auto_config(codec
);
12817 "hda_codec: Cannot set up configuration "
12818 "from BIOS. Using base mode...\n");
12819 board_config
= ALC268_3ST
;
12823 if (board_config
!= ALC268_AUTO
)
12824 setup_preset(codec
, &alc268_presets
[board_config
]);
12826 spec
->stream_analog_playback
= &alc268_pcm_analog_playback
;
12827 spec
->stream_analog_capture
= &alc268_pcm_analog_capture
;
12828 spec
->stream_analog_alt_capture
= &alc268_pcm_analog_alt_capture
;
12830 spec
->stream_digital_playback
= &alc268_pcm_digital_playback
;
12833 for (i
= 0; i
< spec
->num_mixers
; i
++) {
12834 if (spec
->mixers
[i
] == alc268_beep_mixer
) {
12841 err
= snd_hda_attach_beep_device(codec
, 0x1);
12846 if (!query_amp_caps(codec
, 0x1d, HDA_INPUT
))
12847 /* override the amp caps for beep generator */
12848 snd_hda_override_amp_caps(codec
, 0x1d, HDA_INPUT
,
12849 (0x0c << AC_AMPCAP_OFFSET_SHIFT
) |
12850 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT
) |
12851 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
12852 (0 << AC_AMPCAP_MUTE_SHIFT
));
12855 if (!spec
->no_analog
&& !spec
->adc_nids
&& spec
->input_mux
) {
12856 /* check whether NID 0x07 is valid */
12857 unsigned int wcap
= get_wcaps(codec
, 0x07);
12860 spec
->capsrc_nids
= alc268_capsrc_nids
;
12862 wcap
= get_wcaps_type(wcap
);
12863 if (spec
->auto_mic
||
12864 wcap
!= AC_WID_AUD_IN
|| spec
->input_mux
->num_items
== 1) {
12865 spec
->adc_nids
= alc268_adc_nids_alt
;
12866 spec
->num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
);
12867 if (spec
->auto_mic
)
12868 fixup_automic_adc(codec
);
12869 if (spec
->auto_mic
|| spec
->input_mux
->num_items
== 1)
12870 add_mixer(spec
, alc268_capture_nosrc_mixer
);
12872 add_mixer(spec
, alc268_capture_alt_mixer
);
12874 spec
->adc_nids
= alc268_adc_nids
;
12875 spec
->num_adc_nids
= ARRAY_SIZE(alc268_adc_nids
);
12876 add_mixer(spec
, alc268_capture_mixer
);
12878 /* set default input source */
12879 for (i
= 0; i
< spec
->num_adc_nids
; i
++)
12880 snd_hda_codec_write_cache(codec
, alc268_capsrc_nids
[i
],
12881 0, AC_VERB_SET_CONNECT_SEL
,
12882 i
< spec
->num_mux_defs
?
12883 spec
->input_mux
[i
].items
[0].index
:
12884 spec
->input_mux
->items
[0].index
);
12887 spec
->vmaster_nid
= 0x02;
12889 codec
->patch_ops
= alc_patch_ops
;
12890 if (board_config
== ALC268_AUTO
)
12891 spec
->init_hook
= alc268_auto_init
;
12893 codec
->proc_widget_hook
= print_realtek_coef
;
12899 * ALC269 channel source setting (2 channel)
12901 #define ALC269_DIGOUT_NID ALC880_DIGOUT_NID
12903 #define alc269_dac_nids alc260_dac_nids
12905 static hda_nid_t alc269_adc_nids
[1] = {
12910 static hda_nid_t alc269_capsrc_nids
[1] = {
12914 /* NOTE: ADC2 (0x07) is connected from a recording *MIXER* (0x24),
12918 #define alc269_modes alc260_modes
12919 #define alc269_capture_source alc880_lg_lw_capture_source
12921 static struct snd_kcontrol_new alc269_base_mixer
[] = {
12922 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
12923 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
12924 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
12925 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
12926 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
12927 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
12928 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
12929 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
12930 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
12931 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
12932 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
12933 HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x16, 2, 0x0, HDA_OUTPUT
),
12937 static struct snd_kcontrol_new alc269_quanta_fl1_mixer
[] = {
12938 /* output mixer control */
12939 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol
),
12941 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
12942 .name
= "Master Playback Switch",
12943 .info
= snd_hda_mixer_amp_switch_info
,
12944 .get
= snd_hda_mixer_amp_switch_get
,
12945 .put
= alc268_acer_master_sw_put
,
12946 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
12948 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
12949 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
12950 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
12951 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
12952 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
12953 HDA_CODEC_VOLUME("Internal Mic Boost", 0x19, 0, HDA_INPUT
),
12957 static struct snd_kcontrol_new alc269_lifebook_mixer
[] = {
12958 /* output mixer control */
12959 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol
),
12961 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
12962 .name
= "Master Playback Switch",
12963 .info
= snd_hda_mixer_amp_switch_info
,
12964 .get
= snd_hda_mixer_amp_switch_get
,
12965 .put
= alc268_acer_master_sw_put
,
12966 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
12968 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
12969 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
12970 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
12971 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
12972 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
12973 HDA_CODEC_VOLUME("Internal Mic Boost", 0x19, 0, HDA_INPUT
),
12974 HDA_CODEC_VOLUME("Dock Mic Playback Volume", 0x0b, 0x03, HDA_INPUT
),
12975 HDA_CODEC_MUTE("Dock Mic Playback Switch", 0x0b, 0x03, HDA_INPUT
),
12976 HDA_CODEC_VOLUME("Dock Mic Boost", 0x1b, 0, HDA_INPUT
),
12980 static struct snd_kcontrol_new alc269_eeepc_mixer
[] = {
12981 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
12982 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
12983 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
12984 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
12988 /* capture mixer elements */
12989 static struct snd_kcontrol_new alc269_epc_capture_mixer
[] = {
12990 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT
),
12991 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT
),
12992 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
12997 #define alc269_fujitsu_mixer alc269_eeepc_mixer
12999 static struct hda_verb alc269_quanta_fl1_verbs
[] = {
13000 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
13001 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13002 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
13003 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
13004 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
13005 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13009 static struct hda_verb alc269_lifebook_verbs
[] = {
13010 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
13011 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01},
13012 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13013 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
13014 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
13015 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13016 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
13017 {0x1a, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
13018 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
13019 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13023 /* toggle speaker-output according to the hp-jack state */
13024 static void alc269_quanta_fl1_speaker_automute(struct hda_codec
*codec
)
13026 unsigned int present
;
13027 unsigned char bits
;
13029 present
= snd_hda_codec_read(codec
, 0x15, 0,
13030 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
13031 bits
= present
? AMP_IN_MUTE(0) : 0;
13032 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
13033 AMP_IN_MUTE(0), bits
);
13034 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
13035 AMP_IN_MUTE(0), bits
);
13037 snd_hda_codec_write(codec
, 0x20, 0,
13038 AC_VERB_SET_COEF_INDEX
, 0x0c);
13039 snd_hda_codec_write(codec
, 0x20, 0,
13040 AC_VERB_SET_PROC_COEF
, 0x680);
13042 snd_hda_codec_write(codec
, 0x20, 0,
13043 AC_VERB_SET_COEF_INDEX
, 0x0c);
13044 snd_hda_codec_write(codec
, 0x20, 0,
13045 AC_VERB_SET_PROC_COEF
, 0x480);
13048 /* toggle speaker-output according to the hp-jacks state */
13049 static void alc269_lifebook_speaker_automute(struct hda_codec
*codec
)
13051 unsigned int present
;
13052 unsigned char bits
;
13054 /* Check laptop headphone socket */
13055 present
= snd_hda_codec_read(codec
, 0x15, 0,
13056 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
13058 /* Check port replicator headphone socket */
13059 present
|= snd_hda_codec_read(codec
, 0x1a, 0,
13060 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
13062 bits
= present
? AMP_IN_MUTE(0) : 0;
13063 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
13064 AMP_IN_MUTE(0), bits
);
13065 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
13066 AMP_IN_MUTE(0), bits
);
13068 snd_hda_codec_write(codec
, 0x20, 0,
13069 AC_VERB_SET_COEF_INDEX
, 0x0c);
13070 snd_hda_codec_write(codec
, 0x20, 0,
13071 AC_VERB_SET_PROC_COEF
, 0x680);
13073 snd_hda_codec_write(codec
, 0x20, 0,
13074 AC_VERB_SET_COEF_INDEX
, 0x0c);
13075 snd_hda_codec_write(codec
, 0x20, 0,
13076 AC_VERB_SET_PROC_COEF
, 0x480);
13079 static void alc269_lifebook_mic_autoswitch(struct hda_codec
*codec
)
13081 unsigned int present_laptop
;
13082 unsigned int present_dock
;
13084 present_laptop
= snd_hda_codec_read(codec
, 0x18, 0,
13085 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
13087 present_dock
= snd_hda_codec_read(codec
, 0x1b, 0,
13088 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
13090 /* Laptop mic port overrides dock mic port, design decision */
13092 snd_hda_codec_write(codec
, 0x23, 0,
13093 AC_VERB_SET_CONNECT_SEL
, 0x3);
13094 if (present_laptop
)
13095 snd_hda_codec_write(codec
, 0x23, 0,
13096 AC_VERB_SET_CONNECT_SEL
, 0x0);
13097 if (!present_dock
&& !present_laptop
)
13098 snd_hda_codec_write(codec
, 0x23, 0,
13099 AC_VERB_SET_CONNECT_SEL
, 0x1);
13102 static void alc269_quanta_fl1_unsol_event(struct hda_codec
*codec
,
13105 switch (res
>> 26) {
13106 case ALC880_HP_EVENT
:
13107 alc269_quanta_fl1_speaker_automute(codec
);
13109 case ALC880_MIC_EVENT
:
13110 alc_mic_automute(codec
);
13115 static void alc269_lifebook_unsol_event(struct hda_codec
*codec
,
13118 if ((res
>> 26) == ALC880_HP_EVENT
)
13119 alc269_lifebook_speaker_automute(codec
);
13120 if ((res
>> 26) == ALC880_MIC_EVENT
)
13121 alc269_lifebook_mic_autoswitch(codec
);
13124 static void alc269_quanta_fl1_setup(struct hda_codec
*codec
)
13126 struct alc_spec
*spec
= codec
->spec
;
13127 spec
->ext_mic
.pin
= 0x18;
13128 spec
->ext_mic
.mux_idx
= 0;
13129 spec
->int_mic
.pin
= 0x19;
13130 spec
->int_mic
.mux_idx
= 1;
13131 spec
->auto_mic
= 1;
13134 static void alc269_quanta_fl1_init_hook(struct hda_codec
*codec
)
13136 alc269_quanta_fl1_speaker_automute(codec
);
13137 alc_mic_automute(codec
);
13140 static void alc269_lifebook_init_hook(struct hda_codec
*codec
)
13142 alc269_lifebook_speaker_automute(codec
);
13143 alc269_lifebook_mic_autoswitch(codec
);
13146 static struct hda_verb alc269_eeepc_dmic_init_verbs
[] = {
13147 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
13148 {0x23, AC_VERB_SET_CONNECT_SEL
, 0x05},
13149 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb026 },
13150 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7019 | (0x00 << 8))},
13151 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13152 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
13153 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
13157 static struct hda_verb alc269_eeepc_amic_init_verbs
[] = {
13158 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
13159 {0x23, AC_VERB_SET_CONNECT_SEL
, 0x01},
13160 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb026 },
13161 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x701b | (0x00 << 8))},
13162 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
13163 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
13167 /* toggle speaker-output according to the hp-jack state */
13168 static void alc269_speaker_automute(struct hda_codec
*codec
)
13170 unsigned int present
;
13171 unsigned char bits
;
13173 present
= snd_hda_codec_read(codec
, 0x15, 0,
13174 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
13175 bits
= present
? AMP_IN_MUTE(0) : 0;
13176 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
13177 AMP_IN_MUTE(0), bits
);
13178 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
13179 AMP_IN_MUTE(0), bits
);
13182 /* unsolicited event for HP jack sensing */
13183 static void alc269_eeepc_unsol_event(struct hda_codec
*codec
,
13186 switch (res
>> 26) {
13187 case ALC880_HP_EVENT
:
13188 alc269_speaker_automute(codec
);
13190 case ALC880_MIC_EVENT
:
13191 alc_mic_automute(codec
);
13196 static void alc269_eeepc_dmic_setup(struct hda_codec
*codec
)
13198 struct alc_spec
*spec
= codec
->spec
;
13199 spec
->ext_mic
.pin
= 0x18;
13200 spec
->ext_mic
.mux_idx
= 0;
13201 spec
->int_mic
.pin
= 0x12;
13202 spec
->int_mic
.mux_idx
= 5;
13203 spec
->auto_mic
= 1;
13206 static void alc269_eeepc_amic_setup(struct hda_codec
*codec
)
13208 struct alc_spec
*spec
= codec
->spec
;
13209 spec
->ext_mic
.pin
= 0x18;
13210 spec
->ext_mic
.mux_idx
= 0;
13211 spec
->int_mic
.pin
= 0x19;
13212 spec
->int_mic
.mux_idx
= 1;
13213 spec
->auto_mic
= 1;
13216 static void alc269_eeepc_inithook(struct hda_codec
*codec
)
13218 alc269_speaker_automute(codec
);
13219 alc_mic_automute(codec
);
13223 * generic initialization of ADC, input mixers and output mixers
13225 static struct hda_verb alc269_init_verbs
[] = {
13227 * Unmute ADC0 and set the default input to mic-in
13229 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13231 /* Mute input amps (PCBeep, Line In, Mic 1 & Mic 2) of the
13232 * analog-loopback mixer widget
13233 * Note: PASD motherboards uses the Line In 2 as the input for
13234 * front panel mic (mic 2)
13236 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
13237 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
13238 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
13239 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
13240 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
13241 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
13244 * Set up output mixers (0x0c - 0x0e)
13246 /* set vol=0 to output mixers */
13247 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
13248 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
13250 /* set up input amps for analog loopback */
13251 /* Amp Indices: DAC = 0, mixer = 1 */
13252 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13253 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13254 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13255 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13256 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13257 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13259 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
13260 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
13261 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
13262 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
13263 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
13264 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13265 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13267 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13268 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13269 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13270 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13271 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13272 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13273 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13275 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
13276 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
13278 /* FIXME: use matrix-type input source selection */
13279 /* Mixer elements: 0x18, 19, 1a, 1b, 1d, 0b */
13280 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
13281 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
13282 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13283 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
13284 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
13287 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
13288 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
13292 #define alc269_auto_create_multi_out_ctls \
13293 alc268_auto_create_multi_out_ctls
13294 #define alc269_auto_create_input_ctls \
13295 alc268_auto_create_input_ctls
13297 #ifdef CONFIG_SND_HDA_POWER_SAVE
13298 #define alc269_loopbacks alc880_loopbacks
13301 /* pcm configuration: identical with ALC880 */
13302 #define alc269_pcm_analog_playback alc880_pcm_analog_playback
13303 #define alc269_pcm_analog_capture alc880_pcm_analog_capture
13304 #define alc269_pcm_digital_playback alc880_pcm_digital_playback
13305 #define alc269_pcm_digital_capture alc880_pcm_digital_capture
13307 static struct hda_pcm_stream alc269_44k_pcm_analog_playback
= {
13311 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
13312 /* NID is set in alc_build_pcms */
13314 .open
= alc880_playback_pcm_open
,
13315 .prepare
= alc880_playback_pcm_prepare
,
13316 .cleanup
= alc880_playback_pcm_cleanup
13320 static struct hda_pcm_stream alc269_44k_pcm_analog_capture
= {
13324 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
13325 /* NID is set in alc_build_pcms */
13329 * BIOS auto configuration
13331 static int alc269_parse_auto_config(struct hda_codec
*codec
)
13333 struct alc_spec
*spec
= codec
->spec
;
13335 static hda_nid_t alc269_ignore
[] = { 0x1d, 0 };
13337 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
13342 err
= alc269_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
13345 err
= alc269_auto_create_input_ctls(codec
, &spec
->autocfg
);
13349 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
13351 if (spec
->autocfg
.dig_outs
)
13352 spec
->multiout
.dig_out_nid
= ALC269_DIGOUT_NID
;
13354 if (spec
->kctls
.list
)
13355 add_mixer(spec
, spec
->kctls
.list
);
13357 add_verb(spec
, alc269_init_verbs
);
13358 spec
->num_mux_defs
= 1;
13359 spec
->input_mux
= &spec
->private_imux
[0];
13360 /* set default input source */
13361 snd_hda_codec_write_cache(codec
, alc269_capsrc_nids
[0],
13362 0, AC_VERB_SET_CONNECT_SEL
,
13363 spec
->input_mux
->items
[0].index
);
13365 err
= alc_auto_add_mic_boost(codec
);
13369 if (!spec
->cap_mixer
&& !spec
->no_analog
)
13370 set_capture_mixer(codec
);
13372 alc_ssid_check(codec
, 0x15, 0x1b, 0x14);
13377 #define alc269_auto_init_multi_out alc268_auto_init_multi_out
13378 #define alc269_auto_init_hp_out alc268_auto_init_hp_out
13379 #define alc269_auto_init_analog_input alc882_auto_init_analog_input
13382 /* init callback for auto-configuration model -- overriding the default init */
13383 static void alc269_auto_init(struct hda_codec
*codec
)
13385 struct alc_spec
*spec
= codec
->spec
;
13386 alc269_auto_init_multi_out(codec
);
13387 alc269_auto_init_hp_out(codec
);
13388 alc269_auto_init_analog_input(codec
);
13389 if (spec
->unsol_event
)
13390 alc_inithook(codec
);
13394 * configuration and preset
13396 static const char *alc269_models
[ALC269_MODEL_LAST
] = {
13397 [ALC269_BASIC
] = "basic",
13398 [ALC269_QUANTA_FL1
] = "quanta",
13399 [ALC269_ASUS_EEEPC_P703
] = "eeepc-p703",
13400 [ALC269_ASUS_EEEPC_P901
] = "eeepc-p901",
13401 [ALC269_FUJITSU
] = "fujitsu",
13402 [ALC269_LIFEBOOK
] = "lifebook",
13403 [ALC269_AUTO
] = "auto",
13406 static struct snd_pci_quirk alc269_cfg_tbl
[] = {
13407 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1
),
13408 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
13409 ALC269_ASUS_EEEPC_P703
),
13410 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_ASUS_EEEPC_P703
),
13411 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_ASUS_EEEPC_P703
),
13412 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_ASUS_EEEPC_P703
),
13413 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_ASUS_EEEPC_P703
),
13414 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_ASUS_EEEPC_P703
),
13415 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_ASUS_EEEPC_P703
),
13416 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901",
13417 ALC269_ASUS_EEEPC_P901
),
13418 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101",
13419 ALC269_ASUS_EEEPC_P901
),
13420 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_ASUS_EEEPC_P901
),
13421 SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU
),
13422 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK
),
13426 static struct alc_config_preset alc269_presets
[] = {
13428 .mixers
= { alc269_base_mixer
},
13429 .init_verbs
= { alc269_init_verbs
},
13430 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
13431 .dac_nids
= alc269_dac_nids
,
13433 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
13434 .channel_mode
= alc269_modes
,
13435 .input_mux
= &alc269_capture_source
,
13437 [ALC269_QUANTA_FL1
] = {
13438 .mixers
= { alc269_quanta_fl1_mixer
},
13439 .init_verbs
= { alc269_init_verbs
, alc269_quanta_fl1_verbs
},
13440 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
13441 .dac_nids
= alc269_dac_nids
,
13443 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
13444 .channel_mode
= alc269_modes
,
13445 .input_mux
= &alc269_capture_source
,
13446 .unsol_event
= alc269_quanta_fl1_unsol_event
,
13447 .setup
= alc269_quanta_fl1_setup
,
13448 .init_hook
= alc269_quanta_fl1_init_hook
,
13450 [ALC269_ASUS_EEEPC_P703
] = {
13451 .mixers
= { alc269_eeepc_mixer
},
13452 .cap_mixer
= alc269_epc_capture_mixer
,
13453 .init_verbs
= { alc269_init_verbs
,
13454 alc269_eeepc_amic_init_verbs
},
13455 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
13456 .dac_nids
= alc269_dac_nids
,
13458 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
13459 .channel_mode
= alc269_modes
,
13460 .unsol_event
= alc269_eeepc_unsol_event
,
13461 .setup
= alc269_eeepc_amic_setup
,
13462 .init_hook
= alc269_eeepc_inithook
,
13464 [ALC269_ASUS_EEEPC_P901
] = {
13465 .mixers
= { alc269_eeepc_mixer
},
13466 .cap_mixer
= alc269_epc_capture_mixer
,
13467 .init_verbs
= { alc269_init_verbs
,
13468 alc269_eeepc_dmic_init_verbs
},
13469 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
13470 .dac_nids
= alc269_dac_nids
,
13472 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
13473 .channel_mode
= alc269_modes
,
13474 .unsol_event
= alc269_eeepc_unsol_event
,
13475 .setup
= alc269_eeepc_dmic_setup
,
13476 .init_hook
= alc269_eeepc_inithook
,
13478 [ALC269_FUJITSU
] = {
13479 .mixers
= { alc269_fujitsu_mixer
},
13480 .cap_mixer
= alc269_epc_capture_mixer
,
13481 .init_verbs
= { alc269_init_verbs
,
13482 alc269_eeepc_dmic_init_verbs
},
13483 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
13484 .dac_nids
= alc269_dac_nids
,
13486 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
13487 .channel_mode
= alc269_modes
,
13488 .unsol_event
= alc269_eeepc_unsol_event
,
13489 .setup
= alc269_eeepc_dmic_setup
,
13490 .init_hook
= alc269_eeepc_inithook
,
13492 [ALC269_LIFEBOOK
] = {
13493 .mixers
= { alc269_lifebook_mixer
},
13494 .init_verbs
= { alc269_init_verbs
, alc269_lifebook_verbs
},
13495 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
13496 .dac_nids
= alc269_dac_nids
,
13498 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
13499 .channel_mode
= alc269_modes
,
13500 .input_mux
= &alc269_capture_source
,
13501 .unsol_event
= alc269_lifebook_unsol_event
,
13502 .init_hook
= alc269_lifebook_init_hook
,
13506 static int patch_alc269(struct hda_codec
*codec
)
13508 struct alc_spec
*spec
;
13512 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
13516 codec
->spec
= spec
;
13518 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
13520 board_config
= snd_hda_check_board_config(codec
, ALC269_MODEL_LAST
,
13524 if (board_config
< 0) {
13525 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
13527 board_config
= ALC269_AUTO
;
13530 if (board_config
== ALC269_AUTO
) {
13531 /* automatic parse from the BIOS config */
13532 err
= alc269_parse_auto_config(codec
);
13538 "hda_codec: Cannot set up configuration "
13539 "from BIOS. Using base mode...\n");
13540 board_config
= ALC269_BASIC
;
13544 err
= snd_hda_attach_beep_device(codec
, 0x1);
13550 if (board_config
!= ALC269_AUTO
)
13551 setup_preset(codec
, &alc269_presets
[board_config
]);
13553 if (codec
->subsystem_id
== 0x17aa3bf8) {
13554 /* Due to a hardware problem on Lenovo Ideadpad, we need to
13555 * fix the sample rate of analog I/O to 44.1kHz
13557 spec
->stream_analog_playback
= &alc269_44k_pcm_analog_playback
;
13558 spec
->stream_analog_capture
= &alc269_44k_pcm_analog_capture
;
13560 spec
->stream_analog_playback
= &alc269_pcm_analog_playback
;
13561 spec
->stream_analog_capture
= &alc269_pcm_analog_capture
;
13563 spec
->stream_digital_playback
= &alc269_pcm_digital_playback
;
13564 spec
->stream_digital_capture
= &alc269_pcm_digital_capture
;
13566 spec
->adc_nids
= alc269_adc_nids
;
13567 spec
->num_adc_nids
= ARRAY_SIZE(alc269_adc_nids
);
13568 spec
->capsrc_nids
= alc269_capsrc_nids
;
13569 if (!spec
->cap_mixer
)
13570 set_capture_mixer(codec
);
13571 set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
13573 spec
->vmaster_nid
= 0x02;
13575 codec
->patch_ops
= alc_patch_ops
;
13576 if (board_config
== ALC269_AUTO
)
13577 spec
->init_hook
= alc269_auto_init
;
13578 #ifdef CONFIG_SND_HDA_POWER_SAVE
13579 if (!spec
->loopback
.amplist
)
13580 spec
->loopback
.amplist
= alc269_loopbacks
;
13582 codec
->proc_widget_hook
= print_realtek_coef
;
13588 * ALC861 channel source setting (2/6 channel selection for 3-stack)
13592 * set the path ways for 2 channel output
13593 * need to set the codec line out and mic 1 pin widgets to inputs
13595 static struct hda_verb alc861_threestack_ch2_init
[] = {
13596 /* set pin widget 1Ah (line in) for input */
13597 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13598 /* set pin widget 18h (mic1/2) for input, for mic also enable
13601 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13603 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c },
13605 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8)) }, /*mic*/
13606 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x02 << 8)) }, /*line-in*/
13612 * need to set the codec line out and mic 1 pin widgets to outputs
13614 static struct hda_verb alc861_threestack_ch6_init
[] = {
13615 /* set pin widget 1Ah (line in) for output (Back Surround)*/
13616 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13617 /* set pin widget 18h (mic1) for output (CLFE)*/
13618 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13620 { 0x0c, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13621 { 0x0d, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13623 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb080 },
13625 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8)) }, /*mic*/
13626 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8)) }, /*line in*/
13631 static struct hda_channel_mode alc861_threestack_modes
[2] = {
13632 { 2, alc861_threestack_ch2_init
},
13633 { 6, alc861_threestack_ch6_init
},
13635 /* Set mic1 as input and unmute the mixer */
13636 static struct hda_verb alc861_uniwill_m31_ch2_init
[] = {
13637 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13638 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8)) }, /*mic*/
13641 /* Set mic1 as output and mute mixer */
13642 static struct hda_verb alc861_uniwill_m31_ch4_init
[] = {
13643 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13644 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8)) }, /*mic*/
13648 static struct hda_channel_mode alc861_uniwill_m31_modes
[2] = {
13649 { 2, alc861_uniwill_m31_ch2_init
},
13650 { 4, alc861_uniwill_m31_ch4_init
},
13653 /* Set mic1 and line-in as input and unmute the mixer */
13654 static struct hda_verb alc861_asus_ch2_init
[] = {
13655 /* set pin widget 1Ah (line in) for input */
13656 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13657 /* set pin widget 18h (mic1/2) for input, for mic also enable
13660 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13662 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c },
13664 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8)) }, /*mic*/
13665 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x02 << 8)) }, /*line-in*/
13669 /* Set mic1 nad line-in as output and mute mixer */
13670 static struct hda_verb alc861_asus_ch6_init
[] = {
13671 /* set pin widget 1Ah (line in) for output (Back Surround)*/
13672 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13673 /* { 0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, */
13674 /* set pin widget 18h (mic1) for output (CLFE)*/
13675 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13676 /* { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, */
13677 { 0x0c, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13678 { 0x0d, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13680 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb080 },
13682 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8)) }, /*mic*/
13683 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8)) }, /*line in*/
13688 static struct hda_channel_mode alc861_asus_modes
[2] = {
13689 { 2, alc861_asus_ch2_init
},
13690 { 6, alc861_asus_ch6_init
},
13695 static struct snd_kcontrol_new alc861_base_mixer
[] = {
13696 /* output mixer control */
13697 HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT
),
13698 HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT
),
13699 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT
),
13700 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT
),
13701 HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT
),
13703 /*Input mixer control */
13704 /* HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT),
13705 HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT), */
13706 HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT
),
13707 HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT
),
13708 HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT
),
13709 HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT
),
13710 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT
),
13711 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT
),
13712 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT
),
13713 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT
),
13718 static struct snd_kcontrol_new alc861_3ST_mixer
[] = {
13719 /* output mixer control */
13720 HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT
),
13721 HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT
),
13722 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT
),
13723 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT
),
13724 /*HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT), */
13726 /* Input mixer control */
13727 /* HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT),
13728 HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT), */
13729 HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT
),
13730 HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT
),
13731 HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT
),
13732 HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT
),
13733 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT
),
13734 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT
),
13735 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT
),
13736 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT
),
13739 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
13740 .name
= "Channel Mode",
13741 .info
= alc_ch_mode_info
,
13742 .get
= alc_ch_mode_get
,
13743 .put
= alc_ch_mode_put
,
13744 .private_value
= ARRAY_SIZE(alc861_threestack_modes
),
13749 static struct snd_kcontrol_new alc861_toshiba_mixer
[] = {
13750 /* output mixer control */
13751 HDA_CODEC_MUTE("Master Playback Switch", 0x03, 0x0, HDA_OUTPUT
),
13752 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT
),
13753 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT
),
13758 static struct snd_kcontrol_new alc861_uniwill_m31_mixer
[] = {
13759 /* output mixer control */
13760 HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT
),
13761 HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT
),
13762 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT
),
13763 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT
),
13764 /*HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT), */
13766 /* Input mixer control */
13767 /* HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT),
13768 HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT), */
13769 HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT
),
13770 HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT
),
13771 HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT
),
13772 HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT
),
13773 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT
),
13774 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT
),
13775 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT
),
13776 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT
),
13779 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
13780 .name
= "Channel Mode",
13781 .info
= alc_ch_mode_info
,
13782 .get
= alc_ch_mode_get
,
13783 .put
= alc_ch_mode_put
,
13784 .private_value
= ARRAY_SIZE(alc861_uniwill_m31_modes
),
13789 static struct snd_kcontrol_new alc861_asus_mixer
[] = {
13790 /* output mixer control */
13791 HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT
),
13792 HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT
),
13793 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT
),
13794 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT
),
13795 HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT
),
13797 /* Input mixer control */
13798 HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT
),
13799 HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
13800 HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT
),
13801 HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT
),
13802 HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT
),
13803 HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT
),
13804 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT
),
13805 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT
),
13806 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT
),
13807 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_OUTPUT
),
13810 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
13811 .name
= "Channel Mode",
13812 .info
= alc_ch_mode_info
,
13813 .get
= alc_ch_mode_get
,
13814 .put
= alc_ch_mode_put
,
13815 .private_value
= ARRAY_SIZE(alc861_asus_modes
),
13820 /* additional mixer */
13821 static struct snd_kcontrol_new alc861_asus_laptop_mixer
[] = {
13822 HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT
),
13823 HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT
),
13828 * generic initialization of ADC, input mixers and output mixers
13830 static struct hda_verb alc861_base_init_verbs
[] = {
13832 * Unmute ADC0 and set the default input to mic-in
13834 /* port-A for surround (rear panel) */
13835 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13836 { 0x0e, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13837 /* port-B for mic-in (rear panel) with vref */
13838 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13839 /* port-C for line-in (rear panel) */
13840 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13841 /* port-D for Front */
13842 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13843 { 0x0b, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13844 /* port-E for HP out (front panel) */
13845 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0 },
13846 /* route front PCM to HP */
13847 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13848 /* port-F for mic-in (front panel) with vref */
13849 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13850 /* port-G for CLFE (rear panel) */
13851 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13852 { 0x1f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13853 /* port-H for side (rear panel) */
13854 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13855 { 0x20, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13857 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13858 /* route front mic to ADC1*/
13859 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
13860 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13862 /* Unmute DAC0~3 & spdif out*/
13863 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13864 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13865 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13866 {0x06, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13867 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13869 /* Unmute Mixer 14 (mic) 1c (Line in)*/
13870 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13871 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13872 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13873 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13875 /* Unmute Stereo Mixer 15 */
13876 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13877 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13878 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
13879 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c}, /* Output 0~12 step */
13881 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13882 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13883 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13884 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13885 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13886 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13887 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13888 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13889 /* hp used DAC 3 (Front) */
13890 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
13891 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
13896 static struct hda_verb alc861_threestack_init_verbs
[] = {
13898 * Unmute ADC0 and set the default input to mic-in
13900 /* port-A for surround (rear panel) */
13901 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
13902 /* port-B for mic-in (rear panel) with vref */
13903 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13904 /* port-C for line-in (rear panel) */
13905 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13906 /* port-D for Front */
13907 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13908 { 0x0b, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13909 /* port-E for HP out (front panel) */
13910 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0 },
13911 /* route front PCM to HP */
13912 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13913 /* port-F for mic-in (front panel) with vref */
13914 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13915 /* port-G for CLFE (rear panel) */
13916 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
13917 /* port-H for side (rear panel) */
13918 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
13920 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13921 /* route front mic to ADC1*/
13922 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
13923 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13924 /* Unmute DAC0~3 & spdif out*/
13925 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13926 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13927 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13928 {0x06, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13929 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13931 /* Unmute Mixer 14 (mic) 1c (Line in)*/
13932 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13933 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13934 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13935 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13937 /* Unmute Stereo Mixer 15 */
13938 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13939 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13940 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
13941 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c}, /* Output 0~12 step */
13943 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13944 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13945 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13946 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13947 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13948 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13949 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13950 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13951 /* hp used DAC 3 (Front) */
13952 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
13953 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
13957 static struct hda_verb alc861_uniwill_m31_init_verbs
[] = {
13959 * Unmute ADC0 and set the default input to mic-in
13961 /* port-A for surround (rear panel) */
13962 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
13963 /* port-B for mic-in (rear panel) with vref */
13964 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13965 /* port-C for line-in (rear panel) */
13966 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13967 /* port-D for Front */
13968 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13969 { 0x0b, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13970 /* port-E for HP out (front panel) */
13971 /* this has to be set to VREF80 */
13972 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13973 /* route front PCM to HP */
13974 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13975 /* port-F for mic-in (front panel) with vref */
13976 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13977 /* port-G for CLFE (rear panel) */
13978 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
13979 /* port-H for side (rear panel) */
13980 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
13982 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13983 /* route front mic to ADC1*/
13984 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
13985 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13986 /* Unmute DAC0~3 & spdif out*/
13987 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13988 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13989 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13990 {0x06, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13991 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13993 /* Unmute Mixer 14 (mic) 1c (Line in)*/
13994 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13995 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13996 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13997 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13999 /* Unmute Stereo Mixer 15 */
14000 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14001 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14002 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
14003 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c}, /* Output 0~12 step */
14005 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14006 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14007 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14008 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14009 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14010 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14011 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14012 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14013 /* hp used DAC 3 (Front) */
14014 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
14015 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
14019 static struct hda_verb alc861_asus_init_verbs
[] = {
14021 * Unmute ADC0 and set the default input to mic-in
14023 /* port-A for surround (rear panel)
14024 * according to codec#0 this is the HP jack
14026 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0 }, /* was 0x00 */
14027 /* route front PCM to HP */
14028 { 0x0e, AC_VERB_SET_CONNECT_SEL
, 0x01 },
14029 /* port-B for mic-in (rear panel) with vref */
14030 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
14031 /* port-C for line-in (rear panel) */
14032 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
14033 /* port-D for Front */
14034 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
14035 { 0x0b, AC_VERB_SET_CONNECT_SEL
, 0x00 },
14036 /* port-E for HP out (front panel) */
14037 /* this has to be set to VREF80 */
14038 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
14039 /* route front PCM to HP */
14040 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
14041 /* port-F for mic-in (front panel) with vref */
14042 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
14043 /* port-G for CLFE (rear panel) */
14044 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
14045 /* port-H for side (rear panel) */
14046 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
14048 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
14049 /* route front mic to ADC1*/
14050 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
14051 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14052 /* Unmute DAC0~3 & spdif out*/
14053 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14054 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14055 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14056 {0x06, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14057 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14058 /* Unmute Mixer 14 (mic) 1c (Line in)*/
14059 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14060 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14061 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14062 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14064 /* Unmute Stereo Mixer 15 */
14065 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14066 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14067 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
14068 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c}, /* Output 0~12 step */
14070 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14071 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14072 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14073 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14074 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14075 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14076 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14077 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14078 /* hp used DAC 3 (Front) */
14079 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
14080 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
14084 /* additional init verbs for ASUS laptops */
14085 static struct hda_verb alc861_asus_laptop_init_verbs
[] = {
14086 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x45 }, /* HP-out */
14087 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2) }, /* mute line-in */
14092 * generic initialization of ADC, input mixers and output mixers
14094 static struct hda_verb alc861_auto_init_verbs
[] = {
14096 * Unmute ADC0 and set the default input to mic-in
14098 /* {0x08, AC_VERB_SET_CONNECT_SEL, 0x00}, */
14099 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14101 /* Unmute DAC0~3 & spdif out*/
14102 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
14103 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
14104 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
14105 {0x06, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
14106 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14108 /* Unmute Mixer 14 (mic) 1c (Line in)*/
14109 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14110 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14111 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14112 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14114 /* Unmute Stereo Mixer 15 */
14115 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14116 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14117 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
14118 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c},
14120 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14121 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14122 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14123 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14124 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14125 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14126 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14127 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14129 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14130 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14131 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
14132 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
14133 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14134 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14135 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
14136 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
14138 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* set Mic 1 */
14143 static struct hda_verb alc861_toshiba_init_verbs
[] = {
14144 {0x0f, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
14149 /* toggle speaker-output according to the hp-jack state */
14150 static void alc861_toshiba_automute(struct hda_codec
*codec
)
14152 unsigned int present
;
14154 present
= snd_hda_codec_read(codec
, 0x0f, 0,
14155 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
14156 snd_hda_codec_amp_stereo(codec
, 0x16, HDA_INPUT
, 0,
14157 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
14158 snd_hda_codec_amp_stereo(codec
, 0x1a, HDA_INPUT
, 3,
14159 HDA_AMP_MUTE
, present
? 0 : HDA_AMP_MUTE
);
14162 static void alc861_toshiba_unsol_event(struct hda_codec
*codec
,
14165 if ((res
>> 26) == ALC880_HP_EVENT
)
14166 alc861_toshiba_automute(codec
);
14169 /* pcm configuration: identical with ALC880 */
14170 #define alc861_pcm_analog_playback alc880_pcm_analog_playback
14171 #define alc861_pcm_analog_capture alc880_pcm_analog_capture
14172 #define alc861_pcm_digital_playback alc880_pcm_digital_playback
14173 #define alc861_pcm_digital_capture alc880_pcm_digital_capture
14176 #define ALC861_DIGOUT_NID 0x07
14178 static struct hda_channel_mode alc861_8ch_modes
[1] = {
14182 static hda_nid_t alc861_dac_nids
[4] = {
14183 /* front, surround, clfe, side */
14184 0x03, 0x06, 0x05, 0x04
14187 static hda_nid_t alc660_dac_nids
[3] = {
14188 /* front, clfe, surround */
14192 static hda_nid_t alc861_adc_nids
[1] = {
14197 static struct hda_input_mux alc861_capture_source
= {
14201 { "Front Mic", 0x3 },
14208 static hda_nid_t
alc861_look_for_dac(struct hda_codec
*codec
, hda_nid_t pin
)
14210 struct alc_spec
*spec
= codec
->spec
;
14211 hda_nid_t mix
, srcs
[5];
14214 if (snd_hda_get_connections(codec
, pin
, &mix
, 1) != 1)
14216 num
= snd_hda_get_connections(codec
, mix
, srcs
, ARRAY_SIZE(srcs
));
14219 for (i
= 0; i
< num
; i
++) {
14221 type
= get_wcaps_type(get_wcaps(codec
, srcs
[i
]));
14222 if (type
!= AC_WID_AUD_OUT
)
14224 for (j
= 0; j
< spec
->multiout
.num_dacs
; j
++)
14225 if (spec
->multiout
.dac_nids
[j
] == srcs
[i
])
14227 if (j
>= spec
->multiout
.num_dacs
)
14233 /* fill in the dac_nids table from the parsed pin configuration */
14234 static int alc861_auto_fill_dac_nids(struct hda_codec
*codec
,
14235 const struct auto_pin_cfg
*cfg
)
14237 struct alc_spec
*spec
= codec
->spec
;
14239 hda_nid_t nid
, dac
;
14241 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
14242 for (i
= 0; i
< cfg
->line_outs
; i
++) {
14243 nid
= cfg
->line_out_pins
[i
];
14244 dac
= alc861_look_for_dac(codec
, nid
);
14247 spec
->multiout
.dac_nids
[spec
->multiout
.num_dacs
++] = dac
;
14252 static int alc861_create_out_sw(struct hda_codec
*codec
, const char *pfx
,
14253 hda_nid_t nid
, unsigned int chs
)
14255 return add_pb_sw_ctrl(codec
->spec
, ALC_CTL_WIDGET_MUTE
, pfx
,
14256 HDA_COMPOSE_AMP_VAL(nid
, chs
, 0, HDA_OUTPUT
));
14259 /* add playback controls from the parsed DAC table */
14260 static int alc861_auto_create_multi_out_ctls(struct hda_codec
*codec
,
14261 const struct auto_pin_cfg
*cfg
)
14263 struct alc_spec
*spec
= codec
->spec
;
14264 static const char *chname
[4] = {
14265 "Front", "Surround", NULL
/*CLFE*/, "Side"
14270 if (cfg
->line_outs
== 1) {
14271 const char *pfx
= NULL
;
14274 else if (cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
14277 nid
= spec
->multiout
.dac_nids
[0];
14278 return alc861_create_out_sw(codec
, pfx
, nid
, 3);
14282 for (i
= 0; i
< cfg
->line_outs
; i
++) {
14283 nid
= spec
->multiout
.dac_nids
[i
];
14288 err
= alc861_create_out_sw(codec
, "Center", nid
, 1);
14291 err
= alc861_create_out_sw(codec
, "LFE", nid
, 2);
14295 err
= alc861_create_out_sw(codec
, chname
[i
], nid
, 3);
14303 static int alc861_auto_create_hp_ctls(struct hda_codec
*codec
, hda_nid_t pin
)
14305 struct alc_spec
*spec
= codec
->spec
;
14312 if ((pin
>= 0x0b && pin
<= 0x10) || pin
== 0x1f || pin
== 0x20) {
14313 nid
= alc861_look_for_dac(codec
, pin
);
14315 err
= alc861_create_out_sw(codec
, "Headphone", nid
, 3);
14318 spec
->multiout
.hp_nid
= nid
;
14324 /* create playback/capture controls for input pins */
14325 static int alc861_auto_create_input_ctls(struct hda_codec
*codec
,
14326 const struct auto_pin_cfg
*cfg
)
14328 return alc_auto_create_input_ctls(codec
, cfg
, 0x15, 0x08, 0);
14331 static void alc861_auto_set_output_and_unmute(struct hda_codec
*codec
,
14333 int pin_type
, hda_nid_t dac
)
14335 hda_nid_t mix
, srcs
[5];
14338 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
14340 snd_hda_codec_write(codec
, dac
, 0, AC_VERB_SET_AMP_GAIN_MUTE
,
14342 if (snd_hda_get_connections(codec
, nid
, &mix
, 1) != 1)
14344 num
= snd_hda_get_connections(codec
, mix
, srcs
, ARRAY_SIZE(srcs
));
14347 for (i
= 0; i
< num
; i
++) {
14349 if (srcs
[i
] == dac
|| srcs
[i
] == 0x15)
14350 mute
= AMP_IN_UNMUTE(i
);
14352 mute
= AMP_IN_MUTE(i
);
14353 snd_hda_codec_write(codec
, mix
, 0, AC_VERB_SET_AMP_GAIN_MUTE
,
14358 static void alc861_auto_init_multi_out(struct hda_codec
*codec
)
14360 struct alc_spec
*spec
= codec
->spec
;
14363 for (i
= 0; i
< spec
->autocfg
.line_outs
; i
++) {
14364 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
14365 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
14367 alc861_auto_set_output_and_unmute(codec
, nid
, pin_type
,
14368 spec
->multiout
.dac_nids
[i
]);
14372 static void alc861_auto_init_hp_out(struct hda_codec
*codec
)
14374 struct alc_spec
*spec
= codec
->spec
;
14376 if (spec
->autocfg
.hp_outs
)
14377 alc861_auto_set_output_and_unmute(codec
,
14378 spec
->autocfg
.hp_pins
[0],
14380 spec
->multiout
.hp_nid
);
14381 if (spec
->autocfg
.speaker_outs
)
14382 alc861_auto_set_output_and_unmute(codec
,
14383 spec
->autocfg
.speaker_pins
[0],
14385 spec
->multiout
.dac_nids
[0]);
14388 static void alc861_auto_init_analog_input(struct hda_codec
*codec
)
14390 struct alc_spec
*spec
= codec
->spec
;
14393 for (i
= 0; i
< AUTO_PIN_LAST
; i
++) {
14394 hda_nid_t nid
= spec
->autocfg
.input_pins
[i
];
14395 if (nid
>= 0x0c && nid
<= 0x11)
14396 alc_set_input_pin(codec
, nid
, i
);
14400 /* parse the BIOS configuration and set up the alc_spec */
14401 /* return 1 if successful, 0 if the proper config is not found,
14402 * or a negative error code
14404 static int alc861_parse_auto_config(struct hda_codec
*codec
)
14406 struct alc_spec
*spec
= codec
->spec
;
14408 static hda_nid_t alc861_ignore
[] = { 0x1d, 0 };
14410 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
14414 if (!spec
->autocfg
.line_outs
)
14415 return 0; /* can't find valid BIOS pin config */
14417 err
= alc861_auto_fill_dac_nids(codec
, &spec
->autocfg
);
14420 err
= alc861_auto_create_multi_out_ctls(codec
, &spec
->autocfg
);
14423 err
= alc861_auto_create_hp_ctls(codec
, spec
->autocfg
.hp_pins
[0]);
14426 err
= alc861_auto_create_input_ctls(codec
, &spec
->autocfg
);
14430 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
14432 if (spec
->autocfg
.dig_outs
)
14433 spec
->multiout
.dig_out_nid
= ALC861_DIGOUT_NID
;
14435 if (spec
->kctls
.list
)
14436 add_mixer(spec
, spec
->kctls
.list
);
14438 add_verb(spec
, alc861_auto_init_verbs
);
14440 spec
->num_mux_defs
= 1;
14441 spec
->input_mux
= &spec
->private_imux
[0];
14443 spec
->adc_nids
= alc861_adc_nids
;
14444 spec
->num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
);
14445 set_capture_mixer(codec
);
14447 alc_ssid_check(codec
, 0x0e, 0x0f, 0x0b);
14452 /* additional initialization for auto-configuration model */
14453 static void alc861_auto_init(struct hda_codec
*codec
)
14455 struct alc_spec
*spec
= codec
->spec
;
14456 alc861_auto_init_multi_out(codec
);
14457 alc861_auto_init_hp_out(codec
);
14458 alc861_auto_init_analog_input(codec
);
14459 if (spec
->unsol_event
)
14460 alc_inithook(codec
);
14463 #ifdef CONFIG_SND_HDA_POWER_SAVE
14464 static struct hda_amp_list alc861_loopbacks
[] = {
14465 { 0x15, HDA_INPUT
, 0 },
14466 { 0x15, HDA_INPUT
, 1 },
14467 { 0x15, HDA_INPUT
, 2 },
14468 { 0x15, HDA_INPUT
, 3 },
14475 * configuration and preset
14477 static const char *alc861_models
[ALC861_MODEL_LAST
] = {
14478 [ALC861_3ST
] = "3stack",
14479 [ALC660_3ST
] = "3stack-660",
14480 [ALC861_3ST_DIG
] = "3stack-dig",
14481 [ALC861_6ST_DIG
] = "6stack-dig",
14482 [ALC861_UNIWILL_M31
] = "uniwill-m31",
14483 [ALC861_TOSHIBA
] = "toshiba",
14484 [ALC861_ASUS
] = "asus",
14485 [ALC861_ASUS_LAPTOP
] = "asus-laptop",
14486 [ALC861_AUTO
] = "auto",
14489 static struct snd_pci_quirk alc861_cfg_tbl
[] = {
14490 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC861_3ST
),
14491 SND_PCI_QUIRK(0x1043, 0x1335, "ASUS F2/3", ALC861_ASUS_LAPTOP
),
14492 SND_PCI_QUIRK(0x1043, 0x1338, "ASUS F2/3", ALC861_ASUS_LAPTOP
),
14493 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS", ALC861_ASUS
),
14494 SND_PCI_QUIRK(0x1043, 0x13d7, "ASUS A9rp", ALC861_ASUS_LAPTOP
),
14495 SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS P1-AH2", ALC861_3ST_DIG
),
14496 SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba", ALC861_TOSHIBA
),
14497 /* FIXME: the entry below breaks Toshiba A100 (model=auto works!)
14498 * Any other models that need this preset?
14500 /* SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba", ALC861_TOSHIBA), */
14501 SND_PCI_QUIRK(0x1462, 0x7254, "HP dx2200 (MSI MS-7254)", ALC861_3ST
),
14502 SND_PCI_QUIRK(0x1462, 0x7297, "HP dx2250 (MSI MS-7297)", ALC861_3ST
),
14503 SND_PCI_QUIRK(0x1584, 0x2b01, "Uniwill X40AIx", ALC861_UNIWILL_M31
),
14504 SND_PCI_QUIRK(0x1584, 0x9072, "Uniwill m31", ALC861_UNIWILL_M31
),
14505 SND_PCI_QUIRK(0x1584, 0x9075, "Airis Praxis N1212", ALC861_ASUS_LAPTOP
),
14506 /* FIXME: the below seems conflict */
14507 /* SND_PCI_QUIRK(0x1584, 0x9075, "Uniwill", ALC861_UNIWILL_M31), */
14508 SND_PCI_QUIRK(0x1849, 0x0660, "Asrock 939SLI32", ALC660_3ST
),
14509 SND_PCI_QUIRK(0x8086, 0xd600, "Intel", ALC861_3ST
),
14513 static struct alc_config_preset alc861_presets
[] = {
14515 .mixers
= { alc861_3ST_mixer
},
14516 .init_verbs
= { alc861_threestack_init_verbs
},
14517 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
14518 .dac_nids
= alc861_dac_nids
,
14519 .num_channel_mode
= ARRAY_SIZE(alc861_threestack_modes
),
14520 .channel_mode
= alc861_threestack_modes
,
14522 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14523 .adc_nids
= alc861_adc_nids
,
14524 .input_mux
= &alc861_capture_source
,
14526 [ALC861_3ST_DIG
] = {
14527 .mixers
= { alc861_base_mixer
},
14528 .init_verbs
= { alc861_threestack_init_verbs
},
14529 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
14530 .dac_nids
= alc861_dac_nids
,
14531 .dig_out_nid
= ALC861_DIGOUT_NID
,
14532 .num_channel_mode
= ARRAY_SIZE(alc861_threestack_modes
),
14533 .channel_mode
= alc861_threestack_modes
,
14535 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14536 .adc_nids
= alc861_adc_nids
,
14537 .input_mux
= &alc861_capture_source
,
14539 [ALC861_6ST_DIG
] = {
14540 .mixers
= { alc861_base_mixer
},
14541 .init_verbs
= { alc861_base_init_verbs
},
14542 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
14543 .dac_nids
= alc861_dac_nids
,
14544 .dig_out_nid
= ALC861_DIGOUT_NID
,
14545 .num_channel_mode
= ARRAY_SIZE(alc861_8ch_modes
),
14546 .channel_mode
= alc861_8ch_modes
,
14547 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14548 .adc_nids
= alc861_adc_nids
,
14549 .input_mux
= &alc861_capture_source
,
14552 .mixers
= { alc861_3ST_mixer
},
14553 .init_verbs
= { alc861_threestack_init_verbs
},
14554 .num_dacs
= ARRAY_SIZE(alc660_dac_nids
),
14555 .dac_nids
= alc660_dac_nids
,
14556 .num_channel_mode
= ARRAY_SIZE(alc861_threestack_modes
),
14557 .channel_mode
= alc861_threestack_modes
,
14559 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14560 .adc_nids
= alc861_adc_nids
,
14561 .input_mux
= &alc861_capture_source
,
14563 [ALC861_UNIWILL_M31
] = {
14564 .mixers
= { alc861_uniwill_m31_mixer
},
14565 .init_verbs
= { alc861_uniwill_m31_init_verbs
},
14566 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
14567 .dac_nids
= alc861_dac_nids
,
14568 .dig_out_nid
= ALC861_DIGOUT_NID
,
14569 .num_channel_mode
= ARRAY_SIZE(alc861_uniwill_m31_modes
),
14570 .channel_mode
= alc861_uniwill_m31_modes
,
14572 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14573 .adc_nids
= alc861_adc_nids
,
14574 .input_mux
= &alc861_capture_source
,
14576 [ALC861_TOSHIBA
] = {
14577 .mixers
= { alc861_toshiba_mixer
},
14578 .init_verbs
= { alc861_base_init_verbs
,
14579 alc861_toshiba_init_verbs
},
14580 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
14581 .dac_nids
= alc861_dac_nids
,
14582 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
14583 .channel_mode
= alc883_3ST_2ch_modes
,
14584 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14585 .adc_nids
= alc861_adc_nids
,
14586 .input_mux
= &alc861_capture_source
,
14587 .unsol_event
= alc861_toshiba_unsol_event
,
14588 .init_hook
= alc861_toshiba_automute
,
14591 .mixers
= { alc861_asus_mixer
},
14592 .init_verbs
= { alc861_asus_init_verbs
},
14593 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
14594 .dac_nids
= alc861_dac_nids
,
14595 .dig_out_nid
= ALC861_DIGOUT_NID
,
14596 .num_channel_mode
= ARRAY_SIZE(alc861_asus_modes
),
14597 .channel_mode
= alc861_asus_modes
,
14600 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14601 .adc_nids
= alc861_adc_nids
,
14602 .input_mux
= &alc861_capture_source
,
14604 [ALC861_ASUS_LAPTOP
] = {
14605 .mixers
= { alc861_toshiba_mixer
, alc861_asus_laptop_mixer
},
14606 .init_verbs
= { alc861_asus_init_verbs
,
14607 alc861_asus_laptop_init_verbs
},
14608 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
14609 .dac_nids
= alc861_dac_nids
,
14610 .dig_out_nid
= ALC861_DIGOUT_NID
,
14611 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
14612 .channel_mode
= alc883_3ST_2ch_modes
,
14614 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14615 .adc_nids
= alc861_adc_nids
,
14616 .input_mux
= &alc861_capture_source
,
14621 static int patch_alc861(struct hda_codec
*codec
)
14623 struct alc_spec
*spec
;
14627 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
14631 codec
->spec
= spec
;
14633 board_config
= snd_hda_check_board_config(codec
, ALC861_MODEL_LAST
,
14637 if (board_config
< 0) {
14638 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
14640 board_config
= ALC861_AUTO
;
14643 if (board_config
== ALC861_AUTO
) {
14644 /* automatic parse from the BIOS config */
14645 err
= alc861_parse_auto_config(codec
);
14651 "hda_codec: Cannot set up configuration "
14652 "from BIOS. Using base mode...\n");
14653 board_config
= ALC861_3ST_DIG
;
14657 err
= snd_hda_attach_beep_device(codec
, 0x23);
14663 if (board_config
!= ALC861_AUTO
)
14664 setup_preset(codec
, &alc861_presets
[board_config
]);
14666 spec
->stream_analog_playback
= &alc861_pcm_analog_playback
;
14667 spec
->stream_analog_capture
= &alc861_pcm_analog_capture
;
14669 spec
->stream_digital_playback
= &alc861_pcm_digital_playback
;
14670 spec
->stream_digital_capture
= &alc861_pcm_digital_capture
;
14672 set_beep_amp(spec
, 0x23, 0, HDA_OUTPUT
);
14674 spec
->vmaster_nid
= 0x03;
14676 codec
->patch_ops
= alc_patch_ops
;
14677 if (board_config
== ALC861_AUTO
)
14678 spec
->init_hook
= alc861_auto_init
;
14679 #ifdef CONFIG_SND_HDA_POWER_SAVE
14680 if (!spec
->loopback
.amplist
)
14681 spec
->loopback
.amplist
= alc861_loopbacks
;
14683 codec
->proc_widget_hook
= print_realtek_coef
;
14689 * ALC861-VD support
14693 * In addition, an independent DAC
14695 #define ALC861VD_DIGOUT_NID 0x06
14697 static hda_nid_t alc861vd_dac_nids
[4] = {
14698 /* front, surr, clfe, side surr */
14699 0x02, 0x03, 0x04, 0x05
14702 /* dac_nids for ALC660vd are in a different order - according to
14703 * Realtek's driver.
14704 * This should probably result in a different mixer for 6stack models
14705 * of ALC660vd codecs, but for now there is only 3stack mixer
14706 * - and it is the same as in 861vd.
14707 * adc_nids in ALC660vd are (is) the same as in 861vd
14709 static hda_nid_t alc660vd_dac_nids
[3] = {
14710 /* front, rear, clfe, rear_surr */
14714 static hda_nid_t alc861vd_adc_nids
[1] = {
14719 static hda_nid_t alc861vd_capsrc_nids
[1] = { 0x22 };
14722 /* FIXME: should be a matrix-type input source selection */
14723 static struct hda_input_mux alc861vd_capture_source
= {
14727 { "Front Mic", 0x1 },
14733 static struct hda_input_mux alc861vd_dallas_capture_source
= {
14736 { "Ext Mic", 0x0 },
14737 { "Int Mic", 0x1 },
14741 static struct hda_input_mux alc861vd_hp_capture_source
= {
14744 { "Front Mic", 0x0 },
14745 { "ATAPI Mic", 0x1 },
14752 static struct hda_channel_mode alc861vd_3stack_2ch_modes
[1] = {
14759 static struct hda_verb alc861vd_6stack_ch6_init
[] = {
14760 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
14761 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14762 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14763 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14770 static struct hda_verb alc861vd_6stack_ch8_init
[] = {
14771 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14772 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14773 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14774 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14778 static struct hda_channel_mode alc861vd_6stack_modes
[2] = {
14779 { 6, alc861vd_6stack_ch6_init
},
14780 { 8, alc861vd_6stack_ch8_init
},
14783 static struct snd_kcontrol_new alc861vd_chmode_mixer
[] = {
14785 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
14786 .name
= "Channel Mode",
14787 .info
= alc_ch_mode_info
,
14788 .get
= alc_ch_mode_get
,
14789 .put
= alc_ch_mode_put
,
14794 /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
14795 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
14797 static struct snd_kcontrol_new alc861vd_6st_mixer
[] = {
14798 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
14799 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
14801 HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
14802 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
14804 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0,
14806 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0,
14808 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
14809 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
14811 HDA_CODEC_VOLUME("Side Playback Volume", 0x05, 0x0, HDA_OUTPUT
),
14812 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
14814 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
14816 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
14817 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
14818 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
14820 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
14821 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
14822 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
14824 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
14825 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
14827 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
14828 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
14833 static struct snd_kcontrol_new alc861vd_3st_mixer
[] = {
14834 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
14835 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
14837 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
14839 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
14840 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
14841 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
14843 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
14844 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
14845 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
14847 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
14848 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
14850 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
14851 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
14856 static struct snd_kcontrol_new alc861vd_lenovo_mixer
[] = {
14857 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
14858 /*HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),*/
14859 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
14861 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
14863 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
14864 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
14865 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
14867 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
14868 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
14869 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
14871 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
14872 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
14877 /* Pin assignment: Speaker=0x14, HP = 0x15,
14878 * Ext Mic=0x18, Int Mic = 0x19, CD = 0x1c, PC Beep = 0x1d
14880 static struct snd_kcontrol_new alc861vd_dallas_mixer
[] = {
14881 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
14882 HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 2, HDA_INPUT
),
14883 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
14884 HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT
),
14885 HDA_CODEC_VOLUME("Ext Mic Boost", 0x18, 0, HDA_INPUT
),
14886 HDA_CODEC_VOLUME("Ext Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
14887 HDA_CODEC_MUTE("Ext Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
14888 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
14889 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
14890 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
14894 /* Pin assignment: Speaker=0x14, Line-out = 0x15,
14895 * Front Mic=0x18, ATAPI Mic = 0x19,
14897 static struct snd_kcontrol_new alc861vd_hp_mixer
[] = {
14898 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
14899 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
14900 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
14901 HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT
),
14902 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
14903 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
14904 HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
14905 HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
14911 * generic initialization of ADC, input mixers and output mixers
14913 static struct hda_verb alc861vd_volume_init_verbs
[] = {
14915 * Unmute ADC0 and set the default input to mic-in
14917 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
14918 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14920 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of
14921 * the analog-loopback mixer widget
14923 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
14924 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14925 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14926 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
14927 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
14928 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
14930 /* Capture mixer: unmute Mic, F-Mic, Line, CD inputs */
14931 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14932 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14933 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
14934 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(4)},
14937 * Set up output mixers (0x02 - 0x05)
14939 /* set vol=0 to output mixers */
14940 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
14941 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
14942 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
14943 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
14945 /* set up input amps for analog loopback */
14946 /* Amp Indices: DAC = 0, mixer = 1 */
14947 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14948 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14949 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14950 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14951 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14952 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14953 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14954 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14960 * 3-stack pin configuration:
14961 * front = 0x14, mic/clfe = 0x18, HP = 0x19, line/surr = 0x1a, f-mic = 0x1b
14963 static struct hda_verb alc861vd_3stack_init_verbs
[] = {
14965 * Set pin mode and muting
14967 /* set front pin widgets 0x14 for output */
14968 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14969 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14970 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
14972 /* Mic (rear) pin: input vref at 80% */
14973 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
14974 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
14975 /* Front Mic pin: input vref at 80% */
14976 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
14977 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
14978 /* Line In pin: input */
14979 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14980 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
14981 /* Line-2 In: Headphone output (output 0 - 0x0c) */
14982 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
14983 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14984 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
14985 /* CD pin widget for input */
14986 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14992 * 6-stack pin configuration:
14994 static struct hda_verb alc861vd_6stack_init_verbs
[] = {
14996 * Set pin mode and muting
14998 /* set front pin widgets 0x14 for output */
14999 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15000 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15001 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
15003 /* Rear Pin: output 1 (0x0d) */
15004 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15005 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15006 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
15007 /* CLFE Pin: output 2 (0x0e) */
15008 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15009 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15010 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x02},
15011 /* Side Pin: output 3 (0x0f) */
15012 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15013 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15014 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
15016 /* Mic (rear) pin: input vref at 80% */
15017 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
15018 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15019 /* Front Mic pin: input vref at 80% */
15020 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
15021 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15022 /* Line In pin: input */
15023 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
15024 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15025 /* Line-2 In: Headphone output (output 0 - 0x0c) */
15026 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
15027 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15028 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
15029 /* CD pin widget for input */
15030 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
15035 static struct hda_verb alc861vd_eapd_verbs
[] = {
15036 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
15040 static struct hda_verb alc660vd_eapd_verbs
[] = {
15041 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
15042 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
15046 static struct hda_verb alc861vd_lenovo_unsol_verbs
[] = {
15047 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15048 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15049 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)},
15050 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
15051 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
15055 static void alc861vd_lenovo_mic_automute(struct hda_codec
*codec
)
15057 unsigned int present
;
15058 unsigned char bits
;
15060 present
= snd_hda_codec_read(codec
, 0x18, 0,
15061 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
15062 bits
= present
? HDA_AMP_MUTE
: 0;
15063 snd_hda_codec_amp_stereo(codec
, 0x0b, HDA_INPUT
, 1,
15064 HDA_AMP_MUTE
, bits
);
15067 static void alc861vd_lenovo_setup(struct hda_codec
*codec
)
15069 struct alc_spec
*spec
= codec
->spec
;
15070 spec
->autocfg
.hp_pins
[0] = 0x1b;
15071 spec
->autocfg
.speaker_pins
[0] = 0x14;
15074 static void alc861vd_lenovo_init_hook(struct hda_codec
*codec
)
15076 alc_automute_amp(codec
);
15077 alc861vd_lenovo_mic_automute(codec
);
15080 static void alc861vd_lenovo_unsol_event(struct hda_codec
*codec
,
15083 switch (res
>> 26) {
15084 case ALC880_MIC_EVENT
:
15085 alc861vd_lenovo_mic_automute(codec
);
15088 alc_automute_amp_unsol_event(codec
, res
);
15093 static struct hda_verb alc861vd_dallas_verbs
[] = {
15094 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
15095 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
15096 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
15097 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
15099 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15100 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15101 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
15102 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
15103 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
15104 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
15105 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
15106 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
15108 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15109 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15110 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15111 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15112 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15113 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15114 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15115 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15117 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
15118 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15119 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
15120 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15121 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
15122 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
15123 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
15124 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
15126 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15127 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
15128 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
15129 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
15131 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
15132 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
15133 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
15138 /* toggle speaker-output according to the hp-jack state */
15139 static void alc861vd_dallas_setup(struct hda_codec
*codec
)
15141 struct alc_spec
*spec
= codec
->spec
;
15143 spec
->autocfg
.hp_pins
[0] = 0x15;
15144 spec
->autocfg
.speaker_pins
[0] = 0x14;
15147 #ifdef CONFIG_SND_HDA_POWER_SAVE
15148 #define alc861vd_loopbacks alc880_loopbacks
15151 /* pcm configuration: identical with ALC880 */
15152 #define alc861vd_pcm_analog_playback alc880_pcm_analog_playback
15153 #define alc861vd_pcm_analog_capture alc880_pcm_analog_capture
15154 #define alc861vd_pcm_digital_playback alc880_pcm_digital_playback
15155 #define alc861vd_pcm_digital_capture alc880_pcm_digital_capture
15158 * configuration and preset
15160 static const char *alc861vd_models
[ALC861VD_MODEL_LAST
] = {
15161 [ALC660VD_3ST
] = "3stack-660",
15162 [ALC660VD_3ST_DIG
] = "3stack-660-digout",
15163 [ALC660VD_ASUS_V1S
] = "asus-v1s",
15164 [ALC861VD_3ST
] = "3stack",
15165 [ALC861VD_3ST_DIG
] = "3stack-digout",
15166 [ALC861VD_6ST_DIG
] = "6stack-digout",
15167 [ALC861VD_LENOVO
] = "lenovo",
15168 [ALC861VD_DALLAS
] = "dallas",
15169 [ALC861VD_HP
] = "hp",
15170 [ALC861VD_AUTO
] = "auto",
15173 static struct snd_pci_quirk alc861vd_cfg_tbl
[] = {
15174 SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST
),
15175 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_HP
),
15176 SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST
),
15177 /*SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST),*/ /* auto */
15178 SND_PCI_QUIRK(0x1043, 0x1633, "Asus V1Sn", ALC660VD_ASUS_V1S
),
15179 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST_DIG
),
15180 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST
),
15181 SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO
),
15182 /*SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS),*/ /*lenovo*/
15183 SND_PCI_QUIRK(0x1179, 0xff01, "Toshiba A135", ALC861VD_LENOVO
),
15184 SND_PCI_QUIRK(0x1179, 0xff03, "Toshiba P205", ALC861VD_LENOVO
),
15185 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_DALLAS
),
15186 SND_PCI_QUIRK(0x1565, 0x820d, "Biostar NF61S SE", ALC861VD_6ST_DIG
),
15187 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", ALC861VD_LENOVO
),
15188 SND_PCI_QUIRK(0x1849, 0x0862, "ASRock K8NF6G-VSTA", ALC861VD_6ST_DIG
),
15192 static struct alc_config_preset alc861vd_presets
[] = {
15194 .mixers
= { alc861vd_3st_mixer
},
15195 .init_verbs
= { alc861vd_volume_init_verbs
,
15196 alc861vd_3stack_init_verbs
},
15197 .num_dacs
= ARRAY_SIZE(alc660vd_dac_nids
),
15198 .dac_nids
= alc660vd_dac_nids
,
15199 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15200 .channel_mode
= alc861vd_3stack_2ch_modes
,
15201 .input_mux
= &alc861vd_capture_source
,
15203 [ALC660VD_3ST_DIG
] = {
15204 .mixers
= { alc861vd_3st_mixer
},
15205 .init_verbs
= { alc861vd_volume_init_verbs
,
15206 alc861vd_3stack_init_verbs
},
15207 .num_dacs
= ARRAY_SIZE(alc660vd_dac_nids
),
15208 .dac_nids
= alc660vd_dac_nids
,
15209 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
15210 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15211 .channel_mode
= alc861vd_3stack_2ch_modes
,
15212 .input_mux
= &alc861vd_capture_source
,
15215 .mixers
= { alc861vd_3st_mixer
},
15216 .init_verbs
= { alc861vd_volume_init_verbs
,
15217 alc861vd_3stack_init_verbs
},
15218 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
15219 .dac_nids
= alc861vd_dac_nids
,
15220 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15221 .channel_mode
= alc861vd_3stack_2ch_modes
,
15222 .input_mux
= &alc861vd_capture_source
,
15224 [ALC861VD_3ST_DIG
] = {
15225 .mixers
= { alc861vd_3st_mixer
},
15226 .init_verbs
= { alc861vd_volume_init_verbs
,
15227 alc861vd_3stack_init_verbs
},
15228 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
15229 .dac_nids
= alc861vd_dac_nids
,
15230 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
15231 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15232 .channel_mode
= alc861vd_3stack_2ch_modes
,
15233 .input_mux
= &alc861vd_capture_source
,
15235 [ALC861VD_6ST_DIG
] = {
15236 .mixers
= { alc861vd_6st_mixer
, alc861vd_chmode_mixer
},
15237 .init_verbs
= { alc861vd_volume_init_verbs
,
15238 alc861vd_6stack_init_verbs
},
15239 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
15240 .dac_nids
= alc861vd_dac_nids
,
15241 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
15242 .num_channel_mode
= ARRAY_SIZE(alc861vd_6stack_modes
),
15243 .channel_mode
= alc861vd_6stack_modes
,
15244 .input_mux
= &alc861vd_capture_source
,
15246 [ALC861VD_LENOVO
] = {
15247 .mixers
= { alc861vd_lenovo_mixer
},
15248 .init_verbs
= { alc861vd_volume_init_verbs
,
15249 alc861vd_3stack_init_verbs
,
15250 alc861vd_eapd_verbs
,
15251 alc861vd_lenovo_unsol_verbs
},
15252 .num_dacs
= ARRAY_SIZE(alc660vd_dac_nids
),
15253 .dac_nids
= alc660vd_dac_nids
,
15254 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15255 .channel_mode
= alc861vd_3stack_2ch_modes
,
15256 .input_mux
= &alc861vd_capture_source
,
15257 .unsol_event
= alc861vd_lenovo_unsol_event
,
15258 .setup
= alc861vd_lenovo_setup
,
15259 .init_hook
= alc861vd_lenovo_init_hook
,
15261 [ALC861VD_DALLAS
] = {
15262 .mixers
= { alc861vd_dallas_mixer
},
15263 .init_verbs
= { alc861vd_dallas_verbs
},
15264 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
15265 .dac_nids
= alc861vd_dac_nids
,
15266 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15267 .channel_mode
= alc861vd_3stack_2ch_modes
,
15268 .input_mux
= &alc861vd_dallas_capture_source
,
15269 .unsol_event
= alc_automute_amp_unsol_event
,
15270 .setup
= alc861vd_dallas_setup
,
15271 .init_hook
= alc_automute_amp
,
15274 .mixers
= { alc861vd_hp_mixer
},
15275 .init_verbs
= { alc861vd_dallas_verbs
, alc861vd_eapd_verbs
},
15276 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
15277 .dac_nids
= alc861vd_dac_nids
,
15278 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
15279 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15280 .channel_mode
= alc861vd_3stack_2ch_modes
,
15281 .input_mux
= &alc861vd_hp_capture_source
,
15282 .unsol_event
= alc_automute_amp_unsol_event
,
15283 .setup
= alc861vd_dallas_setup
,
15284 .init_hook
= alc_automute_amp
,
15286 [ALC660VD_ASUS_V1S
] = {
15287 .mixers
= { alc861vd_lenovo_mixer
},
15288 .init_verbs
= { alc861vd_volume_init_verbs
,
15289 alc861vd_3stack_init_verbs
,
15290 alc861vd_eapd_verbs
,
15291 alc861vd_lenovo_unsol_verbs
},
15292 .num_dacs
= ARRAY_SIZE(alc660vd_dac_nids
),
15293 .dac_nids
= alc660vd_dac_nids
,
15294 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
15295 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15296 .channel_mode
= alc861vd_3stack_2ch_modes
,
15297 .input_mux
= &alc861vd_capture_source
,
15298 .unsol_event
= alc861vd_lenovo_unsol_event
,
15299 .setup
= alc861vd_lenovo_setup
,
15300 .init_hook
= alc861vd_lenovo_init_hook
,
15305 * BIOS auto configuration
15307 static int alc861vd_auto_create_input_ctls(struct hda_codec
*codec
,
15308 const struct auto_pin_cfg
*cfg
)
15310 return alc_auto_create_input_ctls(codec
, cfg
, 0x15, 0x09, 0);
15314 static void alc861vd_auto_set_output_and_unmute(struct hda_codec
*codec
,
15315 hda_nid_t nid
, int pin_type
, int dac_idx
)
15317 alc_set_pin_output(codec
, nid
, pin_type
);
15320 static void alc861vd_auto_init_multi_out(struct hda_codec
*codec
)
15322 struct alc_spec
*spec
= codec
->spec
;
15325 for (i
= 0; i
<= HDA_SIDE
; i
++) {
15326 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
15327 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
15329 alc861vd_auto_set_output_and_unmute(codec
, nid
,
15335 static void alc861vd_auto_init_hp_out(struct hda_codec
*codec
)
15337 struct alc_spec
*spec
= codec
->spec
;
15340 pin
= spec
->autocfg
.hp_pins
[0];
15341 if (pin
) /* connect to front and use dac 0 */
15342 alc861vd_auto_set_output_and_unmute(codec
, pin
, PIN_HP
, 0);
15343 pin
= spec
->autocfg
.speaker_pins
[0];
15345 alc861vd_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
, 0);
15348 #define ALC861VD_PIN_CD_NID ALC880_PIN_CD_NID
15350 static void alc861vd_auto_init_analog_input(struct hda_codec
*codec
)
15352 struct alc_spec
*spec
= codec
->spec
;
15355 for (i
= 0; i
< AUTO_PIN_LAST
; i
++) {
15356 hda_nid_t nid
= spec
->autocfg
.input_pins
[i
];
15357 if (alc_is_input_pin(codec
, nid
)) {
15358 alc_set_input_pin(codec
, nid
, i
);
15359 if (nid
!= ALC861VD_PIN_CD_NID
&&
15360 (get_wcaps(codec
, nid
) & AC_WCAP_OUT_AMP
))
15361 snd_hda_codec_write(codec
, nid
, 0,
15362 AC_VERB_SET_AMP_GAIN_MUTE
,
15368 #define alc861vd_auto_init_input_src alc882_auto_init_input_src
15370 #define alc861vd_idx_to_mixer_vol(nid) ((nid) + 0x02)
15371 #define alc861vd_idx_to_mixer_switch(nid) ((nid) + 0x0c)
15373 /* add playback controls from the parsed DAC table */
15374 /* Based on ALC880 version. But ALC861VD has separate,
15375 * different NIDs for mute/unmute switch and volume control */
15376 static int alc861vd_auto_create_multi_out_ctls(struct alc_spec
*spec
,
15377 const struct auto_pin_cfg
*cfg
)
15379 static const char *chname
[4] = {"Front", "Surround", "CLFE", "Side"};
15380 hda_nid_t nid_v
, nid_s
;
15383 for (i
= 0; i
< cfg
->line_outs
; i
++) {
15384 if (!spec
->multiout
.dac_nids
[i
])
15386 nid_v
= alc861vd_idx_to_mixer_vol(
15388 spec
->multiout
.dac_nids
[i
]));
15389 nid_s
= alc861vd_idx_to_mixer_switch(
15391 spec
->multiout
.dac_nids
[i
]));
15395 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
,
15397 HDA_COMPOSE_AMP_VAL(nid_v
, 1, 0,
15401 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
,
15403 HDA_COMPOSE_AMP_VAL(nid_v
, 2, 0,
15407 err
= add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
,
15409 HDA_COMPOSE_AMP_VAL(nid_s
, 1, 2,
15413 err
= add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
,
15415 HDA_COMPOSE_AMP_VAL(nid_s
, 2, 2,
15421 if (cfg
->line_outs
== 1 &&
15422 cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
) {
15429 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, pfx
,
15430 HDA_COMPOSE_AMP_VAL(nid_v
, 3, 0,
15434 if (cfg
->line_outs
== 1 &&
15435 cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
15437 err
= add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
, pfx
,
15438 HDA_COMPOSE_AMP_VAL(nid_s
, 3, 2,
15447 /* add playback controls for speaker and HP outputs */
15448 /* Based on ALC880 version. But ALC861VD has separate,
15449 * different NIDs for mute/unmute switch and volume control */
15450 static int alc861vd_auto_create_extra_out(struct alc_spec
*spec
,
15451 hda_nid_t pin
, const char *pfx
)
15453 hda_nid_t nid_v
, nid_s
;
15459 if (alc880_is_fixed_pin(pin
)) {
15460 nid_v
= alc880_idx_to_dac(alc880_fixed_pin_idx(pin
));
15461 /* specify the DAC as the extra output */
15462 if (!spec
->multiout
.hp_nid
)
15463 spec
->multiout
.hp_nid
= nid_v
;
15465 spec
->multiout
.extra_out_nid
[0] = nid_v
;
15466 /* control HP volume/switch on the output mixer amp */
15467 nid_v
= alc861vd_idx_to_mixer_vol(
15468 alc880_fixed_pin_idx(pin
));
15469 nid_s
= alc861vd_idx_to_mixer_switch(
15470 alc880_fixed_pin_idx(pin
));
15472 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, pfx
,
15473 HDA_COMPOSE_AMP_VAL(nid_v
, 3, 0, HDA_OUTPUT
));
15476 err
= add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
, pfx
,
15477 HDA_COMPOSE_AMP_VAL(nid_s
, 3, 2, HDA_INPUT
));
15480 } else if (alc880_is_multi_pin(pin
)) {
15481 /* set manual connection */
15482 /* we have only a switch on HP-out PIN */
15483 err
= add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, pfx
,
15484 HDA_COMPOSE_AMP_VAL(pin
, 3, 0, HDA_OUTPUT
));
15491 /* parse the BIOS configuration and set up the alc_spec
15492 * return 1 if successful, 0 if the proper config is not found,
15493 * or a negative error code
15494 * Based on ALC880 version - had to change it to override
15495 * alc880_auto_create_extra_out and alc880_auto_create_multi_out_ctls */
15496 static int alc861vd_parse_auto_config(struct hda_codec
*codec
)
15498 struct alc_spec
*spec
= codec
->spec
;
15500 static hda_nid_t alc861vd_ignore
[] = { 0x1d, 0 };
15502 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
15506 if (!spec
->autocfg
.line_outs
)
15507 return 0; /* can't find valid BIOS pin config */
15509 err
= alc880_auto_fill_dac_nids(spec
, &spec
->autocfg
);
15512 err
= alc861vd_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
15515 err
= alc861vd_auto_create_extra_out(spec
,
15516 spec
->autocfg
.speaker_pins
[0],
15520 err
= alc861vd_auto_create_extra_out(spec
,
15521 spec
->autocfg
.hp_pins
[0],
15525 err
= alc861vd_auto_create_input_ctls(codec
, &spec
->autocfg
);
15529 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
15531 if (spec
->autocfg
.dig_outs
)
15532 spec
->multiout
.dig_out_nid
= ALC861VD_DIGOUT_NID
;
15534 if (spec
->kctls
.list
)
15535 add_mixer(spec
, spec
->kctls
.list
);
15537 add_verb(spec
, alc861vd_volume_init_verbs
);
15539 spec
->num_mux_defs
= 1;
15540 spec
->input_mux
= &spec
->private_imux
[0];
15542 err
= alc_auto_add_mic_boost(codec
);
15546 alc_ssid_check(codec
, 0x15, 0x1b, 0x14);
15551 /* additional initialization for auto-configuration model */
15552 static void alc861vd_auto_init(struct hda_codec
*codec
)
15554 struct alc_spec
*spec
= codec
->spec
;
15555 alc861vd_auto_init_multi_out(codec
);
15556 alc861vd_auto_init_hp_out(codec
);
15557 alc861vd_auto_init_analog_input(codec
);
15558 alc861vd_auto_init_input_src(codec
);
15559 if (spec
->unsol_event
)
15560 alc_inithook(codec
);
15564 ALC660VD_FIX_ASUS_GPIO1
15568 static const struct hda_verb alc660vd_fix_asus_gpio1_verbs
[] = {
15569 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
15570 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
15571 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
15575 static const struct alc_fixup alc861vd_fixups
[] = {
15576 [ALC660VD_FIX_ASUS_GPIO1
] = {
15577 .verbs
= alc660vd_fix_asus_gpio1_verbs
,
15581 static struct snd_pci_quirk alc861vd_fixup_tbl
[] = {
15582 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1
),
15586 static int patch_alc861vd(struct hda_codec
*codec
)
15588 struct alc_spec
*spec
;
15589 int err
, board_config
;
15591 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
15595 codec
->spec
= spec
;
15597 board_config
= snd_hda_check_board_config(codec
, ALC861VD_MODEL_LAST
,
15601 if (board_config
< 0 || board_config
>= ALC861VD_MODEL_LAST
) {
15602 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
15604 board_config
= ALC861VD_AUTO
;
15607 alc_pick_fixup(codec
, alc861vd_fixup_tbl
, alc861vd_fixups
);
15609 if (board_config
== ALC861VD_AUTO
) {
15610 /* automatic parse from the BIOS config */
15611 err
= alc861vd_parse_auto_config(codec
);
15617 "hda_codec: Cannot set up configuration "
15618 "from BIOS. Using base mode...\n");
15619 board_config
= ALC861VD_3ST
;
15623 err
= snd_hda_attach_beep_device(codec
, 0x23);
15629 if (board_config
!= ALC861VD_AUTO
)
15630 setup_preset(codec
, &alc861vd_presets
[board_config
]);
15632 if (codec
->vendor_id
== 0x10ec0660) {
15633 /* always turn on EAPD */
15634 add_verb(spec
, alc660vd_eapd_verbs
);
15637 spec
->stream_analog_playback
= &alc861vd_pcm_analog_playback
;
15638 spec
->stream_analog_capture
= &alc861vd_pcm_analog_capture
;
15640 spec
->stream_digital_playback
= &alc861vd_pcm_digital_playback
;
15641 spec
->stream_digital_capture
= &alc861vd_pcm_digital_capture
;
15643 if (!spec
->adc_nids
) {
15644 spec
->adc_nids
= alc861vd_adc_nids
;
15645 spec
->num_adc_nids
= ARRAY_SIZE(alc861vd_adc_nids
);
15647 if (!spec
->capsrc_nids
)
15648 spec
->capsrc_nids
= alc861vd_capsrc_nids
;
15650 set_capture_mixer(codec
);
15651 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
15653 spec
->vmaster_nid
= 0x02;
15655 codec
->patch_ops
= alc_patch_ops
;
15657 if (board_config
== ALC861VD_AUTO
)
15658 spec
->init_hook
= alc861vd_auto_init
;
15659 #ifdef CONFIG_SND_HDA_POWER_SAVE
15660 if (!spec
->loopback
.amplist
)
15661 spec
->loopback
.amplist
= alc861vd_loopbacks
;
15663 codec
->proc_widget_hook
= print_realtek_coef
;
15671 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
15672 * configuration. Each pin widget can choose any input DACs and a mixer.
15673 * Each ADC is connected from a mixer of all inputs. This makes possible
15674 * 6-channel independent captures.
15676 * In addition, an independent DAC for the multi-playback (not used in this
15679 #define ALC662_DIGOUT_NID 0x06
15680 #define ALC662_DIGIN_NID 0x0a
15682 static hda_nid_t alc662_dac_nids
[4] = {
15683 /* front, rear, clfe, rear_surr */
15687 static hda_nid_t alc272_dac_nids
[2] = {
15691 static hda_nid_t alc662_adc_nids
[2] = {
15696 static hda_nid_t alc272_adc_nids
[1] = {
15701 static hda_nid_t alc662_capsrc_nids
[2] = { 0x22, 0x23 };
15702 static hda_nid_t alc272_capsrc_nids
[1] = { 0x23 };
15706 /* FIXME: should be a matrix-type input source selection */
15707 static struct hda_input_mux alc662_capture_source
= {
15711 { "Front Mic", 0x1 },
15717 static struct hda_input_mux alc662_lenovo_101e_capture_source
= {
15725 static struct hda_input_mux alc663_capture_source
= {
15729 { "Front Mic", 0x1 },
15734 #if 0 /* set to 1 for testing other input sources below */
15735 static struct hda_input_mux alc272_nc10_capture_source
= {
15738 { "Autoselect Mic", 0x0 },
15739 { "Internal Mic", 0x1 },
15740 { "In-0x02", 0x2 },
15741 { "In-0x03", 0x3 },
15742 { "In-0x04", 0x4 },
15743 { "In-0x05", 0x5 },
15744 { "In-0x06", 0x6 },
15745 { "In-0x07", 0x7 },
15746 { "In-0x08", 0x8 },
15747 { "In-0x09", 0x9 },
15748 { "In-0x0a", 0x0a },
15749 { "In-0x0b", 0x0b },
15750 { "In-0x0c", 0x0c },
15751 { "In-0x0d", 0x0d },
15752 { "In-0x0e", 0x0e },
15753 { "In-0x0f", 0x0f },
15761 static struct hda_channel_mode alc662_3ST_2ch_modes
[1] = {
15768 static struct hda_verb alc662_3ST_ch2_init
[] = {
15769 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
15770 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15771 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
15772 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15779 static struct hda_verb alc662_3ST_ch6_init
[] = {
15780 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15781 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15782 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
15783 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15784 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15785 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
15789 static struct hda_channel_mode alc662_3ST_6ch_modes
[2] = {
15790 { 2, alc662_3ST_ch2_init
},
15791 { 6, alc662_3ST_ch6_init
},
15797 static struct hda_verb alc662_sixstack_ch6_init
[] = {
15798 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
15799 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
15800 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15807 static struct hda_verb alc662_sixstack_ch8_init
[] = {
15808 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15809 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15810 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15814 static struct hda_channel_mode alc662_5stack_modes
[2] = {
15815 { 2, alc662_sixstack_ch6_init
},
15816 { 6, alc662_sixstack_ch8_init
},
15819 /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
15820 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
15823 static struct snd_kcontrol_new alc662_base_mixer
[] = {
15824 /* output mixer control */
15825 HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT
),
15826 HDA_CODEC_MUTE("Front Playback Switch", 0x0c, 0x0, HDA_INPUT
),
15827 HDA_CODEC_VOLUME("Surround Playback Volume", 0x3, 0x0, HDA_OUTPUT
),
15828 HDA_CODEC_MUTE("Surround Playback Switch", 0x0d, 0x0, HDA_INPUT
),
15829 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0, HDA_OUTPUT
),
15830 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0, HDA_OUTPUT
),
15831 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x0, HDA_INPUT
),
15832 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x0, HDA_INPUT
),
15833 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
15835 /*Input mixer control */
15836 HDA_CODEC_VOLUME("CD Playback Volume", 0xb, 0x4, HDA_INPUT
),
15837 HDA_CODEC_MUTE("CD Playback Switch", 0xb, 0x4, HDA_INPUT
),
15838 HDA_CODEC_VOLUME("Line Playback Volume", 0xb, 0x02, HDA_INPUT
),
15839 HDA_CODEC_MUTE("Line Playback Switch", 0xb, 0x02, HDA_INPUT
),
15840 HDA_CODEC_VOLUME("Mic Playback Volume", 0xb, 0x0, HDA_INPUT
),
15841 HDA_CODEC_MUTE("Mic Playback Switch", 0xb, 0x0, HDA_INPUT
),
15842 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0xb, 0x01, HDA_INPUT
),
15843 HDA_CODEC_MUTE("Front Mic Playback Switch", 0xb, 0x01, HDA_INPUT
),
15847 static struct snd_kcontrol_new alc662_3ST_2ch_mixer
[] = {
15848 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
15849 HDA_CODEC_MUTE("Front Playback Switch", 0x0c, 0x0, HDA_INPUT
),
15850 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
15851 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
15852 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
15853 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
15854 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
15855 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
15856 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
15857 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
15858 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
15862 static struct snd_kcontrol_new alc662_3ST_6ch_mixer
[] = {
15863 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
15864 HDA_CODEC_MUTE("Front Playback Switch", 0x0c, 0x0, HDA_INPUT
),
15865 HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
15866 HDA_CODEC_MUTE("Surround Playback Switch", 0x0d, 0x0, HDA_INPUT
),
15867 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0, HDA_OUTPUT
),
15868 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0, HDA_OUTPUT
),
15869 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x0, HDA_INPUT
),
15870 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x0, HDA_INPUT
),
15871 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
15872 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
15873 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
15874 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
15875 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
15876 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
15877 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
15878 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
15879 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
15883 static struct snd_kcontrol_new alc662_lenovo_101e_mixer
[] = {
15884 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
15885 HDA_BIND_MUTE("Front Playback Switch", 0x02, 2, HDA_INPUT
),
15886 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
15887 HDA_BIND_MUTE("Speaker Playback Switch", 0x03, 2, HDA_INPUT
),
15888 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
15889 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
15890 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
15891 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
15892 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
15896 static struct snd_kcontrol_new alc662_eeepc_p701_mixer
[] = {
15897 HDA_CODEC_VOLUME("Master Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
15898 ALC262_HIPPO_MASTER_SWITCH
,
15900 HDA_CODEC_VOLUME("e-Mic Boost", 0x18, 0, HDA_INPUT
),
15901 HDA_CODEC_VOLUME("e-Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
15902 HDA_CODEC_MUTE("e-Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
15904 HDA_CODEC_VOLUME("i-Mic Boost", 0x19, 0, HDA_INPUT
),
15905 HDA_CODEC_VOLUME("i-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
15906 HDA_CODEC_MUTE("i-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
15910 static struct snd_kcontrol_new alc662_eeepc_ep20_mixer
[] = {
15911 ALC262_HIPPO_MASTER_SWITCH
,
15912 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
15913 HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
15914 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0, HDA_OUTPUT
),
15915 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0, HDA_OUTPUT
),
15916 HDA_BIND_MUTE("MuteCtrl Playback Switch", 0x0c, 2, HDA_INPUT
),
15917 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
15918 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
15919 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
15920 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
15924 static struct hda_bind_ctls alc663_asus_bind_master_vol
= {
15925 .ops
= &snd_hda_bind_vol
,
15927 HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT
),
15928 HDA_COMPOSE_AMP_VAL(0x03, 3, 0, HDA_OUTPUT
),
15933 static struct hda_bind_ctls alc663_asus_one_bind_switch
= {
15934 .ops
= &snd_hda_bind_sw
,
15936 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
15937 HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT
),
15942 static struct snd_kcontrol_new alc663_m51va_mixer
[] = {
15943 HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol
),
15944 HDA_BIND_SW("Master Playback Switch", &alc663_asus_one_bind_switch
),
15945 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
15946 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
15950 static struct hda_bind_ctls alc663_asus_tree_bind_switch
= {
15951 .ops
= &snd_hda_bind_sw
,
15953 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
15954 HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT
),
15955 HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT
),
15960 static struct snd_kcontrol_new alc663_two_hp_m1_mixer
[] = {
15961 HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol
),
15962 HDA_BIND_SW("Master Playback Switch", &alc663_asus_tree_bind_switch
),
15963 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
15964 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
15965 HDA_CODEC_VOLUME("F-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
15966 HDA_CODEC_MUTE("F-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
15971 static struct hda_bind_ctls alc663_asus_four_bind_switch
= {
15972 .ops
= &snd_hda_bind_sw
,
15974 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
15975 HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT
),
15976 HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_OUTPUT
),
15981 static struct snd_kcontrol_new alc663_two_hp_m2_mixer
[] = {
15982 HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol
),
15983 HDA_BIND_SW("Master Playback Switch", &alc663_asus_four_bind_switch
),
15984 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
15985 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
15986 HDA_CODEC_VOLUME("F-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
15987 HDA_CODEC_MUTE("F-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
15991 static struct snd_kcontrol_new alc662_1bjd_mixer
[] = {
15992 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
15993 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
15994 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
15995 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
15996 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
15997 HDA_CODEC_VOLUME("F-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
15998 HDA_CODEC_MUTE("F-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16002 static struct hda_bind_ctls alc663_asus_two_bind_master_vol
= {
16003 .ops
= &snd_hda_bind_vol
,
16005 HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT
),
16006 HDA_COMPOSE_AMP_VAL(0x04, 3, 0, HDA_OUTPUT
),
16011 static struct hda_bind_ctls alc663_asus_two_bind_switch
= {
16012 .ops
= &snd_hda_bind_sw
,
16014 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
16015 HDA_COMPOSE_AMP_VAL(0x16, 3, 0, HDA_OUTPUT
),
16020 static struct snd_kcontrol_new alc663_asus_21jd_clfe_mixer
[] = {
16021 HDA_BIND_VOL("Master Playback Volume",
16022 &alc663_asus_two_bind_master_vol
),
16023 HDA_BIND_SW("Master Playback Switch", &alc663_asus_two_bind_switch
),
16024 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
16025 HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT
),
16026 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16027 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16031 static struct snd_kcontrol_new alc663_asus_15jd_clfe_mixer
[] = {
16032 HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol
),
16033 HDA_BIND_SW("Master Playback Switch", &alc663_asus_two_bind_switch
),
16034 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
16035 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
16036 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16037 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16041 static struct snd_kcontrol_new alc663_g71v_mixer
[] = {
16042 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
16043 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
16044 HDA_CODEC_VOLUME("Front Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
16045 HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
16046 HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT
),
16048 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16049 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16050 HDA_CODEC_VOLUME("i-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
16051 HDA_CODEC_MUTE("i-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16055 static struct snd_kcontrol_new alc663_g50v_mixer
[] = {
16056 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
16057 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
16058 HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT
),
16060 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16061 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16062 HDA_CODEC_VOLUME("i-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
16063 HDA_CODEC_MUTE("i-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16064 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
16065 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
16069 static struct snd_kcontrol_new alc662_chmode_mixer
[] = {
16071 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
16072 .name
= "Channel Mode",
16073 .info
= alc_ch_mode_info
,
16074 .get
= alc_ch_mode_get
,
16075 .put
= alc_ch_mode_put
,
16080 static struct hda_verb alc662_init_verbs
[] = {
16081 /* ADC: mute amp left and right */
16082 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16083 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
16084 /* Front mixer: unmute input/output amp left and right (volume = 0) */
16086 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16087 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
16088 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
16089 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
16090 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
16092 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16093 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16094 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16095 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16096 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16097 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16099 /* Front Pin: output 0 (0x0c) */
16100 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16101 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16103 /* Rear Pin: output 1 (0x0d) */
16104 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16105 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16107 /* CLFE Pin: output 2 (0x0e) */
16108 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16109 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16111 /* Mic (rear) pin: input vref at 80% */
16112 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
16113 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
16114 /* Front Mic pin: input vref at 80% */
16115 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
16116 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
16117 /* Line In pin: input */
16118 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16119 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
16120 /* Line-2 In: Headphone output (output 0 - 0x0c) */
16121 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16122 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16123 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
16124 /* CD pin widget for input */
16125 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16127 /* FIXME: use matrix-type input source selection */
16128 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
16130 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16131 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16133 /* always trun on EAPD */
16134 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
16135 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
16140 static struct hda_verb alc662_sue_init_verbs
[] = {
16141 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_FRONT_EVENT
},
16142 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_HP_EVENT
},
16146 static struct hda_verb alc662_eeepc_sue_init_verbs
[] = {
16147 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16148 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16152 /* Set Unsolicited Event*/
16153 static struct hda_verb alc662_eeepc_ep20_sue_init_verbs
[] = {
16154 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16155 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16160 * generic initialization of ADC, input mixers and output mixers
16162 static struct hda_verb alc662_auto_init_verbs
[] = {
16164 * Unmute ADC and set the default input to mic-in
16166 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
16167 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16169 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
16171 * Note: PASD motherboards uses the Line In 2 as the input for front
16172 * panel mic (mic 2)
16174 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
16175 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16176 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
16177 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
16178 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
16179 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
16182 * Set up output mixers (0x0c - 0x0f)
16184 /* set vol=0 to output mixers */
16185 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
16186 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
16187 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
16189 /* set up input amps for analog loopback */
16190 /* Amp Indices: DAC = 0, mixer = 1 */
16191 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16192 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16193 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16194 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16195 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16196 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16199 /* FIXME: use matrix-type input source selection */
16200 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
16202 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16203 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16207 /* additional verbs for ALC663 */
16208 static struct hda_verb alc663_auto_init_verbs
[] = {
16209 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16210 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16214 static struct hda_verb alc663_m51va_init_verbs
[] = {
16215 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16216 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16217 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16218 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16219 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
16220 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16221 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(9)},
16222 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16223 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16227 static struct hda_verb alc663_21jd_amic_init_verbs
[] = {
16228 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16229 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16230 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
16231 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16232 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16233 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16234 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16238 static struct hda_verb alc662_1bjd_amic_init_verbs
[] = {
16239 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16240 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16241 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16242 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Headphone */
16243 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16244 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16245 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16246 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16250 static struct hda_verb alc663_15jd_amic_init_verbs
[] = {
16251 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16252 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16253 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
16254 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16255 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16256 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16257 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16261 static struct hda_verb alc663_two_hp_amic_m1_init_verbs
[] = {
16262 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16263 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16264 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16265 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x0}, /* Headphone */
16266 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16267 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16268 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x0}, /* Headphone */
16269 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16270 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16271 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16272 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16273 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16277 static struct hda_verb alc663_two_hp_amic_m2_init_verbs
[] = {
16278 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16279 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16280 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16281 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
16282 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16283 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16284 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
16285 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16286 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16287 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16288 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16289 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16293 static struct hda_verb alc663_g71v_init_verbs
[] = {
16294 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16295 /* {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, */
16296 /* {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, */ /* Headphone */
16298 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16299 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16300 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Headphone */
16302 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_FRONT_EVENT
},
16303 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_MIC_EVENT
},
16304 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_HP_EVENT
},
16308 static struct hda_verb alc663_g50v_init_verbs
[] = {
16309 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16310 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16311 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Headphone */
16313 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16314 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16318 static struct hda_verb alc662_ecs_init_verbs
[] = {
16319 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, 0x701f},
16320 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16321 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16322 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16326 static struct hda_verb alc272_dell_zm1_init_verbs
[] = {
16327 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16328 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16329 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16330 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16331 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16332 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16333 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
16334 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16335 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(9)},
16336 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16337 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16341 static struct hda_verb alc272_dell_init_verbs
[] = {
16342 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16343 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16344 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16345 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16346 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16347 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16348 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
16349 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16350 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(9)},
16351 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16352 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16356 static struct snd_kcontrol_new alc662_auto_capture_mixer
[] = {
16357 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT
),
16358 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT
),
16362 static struct snd_kcontrol_new alc272_auto_capture_mixer
[] = {
16363 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT
),
16364 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT
),
16368 static void alc662_lenovo_101e_ispeaker_automute(struct hda_codec
*codec
)
16370 unsigned int present
;
16371 unsigned char bits
;
16373 present
= snd_hda_codec_read(codec
, 0x14, 0,
16374 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
16375 bits
= present
? HDA_AMP_MUTE
: 0;
16376 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
16377 HDA_AMP_MUTE
, bits
);
16380 static void alc662_lenovo_101e_all_automute(struct hda_codec
*codec
)
16382 unsigned int present
;
16383 unsigned char bits
;
16385 present
= snd_hda_codec_read(codec
, 0x1b, 0,
16386 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
16387 bits
= present
? HDA_AMP_MUTE
: 0;
16388 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
16389 HDA_AMP_MUTE
, bits
);
16390 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
16391 HDA_AMP_MUTE
, bits
);
16394 static void alc662_lenovo_101e_unsol_event(struct hda_codec
*codec
,
16397 if ((res
>> 26) == ALC880_HP_EVENT
)
16398 alc662_lenovo_101e_all_automute(codec
);
16399 if ((res
>> 26) == ALC880_FRONT_EVENT
)
16400 alc662_lenovo_101e_ispeaker_automute(codec
);
16403 /* unsolicited event for HP jack sensing */
16404 static void alc662_eeepc_unsol_event(struct hda_codec
*codec
,
16407 if ((res
>> 26) == ALC880_MIC_EVENT
)
16408 alc_mic_automute(codec
);
16410 alc262_hippo_unsol_event(codec
, res
);
16413 static void alc662_eeepc_setup(struct hda_codec
*codec
)
16415 struct alc_spec
*spec
= codec
->spec
;
16417 alc262_hippo1_setup(codec
);
16418 spec
->ext_mic
.pin
= 0x18;
16419 spec
->ext_mic
.mux_idx
= 0;
16420 spec
->int_mic
.pin
= 0x19;
16421 spec
->int_mic
.mux_idx
= 1;
16422 spec
->auto_mic
= 1;
16425 static void alc662_eeepc_inithook(struct hda_codec
*codec
)
16427 alc262_hippo_automute(codec
);
16428 alc_mic_automute(codec
);
16431 static void alc662_eeepc_ep20_setup(struct hda_codec
*codec
)
16433 struct alc_spec
*spec
= codec
->spec
;
16435 spec
->autocfg
.hp_pins
[0] = 0x14;
16436 spec
->autocfg
.speaker_pins
[0] = 0x1b;
16439 #define alc662_eeepc_ep20_inithook alc262_hippo_master_update
16441 static void alc663_m51va_speaker_automute(struct hda_codec
*codec
)
16443 unsigned int present
;
16444 unsigned char bits
;
16446 present
= snd_hda_codec_read(codec
, 0x21, 0,
16447 AC_VERB_GET_PIN_SENSE
, 0)
16448 & AC_PINSENSE_PRESENCE
;
16449 bits
= present
? HDA_AMP_MUTE
: 0;
16450 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
16451 AMP_IN_MUTE(0), bits
);
16452 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
16453 AMP_IN_MUTE(0), bits
);
16456 static void alc663_21jd_two_speaker_automute(struct hda_codec
*codec
)
16458 unsigned int present
;
16459 unsigned char bits
;
16461 present
= snd_hda_codec_read(codec
, 0x21, 0,
16462 AC_VERB_GET_PIN_SENSE
, 0)
16463 & AC_PINSENSE_PRESENCE
;
16464 bits
= present
? HDA_AMP_MUTE
: 0;
16465 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
16466 AMP_IN_MUTE(0), bits
);
16467 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
16468 AMP_IN_MUTE(0), bits
);
16469 snd_hda_codec_amp_stereo(codec
, 0x0e, HDA_INPUT
, 0,
16470 AMP_IN_MUTE(0), bits
);
16471 snd_hda_codec_amp_stereo(codec
, 0x0e, HDA_INPUT
, 1,
16472 AMP_IN_MUTE(0), bits
);
16475 static void alc663_15jd_two_speaker_automute(struct hda_codec
*codec
)
16477 unsigned int present
;
16478 unsigned char bits
;
16480 present
= snd_hda_codec_read(codec
, 0x15, 0,
16481 AC_VERB_GET_PIN_SENSE
, 0)
16482 & AC_PINSENSE_PRESENCE
;
16483 bits
= present
? HDA_AMP_MUTE
: 0;
16484 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
16485 AMP_IN_MUTE(0), bits
);
16486 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
16487 AMP_IN_MUTE(0), bits
);
16488 snd_hda_codec_amp_stereo(codec
, 0x0e, HDA_INPUT
, 0,
16489 AMP_IN_MUTE(0), bits
);
16490 snd_hda_codec_amp_stereo(codec
, 0x0e, HDA_INPUT
, 1,
16491 AMP_IN_MUTE(0), bits
);
16494 static void alc662_f5z_speaker_automute(struct hda_codec
*codec
)
16496 unsigned int present
;
16497 unsigned char bits
;
16499 present
= snd_hda_codec_read(codec
, 0x1b, 0,
16500 AC_VERB_GET_PIN_SENSE
, 0)
16501 & AC_PINSENSE_PRESENCE
;
16502 bits
= present
? 0 : PIN_OUT
;
16503 snd_hda_codec_write(codec
, 0x14, 0,
16504 AC_VERB_SET_PIN_WIDGET_CONTROL
, bits
);
16507 static void alc663_two_hp_m1_speaker_automute(struct hda_codec
*codec
)
16509 unsigned int present1
, present2
;
16511 present1
= snd_hda_codec_read(codec
, 0x21, 0,
16512 AC_VERB_GET_PIN_SENSE
, 0)
16513 & AC_PINSENSE_PRESENCE
;
16514 present2
= snd_hda_codec_read(codec
, 0x15, 0,
16515 AC_VERB_GET_PIN_SENSE
, 0)
16516 & AC_PINSENSE_PRESENCE
;
16518 if (present1
|| present2
) {
16519 snd_hda_codec_write_cache(codec
, 0x14, 0,
16520 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0);
16522 snd_hda_codec_write_cache(codec
, 0x14, 0,
16523 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
16527 static void alc663_two_hp_m2_speaker_automute(struct hda_codec
*codec
)
16529 unsigned int present1
, present2
;
16531 present1
= snd_hda_codec_read(codec
, 0x1b, 0,
16532 AC_VERB_GET_PIN_SENSE
, 0)
16533 & AC_PINSENSE_PRESENCE
;
16534 present2
= snd_hda_codec_read(codec
, 0x15, 0,
16535 AC_VERB_GET_PIN_SENSE
, 0)
16536 & AC_PINSENSE_PRESENCE
;
16538 if (present1
|| present2
) {
16539 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
16540 AMP_IN_MUTE(0), AMP_IN_MUTE(0));
16541 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
16542 AMP_IN_MUTE(0), AMP_IN_MUTE(0));
16544 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
16545 AMP_IN_MUTE(0), 0);
16546 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
16547 AMP_IN_MUTE(0), 0);
16551 static void alc663_m51va_unsol_event(struct hda_codec
*codec
,
16554 switch (res
>> 26) {
16555 case ALC880_HP_EVENT
:
16556 alc663_m51va_speaker_automute(codec
);
16558 case ALC880_MIC_EVENT
:
16559 alc_mic_automute(codec
);
16564 static void alc663_m51va_setup(struct hda_codec
*codec
)
16566 struct alc_spec
*spec
= codec
->spec
;
16567 spec
->ext_mic
.pin
= 0x18;
16568 spec
->ext_mic
.mux_idx
= 0;
16569 spec
->int_mic
.pin
= 0x12;
16570 spec
->int_mic
.mux_idx
= 1;
16571 spec
->auto_mic
= 1;
16574 static void alc663_m51va_inithook(struct hda_codec
*codec
)
16576 alc663_m51va_speaker_automute(codec
);
16577 alc_mic_automute(codec
);
16580 /* ***************** Mode1 ******************************/
16581 #define alc663_mode1_unsol_event alc663_m51va_unsol_event
16582 #define alc663_mode1_setup alc663_m51va_setup
16583 #define alc663_mode1_inithook alc663_m51va_inithook
16585 /* ***************** Mode2 ******************************/
16586 static void alc662_mode2_unsol_event(struct hda_codec
*codec
,
16589 switch (res
>> 26) {
16590 case ALC880_HP_EVENT
:
16591 alc662_f5z_speaker_automute(codec
);
16593 case ALC880_MIC_EVENT
:
16594 alc_mic_automute(codec
);
16599 #define alc662_mode2_setup alc663_m51va_setup
16601 static void alc662_mode2_inithook(struct hda_codec
*codec
)
16603 alc662_f5z_speaker_automute(codec
);
16604 alc_mic_automute(codec
);
16606 /* ***************** Mode3 ******************************/
16607 static void alc663_mode3_unsol_event(struct hda_codec
*codec
,
16610 switch (res
>> 26) {
16611 case ALC880_HP_EVENT
:
16612 alc663_two_hp_m1_speaker_automute(codec
);
16614 case ALC880_MIC_EVENT
:
16615 alc_mic_automute(codec
);
16620 #define alc663_mode3_setup alc663_m51va_setup
16622 static void alc663_mode3_inithook(struct hda_codec
*codec
)
16624 alc663_two_hp_m1_speaker_automute(codec
);
16625 alc_mic_automute(codec
);
16627 /* ***************** Mode4 ******************************/
16628 static void alc663_mode4_unsol_event(struct hda_codec
*codec
,
16631 switch (res
>> 26) {
16632 case ALC880_HP_EVENT
:
16633 alc663_21jd_two_speaker_automute(codec
);
16635 case ALC880_MIC_EVENT
:
16636 alc_mic_automute(codec
);
16641 #define alc663_mode4_setup alc663_m51va_setup
16643 static void alc663_mode4_inithook(struct hda_codec
*codec
)
16645 alc663_21jd_two_speaker_automute(codec
);
16646 alc_mic_automute(codec
);
16648 /* ***************** Mode5 ******************************/
16649 static void alc663_mode5_unsol_event(struct hda_codec
*codec
,
16652 switch (res
>> 26) {
16653 case ALC880_HP_EVENT
:
16654 alc663_15jd_two_speaker_automute(codec
);
16656 case ALC880_MIC_EVENT
:
16657 alc_mic_automute(codec
);
16662 #define alc663_mode5_setup alc663_m51va_setup
16664 static void alc663_mode5_inithook(struct hda_codec
*codec
)
16666 alc663_15jd_two_speaker_automute(codec
);
16667 alc_mic_automute(codec
);
16669 /* ***************** Mode6 ******************************/
16670 static void alc663_mode6_unsol_event(struct hda_codec
*codec
,
16673 switch (res
>> 26) {
16674 case ALC880_HP_EVENT
:
16675 alc663_two_hp_m2_speaker_automute(codec
);
16677 case ALC880_MIC_EVENT
:
16678 alc_mic_automute(codec
);
16683 #define alc663_mode6_setup alc663_m51va_setup
16685 static void alc663_mode6_inithook(struct hda_codec
*codec
)
16687 alc663_two_hp_m2_speaker_automute(codec
);
16688 alc_mic_automute(codec
);
16691 static void alc663_g71v_hp_automute(struct hda_codec
*codec
)
16693 unsigned int present
;
16694 unsigned char bits
;
16696 present
= snd_hda_codec_read(codec
, 0x21, 0,
16697 AC_VERB_GET_PIN_SENSE
, 0)
16698 & AC_PINSENSE_PRESENCE
;
16699 bits
= present
? HDA_AMP_MUTE
: 0;
16700 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
16701 HDA_AMP_MUTE
, bits
);
16702 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
16703 HDA_AMP_MUTE
, bits
);
16706 static void alc663_g71v_front_automute(struct hda_codec
*codec
)
16708 unsigned int present
;
16709 unsigned char bits
;
16711 present
= snd_hda_codec_read(codec
, 0x15, 0,
16712 AC_VERB_GET_PIN_SENSE
, 0)
16713 & AC_PINSENSE_PRESENCE
;
16714 bits
= present
? HDA_AMP_MUTE
: 0;
16715 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
16716 HDA_AMP_MUTE
, bits
);
16719 static void alc663_g71v_unsol_event(struct hda_codec
*codec
,
16722 switch (res
>> 26) {
16723 case ALC880_HP_EVENT
:
16724 alc663_g71v_hp_automute(codec
);
16726 case ALC880_FRONT_EVENT
:
16727 alc663_g71v_front_automute(codec
);
16729 case ALC880_MIC_EVENT
:
16730 alc_mic_automute(codec
);
16735 #define alc663_g71v_setup alc663_m51va_setup
16737 static void alc663_g71v_inithook(struct hda_codec
*codec
)
16739 alc663_g71v_front_automute(codec
);
16740 alc663_g71v_hp_automute(codec
);
16741 alc_mic_automute(codec
);
16744 static void alc663_g50v_unsol_event(struct hda_codec
*codec
,
16747 switch (res
>> 26) {
16748 case ALC880_HP_EVENT
:
16749 alc663_m51va_speaker_automute(codec
);
16751 case ALC880_MIC_EVENT
:
16752 alc_mic_automute(codec
);
16757 #define alc663_g50v_setup alc663_m51va_setup
16759 static void alc663_g50v_inithook(struct hda_codec
*codec
)
16761 alc663_m51va_speaker_automute(codec
);
16762 alc_mic_automute(codec
);
16765 static struct snd_kcontrol_new alc662_ecs_mixer
[] = {
16766 HDA_CODEC_VOLUME("Master Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
16767 ALC262_HIPPO_MASTER_SWITCH
,
16769 HDA_CODEC_VOLUME("e-Mic/LineIn Boost", 0x18, 0, HDA_INPUT
),
16770 HDA_CODEC_VOLUME("e-Mic/LineIn Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16771 HDA_CODEC_MUTE("e-Mic/LineIn Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16773 HDA_CODEC_VOLUME("i-Mic Boost", 0x19, 0, HDA_INPUT
),
16774 HDA_CODEC_VOLUME("i-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
16775 HDA_CODEC_MUTE("i-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16779 static struct snd_kcontrol_new alc272_nc10_mixer
[] = {
16780 /* Master Playback automatically created from Speaker and Headphone */
16781 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
16782 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
16783 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
16784 HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT
),
16786 HDA_CODEC_VOLUME("Ext Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16787 HDA_CODEC_MUTE("Ext Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16788 HDA_CODEC_VOLUME("Ext Mic Boost", 0x18, 0, HDA_INPUT
),
16790 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
16791 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16792 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
16796 #ifdef CONFIG_SND_HDA_POWER_SAVE
16797 #define alc662_loopbacks alc880_loopbacks
16801 /* pcm configuration: identical with ALC880 */
16802 #define alc662_pcm_analog_playback alc880_pcm_analog_playback
16803 #define alc662_pcm_analog_capture alc880_pcm_analog_capture
16804 #define alc662_pcm_digital_playback alc880_pcm_digital_playback
16805 #define alc662_pcm_digital_capture alc880_pcm_digital_capture
16808 * configuration and preset
16810 static const char *alc662_models
[ALC662_MODEL_LAST
] = {
16811 [ALC662_3ST_2ch_DIG
] = "3stack-dig",
16812 [ALC662_3ST_6ch_DIG
] = "3stack-6ch-dig",
16813 [ALC662_3ST_6ch
] = "3stack-6ch",
16814 [ALC662_5ST_DIG
] = "6stack-dig",
16815 [ALC662_LENOVO_101E
] = "lenovo-101e",
16816 [ALC662_ASUS_EEEPC_P701
] = "eeepc-p701",
16817 [ALC662_ASUS_EEEPC_EP20
] = "eeepc-ep20",
16818 [ALC662_ECS
] = "ecs",
16819 [ALC663_ASUS_M51VA
] = "m51va",
16820 [ALC663_ASUS_G71V
] = "g71v",
16821 [ALC663_ASUS_H13
] = "h13",
16822 [ALC663_ASUS_G50V
] = "g50v",
16823 [ALC663_ASUS_MODE1
] = "asus-mode1",
16824 [ALC662_ASUS_MODE2
] = "asus-mode2",
16825 [ALC663_ASUS_MODE3
] = "asus-mode3",
16826 [ALC663_ASUS_MODE4
] = "asus-mode4",
16827 [ALC663_ASUS_MODE5
] = "asus-mode5",
16828 [ALC663_ASUS_MODE6
] = "asus-mode6",
16829 [ALC272_DELL
] = "dell",
16830 [ALC272_DELL_ZM1
] = "dell-zm1",
16831 [ALC272_SAMSUNG_NC10
] = "samsung-nc10",
16832 [ALC662_AUTO
] = "auto",
16835 static struct snd_pci_quirk alc662_cfg_tbl
[] = {
16836 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_ECS
),
16837 SND_PCI_QUIRK(0x1028, 0x02d6, "DELL", ALC272_DELL
),
16838 SND_PCI_QUIRK(0x1028, 0x02f4, "DELL ZM1", ALC272_DELL_ZM1
),
16839 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC663_ASUS_MODE1
),
16840 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC663_ASUS_MODE3
),
16841 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC663_ASUS_MODE3
),
16842 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1
),
16843 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2
),
16844 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC663_ASUS_MODE1
),
16845 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_ASUS_MODE2
),
16846 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_ASUS_MODE2
),
16847 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_ASUS_MODE2
),
16848 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC663_ASUS_MODE6
),
16849 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC663_ASUS_MODE6
),
16850 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_ASUS_MODE2
),
16851 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC663_ASUS_MODE3
),
16852 SND_PCI_QUIRK(0x1043, 0x17c3, "ASUS UX20", ALC663_ASUS_M51VA
),
16853 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_ASUS_MODE2
),
16854 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_ASUS_MODE2
),
16855 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC663_ASUS_MODE5
),
16856 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC663_ASUS_MODE6
),
16857 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_ASUS_MODE2
),
16858 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC663_ASUS_MODE1
),
16859 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_ASUS_MODE2
),
16860 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_ASUS_MODE2
),
16861 SND_PCI_QUIRK(0x1043, 0x1878, "ASUS M51VA", ALC663_ASUS_M51VA
),
16862 /*SND_PCI_QUIRK(0x1043, 0x1878, "ASUS M50Vr", ALC663_ASUS_MODE1),*/
16863 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC663_ASUS_MODE3
),
16864 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC663_ASUS_MODE3
),
16865 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC663_ASUS_MODE1
),
16866 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC663_ASUS_MODE1
),
16867 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC663_ASUS_MODE1
),
16868 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC663_ASUS_MODE1
),
16869 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_ASUS_MODE2
),
16870 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_ASUS_MODE2
),
16871 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC663_ASUS_MODE1
),
16872 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC663_ASUS_MODE1
),
16873 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC663_ASUS_MODE3
),
16874 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC663_ASUS_MODE1
),
16875 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC663_ASUS_MODE1
),
16876 SND_PCI_QUIRK(0x1043, 0x19a3, "ASUS G50V", ALC663_ASUS_G50V
),
16877 /*SND_PCI_QUIRK(0x1043, 0x19a3, "ASUS NB", ALC663_ASUS_MODE1),*/
16878 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC663_ASUS_MODE1
),
16879 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_ASUS_MODE2
),
16880 SND_PCI_QUIRK(0x1043, 0x19d3, "ASUS NB", ALC663_ASUS_M51VA
),
16881 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC663_ASUS_MODE1
),
16882 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC663_ASUS_MODE4
),
16883 SND_PCI_QUIRK(0x1043, 0x8290, "ASUS P5GC-MX", ALC662_3ST_6ch_DIG
),
16884 SND_PCI_QUIRK(0x1043, 0x82a1, "ASUS Eeepc", ALC662_ASUS_EEEPC_P701
),
16885 SND_PCI_QUIRK(0x1043, 0x82d1, "ASUS Eeepc EP20", ALC662_ASUS_EEEPC_EP20
),
16886 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_ECS
),
16887 SND_PCI_QUIRK(0x105b, 0x0d47, "Foxconn 45CMX/45GMX/45CMX-K",
16888 ALC662_3ST_6ch_DIG
),
16889 SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB200", ALC663_ASUS_MODE4
),
16890 SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10
),
16891 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L",
16892 ALC662_3ST_6ch_DIG
),
16893 SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG
),
16894 SND_PCI_QUIRK(0x1631, 0xc10c, "PB RS65", ALC663_ASUS_M51VA
),
16895 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo", ALC662_LENOVO_101E
),
16896 SND_PCI_QUIRK(0x1849, 0x3662, "ASROCK K10N78FullHD-hSLI R3.0",
16897 ALC662_3ST_6ch_DIG
),
16898 SND_PCI_QUIRK_MASK(0x1854, 0xf000, 0x2000, "ASUS H13-200x",
16903 static struct alc_config_preset alc662_presets
[] = {
16904 [ALC662_3ST_2ch_DIG
] = {
16905 .mixers
= { alc662_3ST_2ch_mixer
},
16906 .init_verbs
= { alc662_init_verbs
},
16907 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16908 .dac_nids
= alc662_dac_nids
,
16909 .dig_out_nid
= ALC662_DIGOUT_NID
,
16910 .dig_in_nid
= ALC662_DIGIN_NID
,
16911 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
16912 .channel_mode
= alc662_3ST_2ch_modes
,
16913 .input_mux
= &alc662_capture_source
,
16915 [ALC662_3ST_6ch_DIG
] = {
16916 .mixers
= { alc662_3ST_6ch_mixer
, alc662_chmode_mixer
},
16917 .init_verbs
= { alc662_init_verbs
},
16918 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16919 .dac_nids
= alc662_dac_nids
,
16920 .dig_out_nid
= ALC662_DIGOUT_NID
,
16921 .dig_in_nid
= ALC662_DIGIN_NID
,
16922 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_6ch_modes
),
16923 .channel_mode
= alc662_3ST_6ch_modes
,
16925 .input_mux
= &alc662_capture_source
,
16927 [ALC662_3ST_6ch
] = {
16928 .mixers
= { alc662_3ST_6ch_mixer
, alc662_chmode_mixer
},
16929 .init_verbs
= { alc662_init_verbs
},
16930 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16931 .dac_nids
= alc662_dac_nids
,
16932 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_6ch_modes
),
16933 .channel_mode
= alc662_3ST_6ch_modes
,
16935 .input_mux
= &alc662_capture_source
,
16937 [ALC662_5ST_DIG
] = {
16938 .mixers
= { alc662_base_mixer
, alc662_chmode_mixer
},
16939 .init_verbs
= { alc662_init_verbs
},
16940 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16941 .dac_nids
= alc662_dac_nids
,
16942 .dig_out_nid
= ALC662_DIGOUT_NID
,
16943 .dig_in_nid
= ALC662_DIGIN_NID
,
16944 .num_channel_mode
= ARRAY_SIZE(alc662_5stack_modes
),
16945 .channel_mode
= alc662_5stack_modes
,
16946 .input_mux
= &alc662_capture_source
,
16948 [ALC662_LENOVO_101E
] = {
16949 .mixers
= { alc662_lenovo_101e_mixer
},
16950 .init_verbs
= { alc662_init_verbs
, alc662_sue_init_verbs
},
16951 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16952 .dac_nids
= alc662_dac_nids
,
16953 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
16954 .channel_mode
= alc662_3ST_2ch_modes
,
16955 .input_mux
= &alc662_lenovo_101e_capture_source
,
16956 .unsol_event
= alc662_lenovo_101e_unsol_event
,
16957 .init_hook
= alc662_lenovo_101e_all_automute
,
16959 [ALC662_ASUS_EEEPC_P701
] = {
16960 .mixers
= { alc662_eeepc_p701_mixer
},
16961 .init_verbs
= { alc662_init_verbs
,
16962 alc662_eeepc_sue_init_verbs
},
16963 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16964 .dac_nids
= alc662_dac_nids
,
16965 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
16966 .channel_mode
= alc662_3ST_2ch_modes
,
16967 .unsol_event
= alc662_eeepc_unsol_event
,
16968 .setup
= alc662_eeepc_setup
,
16969 .init_hook
= alc662_eeepc_inithook
,
16971 [ALC662_ASUS_EEEPC_EP20
] = {
16972 .mixers
= { alc662_eeepc_ep20_mixer
,
16973 alc662_chmode_mixer
},
16974 .init_verbs
= { alc662_init_verbs
,
16975 alc662_eeepc_ep20_sue_init_verbs
},
16976 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16977 .dac_nids
= alc662_dac_nids
,
16978 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_6ch_modes
),
16979 .channel_mode
= alc662_3ST_6ch_modes
,
16980 .input_mux
= &alc662_lenovo_101e_capture_source
,
16981 .unsol_event
= alc662_eeepc_unsol_event
,
16982 .setup
= alc662_eeepc_ep20_setup
,
16983 .init_hook
= alc662_eeepc_ep20_inithook
,
16986 .mixers
= { alc662_ecs_mixer
},
16987 .init_verbs
= { alc662_init_verbs
,
16988 alc662_ecs_init_verbs
},
16989 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16990 .dac_nids
= alc662_dac_nids
,
16991 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
16992 .channel_mode
= alc662_3ST_2ch_modes
,
16993 .unsol_event
= alc662_eeepc_unsol_event
,
16994 .setup
= alc662_eeepc_setup
,
16995 .init_hook
= alc662_eeepc_inithook
,
16997 [ALC663_ASUS_M51VA
] = {
16998 .mixers
= { alc663_m51va_mixer
},
16999 .init_verbs
= { alc662_init_verbs
, alc663_m51va_init_verbs
},
17000 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17001 .dac_nids
= alc662_dac_nids
,
17002 .dig_out_nid
= ALC662_DIGOUT_NID
,
17003 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17004 .channel_mode
= alc662_3ST_2ch_modes
,
17005 .unsol_event
= alc663_m51va_unsol_event
,
17006 .setup
= alc663_m51va_setup
,
17007 .init_hook
= alc663_m51va_inithook
,
17009 [ALC663_ASUS_G71V
] = {
17010 .mixers
= { alc663_g71v_mixer
},
17011 .init_verbs
= { alc662_init_verbs
, alc663_g71v_init_verbs
},
17012 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17013 .dac_nids
= alc662_dac_nids
,
17014 .dig_out_nid
= ALC662_DIGOUT_NID
,
17015 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17016 .channel_mode
= alc662_3ST_2ch_modes
,
17017 .unsol_event
= alc663_g71v_unsol_event
,
17018 .setup
= alc663_g71v_setup
,
17019 .init_hook
= alc663_g71v_inithook
,
17021 [ALC663_ASUS_H13
] = {
17022 .mixers
= { alc663_m51va_mixer
},
17023 .init_verbs
= { alc662_init_verbs
, alc663_m51va_init_verbs
},
17024 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17025 .dac_nids
= alc662_dac_nids
,
17026 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17027 .channel_mode
= alc662_3ST_2ch_modes
,
17028 .unsol_event
= alc663_m51va_unsol_event
,
17029 .init_hook
= alc663_m51va_inithook
,
17031 [ALC663_ASUS_G50V
] = {
17032 .mixers
= { alc663_g50v_mixer
},
17033 .init_verbs
= { alc662_init_verbs
, alc663_g50v_init_verbs
},
17034 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17035 .dac_nids
= alc662_dac_nids
,
17036 .dig_out_nid
= ALC662_DIGOUT_NID
,
17037 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_6ch_modes
),
17038 .channel_mode
= alc662_3ST_6ch_modes
,
17039 .input_mux
= &alc663_capture_source
,
17040 .unsol_event
= alc663_g50v_unsol_event
,
17041 .setup
= alc663_g50v_setup
,
17042 .init_hook
= alc663_g50v_inithook
,
17044 [ALC663_ASUS_MODE1
] = {
17045 .mixers
= { alc663_m51va_mixer
},
17046 .cap_mixer
= alc662_auto_capture_mixer
,
17047 .init_verbs
= { alc662_init_verbs
,
17048 alc663_21jd_amic_init_verbs
},
17049 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17051 .dac_nids
= alc662_dac_nids
,
17052 .dig_out_nid
= ALC662_DIGOUT_NID
,
17053 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17054 .channel_mode
= alc662_3ST_2ch_modes
,
17055 .unsol_event
= alc663_mode1_unsol_event
,
17056 .setup
= alc663_mode1_setup
,
17057 .init_hook
= alc663_mode1_inithook
,
17059 [ALC662_ASUS_MODE2
] = {
17060 .mixers
= { alc662_1bjd_mixer
},
17061 .cap_mixer
= alc662_auto_capture_mixer
,
17062 .init_verbs
= { alc662_init_verbs
,
17063 alc662_1bjd_amic_init_verbs
},
17064 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17065 .dac_nids
= alc662_dac_nids
,
17066 .dig_out_nid
= ALC662_DIGOUT_NID
,
17067 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17068 .channel_mode
= alc662_3ST_2ch_modes
,
17069 .unsol_event
= alc662_mode2_unsol_event
,
17070 .setup
= alc662_mode2_setup
,
17071 .init_hook
= alc662_mode2_inithook
,
17073 [ALC663_ASUS_MODE3
] = {
17074 .mixers
= { alc663_two_hp_m1_mixer
},
17075 .cap_mixer
= alc662_auto_capture_mixer
,
17076 .init_verbs
= { alc662_init_verbs
,
17077 alc663_two_hp_amic_m1_init_verbs
},
17078 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17080 .dac_nids
= alc662_dac_nids
,
17081 .dig_out_nid
= ALC662_DIGOUT_NID
,
17082 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17083 .channel_mode
= alc662_3ST_2ch_modes
,
17084 .unsol_event
= alc663_mode3_unsol_event
,
17085 .setup
= alc663_mode3_setup
,
17086 .init_hook
= alc663_mode3_inithook
,
17088 [ALC663_ASUS_MODE4
] = {
17089 .mixers
= { alc663_asus_21jd_clfe_mixer
},
17090 .cap_mixer
= alc662_auto_capture_mixer
,
17091 .init_verbs
= { alc662_init_verbs
,
17092 alc663_21jd_amic_init_verbs
},
17093 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17095 .dac_nids
= alc662_dac_nids
,
17096 .dig_out_nid
= ALC662_DIGOUT_NID
,
17097 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17098 .channel_mode
= alc662_3ST_2ch_modes
,
17099 .unsol_event
= alc663_mode4_unsol_event
,
17100 .setup
= alc663_mode4_setup
,
17101 .init_hook
= alc663_mode4_inithook
,
17103 [ALC663_ASUS_MODE5
] = {
17104 .mixers
= { alc663_asus_15jd_clfe_mixer
},
17105 .cap_mixer
= alc662_auto_capture_mixer
,
17106 .init_verbs
= { alc662_init_verbs
,
17107 alc663_15jd_amic_init_verbs
},
17108 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17110 .dac_nids
= alc662_dac_nids
,
17111 .dig_out_nid
= ALC662_DIGOUT_NID
,
17112 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17113 .channel_mode
= alc662_3ST_2ch_modes
,
17114 .unsol_event
= alc663_mode5_unsol_event
,
17115 .setup
= alc663_mode5_setup
,
17116 .init_hook
= alc663_mode5_inithook
,
17118 [ALC663_ASUS_MODE6
] = {
17119 .mixers
= { alc663_two_hp_m2_mixer
},
17120 .cap_mixer
= alc662_auto_capture_mixer
,
17121 .init_verbs
= { alc662_init_verbs
,
17122 alc663_two_hp_amic_m2_init_verbs
},
17123 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17125 .dac_nids
= alc662_dac_nids
,
17126 .dig_out_nid
= ALC662_DIGOUT_NID
,
17127 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17128 .channel_mode
= alc662_3ST_2ch_modes
,
17129 .unsol_event
= alc663_mode6_unsol_event
,
17130 .setup
= alc663_mode6_setup
,
17131 .init_hook
= alc663_mode6_inithook
,
17134 .mixers
= { alc663_m51va_mixer
},
17135 .cap_mixer
= alc272_auto_capture_mixer
,
17136 .init_verbs
= { alc662_init_verbs
, alc272_dell_init_verbs
},
17137 .num_dacs
= ARRAY_SIZE(alc272_dac_nids
),
17138 .dac_nids
= alc662_dac_nids
,
17139 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17140 .adc_nids
= alc272_adc_nids
,
17141 .num_adc_nids
= ARRAY_SIZE(alc272_adc_nids
),
17142 .capsrc_nids
= alc272_capsrc_nids
,
17143 .channel_mode
= alc662_3ST_2ch_modes
,
17144 .unsol_event
= alc663_m51va_unsol_event
,
17145 .setup
= alc663_m51va_setup
,
17146 .init_hook
= alc663_m51va_inithook
,
17148 [ALC272_DELL_ZM1
] = {
17149 .mixers
= { alc663_m51va_mixer
},
17150 .cap_mixer
= alc662_auto_capture_mixer
,
17151 .init_verbs
= { alc662_init_verbs
, alc272_dell_zm1_init_verbs
},
17152 .num_dacs
= ARRAY_SIZE(alc272_dac_nids
),
17153 .dac_nids
= alc662_dac_nids
,
17154 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17155 .adc_nids
= alc662_adc_nids
,
17157 .capsrc_nids
= alc662_capsrc_nids
,
17158 .channel_mode
= alc662_3ST_2ch_modes
,
17159 .unsol_event
= alc663_m51va_unsol_event
,
17160 .setup
= alc663_m51va_setup
,
17161 .init_hook
= alc663_m51va_inithook
,
17163 [ALC272_SAMSUNG_NC10
] = {
17164 .mixers
= { alc272_nc10_mixer
},
17165 .init_verbs
= { alc662_init_verbs
,
17166 alc663_21jd_amic_init_verbs
},
17167 .num_dacs
= ARRAY_SIZE(alc272_dac_nids
),
17168 .dac_nids
= alc272_dac_nids
,
17169 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17170 .channel_mode
= alc662_3ST_2ch_modes
,
17171 /*.input_mux = &alc272_nc10_capture_source,*/
17172 .unsol_event
= alc663_mode4_unsol_event
,
17173 .setup
= alc663_mode4_setup
,
17174 .init_hook
= alc663_mode4_inithook
,
17180 * BIOS auto configuration
17183 /* convert from MIX nid to DAC */
17184 static inline hda_nid_t
alc662_mix_to_dac(hda_nid_t nid
)
17188 else if (nid
>= 0x0c && nid
<= 0x0e)
17189 return nid
- 0x0c + 0x02;
17194 /* get MIX nid connected to the given pin targeted to DAC */
17195 static hda_nid_t
alc662_dac_to_mix(struct hda_codec
*codec
, hda_nid_t pin
,
17201 num
= snd_hda_get_connections(codec
, pin
, mix
, ARRAY_SIZE(mix
));
17202 for (i
= 0; i
< num
; i
++) {
17203 if (alc662_mix_to_dac(mix
[i
]) == dac
)
17209 /* look for an empty DAC slot */
17210 static hda_nid_t
alc662_look_for_dac(struct hda_codec
*codec
, hda_nid_t pin
)
17212 struct alc_spec
*spec
= codec
->spec
;
17216 num
= snd_hda_get_connections(codec
, pin
, srcs
, ARRAY_SIZE(srcs
));
17219 for (i
= 0; i
< num
; i
++) {
17220 hda_nid_t nid
= alc662_mix_to_dac(srcs
[i
]);
17223 for (j
= 0; j
< spec
->multiout
.num_dacs
; j
++)
17224 if (spec
->multiout
.dac_nids
[j
] == nid
)
17226 if (j
>= spec
->multiout
.num_dacs
)
17232 /* fill in the dac_nids table from the parsed pin configuration */
17233 static int alc662_auto_fill_dac_nids(struct hda_codec
*codec
,
17234 const struct auto_pin_cfg
*cfg
)
17236 struct alc_spec
*spec
= codec
->spec
;
17240 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
17241 for (i
= 0; i
< cfg
->line_outs
; i
++) {
17242 dac
= alc662_look_for_dac(codec
, cfg
->line_out_pins
[i
]);
17245 spec
->multiout
.dac_nids
[spec
->multiout
.num_dacs
++] = dac
;
17250 static inline int alc662_add_vol_ctl(struct alc_spec
*spec
, const char *pfx
,
17251 hda_nid_t nid
, unsigned int chs
)
17253 return add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, pfx
,
17254 HDA_COMPOSE_AMP_VAL(nid
, chs
, 0, HDA_OUTPUT
));
17257 static inline int alc662_add_sw_ctl(struct alc_spec
*spec
, const char *pfx
,
17258 hda_nid_t nid
, unsigned int chs
)
17260 return add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, pfx
,
17261 HDA_COMPOSE_AMP_VAL(nid
, chs
, 0, HDA_INPUT
));
17264 #define alc662_add_stereo_vol(spec, pfx, nid) \
17265 alc662_add_vol_ctl(spec, pfx, nid, 3)
17266 #define alc662_add_stereo_sw(spec, pfx, nid) \
17267 alc662_add_sw_ctl(spec, pfx, nid, 3)
17269 /* add playback controls from the parsed DAC table */
17270 static int alc662_auto_create_multi_out_ctls(struct hda_codec
*codec
,
17271 const struct auto_pin_cfg
*cfg
)
17273 struct alc_spec
*spec
= codec
->spec
;
17274 static const char *chname
[4] = {
17275 "Front", "Surround", NULL
/*CLFE*/, "Side"
17277 hda_nid_t nid
, mix
;
17280 for (i
= 0; i
< cfg
->line_outs
; i
++) {
17281 nid
= spec
->multiout
.dac_nids
[i
];
17284 mix
= alc662_dac_to_mix(codec
, cfg
->line_out_pins
[i
], nid
);
17289 err
= alc662_add_vol_ctl(spec
, "Center", nid
, 1);
17292 err
= alc662_add_vol_ctl(spec
, "LFE", nid
, 2);
17295 err
= alc662_add_sw_ctl(spec
, "Center", mix
, 1);
17298 err
= alc662_add_sw_ctl(spec
, "LFE", mix
, 2);
17303 if (cfg
->line_outs
== 1 &&
17304 cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
) {
17311 err
= alc662_add_vol_ctl(spec
, pfx
, nid
, 3);
17314 if (cfg
->line_outs
== 1 &&
17315 cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
17317 err
= alc662_add_sw_ctl(spec
, pfx
, mix
, 3);
17325 /* add playback controls for speaker and HP outputs */
17326 /* return DAC nid if any new DAC is assigned */
17327 static int alc662_auto_create_extra_out(struct hda_codec
*codec
, hda_nid_t pin
,
17330 struct alc_spec
*spec
= codec
->spec
;
17331 hda_nid_t nid
, mix
;
17336 nid
= alc662_look_for_dac(codec
, pin
);
17338 /* the corresponding DAC is already occupied */
17339 if (!(get_wcaps(codec
, pin
) & AC_WCAP_OUT_AMP
))
17340 return 0; /* no way */
17341 /* create a switch only */
17342 return add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, pfx
,
17343 HDA_COMPOSE_AMP_VAL(pin
, 3, 0, HDA_OUTPUT
));
17346 mix
= alc662_dac_to_mix(codec
, pin
, nid
);
17349 err
= alc662_add_vol_ctl(spec
, pfx
, nid
, 3);
17352 err
= alc662_add_sw_ctl(spec
, pfx
, mix
, 3);
17358 /* create playback/capture controls for input pins */
17359 #define alc662_auto_create_input_ctls \
17360 alc882_auto_create_input_ctls
17362 static void alc662_auto_set_output_and_unmute(struct hda_codec
*codec
,
17363 hda_nid_t nid
, int pin_type
,
17369 alc_set_pin_output(codec
, nid
, pin_type
);
17370 /* need the manual connection? */
17371 num
= snd_hda_get_connections(codec
, nid
, srcs
, ARRAY_SIZE(srcs
));
17374 for (i
= 0; i
< num
; i
++) {
17375 if (alc662_mix_to_dac(srcs
[i
]) != dac
)
17377 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_CONNECT_SEL
, i
);
17382 static void alc662_auto_init_multi_out(struct hda_codec
*codec
)
17384 struct alc_spec
*spec
= codec
->spec
;
17385 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
17388 for (i
= 0; i
<= HDA_SIDE
; i
++) {
17389 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
17391 alc662_auto_set_output_and_unmute(codec
, nid
, pin_type
,
17392 spec
->multiout
.dac_nids
[i
]);
17396 static void alc662_auto_init_hp_out(struct hda_codec
*codec
)
17398 struct alc_spec
*spec
= codec
->spec
;
17401 pin
= spec
->autocfg
.hp_pins
[0];
17403 alc662_auto_set_output_and_unmute(codec
, pin
, PIN_HP
,
17404 spec
->multiout
.hp_nid
);
17405 pin
= spec
->autocfg
.speaker_pins
[0];
17407 alc662_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
,
17408 spec
->multiout
.extra_out_nid
[0]);
17411 #define ALC662_PIN_CD_NID ALC880_PIN_CD_NID
17413 static void alc662_auto_init_analog_input(struct hda_codec
*codec
)
17415 struct alc_spec
*spec
= codec
->spec
;
17418 for (i
= 0; i
< AUTO_PIN_LAST
; i
++) {
17419 hda_nid_t nid
= spec
->autocfg
.input_pins
[i
];
17420 if (alc_is_input_pin(codec
, nid
)) {
17421 alc_set_input_pin(codec
, nid
, i
);
17422 if (nid
!= ALC662_PIN_CD_NID
&&
17423 (get_wcaps(codec
, nid
) & AC_WCAP_OUT_AMP
))
17424 snd_hda_codec_write(codec
, nid
, 0,
17425 AC_VERB_SET_AMP_GAIN_MUTE
,
17431 #define alc662_auto_init_input_src alc882_auto_init_input_src
17433 static int alc662_parse_auto_config(struct hda_codec
*codec
)
17435 struct alc_spec
*spec
= codec
->spec
;
17437 static hda_nid_t alc662_ignore
[] = { 0x1d, 0 };
17439 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
17443 if (!spec
->autocfg
.line_outs
)
17444 return 0; /* can't find valid BIOS pin config */
17446 err
= alc662_auto_fill_dac_nids(codec
, &spec
->autocfg
);
17449 err
= alc662_auto_create_multi_out_ctls(codec
, &spec
->autocfg
);
17452 err
= alc662_auto_create_extra_out(codec
,
17453 spec
->autocfg
.speaker_pins
[0],
17458 spec
->multiout
.extra_out_nid
[0] = err
;
17459 err
= alc662_auto_create_extra_out(codec
, spec
->autocfg
.hp_pins
[0],
17464 spec
->multiout
.hp_nid
= err
;
17465 err
= alc662_auto_create_input_ctls(codec
, &spec
->autocfg
);
17469 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
17471 if (spec
->autocfg
.dig_outs
)
17472 spec
->multiout
.dig_out_nid
= ALC880_DIGOUT_NID
;
17474 if (spec
->kctls
.list
)
17475 add_mixer(spec
, spec
->kctls
.list
);
17477 spec
->num_mux_defs
= 1;
17478 spec
->input_mux
= &spec
->private_imux
[0];
17480 add_verb(spec
, alc662_auto_init_verbs
);
17481 if (codec
->vendor_id
== 0x10ec0663)
17482 add_verb(spec
, alc663_auto_init_verbs
);
17484 err
= alc_auto_add_mic_boost(codec
);
17488 alc_ssid_check(codec
, 0x15, 0x1b, 0x14);
17493 /* additional initialization for auto-configuration model */
17494 static void alc662_auto_init(struct hda_codec
*codec
)
17496 struct alc_spec
*spec
= codec
->spec
;
17497 alc662_auto_init_multi_out(codec
);
17498 alc662_auto_init_hp_out(codec
);
17499 alc662_auto_init_analog_input(codec
);
17500 alc662_auto_init_input_src(codec
);
17501 if (spec
->unsol_event
)
17502 alc_inithook(codec
);
17505 static int patch_alc662(struct hda_codec
*codec
)
17507 struct alc_spec
*spec
;
17508 int err
, board_config
;
17510 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
17514 codec
->spec
= spec
;
17516 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
17518 board_config
= snd_hda_check_board_config(codec
, ALC662_MODEL_LAST
,
17521 if (board_config
< 0) {
17522 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
17524 board_config
= ALC662_AUTO
;
17527 if (board_config
== ALC662_AUTO
) {
17528 /* automatic parse from the BIOS config */
17529 err
= alc662_parse_auto_config(codec
);
17535 "hda_codec: Cannot set up configuration "
17536 "from BIOS. Using base mode...\n");
17537 board_config
= ALC662_3ST_2ch_DIG
;
17541 err
= snd_hda_attach_beep_device(codec
, 0x1);
17547 if (board_config
!= ALC662_AUTO
)
17548 setup_preset(codec
, &alc662_presets
[board_config
]);
17550 spec
->stream_analog_playback
= &alc662_pcm_analog_playback
;
17551 spec
->stream_analog_capture
= &alc662_pcm_analog_capture
;
17553 spec
->stream_digital_playback
= &alc662_pcm_digital_playback
;
17554 spec
->stream_digital_capture
= &alc662_pcm_digital_capture
;
17556 if (!spec
->adc_nids
) {
17557 spec
->adc_nids
= alc662_adc_nids
;
17558 spec
->num_adc_nids
= ARRAY_SIZE(alc662_adc_nids
);
17560 if (!spec
->capsrc_nids
)
17561 spec
->capsrc_nids
= alc662_capsrc_nids
;
17563 if (!spec
->cap_mixer
)
17564 set_capture_mixer(codec
);
17565 if (codec
->vendor_id
== 0x10ec0662)
17566 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
17568 set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
17570 spec
->vmaster_nid
= 0x02;
17572 codec
->patch_ops
= alc_patch_ops
;
17573 if (board_config
== ALC662_AUTO
)
17574 spec
->init_hook
= alc662_auto_init
;
17575 #ifdef CONFIG_SND_HDA_POWER_SAVE
17576 if (!spec
->loopback
.amplist
)
17577 spec
->loopback
.amplist
= alc662_loopbacks
;
17579 codec
->proc_widget_hook
= print_realtek_coef
;
17587 static struct hda_codec_preset snd_hda_preset_realtek
[] = {
17588 { .id
= 0x10ec0260, .name
= "ALC260", .patch
= patch_alc260
},
17589 { .id
= 0x10ec0262, .name
= "ALC262", .patch
= patch_alc262
},
17590 { .id
= 0x10ec0267, .name
= "ALC267", .patch
= patch_alc268
},
17591 { .id
= 0x10ec0268, .name
= "ALC268", .patch
= patch_alc268
},
17592 { .id
= 0x10ec0269, .name
= "ALC269", .patch
= patch_alc269
},
17593 { .id
= 0x10ec0272, .name
= "ALC272", .patch
= patch_alc662
},
17594 { .id
= 0x10ec0861, .rev
= 0x100340, .name
= "ALC660",
17595 .patch
= patch_alc861
},
17596 { .id
= 0x10ec0660, .name
= "ALC660-VD", .patch
= patch_alc861vd
},
17597 { .id
= 0x10ec0861, .name
= "ALC861", .patch
= patch_alc861
},
17598 { .id
= 0x10ec0862, .name
= "ALC861-VD", .patch
= patch_alc861vd
},
17599 { .id
= 0x10ec0662, .rev
= 0x100002, .name
= "ALC662 rev2",
17600 .patch
= patch_alc882
},
17601 { .id
= 0x10ec0662, .rev
= 0x100101, .name
= "ALC662 rev1",
17602 .patch
= patch_alc662
},
17603 { .id
= 0x10ec0663, .name
= "ALC663", .patch
= patch_alc662
},
17604 { .id
= 0x10ec0880, .name
= "ALC880", .patch
= patch_alc880
},
17605 { .id
= 0x10ec0882, .name
= "ALC882", .patch
= patch_alc882
},
17606 { .id
= 0x10ec0883, .name
= "ALC883", .patch
= patch_alc882
},
17607 { .id
= 0x10ec0885, .rev
= 0x100101, .name
= "ALC889A",
17608 .patch
= patch_alc882
},
17609 { .id
= 0x10ec0885, .rev
= 0x100103, .name
= "ALC889A",
17610 .patch
= patch_alc882
},
17611 { .id
= 0x10ec0885, .name
= "ALC885", .patch
= patch_alc882
},
17612 { .id
= 0x10ec0887, .name
= "ALC887", .patch
= patch_alc882
},
17613 { .id
= 0x10ec0888, .rev
= 0x100101, .name
= "ALC1200",
17614 .patch
= patch_alc882
},
17615 { .id
= 0x10ec0888, .name
= "ALC888", .patch
= patch_alc882
},
17616 { .id
= 0x10ec0889, .name
= "ALC889", .patch
= patch_alc882
},
17617 {} /* terminator */
17620 MODULE_ALIAS("snd-hda-codec-id:10ec*");
17622 MODULE_LICENSE("GPL");
17623 MODULE_DESCRIPTION("Realtek HD-audio codec");
17625 static struct hda_codec_preset_list realtek_list
= {
17626 .preset
= snd_hda_preset_realtek
,
17627 .owner
= THIS_MODULE
,
17630 static int __init
patch_realtek_init(void)
17632 return snd_hda_add_codec_preset(&realtek_list
);
17635 static void __exit
patch_realtek_exit(void)
17637 snd_hda_delete_codec_preset(&realtek_list
);
17640 module_init(patch_realtek_init
)
17641 module_exit(patch_realtek_exit
)