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 <sound/jack.h>
32 #include "hda_codec.h"
33 #include "hda_local.h"
36 #define ALC880_FRONT_EVENT 0x01
37 #define ALC880_DCVOL_EVENT 0x02
38 #define ALC880_HP_EVENT 0x04
39 #define ALC880_MIC_EVENT 0x08
41 /* ALC880 board config type */
65 #ifdef CONFIG_SND_DEBUG
69 ALC880_MODEL_LAST
/* last tag */
83 #ifdef CONFIG_SND_DEBUG
87 ALC260_MODEL_LAST
/* last tag */
97 ALC262_HP_BPC_D7000_WL
,
98 ALC262_HP_BPC_D7000_WF
,
111 ALC262_MODEL_LAST
/* last tag */
121 ALC268_ACER_ASPIRE_ONE
,
124 #ifdef CONFIG_SND_DEBUG
128 ALC268_MODEL_LAST
/* last tag */
143 ALC269_MODEL_LAST
/* last tag */
160 /* ALC861-VD models */
182 ALC662_ASUS_EEEPC_P701
,
183 ALC662_ASUS_EEEPC_EP20
,
225 ALC883_TARGA_2ch_DIG
,
226 ALC883_TARGA_8ch_DIG
,
229 ALC888_ACER_ASPIRE_4930G
,
230 ALC888_ACER_ASPIRE_6530G
,
231 ALC888_ACER_ASPIRE_8930G
,
232 ALC888_ACER_ASPIRE_7730G
,
234 ALC883_MEDION_WIM2160
,
236 ALC883_LENOVO_101E_2ch
,
237 ALC883_LENOVO_NB0763
,
238 ALC888_LENOVO_MS7195_DIG
,
246 ALC883_FUJITSU_PI2515
,
247 ALC888_FUJITSU_XA3530
,
248 ALC883_3ST_6ch_INTEL
,
268 #define GPIO_MASK 0x03
270 /* extra amp-initialization sequence types */
279 struct alc_mic_route
{
281 unsigned char mux_idx
;
282 unsigned char amix_idx
;
285 #define MUX_IDX_UNDEF ((unsigned char)-1)
287 struct alc_customize_define
{
288 unsigned int sku_cfg
;
289 unsigned char port_connectivity
;
290 unsigned char check_sum
;
291 unsigned char customization
;
292 unsigned char external_amp
;
293 unsigned int enable_pcbeep
:1;
294 unsigned int platform_type
:1;
296 unsigned int override
:1;
297 unsigned int fixup
:1; /* Means that this sku is set by driver, not read from hw */
303 /* codec parameterization */
304 struct snd_kcontrol_new
*mixers
[5]; /* mixer arrays */
305 unsigned int num_mixers
;
306 struct snd_kcontrol_new
*cap_mixer
; /* capture mixer */
307 unsigned int beep_amp
; /* beep amp value, set via set_beep_amp() */
309 const struct hda_verb
*init_verbs
[10]; /* initialization verbs
313 unsigned int num_init_verbs
;
315 char stream_name_analog
[32]; /* analog PCM stream */
316 struct hda_pcm_stream
*stream_analog_playback
;
317 struct hda_pcm_stream
*stream_analog_capture
;
318 struct hda_pcm_stream
*stream_analog_alt_playback
;
319 struct hda_pcm_stream
*stream_analog_alt_capture
;
321 char stream_name_digital
[32]; /* digital PCM stream */
322 struct hda_pcm_stream
*stream_digital_playback
;
323 struct hda_pcm_stream
*stream_digital_capture
;
326 struct hda_multi_out multiout
; /* playback set-up
327 * max_channels, dacs must be set
328 * dig_out_nid and hp_nid are optional
330 hda_nid_t alt_dac_nid
;
331 hda_nid_t slave_dig_outs
[3]; /* optional - for auto-parsing */
335 unsigned int num_adc_nids
;
337 hda_nid_t
*capsrc_nids
;
338 hda_nid_t dig_in_nid
; /* digital-in NID; optional */
340 /* capture setup for dynamic dual-adc switch */
341 unsigned int cur_adc_idx
;
343 unsigned int cur_adc_stream_tag
;
344 unsigned int cur_adc_format
;
347 unsigned int num_mux_defs
;
348 const struct hda_input_mux
*input_mux
;
349 unsigned int cur_mux
[3];
350 struct alc_mic_route ext_mic
;
351 struct alc_mic_route int_mic
;
354 const struct hda_channel_mode
*channel_mode
;
355 int num_channel_mode
;
357 int const_channel_count
;
358 int ext_channel_count
;
360 /* PCM information */
361 struct hda_pcm pcm_rec
[3]; /* used in alc_build_pcms() */
363 /* dynamic controls, init_verbs and input_mux */
364 struct auto_pin_cfg autocfg
;
365 struct alc_customize_define cdefine
;
366 struct snd_array kctls
;
367 struct hda_input_mux private_imux
[3];
368 hda_nid_t private_dac_nids
[AUTO_CFG_MAX_OUTS
];
369 hda_nid_t private_adc_nids
[AUTO_CFG_MAX_OUTS
];
370 hda_nid_t private_capsrc_nids
[AUTO_CFG_MAX_OUTS
];
373 void (*init_hook
)(struct hda_codec
*codec
);
374 void (*unsol_event
)(struct hda_codec
*codec
, unsigned int res
);
375 #ifdef CONFIG_SND_HDA_POWER_SAVE
376 void (*power_hook
)(struct hda_codec
*codec
);
379 /* for pin sensing */
380 unsigned int sense_updated
: 1;
381 unsigned int jack_present
: 1;
382 unsigned int master_sw
: 1;
383 unsigned int auto_mic
:1;
386 unsigned int no_analog
:1; /* digital I/O only */
387 unsigned int dual_adc_switch
:1; /* switch ADCs (for ALC275) */
388 unsigned int single_input_src
:1;
390 int codec_variant
; /* flag for other variants */
392 /* for virtual master */
393 hda_nid_t vmaster_nid
;
394 #ifdef CONFIG_SND_HDA_POWER_SAVE
395 struct hda_loopback_check loopback
;
400 unsigned int pll_coef_idx
, pll_coef_bit
;
404 const struct alc_fixup
*fixup_list
;
405 const char *fixup_name
;
409 * configuration template - to be copied to the spec instance
411 struct alc_config_preset
{
412 struct snd_kcontrol_new
*mixers
[5]; /* should be identical size
415 struct snd_kcontrol_new
*cap_mixer
; /* capture mixer */
416 const struct hda_verb
*init_verbs
[5];
417 unsigned int num_dacs
;
419 hda_nid_t dig_out_nid
; /* optional */
420 hda_nid_t hp_nid
; /* optional */
421 hda_nid_t
*slave_dig_outs
;
422 unsigned int num_adc_nids
;
424 hda_nid_t
*capsrc_nids
;
425 hda_nid_t dig_in_nid
;
426 unsigned int num_channel_mode
;
427 const struct hda_channel_mode
*channel_mode
;
429 int const_channel_count
;
430 unsigned int num_mux_defs
;
431 const struct hda_input_mux
*input_mux
;
432 void (*unsol_event
)(struct hda_codec
*, unsigned int);
433 void (*setup
)(struct hda_codec
*);
434 void (*init_hook
)(struct hda_codec
*);
435 #ifdef CONFIG_SND_HDA_POWER_SAVE
436 struct hda_amp_list
*loopbacks
;
437 void (*power_hook
)(struct hda_codec
*codec
);
445 static int alc_mux_enum_info(struct snd_kcontrol
*kcontrol
,
446 struct snd_ctl_elem_info
*uinfo
)
448 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
449 struct alc_spec
*spec
= codec
->spec
;
450 unsigned int mux_idx
= snd_ctl_get_ioffidx(kcontrol
, &uinfo
->id
);
451 if (mux_idx
>= spec
->num_mux_defs
)
453 if (!spec
->input_mux
[mux_idx
].num_items
&& mux_idx
> 0)
455 return snd_hda_input_mux_info(&spec
->input_mux
[mux_idx
], uinfo
);
458 static int alc_mux_enum_get(struct snd_kcontrol
*kcontrol
,
459 struct snd_ctl_elem_value
*ucontrol
)
461 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
462 struct alc_spec
*spec
= codec
->spec
;
463 unsigned int adc_idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
465 ucontrol
->value
.enumerated
.item
[0] = spec
->cur_mux
[adc_idx
];
469 static int alc_mux_enum_put(struct snd_kcontrol
*kcontrol
,
470 struct snd_ctl_elem_value
*ucontrol
)
472 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
473 struct alc_spec
*spec
= codec
->spec
;
474 const struct hda_input_mux
*imux
;
475 unsigned int adc_idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
476 unsigned int mux_idx
;
477 hda_nid_t nid
= spec
->capsrc_nids
?
478 spec
->capsrc_nids
[adc_idx
] : spec
->adc_nids
[adc_idx
];
481 mux_idx
= adc_idx
>= spec
->num_mux_defs
? 0 : adc_idx
;
482 imux
= &spec
->input_mux
[mux_idx
];
483 if (!imux
->num_items
&& mux_idx
> 0)
484 imux
= &spec
->input_mux
[0];
486 type
= get_wcaps_type(get_wcaps(codec
, nid
));
487 if (type
== AC_WID_AUD_MIX
) {
488 /* Matrix-mixer style (e.g. ALC882) */
489 unsigned int *cur_val
= &spec
->cur_mux
[adc_idx
];
492 idx
= ucontrol
->value
.enumerated
.item
[0];
493 if (idx
>= imux
->num_items
)
494 idx
= imux
->num_items
- 1;
497 for (i
= 0; i
< imux
->num_items
; i
++) {
498 unsigned int v
= (i
== idx
) ? 0 : HDA_AMP_MUTE
;
499 snd_hda_codec_amp_stereo(codec
, nid
, HDA_INPUT
,
500 imux
->items
[i
].index
,
506 /* MUX style (e.g. ALC880) */
507 return snd_hda_input_mux_put(codec
, imux
, ucontrol
, nid
,
508 &spec
->cur_mux
[adc_idx
]);
513 * channel mode setting
515 static int alc_ch_mode_info(struct snd_kcontrol
*kcontrol
,
516 struct snd_ctl_elem_info
*uinfo
)
518 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
519 struct alc_spec
*spec
= codec
->spec
;
520 return snd_hda_ch_mode_info(codec
, uinfo
, spec
->channel_mode
,
521 spec
->num_channel_mode
);
524 static int alc_ch_mode_get(struct snd_kcontrol
*kcontrol
,
525 struct snd_ctl_elem_value
*ucontrol
)
527 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
528 struct alc_spec
*spec
= codec
->spec
;
529 return snd_hda_ch_mode_get(codec
, ucontrol
, spec
->channel_mode
,
530 spec
->num_channel_mode
,
531 spec
->ext_channel_count
);
534 static int alc_ch_mode_put(struct snd_kcontrol
*kcontrol
,
535 struct snd_ctl_elem_value
*ucontrol
)
537 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
538 struct alc_spec
*spec
= codec
->spec
;
539 int err
= snd_hda_ch_mode_put(codec
, ucontrol
, spec
->channel_mode
,
540 spec
->num_channel_mode
,
541 &spec
->ext_channel_count
);
542 if (err
>= 0 && !spec
->const_channel_count
) {
543 spec
->multiout
.max_channels
= spec
->ext_channel_count
;
544 if (spec
->need_dac_fix
)
545 spec
->multiout
.num_dacs
= spec
->multiout
.max_channels
/ 2;
551 * Control the mode of pin widget settings via the mixer. "pc" is used
552 * instead of "%" to avoid consequences of accidently treating the % as
553 * being part of a format specifier. Maximum allowed length of a value is
554 * 63 characters plus NULL terminator.
556 * Note: some retasking pin complexes seem to ignore requests for input
557 * states other than HiZ (eg: PIN_VREFxx) and revert to HiZ if any of these
558 * are requested. Therefore order this list so that this behaviour will not
559 * cause problems when mixer clients move through the enum sequentially.
560 * NIDs 0x0f and 0x10 have been observed to have this behaviour as of
563 static char *alc_pin_mode_names
[] = {
564 "Mic 50pc bias", "Mic 80pc bias",
565 "Line in", "Line out", "Headphone out",
567 static unsigned char alc_pin_mode_values
[] = {
568 PIN_VREF50
, PIN_VREF80
, PIN_IN
, PIN_OUT
, PIN_HP
,
570 /* The control can present all 5 options, or it can limit the options based
571 * in the pin being assumed to be exclusively an input or an output pin. In
572 * addition, "input" pins may or may not process the mic bias option
573 * depending on actual widget capability (NIDs 0x0f and 0x10 don't seem to
574 * accept requests for bias as of chip versions up to March 2006) and/or
575 * wiring in the computer.
577 #define ALC_PIN_DIR_IN 0x00
578 #define ALC_PIN_DIR_OUT 0x01
579 #define ALC_PIN_DIR_INOUT 0x02
580 #define ALC_PIN_DIR_IN_NOMICBIAS 0x03
581 #define ALC_PIN_DIR_INOUT_NOMICBIAS 0x04
583 /* Info about the pin modes supported by the different pin direction modes.
584 * For each direction the minimum and maximum values are given.
586 static signed char alc_pin_mode_dir_info
[5][2] = {
587 { 0, 2 }, /* ALC_PIN_DIR_IN */
588 { 3, 4 }, /* ALC_PIN_DIR_OUT */
589 { 0, 4 }, /* ALC_PIN_DIR_INOUT */
590 { 2, 2 }, /* ALC_PIN_DIR_IN_NOMICBIAS */
591 { 2, 4 }, /* ALC_PIN_DIR_INOUT_NOMICBIAS */
593 #define alc_pin_mode_min(_dir) (alc_pin_mode_dir_info[_dir][0])
594 #define alc_pin_mode_max(_dir) (alc_pin_mode_dir_info[_dir][1])
595 #define alc_pin_mode_n_items(_dir) \
596 (alc_pin_mode_max(_dir)-alc_pin_mode_min(_dir)+1)
598 static int alc_pin_mode_info(struct snd_kcontrol
*kcontrol
,
599 struct snd_ctl_elem_info
*uinfo
)
601 unsigned int item_num
= uinfo
->value
.enumerated
.item
;
602 unsigned char dir
= (kcontrol
->private_value
>> 16) & 0xff;
604 uinfo
->type
= SNDRV_CTL_ELEM_TYPE_ENUMERATED
;
606 uinfo
->value
.enumerated
.items
= alc_pin_mode_n_items(dir
);
608 if (item_num
<alc_pin_mode_min(dir
) || item_num
>alc_pin_mode_max(dir
))
609 item_num
= alc_pin_mode_min(dir
);
610 strcpy(uinfo
->value
.enumerated
.name
, alc_pin_mode_names
[item_num
]);
614 static int alc_pin_mode_get(struct snd_kcontrol
*kcontrol
,
615 struct snd_ctl_elem_value
*ucontrol
)
618 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
619 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
620 unsigned char dir
= (kcontrol
->private_value
>> 16) & 0xff;
621 long *valp
= ucontrol
->value
.integer
.value
;
622 unsigned int pinctl
= snd_hda_codec_read(codec
, nid
, 0,
623 AC_VERB_GET_PIN_WIDGET_CONTROL
,
626 /* Find enumerated value for current pinctl setting */
627 i
= alc_pin_mode_min(dir
);
628 while (i
<= alc_pin_mode_max(dir
) && alc_pin_mode_values
[i
] != pinctl
)
630 *valp
= i
<= alc_pin_mode_max(dir
) ? i
: alc_pin_mode_min(dir
);
634 static int alc_pin_mode_put(struct snd_kcontrol
*kcontrol
,
635 struct snd_ctl_elem_value
*ucontrol
)
638 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
639 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
640 unsigned char dir
= (kcontrol
->private_value
>> 16) & 0xff;
641 long val
= *ucontrol
->value
.integer
.value
;
642 unsigned int pinctl
= snd_hda_codec_read(codec
, nid
, 0,
643 AC_VERB_GET_PIN_WIDGET_CONTROL
,
646 if (val
< alc_pin_mode_min(dir
) || val
> alc_pin_mode_max(dir
))
647 val
= alc_pin_mode_min(dir
);
649 change
= pinctl
!= alc_pin_mode_values
[val
];
651 /* Set pin mode to that requested */
652 snd_hda_codec_write_cache(codec
, nid
, 0,
653 AC_VERB_SET_PIN_WIDGET_CONTROL
,
654 alc_pin_mode_values
[val
]);
656 /* Also enable the retasking pin's input/output as required
657 * for the requested pin mode. Enum values of 2 or less are
660 * Dynamically switching the input/output buffers probably
661 * reduces noise slightly (particularly on input) so we'll
662 * do it. However, having both input and output buffers
663 * enabled simultaneously doesn't seem to be problematic if
664 * this turns out to be necessary in the future.
667 snd_hda_codec_amp_stereo(codec
, nid
, HDA_OUTPUT
, 0,
668 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
669 snd_hda_codec_amp_stereo(codec
, nid
, HDA_INPUT
, 0,
672 snd_hda_codec_amp_stereo(codec
, nid
, HDA_INPUT
, 0,
673 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
674 snd_hda_codec_amp_stereo(codec
, nid
, HDA_OUTPUT
, 0,
681 #define ALC_PIN_MODE(xname, nid, dir) \
682 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
683 .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
684 .info = alc_pin_mode_info, \
685 .get = alc_pin_mode_get, \
686 .put = alc_pin_mode_put, \
687 .private_value = nid | (dir<<16) }
689 /* A switch control for ALC260 GPIO pins. Multiple GPIOs can be ganged
690 * together using a mask with more than one bit set. This control is
691 * currently used only by the ALC260 test model. At this stage they are not
692 * needed for any "production" models.
694 #ifdef CONFIG_SND_DEBUG
695 #define alc_gpio_data_info snd_ctl_boolean_mono_info
697 static int alc_gpio_data_get(struct snd_kcontrol
*kcontrol
,
698 struct snd_ctl_elem_value
*ucontrol
)
700 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
701 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
702 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
703 long *valp
= ucontrol
->value
.integer
.value
;
704 unsigned int val
= snd_hda_codec_read(codec
, nid
, 0,
705 AC_VERB_GET_GPIO_DATA
, 0x00);
707 *valp
= (val
& mask
) != 0;
710 static int alc_gpio_data_put(struct snd_kcontrol
*kcontrol
,
711 struct snd_ctl_elem_value
*ucontrol
)
714 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
715 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
716 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
717 long val
= *ucontrol
->value
.integer
.value
;
718 unsigned int gpio_data
= snd_hda_codec_read(codec
, nid
, 0,
719 AC_VERB_GET_GPIO_DATA
,
722 /* Set/unset the masked GPIO bit(s) as needed */
723 change
= (val
== 0 ? 0 : mask
) != (gpio_data
& mask
);
728 snd_hda_codec_write_cache(codec
, nid
, 0,
729 AC_VERB_SET_GPIO_DATA
, gpio_data
);
733 #define ALC_GPIO_DATA_SWITCH(xname, nid, mask) \
734 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
735 .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
736 .info = alc_gpio_data_info, \
737 .get = alc_gpio_data_get, \
738 .put = alc_gpio_data_put, \
739 .private_value = nid | (mask<<16) }
740 #endif /* CONFIG_SND_DEBUG */
742 /* A switch control to allow the enabling of the digital IO pins on the
743 * ALC260. This is incredibly simplistic; the intention of this control is
744 * to provide something in the test model allowing digital outputs to be
745 * identified if present. If models are found which can utilise these
746 * outputs a more complete mixer control can be devised for those models if
749 #ifdef CONFIG_SND_DEBUG
750 #define alc_spdif_ctrl_info snd_ctl_boolean_mono_info
752 static int alc_spdif_ctrl_get(struct snd_kcontrol
*kcontrol
,
753 struct snd_ctl_elem_value
*ucontrol
)
755 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
756 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
757 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
758 long *valp
= ucontrol
->value
.integer
.value
;
759 unsigned int val
= snd_hda_codec_read(codec
, nid
, 0,
760 AC_VERB_GET_DIGI_CONVERT_1
, 0x00);
762 *valp
= (val
& mask
) != 0;
765 static int alc_spdif_ctrl_put(struct snd_kcontrol
*kcontrol
,
766 struct snd_ctl_elem_value
*ucontrol
)
769 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
770 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
771 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
772 long val
= *ucontrol
->value
.integer
.value
;
773 unsigned int ctrl_data
= snd_hda_codec_read(codec
, nid
, 0,
774 AC_VERB_GET_DIGI_CONVERT_1
,
777 /* Set/unset the masked control bit(s) as needed */
778 change
= (val
== 0 ? 0 : mask
) != (ctrl_data
& mask
);
783 snd_hda_codec_write_cache(codec
, nid
, 0, AC_VERB_SET_DIGI_CONVERT_1
,
788 #define ALC_SPDIF_CTRL_SWITCH(xname, nid, mask) \
789 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
790 .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
791 .info = alc_spdif_ctrl_info, \
792 .get = alc_spdif_ctrl_get, \
793 .put = alc_spdif_ctrl_put, \
794 .private_value = nid | (mask<<16) }
795 #endif /* CONFIG_SND_DEBUG */
797 /* A switch control to allow the enabling EAPD digital outputs on the ALC26x.
798 * Again, this is only used in the ALC26x test models to help identify when
799 * the EAPD line must be asserted for features to work.
801 #ifdef CONFIG_SND_DEBUG
802 #define alc_eapd_ctrl_info snd_ctl_boolean_mono_info
804 static int alc_eapd_ctrl_get(struct snd_kcontrol
*kcontrol
,
805 struct snd_ctl_elem_value
*ucontrol
)
807 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
808 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
809 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
810 long *valp
= ucontrol
->value
.integer
.value
;
811 unsigned int val
= snd_hda_codec_read(codec
, nid
, 0,
812 AC_VERB_GET_EAPD_BTLENABLE
, 0x00);
814 *valp
= (val
& mask
) != 0;
818 static int alc_eapd_ctrl_put(struct snd_kcontrol
*kcontrol
,
819 struct snd_ctl_elem_value
*ucontrol
)
822 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
823 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
824 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
825 long val
= *ucontrol
->value
.integer
.value
;
826 unsigned int ctrl_data
= snd_hda_codec_read(codec
, nid
, 0,
827 AC_VERB_GET_EAPD_BTLENABLE
,
830 /* Set/unset the masked control bit(s) as needed */
831 change
= (!val
? 0 : mask
) != (ctrl_data
& mask
);
836 snd_hda_codec_write_cache(codec
, nid
, 0, AC_VERB_SET_EAPD_BTLENABLE
,
842 #define ALC_EAPD_CTRL_SWITCH(xname, nid, mask) \
843 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
844 .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
845 .info = alc_eapd_ctrl_info, \
846 .get = alc_eapd_ctrl_get, \
847 .put = alc_eapd_ctrl_put, \
848 .private_value = nid | (mask<<16) }
849 #endif /* CONFIG_SND_DEBUG */
852 * set up the input pin config (depending on the given auto-pin type)
854 static void alc_set_input_pin(struct hda_codec
*codec
, hda_nid_t nid
,
857 unsigned int val
= PIN_IN
;
859 if (auto_pin_type
== AUTO_PIN_MIC
) {
862 oldval
= snd_hda_codec_read(codec
, nid
, 0,
863 AC_VERB_GET_PIN_WIDGET_CONTROL
, 0);
864 pincap
= snd_hda_query_pin_caps(codec
, nid
);
865 pincap
= (pincap
& AC_PINCAP_VREF
) >> AC_PINCAP_VREF_SHIFT
;
866 /* if the default pin setup is vref50, we give it priority */
867 if ((pincap
& AC_PINCAP_VREF_80
) && oldval
!= PIN_VREF50
)
869 else if (pincap
& AC_PINCAP_VREF_50
)
871 else if (pincap
& AC_PINCAP_VREF_100
)
873 else if (pincap
& AC_PINCAP_VREF_GRD
)
876 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
, val
);
879 static void alc_fixup_autocfg_pin_nums(struct hda_codec
*codec
)
881 struct alc_spec
*spec
= codec
->spec
;
882 struct auto_pin_cfg
*cfg
= &spec
->autocfg
;
884 if (!cfg
->line_outs
) {
885 while (cfg
->line_outs
< AUTO_CFG_MAX_OUTS
&&
886 cfg
->line_out_pins
[cfg
->line_outs
])
889 if (!cfg
->speaker_outs
) {
890 while (cfg
->speaker_outs
< AUTO_CFG_MAX_OUTS
&&
891 cfg
->speaker_pins
[cfg
->speaker_outs
])
895 while (cfg
->hp_outs
< AUTO_CFG_MAX_OUTS
&&
896 cfg
->hp_pins
[cfg
->hp_outs
])
903 static void add_mixer(struct alc_spec
*spec
, struct snd_kcontrol_new
*mix
)
905 if (snd_BUG_ON(spec
->num_mixers
>= ARRAY_SIZE(spec
->mixers
)))
907 spec
->mixers
[spec
->num_mixers
++] = mix
;
910 static void add_verb(struct alc_spec
*spec
, const struct hda_verb
*verb
)
912 if (snd_BUG_ON(spec
->num_init_verbs
>= ARRAY_SIZE(spec
->init_verbs
)))
914 spec
->init_verbs
[spec
->num_init_verbs
++] = verb
;
918 * set up from the preset table
920 static void setup_preset(struct hda_codec
*codec
,
921 const struct alc_config_preset
*preset
)
923 struct alc_spec
*spec
= codec
->spec
;
926 for (i
= 0; i
< ARRAY_SIZE(preset
->mixers
) && preset
->mixers
[i
]; i
++)
927 add_mixer(spec
, preset
->mixers
[i
]);
928 spec
->cap_mixer
= preset
->cap_mixer
;
929 for (i
= 0; i
< ARRAY_SIZE(preset
->init_verbs
) && preset
->init_verbs
[i
];
931 add_verb(spec
, preset
->init_verbs
[i
]);
933 spec
->channel_mode
= preset
->channel_mode
;
934 spec
->num_channel_mode
= preset
->num_channel_mode
;
935 spec
->need_dac_fix
= preset
->need_dac_fix
;
936 spec
->const_channel_count
= preset
->const_channel_count
;
938 if (preset
->const_channel_count
)
939 spec
->multiout
.max_channels
= preset
->const_channel_count
;
941 spec
->multiout
.max_channels
= spec
->channel_mode
[0].channels
;
942 spec
->ext_channel_count
= spec
->channel_mode
[0].channels
;
944 spec
->multiout
.num_dacs
= preset
->num_dacs
;
945 spec
->multiout
.dac_nids
= preset
->dac_nids
;
946 spec
->multiout
.dig_out_nid
= preset
->dig_out_nid
;
947 spec
->multiout
.slave_dig_outs
= preset
->slave_dig_outs
;
948 spec
->multiout
.hp_nid
= preset
->hp_nid
;
950 spec
->num_mux_defs
= preset
->num_mux_defs
;
951 if (!spec
->num_mux_defs
)
952 spec
->num_mux_defs
= 1;
953 spec
->input_mux
= preset
->input_mux
;
955 spec
->num_adc_nids
= preset
->num_adc_nids
;
956 spec
->adc_nids
= preset
->adc_nids
;
957 spec
->capsrc_nids
= preset
->capsrc_nids
;
958 spec
->dig_in_nid
= preset
->dig_in_nid
;
960 spec
->unsol_event
= preset
->unsol_event
;
961 spec
->init_hook
= preset
->init_hook
;
962 #ifdef CONFIG_SND_HDA_POWER_SAVE
963 spec
->power_hook
= preset
->power_hook
;
964 spec
->loopback
.amplist
= preset
->loopbacks
;
968 preset
->setup(codec
);
970 alc_fixup_autocfg_pin_nums(codec
);
973 /* Enable GPIO mask and set output */
974 static struct hda_verb alc_gpio1_init_verbs
[] = {
975 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
976 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
977 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
981 static struct hda_verb alc_gpio2_init_verbs
[] = {
982 {0x01, AC_VERB_SET_GPIO_MASK
, 0x02},
983 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x02},
984 {0x01, AC_VERB_SET_GPIO_DATA
, 0x02},
988 static struct hda_verb alc_gpio3_init_verbs
[] = {
989 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
990 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x03},
991 {0x01, AC_VERB_SET_GPIO_DATA
, 0x03},
996 * Fix hardware PLL issue
997 * On some codecs, the analog PLL gating control must be off while
998 * the default value is 1.
1000 static void alc_fix_pll(struct hda_codec
*codec
)
1002 struct alc_spec
*spec
= codec
->spec
;
1007 snd_hda_codec_write(codec
, spec
->pll_nid
, 0, AC_VERB_SET_COEF_INDEX
,
1008 spec
->pll_coef_idx
);
1009 val
= snd_hda_codec_read(codec
, spec
->pll_nid
, 0,
1010 AC_VERB_GET_PROC_COEF
, 0);
1011 snd_hda_codec_write(codec
, spec
->pll_nid
, 0, AC_VERB_SET_COEF_INDEX
,
1012 spec
->pll_coef_idx
);
1013 snd_hda_codec_write(codec
, spec
->pll_nid
, 0, AC_VERB_SET_PROC_COEF
,
1014 val
& ~(1 << spec
->pll_coef_bit
));
1017 static void alc_fix_pll_init(struct hda_codec
*codec
, hda_nid_t nid
,
1018 unsigned int coef_idx
, unsigned int coef_bit
)
1020 struct alc_spec
*spec
= codec
->spec
;
1021 spec
->pll_nid
= nid
;
1022 spec
->pll_coef_idx
= coef_idx
;
1023 spec
->pll_coef_bit
= coef_bit
;
1027 static int alc_init_jacks(struct hda_codec
*codec
)
1029 #ifdef CONFIG_SND_HDA_INPUT_JACK
1030 struct alc_spec
*spec
= codec
->spec
;
1032 unsigned int hp_nid
= spec
->autocfg
.hp_pins
[0];
1033 unsigned int mic_nid
= spec
->ext_mic
.pin
;
1036 err
= snd_hda_input_jack_add(codec
, hp_nid
,
1037 SND_JACK_HEADPHONE
, NULL
);
1040 snd_hda_input_jack_report(codec
, hp_nid
);
1044 err
= snd_hda_input_jack_add(codec
, mic_nid
,
1045 SND_JACK_MICROPHONE
, NULL
);
1048 snd_hda_input_jack_report(codec
, mic_nid
);
1050 #endif /* CONFIG_SND_HDA_INPUT_JACK */
1054 static void alc_automute_speaker(struct hda_codec
*codec
, int pinctl
)
1056 struct alc_spec
*spec
= codec
->spec
;
1061 spec
->jack_present
= 0;
1062 for (i
= 0; i
< ARRAY_SIZE(spec
->autocfg
.hp_pins
); i
++) {
1063 nid
= spec
->autocfg
.hp_pins
[i
];
1066 snd_hda_input_jack_report(codec
, nid
);
1067 spec
->jack_present
|= snd_hda_jack_detect(codec
, nid
);
1070 mute
= spec
->jack_present
? HDA_AMP_MUTE
: 0;
1071 /* Toggle internal speakers muting */
1072 for (i
= 0; i
< ARRAY_SIZE(spec
->autocfg
.speaker_pins
); i
++) {
1073 nid
= spec
->autocfg
.speaker_pins
[i
];
1077 snd_hda_codec_write(codec
, nid
, 0,
1078 AC_VERB_SET_PIN_WIDGET_CONTROL
,
1079 spec
->jack_present
? 0 : PIN_OUT
);
1081 snd_hda_codec_amp_stereo(codec
, nid
, HDA_OUTPUT
, 0,
1082 HDA_AMP_MUTE
, mute
);
1087 static void alc_automute_pin(struct hda_codec
*codec
)
1089 alc_automute_speaker(codec
, 1);
1092 static int get_connection_index(struct hda_codec
*codec
, hda_nid_t mux
,
1095 hda_nid_t conn
[HDA_MAX_NUM_INPUTS
];
1098 nums
= snd_hda_get_connections(codec
, mux
, conn
, ARRAY_SIZE(conn
));
1099 for (i
= 0; i
< nums
; i
++)
1105 /* switch the current ADC according to the jack state */
1106 static void alc_dual_mic_adc_auto_switch(struct hda_codec
*codec
)
1108 struct alc_spec
*spec
= codec
->spec
;
1109 unsigned int present
;
1112 present
= snd_hda_jack_detect(codec
, spec
->ext_mic
.pin
);
1114 spec
->cur_adc_idx
= 1;
1116 spec
->cur_adc_idx
= 0;
1117 new_adc
= spec
->adc_nids
[spec
->cur_adc_idx
];
1118 if (spec
->cur_adc
&& spec
->cur_adc
!= new_adc
) {
1119 /* stream is running, let's swap the current ADC */
1120 __snd_hda_codec_cleanup_stream(codec
, spec
->cur_adc
, 1);
1121 spec
->cur_adc
= new_adc
;
1122 snd_hda_codec_setup_stream(codec
, new_adc
,
1123 spec
->cur_adc_stream_tag
, 0,
1124 spec
->cur_adc_format
);
1128 static void alc_mic_automute(struct hda_codec
*codec
)
1130 struct alc_spec
*spec
= codec
->spec
;
1131 struct alc_mic_route
*dead
, *alive
;
1132 unsigned int present
, type
;
1135 if (!spec
->auto_mic
)
1137 if (!spec
->int_mic
.pin
|| !spec
->ext_mic
.pin
)
1139 if (snd_BUG_ON(!spec
->adc_nids
))
1142 if (spec
->dual_adc_switch
) {
1143 alc_dual_mic_adc_auto_switch(codec
);
1147 cap_nid
= spec
->capsrc_nids
? spec
->capsrc_nids
[0] : spec
->adc_nids
[0];
1149 present
= snd_hda_jack_detect(codec
, spec
->ext_mic
.pin
);
1151 alive
= &spec
->ext_mic
;
1152 dead
= &spec
->int_mic
;
1154 alive
= &spec
->int_mic
;
1155 dead
= &spec
->ext_mic
;
1158 type
= get_wcaps_type(get_wcaps(codec
, cap_nid
));
1159 if (type
== AC_WID_AUD_MIX
) {
1160 /* Matrix-mixer style (e.g. ALC882) */
1161 snd_hda_codec_amp_stereo(codec
, cap_nid
, HDA_INPUT
,
1164 snd_hda_codec_amp_stereo(codec
, cap_nid
, HDA_INPUT
,
1166 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
1168 /* MUX style (e.g. ALC880) */
1169 snd_hda_codec_write_cache(codec
, cap_nid
, 0,
1170 AC_VERB_SET_CONNECT_SEL
,
1173 snd_hda_input_jack_report(codec
, spec
->ext_mic
.pin
);
1175 /* FIXME: analog mixer */
1178 /* unsolicited event for HP jack sensing */
1179 static void alc_sku_unsol_event(struct hda_codec
*codec
, unsigned int res
)
1181 if (codec
->vendor_id
== 0x10ec0880)
1186 case ALC880_HP_EVENT
:
1187 alc_automute_pin(codec
);
1189 case ALC880_MIC_EVENT
:
1190 alc_mic_automute(codec
);
1195 static void alc_inithook(struct hda_codec
*codec
)
1197 alc_automute_pin(codec
);
1198 alc_mic_automute(codec
);
1201 /* additional initialization for ALC888 variants */
1202 static void alc888_coef_init(struct hda_codec
*codec
)
1206 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 0);
1207 tmp
= snd_hda_codec_read(codec
, 0x20, 0, AC_VERB_GET_PROC_COEF
, 0);
1208 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 7);
1209 if ((tmp
& 0xf0) == 0x20)
1211 snd_hda_codec_read(codec
, 0x20, 0,
1212 AC_VERB_SET_PROC_COEF
, 0x830);
1215 snd_hda_codec_read(codec
, 0x20, 0,
1216 AC_VERB_SET_PROC_COEF
, 0x3030);
1219 static void alc889_coef_init(struct hda_codec
*codec
)
1223 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 7);
1224 tmp
= snd_hda_codec_read(codec
, 0x20, 0, AC_VERB_GET_PROC_COEF
, 0);
1225 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 7);
1226 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_PROC_COEF
, tmp
|0x2010);
1229 /* turn on/off EAPD control (only if available) */
1230 static void set_eapd(struct hda_codec
*codec
, hda_nid_t nid
, int on
)
1232 if (get_wcaps_type(get_wcaps(codec
, nid
)) != AC_WID_PIN
)
1234 if (snd_hda_query_pin_caps(codec
, nid
) & AC_PINCAP_EAPD
)
1235 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_EAPD_BTLENABLE
,
1239 static void alc_auto_init_amp(struct hda_codec
*codec
, int type
)
1244 case ALC_INIT_GPIO1
:
1245 snd_hda_sequence_write(codec
, alc_gpio1_init_verbs
);
1247 case ALC_INIT_GPIO2
:
1248 snd_hda_sequence_write(codec
, alc_gpio2_init_verbs
);
1250 case ALC_INIT_GPIO3
:
1251 snd_hda_sequence_write(codec
, alc_gpio3_init_verbs
);
1253 case ALC_INIT_DEFAULT
:
1254 switch (codec
->vendor_id
) {
1256 set_eapd(codec
, 0x0f, 1);
1257 set_eapd(codec
, 0x10, 1);
1272 set_eapd(codec
, 0x14, 1);
1273 set_eapd(codec
, 0x15, 1);
1276 switch (codec
->vendor_id
) {
1278 snd_hda_codec_write(codec
, 0x1a, 0,
1279 AC_VERB_SET_COEF_INDEX
, 7);
1280 tmp
= snd_hda_codec_read(codec
, 0x1a, 0,
1281 AC_VERB_GET_PROC_COEF
, 0);
1282 snd_hda_codec_write(codec
, 0x1a, 0,
1283 AC_VERB_SET_COEF_INDEX
, 7);
1284 snd_hda_codec_write(codec
, 0x1a, 0,
1285 AC_VERB_SET_PROC_COEF
,
1294 /*case 0x10ec0889:*/ /* this causes an SPDIF problem */
1295 alc889_coef_init(codec
);
1298 alc888_coef_init(codec
);
1300 #if 0 /* XXX: This may cause the silent output on speaker on some machines */
1303 snd_hda_codec_write(codec
, 0x20, 0,
1304 AC_VERB_SET_COEF_INDEX
, 7);
1305 tmp
= snd_hda_codec_read(codec
, 0x20, 0,
1306 AC_VERB_GET_PROC_COEF
, 0);
1307 snd_hda_codec_write(codec
, 0x20, 0,
1308 AC_VERB_SET_COEF_INDEX
, 7);
1309 snd_hda_codec_write(codec
, 0x20, 0,
1310 AC_VERB_SET_PROC_COEF
,
1319 static void alc_init_auto_hp(struct hda_codec
*codec
)
1321 struct alc_spec
*spec
= codec
->spec
;
1322 struct auto_pin_cfg
*cfg
= &spec
->autocfg
;
1325 if (!cfg
->hp_pins
[0]) {
1326 if (cfg
->line_out_type
!= AUTO_PIN_HP_OUT
)
1330 if (!cfg
->speaker_pins
[0]) {
1331 if (cfg
->line_out_type
!= AUTO_PIN_SPEAKER_OUT
)
1333 memcpy(cfg
->speaker_pins
, cfg
->line_out_pins
,
1334 sizeof(cfg
->speaker_pins
));
1335 cfg
->speaker_outs
= cfg
->line_outs
;
1338 if (!cfg
->hp_pins
[0]) {
1339 memcpy(cfg
->hp_pins
, cfg
->line_out_pins
,
1340 sizeof(cfg
->hp_pins
));
1341 cfg
->hp_outs
= cfg
->line_outs
;
1344 for (i
= 0; i
< cfg
->hp_outs
; i
++) {
1345 snd_printdd("realtek: Enable HP auto-muting on NID 0x%x\n",
1347 snd_hda_codec_write_cache(codec
, cfg
->hp_pins
[i
], 0,
1348 AC_VERB_SET_UNSOLICITED_ENABLE
,
1349 AC_USRSP_EN
| ALC880_HP_EVENT
);
1351 spec
->unsol_event
= alc_sku_unsol_event
;
1354 static void alc_init_auto_mic(struct hda_codec
*codec
)
1356 struct alc_spec
*spec
= codec
->spec
;
1357 struct auto_pin_cfg
*cfg
= &spec
->autocfg
;
1358 hda_nid_t fixed
, ext
;
1361 /* there must be only two mic inputs exclusively */
1362 for (i
= 0; i
< cfg
->num_inputs
; i
++)
1363 if (cfg
->inputs
[i
].type
>= AUTO_PIN_LINE_IN
)
1367 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
1368 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
1369 unsigned int defcfg
;
1370 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
1371 switch (snd_hda_get_input_pin_attr(defcfg
)) {
1372 case INPUT_PIN_ATTR_INT
:
1374 return; /* already occupied */
1377 case INPUT_PIN_ATTR_UNUSED
:
1378 return; /* invalid entry */
1381 return; /* already occupied */
1388 if (!(get_wcaps(codec
, ext
) & AC_WCAP_UNSOL_CAP
))
1389 return; /* no unsol support */
1390 snd_printdd("realtek: Enable auto-mic switch on NID 0x%x/0x%x\n",
1392 spec
->ext_mic
.pin
= ext
;
1393 spec
->int_mic
.pin
= fixed
;
1394 spec
->ext_mic
.mux_idx
= MUX_IDX_UNDEF
; /* set later */
1395 spec
->int_mic
.mux_idx
= MUX_IDX_UNDEF
; /* set later */
1397 snd_hda_codec_write_cache(codec
, spec
->ext_mic
.pin
, 0,
1398 AC_VERB_SET_UNSOLICITED_ENABLE
,
1399 AC_USRSP_EN
| ALC880_MIC_EVENT
);
1400 spec
->unsol_event
= alc_sku_unsol_event
;
1403 /* Could be any non-zero and even value. When used as fixup, tells
1404 * the driver to ignore any present sku defines.
1406 #define ALC_FIXUP_SKU_IGNORE (2)
1408 static int alc_auto_parse_customize_define(struct hda_codec
*codec
)
1410 unsigned int ass
, tmp
, i
;
1412 struct alc_spec
*spec
= codec
->spec
;
1414 spec
->cdefine
.enable_pcbeep
= 1; /* assume always enabled */
1416 if (spec
->cdefine
.fixup
) {
1417 ass
= spec
->cdefine
.sku_cfg
;
1418 if (ass
== ALC_FIXUP_SKU_IGNORE
)
1423 ass
= codec
->subsystem_id
& 0xffff;
1424 if (ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
1428 if (codec
->vendor_id
== 0x10ec0260)
1430 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
1433 printk(KERN_INFO
"hda_codec: %s: SKU not ready 0x%08x\n",
1434 codec
->chip_name
, ass
);
1440 for (i
= 1; i
< 16; i
++) {
1444 if (((ass
>> 16) & 0xf) != tmp
)
1447 spec
->cdefine
.port_connectivity
= ass
>> 30;
1448 spec
->cdefine
.enable_pcbeep
= (ass
& 0x100000) >> 20;
1449 spec
->cdefine
.check_sum
= (ass
>> 16) & 0xf;
1450 spec
->cdefine
.customization
= ass
>> 8;
1452 spec
->cdefine
.sku_cfg
= ass
;
1453 spec
->cdefine
.external_amp
= (ass
& 0x38) >> 3;
1454 spec
->cdefine
.platform_type
= (ass
& 0x4) >> 2;
1455 spec
->cdefine
.swap
= (ass
& 0x2) >> 1;
1456 spec
->cdefine
.override
= ass
& 0x1;
1458 snd_printd("SKU: Nid=0x%x sku_cfg=0x%08x\n",
1459 nid
, spec
->cdefine
.sku_cfg
);
1460 snd_printd("SKU: port_connectivity=0x%x\n",
1461 spec
->cdefine
.port_connectivity
);
1462 snd_printd("SKU: enable_pcbeep=0x%x\n", spec
->cdefine
.enable_pcbeep
);
1463 snd_printd("SKU: check_sum=0x%08x\n", spec
->cdefine
.check_sum
);
1464 snd_printd("SKU: customization=0x%08x\n", spec
->cdefine
.customization
);
1465 snd_printd("SKU: external_amp=0x%x\n", spec
->cdefine
.external_amp
);
1466 snd_printd("SKU: platform_type=0x%x\n", spec
->cdefine
.platform_type
);
1467 snd_printd("SKU: swap=0x%x\n", spec
->cdefine
.swap
);
1468 snd_printd("SKU: override=0x%x\n", spec
->cdefine
.override
);
1473 /* check subsystem ID and set up device-specific initialization;
1474 * return 1 if initialized, 0 if invalid SSID
1476 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
1477 * 31 ~ 16 : Manufacture ID
1479 * 7 ~ 0 : Assembly ID
1480 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
1482 static int alc_subsystem_id(struct hda_codec
*codec
,
1483 hda_nid_t porta
, hda_nid_t porte
,
1484 hda_nid_t portd
, hda_nid_t porti
)
1486 unsigned int ass
, tmp
, i
;
1488 struct alc_spec
*spec
= codec
->spec
;
1490 if (spec
->cdefine
.fixup
) {
1491 ass
= spec
->cdefine
.sku_cfg
;
1492 if (ass
== ALC_FIXUP_SKU_IGNORE
)
1497 ass
= codec
->subsystem_id
& 0xffff;
1498 if ((ass
!= codec
->bus
->pci
->subsystem_device
) && (ass
& 1))
1501 /* invalid SSID, check the special NID pin defcfg instead */
1503 * 31~30 : port connectivity
1506 * 19~16 : Check sum (15:1)
1511 if (codec
->vendor_id
== 0x10ec0260)
1513 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
1514 snd_printd("realtek: No valid SSID, "
1515 "checking pincfg 0x%08x for NID 0x%x\n",
1519 if ((ass
>> 30) != 1) /* no physical connection */
1524 for (i
= 1; i
< 16; i
++) {
1528 if (((ass
>> 16) & 0xf) != tmp
)
1531 snd_printd("realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
1532 ass
& 0xffff, codec
->vendor_id
);
1536 * 2 : 0 --> Desktop, 1 --> Laptop
1537 * 3~5 : External Amplifier control
1540 tmp
= (ass
& 0x38) >> 3; /* external Amp control */
1543 spec
->init_amp
= ALC_INIT_GPIO1
;
1546 spec
->init_amp
= ALC_INIT_GPIO2
;
1549 spec
->init_amp
= ALC_INIT_GPIO3
;
1553 spec
->init_amp
= ALC_INIT_DEFAULT
;
1557 /* is laptop or Desktop and enable the function "Mute internal speaker
1558 * when the external headphone out jack is plugged"
1560 if (!(ass
& 0x8000))
1563 * 10~8 : Jack location
1564 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
1566 * 15 : 1 --> enable the function "Mute internal speaker
1567 * when the external headphone out jack is plugged"
1569 if (!spec
->autocfg
.hp_pins
[0]) {
1571 tmp
= (ass
>> 11) & 0x3; /* HP to chassis */
1582 for (i
= 0; i
< spec
->autocfg
.line_outs
; i
++)
1583 if (spec
->autocfg
.line_out_pins
[i
] == nid
)
1585 spec
->autocfg
.hp_pins
[0] = nid
;
1588 alc_init_auto_hp(codec
);
1589 alc_init_auto_mic(codec
);
1593 static void alc_ssid_check(struct hda_codec
*codec
,
1594 hda_nid_t porta
, hda_nid_t porte
,
1595 hda_nid_t portd
, hda_nid_t porti
)
1597 if (!alc_subsystem_id(codec
, porta
, porte
, portd
, porti
)) {
1598 struct alc_spec
*spec
= codec
->spec
;
1599 snd_printd("realtek: "
1600 "Enable default setup for auto mode as fallback\n");
1601 spec
->init_amp
= ALC_INIT_DEFAULT
;
1602 alc_init_auto_hp(codec
);
1603 alc_init_auto_mic(codec
);
1608 * Fix-up pin default configurations and add default verbs
1616 struct alc_model_fixup
{
1627 const struct alc_pincfg
*pins
;
1628 const struct hda_verb
*verbs
;
1629 void (*func
)(struct hda_codec
*codec
,
1630 const struct alc_fixup
*fix
,
1644 ALC_FIXUP_ACT_PRE_PROBE
,
1645 ALC_FIXUP_ACT_PROBE
,
1649 static void alc_apply_fixup(struct hda_codec
*codec
, int action
)
1651 struct alc_spec
*spec
= codec
->spec
;
1652 int id
= spec
->fixup_id
;
1653 #ifdef CONFIG_SND_DEBUG_VERBOSE
1654 const char *modelname
= spec
->fixup_name
;
1658 if (!spec
->fixup_list
)
1662 const struct alc_fixup
*fix
= spec
->fixup_list
+ id
;
1663 const struct alc_pincfg
*cfg
;
1665 switch (fix
->type
) {
1667 if (action
!= ALC_FIXUP_ACT_PRE_PROBE
|| !fix
->v
.sku
)
1669 snd_printdd(KERN_INFO
"hda_codec: %s: "
1670 "Apply sku override for %s\n",
1671 codec
->chip_name
, modelname
);
1672 spec
->cdefine
.sku_cfg
= fix
->v
.sku
;
1673 spec
->cdefine
.fixup
= 1;
1675 case ALC_FIXUP_PINS
:
1677 if (action
!= ALC_FIXUP_ACT_PRE_PROBE
|| !cfg
)
1679 snd_printdd(KERN_INFO
"hda_codec: %s: "
1680 "Apply pincfg for %s\n",
1681 codec
->chip_name
, modelname
);
1682 for (; cfg
->nid
; cfg
++)
1683 snd_hda_codec_set_pincfg(codec
, cfg
->nid
,
1686 case ALC_FIXUP_VERBS
:
1687 if (action
!= ALC_FIXUP_ACT_PROBE
|| !fix
->v
.verbs
)
1689 snd_printdd(KERN_INFO
"hda_codec: %s: "
1690 "Apply fix-verbs for %s\n",
1691 codec
->chip_name
, modelname
);
1692 add_verb(codec
->spec
, fix
->v
.verbs
);
1694 case ALC_FIXUP_FUNC
:
1697 snd_printdd(KERN_INFO
"hda_codec: %s: "
1698 "Apply fix-func for %s\n",
1699 codec
->chip_name
, modelname
);
1700 fix
->v
.func(codec
, fix
, action
);
1703 snd_printk(KERN_ERR
"hda_codec: %s: "
1704 "Invalid fixup type %d\n",
1705 codec
->chip_name
, fix
->type
);
1708 if (!fix
[id
].chained
)
1712 id
= fix
[id
].chain_id
;
1716 static void alc_pick_fixup(struct hda_codec
*codec
,
1717 const struct alc_model_fixup
*models
,
1718 const struct snd_pci_quirk
*quirk
,
1719 const struct alc_fixup
*fixlist
)
1721 struct alc_spec
*spec
= codec
->spec
;
1723 const char *name
= NULL
;
1725 if (codec
->modelname
&& models
) {
1726 while (models
->name
) {
1727 if (!strcmp(codec
->modelname
, models
->name
)) {
1729 name
= models
->name
;
1736 quirk
= snd_pci_quirk_lookup(codec
->bus
->pci
, quirk
);
1739 #ifdef CONFIG_SND_DEBUG_VERBOSE
1745 spec
->fixup_id
= id
;
1747 spec
->fixup_list
= fixlist
;
1748 spec
->fixup_name
= name
;
1752 static int alc_read_coef_idx(struct hda_codec
*codec
,
1753 unsigned int coef_idx
)
1756 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
,
1758 val
= snd_hda_codec_read(codec
, 0x20, 0,
1759 AC_VERB_GET_PROC_COEF
, 0);
1763 static void alc_write_coef_idx(struct hda_codec
*codec
, unsigned int coef_idx
,
1764 unsigned int coef_val
)
1766 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
,
1768 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_PROC_COEF
,
1772 /* set right pin controls for digital I/O */
1773 static void alc_auto_init_digital(struct hda_codec
*codec
)
1775 struct alc_spec
*spec
= codec
->spec
;
1779 for (i
= 0; i
< spec
->autocfg
.dig_outs
; i
++) {
1780 pin
= spec
->autocfg
.dig_out_pins
[i
];
1782 snd_hda_codec_write(codec
, pin
, 0,
1783 AC_VERB_SET_PIN_WIDGET_CONTROL
,
1787 pin
= spec
->autocfg
.dig_in_pin
;
1789 snd_hda_codec_write(codec
, pin
, 0,
1790 AC_VERB_SET_PIN_WIDGET_CONTROL
,
1794 /* parse digital I/Os and set up NIDs in BIOS auto-parse mode */
1795 static void alc_auto_parse_digital(struct hda_codec
*codec
)
1797 struct alc_spec
*spec
= codec
->spec
;
1801 /* support multiple SPDIFs; the secondary is set up as a slave */
1802 for (i
= 0; i
< spec
->autocfg
.dig_outs
; i
++) {
1803 err
= snd_hda_get_connections(codec
,
1804 spec
->autocfg
.dig_out_pins
[i
],
1809 spec
->multiout
.dig_out_nid
= dig_nid
;
1810 spec
->dig_out_type
= spec
->autocfg
.dig_out_type
[0];
1812 spec
->multiout
.slave_dig_outs
= spec
->slave_dig_outs
;
1813 if (i
>= ARRAY_SIZE(spec
->slave_dig_outs
) - 1)
1815 spec
->slave_dig_outs
[i
- 1] = dig_nid
;
1819 if (spec
->autocfg
.dig_in_pin
) {
1820 dig_nid
= codec
->start_nid
;
1821 for (i
= 0; i
< codec
->num_nodes
; i
++, dig_nid
++) {
1822 unsigned int wcaps
= get_wcaps(codec
, dig_nid
);
1823 if (get_wcaps_type(wcaps
) != AC_WID_AUD_IN
)
1825 if (!(wcaps
& AC_WCAP_DIGITAL
))
1827 if (!(wcaps
& AC_WCAP_CONN_LIST
))
1829 err
= get_connection_index(codec
, dig_nid
,
1830 spec
->autocfg
.dig_in_pin
);
1832 spec
->dig_in_nid
= dig_nid
;
1846 static struct hda_verb alc888_4ST_ch2_intel_init
[] = {
1847 /* Mic-in jack as mic in */
1848 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
1849 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
1850 /* Line-in jack as Line in */
1851 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
1852 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
1853 /* Line-Out as Front */
1854 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x00},
1861 static struct hda_verb alc888_4ST_ch4_intel_init
[] = {
1862 /* Mic-in jack as mic in */
1863 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
1864 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
1865 /* Line-in jack as Surround */
1866 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1867 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1868 /* Line-Out as Front */
1869 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x00},
1876 static struct hda_verb alc888_4ST_ch6_intel_init
[] = {
1877 /* Mic-in jack as CLFE */
1878 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1879 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1880 /* Line-in jack as Surround */
1881 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1882 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1883 /* Line-Out as CLFE (workaround because Mic-in is not loud enough) */
1884 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
1891 static struct hda_verb alc888_4ST_ch8_intel_init
[] = {
1892 /* Mic-in jack as CLFE */
1893 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1894 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1895 /* Line-in jack as Surround */
1896 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1897 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1898 /* Line-Out as Side */
1899 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
1903 static struct hda_channel_mode alc888_4ST_8ch_intel_modes
[4] = {
1904 { 2, alc888_4ST_ch2_intel_init
},
1905 { 4, alc888_4ST_ch4_intel_init
},
1906 { 6, alc888_4ST_ch6_intel_init
},
1907 { 8, alc888_4ST_ch8_intel_init
},
1911 * ALC888 Fujitsu Siemens Amillo xa3530
1914 static struct hda_verb alc888_fujitsu_xa3530_verbs
[] = {
1915 /* Front Mic: set to PIN_IN (empty by default) */
1916 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
1917 /* Connect Internal HP to Front */
1918 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1919 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1920 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
1921 /* Connect Bass HP to Front */
1922 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1923 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1924 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
1925 /* Connect Line-Out side jack (SPDIF) to Side */
1926 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1927 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1928 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
1929 /* Connect Mic jack to CLFE */
1930 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1931 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1932 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02},
1933 /* Connect Line-in jack to Surround */
1934 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1935 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1936 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01},
1937 /* Connect HP out jack to Front */
1938 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1939 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1940 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
1941 /* Enable unsolicited event for HP jack and Line-out jack */
1942 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
1943 {0x17, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
1947 static void alc_automute_amp(struct hda_codec
*codec
)
1949 alc_automute_speaker(codec
, 0);
1952 static void alc_automute_amp_unsol_event(struct hda_codec
*codec
,
1955 if (codec
->vendor_id
== 0x10ec0880)
1959 if (res
== ALC880_HP_EVENT
)
1960 alc_automute_amp(codec
);
1963 static void alc889_automute_setup(struct hda_codec
*codec
)
1965 struct alc_spec
*spec
= codec
->spec
;
1967 spec
->autocfg
.hp_pins
[0] = 0x15;
1968 spec
->autocfg
.speaker_pins
[0] = 0x14;
1969 spec
->autocfg
.speaker_pins
[1] = 0x16;
1970 spec
->autocfg
.speaker_pins
[2] = 0x17;
1971 spec
->autocfg
.speaker_pins
[3] = 0x19;
1972 spec
->autocfg
.speaker_pins
[4] = 0x1a;
1975 static void alc889_intel_init_hook(struct hda_codec
*codec
)
1977 alc889_coef_init(codec
);
1978 alc_automute_amp(codec
);
1981 static void alc888_fujitsu_xa3530_setup(struct hda_codec
*codec
)
1983 struct alc_spec
*spec
= codec
->spec
;
1985 spec
->autocfg
.hp_pins
[0] = 0x17; /* line-out */
1986 spec
->autocfg
.hp_pins
[1] = 0x1b; /* hp */
1987 spec
->autocfg
.speaker_pins
[0] = 0x14; /* speaker */
1988 spec
->autocfg
.speaker_pins
[1] = 0x15; /* bass */
1992 * ALC888 Acer Aspire 4930G model
1995 static struct hda_verb alc888_acer_aspire_4930g_verbs
[] = {
1996 /* Front Mic: set to PIN_IN (empty by default) */
1997 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
1998 /* Unselect Front Mic by default in input mixer 3 */
1999 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0xb)},
2000 /* Enable unsolicited event for HP jack */
2001 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
2002 /* Connect Internal HP to front */
2003 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2004 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2005 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
2006 /* Connect HP out to front */
2007 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2008 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2009 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
2010 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
2015 * ALC888 Acer Aspire 6530G model
2018 static struct hda_verb alc888_acer_aspire_6530g_verbs
[] = {
2019 /* Route to built-in subwoofer as well as speakers */
2020 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2021 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
2022 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2023 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
2024 /* Bias voltage on for external mic port */
2025 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
| PIN_VREF80
},
2026 /* Front Mic: set to PIN_IN (empty by default) */
2027 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2028 /* Unselect Front Mic by default in input mixer 3 */
2029 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0xb)},
2030 /* Enable unsolicited event for HP jack */
2031 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
2032 /* Enable speaker output */
2033 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2034 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2035 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
2036 /* Enable headphone output */
2037 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
| PIN_HP
},
2038 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2039 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
2040 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
2045 *ALC888 Acer Aspire 7730G model
2048 static struct hda_verb alc888_acer_aspire_7730G_verbs
[] = {
2049 /* Bias voltage on for external mic port */
2050 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
| PIN_VREF80
},
2051 /* Front Mic: set to PIN_IN (empty by default) */
2052 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2053 /* Unselect Front Mic by default in input mixer 3 */
2054 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0xb)},
2055 /* Enable unsolicited event for HP jack */
2056 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
2057 /* Enable speaker output */
2058 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2059 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2060 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
2061 /* Enable headphone output */
2062 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
| PIN_HP
},
2063 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2064 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
2065 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
2066 /*Enable internal subwoofer */
2067 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2068 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2069 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x02},
2070 {0x17, AC_VERB_SET_EAPD_BTLENABLE
, 2},
2075 * ALC889 Acer Aspire 8930G model
2078 static struct hda_verb alc889_acer_aspire_8930g_verbs
[] = {
2079 /* Front Mic: set to PIN_IN (empty by default) */
2080 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2081 /* Unselect Front Mic by default in input mixer 3 */
2082 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0xb)},
2083 /* Enable unsolicited event for HP jack */
2084 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
2085 /* Connect Internal Front to Front */
2086 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2087 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2088 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
2089 /* Connect Internal Rear to Rear */
2090 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2091 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2092 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x01},
2093 /* Connect Internal CLFE to CLFE */
2094 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2095 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2096 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x02},
2097 /* Connect HP out to Front */
2098 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
| PIN_HP
},
2099 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2100 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
2101 /* Enable all DACs */
2102 /* DAC DISABLE/MUTE 1? */
2103 /* setting bits 1-5 disables DAC nids 0x02-0x06 apparently. Init=0x38 */
2104 {0x20, AC_VERB_SET_COEF_INDEX
, 0x03},
2105 {0x20, AC_VERB_SET_PROC_COEF
, 0x0000},
2106 /* DAC DISABLE/MUTE 2? */
2107 /* some bit here disables the other DACs. Init=0x4900 */
2108 {0x20, AC_VERB_SET_COEF_INDEX
, 0x08},
2109 {0x20, AC_VERB_SET_PROC_COEF
, 0x0000},
2111 * This laptop has a stereo digital microphone. The mics are only 1cm apart
2112 * which makes the stereo useless. However, either the mic or the ALC889
2113 * makes the signal become a difference/sum signal instead of standard
2114 * stereo, which is annoying. So instead we flip this bit which makes the
2115 * codec replicate the sum signal to both channels, turning it into a
2118 /* DMIC_CONTROL? Init value = 0x0001 */
2119 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0b},
2120 {0x20, AC_VERB_SET_PROC_COEF
, 0x0003},
2124 static struct hda_input_mux alc888_2_capture_sources
[2] = {
2125 /* Front mic only available on one ADC */
2132 { "Front Mic", 0xb },
2145 static struct hda_input_mux alc888_acer_aspire_6530_sources
[2] = {
2146 /* Interal mic only available on one ADC */
2153 { "Input Mix", 0xa },
2154 { "Internal Mic", 0xb },
2163 { "Input Mix", 0xa },
2168 static struct hda_input_mux alc889_capture_sources
[3] = {
2169 /* Digital mic only available on first "ADC" */
2176 { "Front Mic", 0xb },
2177 { "Input Mix", 0xa },
2186 { "Input Mix", 0xa },
2195 { "Input Mix", 0xa },
2200 static struct snd_kcontrol_new alc888_base_mixer
[] = {
2201 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2202 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2203 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2204 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
2205 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
2207 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2208 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2209 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2210 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
2211 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
2212 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2213 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2214 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
2215 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
2216 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2217 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
2218 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2222 static struct snd_kcontrol_new alc888_acer_aspire_4930g_mixer
[] = {
2223 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2224 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2225 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2226 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
2227 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
2229 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2230 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2231 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2232 HDA_CODEC_VOLUME_MONO("Internal LFE Playback Volume", 0x0f, 1, 0x0, HDA_OUTPUT
),
2233 HDA_BIND_MUTE_MONO("Internal LFE Playback Switch", 0x0f, 1, 2, HDA_INPUT
),
2234 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2235 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2236 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
2237 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
2238 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2239 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
2240 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2244 static struct snd_kcontrol_new alc889_acer_aspire_8930g_mixer
[] = {
2245 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2246 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2247 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2248 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
2249 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
2251 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2252 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2253 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2254 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
2255 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
2256 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2257 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
2258 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2263 static void alc888_acer_aspire_4930g_setup(struct hda_codec
*codec
)
2265 struct alc_spec
*spec
= codec
->spec
;
2267 spec
->autocfg
.hp_pins
[0] = 0x15;
2268 spec
->autocfg
.speaker_pins
[0] = 0x14;
2269 spec
->autocfg
.speaker_pins
[1] = 0x16;
2270 spec
->autocfg
.speaker_pins
[2] = 0x17;
2273 static void alc888_acer_aspire_6530g_setup(struct hda_codec
*codec
)
2275 struct alc_spec
*spec
= codec
->spec
;
2277 spec
->autocfg
.hp_pins
[0] = 0x15;
2278 spec
->autocfg
.speaker_pins
[0] = 0x14;
2279 spec
->autocfg
.speaker_pins
[1] = 0x16;
2280 spec
->autocfg
.speaker_pins
[2] = 0x17;
2283 static void alc888_acer_aspire_7730g_setup(struct hda_codec
*codec
)
2285 struct alc_spec
*spec
= codec
->spec
;
2287 spec
->autocfg
.hp_pins
[0] = 0x15;
2288 spec
->autocfg
.speaker_pins
[0] = 0x14;
2289 spec
->autocfg
.speaker_pins
[1] = 0x16;
2290 spec
->autocfg
.speaker_pins
[2] = 0x17;
2293 static void alc889_acer_aspire_8930g_setup(struct hda_codec
*codec
)
2295 struct alc_spec
*spec
= codec
->spec
;
2297 spec
->autocfg
.hp_pins
[0] = 0x15;
2298 spec
->autocfg
.speaker_pins
[0] = 0x14;
2299 spec
->autocfg
.speaker_pins
[1] = 0x16;
2300 spec
->autocfg
.speaker_pins
[2] = 0x1b;
2304 * ALC880 3-stack model
2306 * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0e)
2307 * Pin assignment: Front = 0x14, Line-In/Surr = 0x1a, Mic/CLFE = 0x18,
2308 * F-Mic = 0x1b, HP = 0x19
2311 static hda_nid_t alc880_dac_nids
[4] = {
2312 /* front, rear, clfe, rear_surr */
2313 0x02, 0x05, 0x04, 0x03
2316 static hda_nid_t alc880_adc_nids
[3] = {
2321 /* The datasheet says the node 0x07 is connected from inputs,
2322 * but it shows zero connection in the real implementation on some devices.
2323 * Note: this is a 915GAV bug, fixed on 915GLV
2325 static hda_nid_t alc880_adc_nids_alt
[2] = {
2330 #define ALC880_DIGOUT_NID 0x06
2331 #define ALC880_DIGIN_NID 0x0a
2333 static struct hda_input_mux alc880_capture_source
= {
2337 { "Front Mic", 0x3 },
2343 /* channel source setting (2/6 channel selection for 3-stack) */
2345 static struct hda_verb alc880_threestack_ch2_init
[] = {
2346 /* set line-in to input, mute it */
2347 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2348 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2349 /* set mic-in to input vref 80%, mute it */
2350 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2351 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2356 static struct hda_verb alc880_threestack_ch6_init
[] = {
2357 /* set line-in to output, unmute it */
2358 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2359 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2360 /* set mic-in to output, unmute it */
2361 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2362 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2366 static struct hda_channel_mode alc880_threestack_modes
[2] = {
2367 { 2, alc880_threestack_ch2_init
},
2368 { 6, alc880_threestack_ch6_init
},
2371 static struct snd_kcontrol_new alc880_three_stack_mixer
[] = {
2372 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2373 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2374 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
2375 HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT
),
2376 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
2377 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2378 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2379 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2380 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2381 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2382 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
2383 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
2384 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2385 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2386 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x3, HDA_INPUT
),
2387 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x3, HDA_INPUT
),
2388 HDA_CODEC_MUTE("Headphone Playback Switch", 0x19, 0x0, HDA_OUTPUT
),
2390 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2391 .name
= "Channel Mode",
2392 .info
= alc_ch_mode_info
,
2393 .get
= alc_ch_mode_get
,
2394 .put
= alc_ch_mode_put
,
2399 /* capture mixer elements */
2400 static int alc_cap_vol_info(struct snd_kcontrol
*kcontrol
,
2401 struct snd_ctl_elem_info
*uinfo
)
2403 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
2404 struct alc_spec
*spec
= codec
->spec
;
2407 mutex_lock(&codec
->control_mutex
);
2408 kcontrol
->private_value
= HDA_COMPOSE_AMP_VAL(spec
->adc_nids
[0], 3, 0,
2410 err
= snd_hda_mixer_amp_volume_info(kcontrol
, uinfo
);
2411 mutex_unlock(&codec
->control_mutex
);
2415 static int alc_cap_vol_tlv(struct snd_kcontrol
*kcontrol
, int op_flag
,
2416 unsigned int size
, unsigned int __user
*tlv
)
2418 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
2419 struct alc_spec
*spec
= codec
->spec
;
2422 mutex_lock(&codec
->control_mutex
);
2423 kcontrol
->private_value
= HDA_COMPOSE_AMP_VAL(spec
->adc_nids
[0], 3, 0,
2425 err
= snd_hda_mixer_amp_tlv(kcontrol
, op_flag
, size
, tlv
);
2426 mutex_unlock(&codec
->control_mutex
);
2430 typedef int (*getput_call_t
)(struct snd_kcontrol
*kcontrol
,
2431 struct snd_ctl_elem_value
*ucontrol
);
2433 static int alc_cap_getput_caller(struct snd_kcontrol
*kcontrol
,
2434 struct snd_ctl_elem_value
*ucontrol
,
2437 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
2438 struct alc_spec
*spec
= codec
->spec
;
2439 unsigned int adc_idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
2442 mutex_lock(&codec
->control_mutex
);
2443 kcontrol
->private_value
= HDA_COMPOSE_AMP_VAL(spec
->adc_nids
[adc_idx
],
2445 err
= func(kcontrol
, ucontrol
);
2446 mutex_unlock(&codec
->control_mutex
);
2450 static int alc_cap_vol_get(struct snd_kcontrol
*kcontrol
,
2451 struct snd_ctl_elem_value
*ucontrol
)
2453 return alc_cap_getput_caller(kcontrol
, ucontrol
,
2454 snd_hda_mixer_amp_volume_get
);
2457 static int alc_cap_vol_put(struct snd_kcontrol
*kcontrol
,
2458 struct snd_ctl_elem_value
*ucontrol
)
2460 return alc_cap_getput_caller(kcontrol
, ucontrol
,
2461 snd_hda_mixer_amp_volume_put
);
2464 /* capture mixer elements */
2465 #define alc_cap_sw_info snd_ctl_boolean_stereo_info
2467 static int alc_cap_sw_get(struct snd_kcontrol
*kcontrol
,
2468 struct snd_ctl_elem_value
*ucontrol
)
2470 return alc_cap_getput_caller(kcontrol
, ucontrol
,
2471 snd_hda_mixer_amp_switch_get
);
2474 static int alc_cap_sw_put(struct snd_kcontrol
*kcontrol
,
2475 struct snd_ctl_elem_value
*ucontrol
)
2477 return alc_cap_getput_caller(kcontrol
, ucontrol
,
2478 snd_hda_mixer_amp_switch_put
);
2481 #define _DEFINE_CAPMIX(num) \
2483 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
2484 .name = "Capture Switch", \
2485 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
2487 .info = alc_cap_sw_info, \
2488 .get = alc_cap_sw_get, \
2489 .put = alc_cap_sw_put, \
2492 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
2493 .name = "Capture Volume", \
2494 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | \
2495 SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
2496 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK), \
2498 .info = alc_cap_vol_info, \
2499 .get = alc_cap_vol_get, \
2500 .put = alc_cap_vol_put, \
2501 .tlv = { .c = alc_cap_vol_tlv }, \
2504 #define _DEFINE_CAPSRC(num) \
2506 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
2507 /* .name = "Capture Source", */ \
2508 .name = "Input Source", \
2510 .info = alc_mux_enum_info, \
2511 .get = alc_mux_enum_get, \
2512 .put = alc_mux_enum_put, \
2515 #define DEFINE_CAPMIX(num) \
2516 static struct snd_kcontrol_new alc_capture_mixer ## num[] = { \
2517 _DEFINE_CAPMIX(num), \
2518 _DEFINE_CAPSRC(num), \
2522 #define DEFINE_CAPMIX_NOSRC(num) \
2523 static struct snd_kcontrol_new alc_capture_mixer_nosrc ## num[] = { \
2524 _DEFINE_CAPMIX(num), \
2528 /* up to three ADCs */
2532 DEFINE_CAPMIX_NOSRC(1);
2533 DEFINE_CAPMIX_NOSRC(2);
2534 DEFINE_CAPMIX_NOSRC(3);
2537 * ALC880 5-stack model
2539 * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0d),
2541 * Pin assignment: Front = 0x14, Surr = 0x17, CLFE = 0x16
2542 * Line-In/Side = 0x1a, Mic = 0x18, F-Mic = 0x1b, HP = 0x19
2545 /* additional mixers to alc880_three_stack_mixer */
2546 static struct snd_kcontrol_new alc880_five_stack_mixer
[] = {
2547 HDA_CODEC_VOLUME("Side Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2548 HDA_BIND_MUTE("Side Playback Switch", 0x0d, 2, HDA_INPUT
),
2552 /* channel source setting (6/8 channel selection for 5-stack) */
2554 static struct hda_verb alc880_fivestack_ch6_init
[] = {
2555 /* set line-in to input, mute it */
2556 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2557 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2562 static struct hda_verb alc880_fivestack_ch8_init
[] = {
2563 /* set line-in to output, unmute it */
2564 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2565 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2569 static struct hda_channel_mode alc880_fivestack_modes
[2] = {
2570 { 6, alc880_fivestack_ch6_init
},
2571 { 8, alc880_fivestack_ch8_init
},
2576 * ALC880 6-stack model
2578 * DAC: Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e),
2579 * Side = 0x05 (0x0f)
2580 * Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, Side = 0x17,
2581 * Mic = 0x18, F-Mic = 0x19, Line = 0x1a, HP = 0x1b
2584 static hda_nid_t alc880_6st_dac_nids
[4] = {
2585 /* front, rear, clfe, rear_surr */
2586 0x02, 0x03, 0x04, 0x05
2589 static struct hda_input_mux alc880_6stack_capture_source
= {
2593 { "Front Mic", 0x1 },
2599 /* fixed 8-channels */
2600 static struct hda_channel_mode alc880_sixstack_modes
[1] = {
2604 static struct snd_kcontrol_new alc880_six_stack_mixer
[] = {
2605 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2606 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2607 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2608 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
2609 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
2610 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2611 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2612 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2613 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
2614 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
2615 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2616 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2617 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
2618 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
2619 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2620 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2621 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
2622 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
2624 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2625 .name
= "Channel Mode",
2626 .info
= alc_ch_mode_info
,
2627 .get
= alc_ch_mode_get
,
2628 .put
= alc_ch_mode_put
,
2637 * W810 has rear IO for:
2640 * Center/LFE (DAC 04)
2643 * The system also has a pair of internal speakers, and a headphone jack.
2644 * These are both connected to Line2 on the codec, hence to DAC 02.
2646 * There is a variable resistor to control the speaker or headphone
2647 * volume. This is a hardware-only device without a software API.
2649 * Plugging headphones in will disable the internal speakers. This is
2650 * implemented in hardware, not via the driver using jack sense. In
2651 * a similar fashion, plugging into the rear socket marked "front" will
2652 * disable both the speakers and headphones.
2654 * For input, there's a microphone jack, and an "audio in" jack.
2655 * These may not do anything useful with this driver yet, because I
2656 * haven't setup any initialization verbs for these yet...
2659 static hda_nid_t alc880_w810_dac_nids
[3] = {
2660 /* front, rear/surround, clfe */
2664 /* fixed 6 channels */
2665 static struct hda_channel_mode alc880_w810_modes
[1] = {
2669 /* Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, HP = 0x1b */
2670 static struct snd_kcontrol_new alc880_w810_base_mixer
[] = {
2671 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2672 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2673 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2674 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
2675 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
2676 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2677 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2678 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2679 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
2687 * DAC: Front = 0x02 (0x0c), HP = 0x03 (0x0d)
2688 * Pin assignment: Front = 0x14, HP = 0x15, Mic = 0x18, Mic2 = 0x19(?),
2692 static hda_nid_t alc880_z71v_dac_nids
[1] = {
2695 #define ALC880_Z71V_HP_DAC 0x03
2697 /* fixed 2 channels */
2698 static struct hda_channel_mode alc880_2_jack_modes
[1] = {
2702 static struct snd_kcontrol_new alc880_z71v_mixer
[] = {
2703 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2704 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2705 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2706 HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT
),
2707 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2708 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2709 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2710 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2716 * ALC880 F1734 model
2718 * DAC: HP = 0x02 (0x0c), Front = 0x03 (0x0d)
2719 * Pin assignment: HP = 0x14, Front = 0x15, Mic = 0x18
2722 static hda_nid_t alc880_f1734_dac_nids
[1] = {
2725 #define ALC880_F1734_HP_DAC 0x02
2727 static struct snd_kcontrol_new alc880_f1734_mixer
[] = {
2728 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2729 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
2730 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2731 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
2732 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2733 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2734 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
2735 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
2739 static struct hda_input_mux alc880_f1734_capture_source
= {
2751 * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
2752 * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
2753 * Mic = 0x18, Line = 0x1a
2756 #define alc880_asus_dac_nids alc880_w810_dac_nids /* identical with w810 */
2757 #define alc880_asus_modes alc880_threestack_modes /* 2/6 channel mode */
2759 static struct snd_kcontrol_new alc880_asus_mixer
[] = {
2760 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2761 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2762 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2763 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
2764 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
2765 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2766 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2767 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2768 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2769 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2770 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
2771 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
2772 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2773 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2775 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2776 .name
= "Channel Mode",
2777 .info
= alc_ch_mode_info
,
2778 .get
= alc_ch_mode_get
,
2779 .put
= alc_ch_mode_put
,
2785 * ALC880 ASUS W1V model
2787 * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
2788 * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
2789 * Mic = 0x18, Line = 0x1a, Line2 = 0x1b
2792 /* additional mixers to alc880_asus_mixer */
2793 static struct snd_kcontrol_new alc880_asus_w1v_mixer
[] = {
2794 HDA_CODEC_VOLUME("Line2 Playback Volume", 0x0b, 0x03, HDA_INPUT
),
2795 HDA_CODEC_MUTE("Line2 Playback Switch", 0x0b, 0x03, HDA_INPUT
),
2800 static struct snd_kcontrol_new alc880_tcl_s700_mixer
[] = {
2801 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2802 HDA_CODEC_MUTE("Front Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
2803 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
2804 HDA_CODEC_VOLUME("CD Playback Volume", 0x0B, 0x04, HDA_INPUT
),
2805 HDA_CODEC_MUTE("CD Playback Switch", 0x0B, 0x04, HDA_INPUT
),
2806 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0B, 0x0, HDA_INPUT
),
2807 HDA_CODEC_MUTE("Mic Playback Switch", 0x0B, 0x0, HDA_INPUT
),
2808 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT
),
2809 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT
),
2814 static struct snd_kcontrol_new alc880_uniwill_mixer
[] = {
2815 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2816 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
2817 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2818 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
2819 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
2820 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2821 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2822 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2823 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2824 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2825 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
2826 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
2827 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2828 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2829 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
2830 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
2832 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2833 .name
= "Channel Mode",
2834 .info
= alc_ch_mode_info
,
2835 .get
= alc_ch_mode_get
,
2836 .put
= alc_ch_mode_put
,
2841 static struct snd_kcontrol_new alc880_fujitsu_mixer
[] = {
2842 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2843 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
2844 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2845 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
2846 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2847 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2848 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2849 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2850 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
2851 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
2855 static struct snd_kcontrol_new alc880_uniwill_p53_mixer
[] = {
2856 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2857 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
2858 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2859 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
2860 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2861 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2866 * virtual master controls
2870 * slave controls for virtual master
2872 static const char * const alc_slave_vols
[] = {
2873 "Front Playback Volume",
2874 "Surround Playback Volume",
2875 "Center Playback Volume",
2876 "LFE Playback Volume",
2877 "Side Playback Volume",
2878 "Headphone Playback Volume",
2879 "Speaker Playback Volume",
2880 "Mono Playback Volume",
2881 "Line-Out Playback Volume",
2882 "PCM Playback Volume",
2886 static const char * const alc_slave_sws
[] = {
2887 "Front Playback Switch",
2888 "Surround Playback Switch",
2889 "Center Playback Switch",
2890 "LFE Playback Switch",
2891 "Side Playback Switch",
2892 "Headphone Playback Switch",
2893 "Speaker Playback Switch",
2894 "Mono Playback Switch",
2895 "IEC958 Playback Switch",
2896 "Line-Out Playback Switch",
2897 "PCM Playback Switch",
2902 * build control elements
2905 #define NID_MAPPING (-1)
2907 #define SUBDEV_SPEAKER_ (0 << 6)
2908 #define SUBDEV_HP_ (1 << 6)
2909 #define SUBDEV_LINE_ (2 << 6)
2910 #define SUBDEV_SPEAKER(x) (SUBDEV_SPEAKER_ | ((x) & 0x3f))
2911 #define SUBDEV_HP(x) (SUBDEV_HP_ | ((x) & 0x3f))
2912 #define SUBDEV_LINE(x) (SUBDEV_LINE_ | ((x) & 0x3f))
2914 static void alc_free_kctls(struct hda_codec
*codec
);
2916 #ifdef CONFIG_SND_HDA_INPUT_BEEP
2917 /* additional beep mixers; the actual parameters are overwritten at build */
2918 static struct snd_kcontrol_new alc_beep_mixer
[] = {
2919 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT
),
2920 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT
),
2925 static int alc_build_controls(struct hda_codec
*codec
)
2927 struct alc_spec
*spec
= codec
->spec
;
2928 struct snd_kcontrol
*kctl
= NULL
;
2929 struct snd_kcontrol_new
*knew
;
2934 for (i
= 0; i
< spec
->num_mixers
; i
++) {
2935 err
= snd_hda_add_new_ctls(codec
, spec
->mixers
[i
]);
2939 if (spec
->cap_mixer
) {
2940 err
= snd_hda_add_new_ctls(codec
, spec
->cap_mixer
);
2944 if (spec
->multiout
.dig_out_nid
) {
2945 err
= snd_hda_create_spdif_out_ctls(codec
,
2946 spec
->multiout
.dig_out_nid
);
2949 if (!spec
->no_analog
) {
2950 err
= snd_hda_create_spdif_share_sw(codec
,
2954 spec
->multiout
.share_spdif
= 1;
2957 if (spec
->dig_in_nid
) {
2958 err
= snd_hda_create_spdif_in_ctls(codec
, spec
->dig_in_nid
);
2963 #ifdef CONFIG_SND_HDA_INPUT_BEEP
2964 /* create beep controls if needed */
2965 if (spec
->beep_amp
) {
2966 struct snd_kcontrol_new
*knew
;
2967 for (knew
= alc_beep_mixer
; knew
->name
; knew
++) {
2968 struct snd_kcontrol
*kctl
;
2969 kctl
= snd_ctl_new1(knew
, codec
);
2972 kctl
->private_value
= spec
->beep_amp
;
2973 err
= snd_hda_ctl_add(codec
, 0, kctl
);
2980 /* if we have no master control, let's create it */
2981 if (!spec
->no_analog
&&
2982 !snd_hda_find_mixer_ctl(codec
, "Master Playback Volume")) {
2983 unsigned int vmaster_tlv
[4];
2984 snd_hda_set_vmaster_tlv(codec
, spec
->vmaster_nid
,
2985 HDA_OUTPUT
, vmaster_tlv
);
2986 err
= snd_hda_add_vmaster(codec
, "Master Playback Volume",
2987 vmaster_tlv
, alc_slave_vols
);
2991 if (!spec
->no_analog
&&
2992 !snd_hda_find_mixer_ctl(codec
, "Master Playback Switch")) {
2993 err
= snd_hda_add_vmaster(codec
, "Master Playback Switch",
2994 NULL
, alc_slave_sws
);
2999 /* assign Capture Source enums to NID */
3000 if (spec
->capsrc_nids
|| spec
->adc_nids
) {
3001 kctl
= snd_hda_find_mixer_ctl(codec
, "Capture Source");
3003 kctl
= snd_hda_find_mixer_ctl(codec
, "Input Source");
3004 for (i
= 0; kctl
&& i
< kctl
->count
; i
++) {
3005 hda_nid_t
*nids
= spec
->capsrc_nids
;
3007 nids
= spec
->adc_nids
;
3008 err
= snd_hda_add_nid(codec
, kctl
, i
, nids
[i
]);
3013 if (spec
->cap_mixer
) {
3014 const char *kname
= kctl
? kctl
->id
.name
: NULL
;
3015 for (knew
= spec
->cap_mixer
; knew
->name
; knew
++) {
3016 if (kname
&& strcmp(knew
->name
, kname
) == 0)
3018 kctl
= snd_hda_find_mixer_ctl(codec
, knew
->name
);
3019 for (i
= 0; kctl
&& i
< kctl
->count
; i
++) {
3020 err
= snd_hda_add_nid(codec
, kctl
, i
,
3028 /* other nid->control mapping */
3029 for (i
= 0; i
< spec
->num_mixers
; i
++) {
3030 for (knew
= spec
->mixers
[i
]; knew
->name
; knew
++) {
3031 if (knew
->iface
!= NID_MAPPING
)
3033 kctl
= snd_hda_find_mixer_ctl(codec
, knew
->name
);
3036 u
= knew
->subdevice
;
3037 for (j
= 0; j
< 4; j
++, u
>>= 8) {
3042 case SUBDEV_SPEAKER_
:
3043 nid
= spec
->autocfg
.speaker_pins
[nid
];
3046 nid
= spec
->autocfg
.line_out_pins
[nid
];
3049 nid
= spec
->autocfg
.hp_pins
[nid
];
3054 err
= snd_hda_add_nid(codec
, kctl
, 0, nid
);
3058 u
= knew
->private_value
;
3059 for (j
= 0; j
< 4; j
++, u
>>= 8) {
3063 err
= snd_hda_add_nid(codec
, kctl
, 0, nid
);
3070 alc_free_kctls(codec
); /* no longer needed */
3077 * initialize the codec volumes, etc
3081 * generic initialization of ADC, input mixers and output mixers
3083 static struct hda_verb alc880_volume_init_verbs
[] = {
3085 * Unmute ADC0-2 and set the default input to mic-in
3087 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
3088 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3089 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
3090 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3091 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
3092 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3094 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
3096 * Note: PASD motherboards uses the Line In 2 as the input for front
3099 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
3100 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
3101 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
3102 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
3103 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
3104 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
3105 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)},
3106 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)},
3109 * Set up output mixers (0x0c - 0x0f)
3111 /* set vol=0 to output mixers */
3112 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
3113 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
3114 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
3115 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
3116 /* set up input amps for analog loopback */
3117 /* Amp Indices: DAC = 0, mixer = 1 */
3118 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
3119 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
3120 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
3121 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
3122 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
3123 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
3124 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
3125 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
3131 * 3-stack pin configuration:
3132 * front = 0x14, mic/clfe = 0x18, HP = 0x19, line/surr = 0x1a, f-mic = 0x1b
3134 static struct hda_verb alc880_pin_3stack_init_verbs
[] = {
3136 * preset connection lists of input pins
3137 * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
3139 {0x10, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* mic/clfe */
3140 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
3141 {0x12, AC_VERB_SET_CONNECT_SEL
, 0x03}, /* line/surround */
3144 * Set pin mode and muting
3146 /* set front pin widgets 0x14 for output */
3147 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3148 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3149 /* Mic1 (rear panel) pin widget for input and vref at 80% */
3150 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3151 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3152 /* Mic2 (as headphone out) for HP output */
3153 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3154 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3155 /* Line In pin widget for input */
3156 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3157 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3158 /* Line2 (as front mic) pin widget for input and vref at 80% */
3159 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3160 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3161 /* CD pin widget for input */
3162 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3168 * 5-stack pin configuration:
3169 * front = 0x14, surround = 0x17, clfe = 0x16, mic = 0x18, HP = 0x19,
3170 * line-in/side = 0x1a, f-mic = 0x1b
3172 static struct hda_verb alc880_pin_5stack_init_verbs
[] = {
3174 * preset connection lists of input pins
3175 * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
3177 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
3178 {0x12, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* line/side */
3181 * Set pin mode and muting
3183 /* set pin widgets 0x14-0x17 for output */
3184 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3185 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3186 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3187 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3188 /* unmute pins for output (no gain on this amp) */
3189 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3190 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3191 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3192 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3194 /* Mic1 (rear panel) pin widget for input and vref at 80% */
3195 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3196 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3197 /* Mic2 (as headphone out) for HP output */
3198 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3199 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3200 /* Line In pin widget for input */
3201 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3202 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3203 /* Line2 (as front mic) pin widget for input and vref at 80% */
3204 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3205 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3206 /* CD pin widget for input */
3207 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3213 * W810 pin configuration:
3214 * front = 0x14, surround = 0x15, clfe = 0x16, HP = 0x1b
3216 static struct hda_verb alc880_pin_w810_init_verbs
[] = {
3217 /* hphone/speaker input selector: front DAC */
3218 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x0},
3220 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3221 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3222 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3223 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3224 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3225 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3227 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3228 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3234 * Z71V pin configuration:
3235 * Speaker-out = 0x14, HP = 0x15, Mic = 0x18, Line-in = 0x1a, Mic2 = 0x1b (?)
3237 static struct hda_verb alc880_pin_z71v_init_verbs
[] = {
3238 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3239 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3240 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3241 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3243 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3244 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3245 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3246 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3252 * 6-stack pin configuration:
3253 * front = 0x14, surr = 0x15, clfe = 0x16, side = 0x17, mic = 0x18,
3254 * f-mic = 0x19, line = 0x1a, HP = 0x1b
3256 static struct hda_verb alc880_pin_6stack_init_verbs
[] = {
3257 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
3259 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3260 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3261 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3262 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3263 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3264 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3265 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3266 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3268 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3269 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3270 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3271 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3272 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3273 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3274 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3275 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3276 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3282 * Uniwill pin configuration:
3283 * HP = 0x14, InternalSpeaker = 0x15, mic = 0x18, internal mic = 0x19,
3286 static struct hda_verb alc880_uniwill_init_verbs
[] = {
3287 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
3289 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3290 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3291 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3292 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3293 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3294 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3295 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3296 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3297 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
3298 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
3299 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
3300 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
3301 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
3302 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
3304 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3305 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3306 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3307 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3308 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3309 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3310 /* {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, */
3311 /* {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, */
3312 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3314 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
3315 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
3322 * HP = 0x14, InternalSpeaker = 0x15, mic = 0x19,
3324 static struct hda_verb alc880_uniwill_p53_init_verbs
[] = {
3325 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
3327 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3328 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3329 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3330 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3331 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3332 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3333 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
3334 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
3335 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
3336 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
3337 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
3338 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
3340 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3341 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3342 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3343 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3344 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3345 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3347 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
3348 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_DCVOL_EVENT
},
3353 static struct hda_verb alc880_beep_init_verbs
[] = {
3354 { 0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(5) },
3358 /* auto-toggle front mic */
3359 static void alc88x_simple_mic_automute(struct hda_codec
*codec
)
3361 unsigned int present
;
3364 present
= snd_hda_jack_detect(codec
, 0x18);
3365 bits
= present
? HDA_AMP_MUTE
: 0;
3366 snd_hda_codec_amp_stereo(codec
, 0x0b, HDA_INPUT
, 1, HDA_AMP_MUTE
, bits
);
3369 static void alc880_uniwill_setup(struct hda_codec
*codec
)
3371 struct alc_spec
*spec
= codec
->spec
;
3373 spec
->autocfg
.hp_pins
[0] = 0x14;
3374 spec
->autocfg
.speaker_pins
[0] = 0x15;
3375 spec
->autocfg
.speaker_pins
[0] = 0x16;
3378 static void alc880_uniwill_init_hook(struct hda_codec
*codec
)
3380 alc_automute_amp(codec
);
3381 alc88x_simple_mic_automute(codec
);
3384 static void alc880_uniwill_unsol_event(struct hda_codec
*codec
,
3387 /* Looks like the unsol event is incompatible with the standard
3388 * definition. 4bit tag is placed at 28 bit!
3390 switch (res
>> 28) {
3391 case ALC880_MIC_EVENT
:
3392 alc88x_simple_mic_automute(codec
);
3395 alc_automute_amp_unsol_event(codec
, res
);
3400 static void alc880_uniwill_p53_setup(struct hda_codec
*codec
)
3402 struct alc_spec
*spec
= codec
->spec
;
3404 spec
->autocfg
.hp_pins
[0] = 0x14;
3405 spec
->autocfg
.speaker_pins
[0] = 0x15;
3408 static void alc880_uniwill_p53_dcvol_automute(struct hda_codec
*codec
)
3410 unsigned int present
;
3412 present
= snd_hda_codec_read(codec
, 0x21, 0,
3413 AC_VERB_GET_VOLUME_KNOB_CONTROL
, 0);
3414 present
&= HDA_AMP_VOLMASK
;
3415 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_OUTPUT
, 0,
3416 HDA_AMP_VOLMASK
, present
);
3417 snd_hda_codec_amp_stereo(codec
, 0x0d, HDA_OUTPUT
, 0,
3418 HDA_AMP_VOLMASK
, present
);
3421 static void alc880_uniwill_p53_unsol_event(struct hda_codec
*codec
,
3424 /* Looks like the unsol event is incompatible with the standard
3425 * definition. 4bit tag is placed at 28 bit!
3427 if ((res
>> 28) == ALC880_DCVOL_EVENT
)
3428 alc880_uniwill_p53_dcvol_automute(codec
);
3430 alc_automute_amp_unsol_event(codec
, res
);
3434 * F1734 pin configuration:
3435 * HP = 0x14, speaker-out = 0x15, mic = 0x18
3437 static struct hda_verb alc880_pin_f1734_init_verbs
[] = {
3438 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x01},
3439 {0x10, AC_VERB_SET_CONNECT_SEL
, 0x02},
3440 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x00},
3441 {0x12, AC_VERB_SET_CONNECT_SEL
, 0x01},
3442 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00},
3444 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3445 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3446 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3447 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3449 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3450 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3451 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
3452 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3453 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3454 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3455 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3456 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3457 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3459 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_HP_EVENT
},
3460 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_DCVOL_EVENT
},
3466 * ASUS pin configuration:
3467 * HP/front = 0x14, surr = 0x15, clfe = 0x16, mic = 0x18, line = 0x1a
3469 static struct hda_verb alc880_pin_asus_init_verbs
[] = {
3470 {0x10, AC_VERB_SET_CONNECT_SEL
, 0x02},
3471 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x00},
3472 {0x12, AC_VERB_SET_CONNECT_SEL
, 0x01},
3473 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00},
3475 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3476 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3477 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3478 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3479 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3480 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3481 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3482 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3484 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3485 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3486 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3487 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3488 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3489 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3490 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3491 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3492 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3497 /* Enable GPIO mask and set output */
3498 #define alc880_gpio1_init_verbs alc_gpio1_init_verbs
3499 #define alc880_gpio2_init_verbs alc_gpio2_init_verbs
3500 #define alc880_gpio3_init_verbs alc_gpio3_init_verbs
3502 /* Clevo m520g init */
3503 static struct hda_verb alc880_pin_clevo_init_verbs
[] = {
3504 /* headphone output */
3505 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x01},
3507 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3508 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3510 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3511 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3513 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3514 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3515 /* Mic1 (rear panel) */
3516 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3517 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3518 /* Mic2 (front panel) */
3519 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3520 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3522 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3523 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3524 /* change to EAPD mode */
3525 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
3526 {0x20, AC_VERB_SET_PROC_COEF
, 0x3060},
3531 static struct hda_verb alc880_pin_tcl_S700_init_verbs
[] = {
3532 /* change to EAPD mode */
3533 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
3534 {0x20, AC_VERB_SET_PROC_COEF
, 0x3060},
3536 /* Headphone output */
3537 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3539 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3540 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
3542 /* Line In pin widget for input */
3543 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3544 /* CD pin widget for input */
3545 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3546 /* Mic1 (rear panel) pin widget for input and vref at 80% */
3547 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3549 /* change to EAPD mode */
3550 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
3551 {0x20, AC_VERB_SET_PROC_COEF
, 0x3070},
3557 * LG m1 express dual
3560 * Rear Line-In/Out (blue): 0x14
3561 * Build-in Mic-In: 0x15
3563 * HP-Out (green): 0x1b
3564 * Mic-In/Out (red): 0x19
3568 /* To make 5.1 output working (green=Front, blue=Surr, red=CLFE) */
3569 static hda_nid_t alc880_lg_dac_nids
[3] = {
3573 /* seems analog CD is not working */
3574 static struct hda_input_mux alc880_lg_capture_source
= {
3579 { "Internal Mic", 0x6 },
3583 /* 2,4,6 channel modes */
3584 static struct hda_verb alc880_lg_ch2_init
[] = {
3585 /* set line-in and mic-in to input */
3586 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3587 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3591 static struct hda_verb alc880_lg_ch4_init
[] = {
3592 /* set line-in to out and mic-in to input */
3593 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3594 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3598 static struct hda_verb alc880_lg_ch6_init
[] = {
3599 /* set line-in and mic-in to output */
3600 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3601 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3605 static struct hda_channel_mode alc880_lg_ch_modes
[3] = {
3606 { 2, alc880_lg_ch2_init
},
3607 { 4, alc880_lg_ch4_init
},
3608 { 6, alc880_lg_ch6_init
},
3611 static struct snd_kcontrol_new alc880_lg_mixer
[] = {
3612 HDA_CODEC_VOLUME("Front Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
3613 HDA_BIND_MUTE("Front Playback Switch", 0x0f, 2, HDA_INPUT
),
3614 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
3615 HDA_BIND_MUTE("Surround Playback Switch", 0x0c, 2, HDA_INPUT
),
3616 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0d, 1, 0x0, HDA_OUTPUT
),
3617 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT
),
3618 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT
),
3619 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT
),
3620 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
3621 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
3622 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x06, HDA_INPUT
),
3623 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x06, HDA_INPUT
),
3624 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x07, HDA_INPUT
),
3625 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x07, HDA_INPUT
),
3627 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
3628 .name
= "Channel Mode",
3629 .info
= alc_ch_mode_info
,
3630 .get
= alc_ch_mode_get
,
3631 .put
= alc_ch_mode_put
,
3636 static struct hda_verb alc880_lg_init_verbs
[] = {
3637 /* set capture source to mic-in */
3638 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3639 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3640 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3641 /* mute all amp mixer inputs */
3642 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(5)},
3643 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)},
3644 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)},
3645 /* line-in to input */
3646 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3647 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3649 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3650 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3652 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3653 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3654 /* mic-in to input */
3655 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x01},
3656 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3657 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3659 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x03},
3660 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3661 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3663 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
3667 /* toggle speaker-output according to the hp-jack state */
3668 static void alc880_lg_setup(struct hda_codec
*codec
)
3670 struct alc_spec
*spec
= codec
->spec
;
3672 spec
->autocfg
.hp_pins
[0] = 0x1b;
3673 spec
->autocfg
.speaker_pins
[0] = 0x17;
3682 * Built-in Mic-In: 0x19
3688 static struct hda_input_mux alc880_lg_lw_capture_source
= {
3692 { "Internal Mic", 0x1 },
3697 #define alc880_lg_lw_modes alc880_threestack_modes
3699 static struct snd_kcontrol_new alc880_lg_lw_mixer
[] = {
3700 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
3701 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
3702 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
3703 HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT
),
3704 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
3705 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
3706 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
3707 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
3708 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
3709 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
3710 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
3711 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
3712 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
3713 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
3715 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
3716 .name
= "Channel Mode",
3717 .info
= alc_ch_mode_info
,
3718 .get
= alc_ch_mode_get
,
3719 .put
= alc_ch_mode_put
,
3724 static struct hda_verb alc880_lg_lw_init_verbs
[] = {
3725 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
3726 {0x10, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* mic/clfe */
3727 {0x12, AC_VERB_SET_CONNECT_SEL
, 0x03}, /* line/surround */
3729 /* set capture source to mic-in */
3730 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3731 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3732 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3733 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)},
3735 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3736 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3738 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3739 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3740 /* mic-in to input */
3741 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3742 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3744 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3745 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3747 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
3751 /* toggle speaker-output according to the hp-jack state */
3752 static void alc880_lg_lw_setup(struct hda_codec
*codec
)
3754 struct alc_spec
*spec
= codec
->spec
;
3756 spec
->autocfg
.hp_pins
[0] = 0x1b;
3757 spec
->autocfg
.speaker_pins
[0] = 0x14;
3760 static struct snd_kcontrol_new alc880_medion_rim_mixer
[] = {
3761 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
3762 HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT
),
3763 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
3764 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
3765 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
3766 HDA_CODEC_MUTE("Internal Playback Switch", 0x0b, 0x1, HDA_INPUT
),
3770 static struct hda_input_mux alc880_medion_rim_capture_source
= {
3774 { "Internal Mic", 0x1 },
3778 static struct hda_verb alc880_medion_rim_init_verbs
[] = {
3779 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
3781 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3782 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3784 /* Mic1 (rear panel) pin widget for input and vref at 80% */
3785 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3786 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3787 /* Mic2 (as headphone out) for HP output */
3788 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3789 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3790 /* Internal Speaker */
3791 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3792 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3794 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
3795 {0x20, AC_VERB_SET_PROC_COEF
, 0x3060},
3797 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
3801 /* toggle speaker-output according to the hp-jack state */
3802 static void alc880_medion_rim_automute(struct hda_codec
*codec
)
3804 struct alc_spec
*spec
= codec
->spec
;
3805 alc_automute_amp(codec
);
3807 if (spec
->jack_present
)
3808 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
, 0);
3810 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
, 2);
3813 static void alc880_medion_rim_unsol_event(struct hda_codec
*codec
,
3816 /* Looks like the unsol event is incompatible with the standard
3817 * definition. 4bit tag is placed at 28 bit!
3819 if ((res
>> 28) == ALC880_HP_EVENT
)
3820 alc880_medion_rim_automute(codec
);
3823 static void alc880_medion_rim_setup(struct hda_codec
*codec
)
3825 struct alc_spec
*spec
= codec
->spec
;
3827 spec
->autocfg
.hp_pins
[0] = 0x14;
3828 spec
->autocfg
.speaker_pins
[0] = 0x1b;
3831 #ifdef CONFIG_SND_HDA_POWER_SAVE
3832 static struct hda_amp_list alc880_loopbacks
[] = {
3833 { 0x0b, HDA_INPUT
, 0 },
3834 { 0x0b, HDA_INPUT
, 1 },
3835 { 0x0b, HDA_INPUT
, 2 },
3836 { 0x0b, HDA_INPUT
, 3 },
3837 { 0x0b, HDA_INPUT
, 4 },
3841 static struct hda_amp_list alc880_lg_loopbacks
[] = {
3842 { 0x0b, HDA_INPUT
, 1 },
3843 { 0x0b, HDA_INPUT
, 6 },
3844 { 0x0b, HDA_INPUT
, 7 },
3853 static void alc_init_special_input_src(struct hda_codec
*codec
);
3855 static int alc_init(struct hda_codec
*codec
)
3857 struct alc_spec
*spec
= codec
->spec
;
3861 alc_auto_init_amp(codec
, spec
->init_amp
);
3863 for (i
= 0; i
< spec
->num_init_verbs
; i
++)
3864 snd_hda_sequence_write(codec
, spec
->init_verbs
[i
]);
3865 alc_init_special_input_src(codec
);
3867 if (spec
->init_hook
)
3868 spec
->init_hook(codec
);
3870 alc_apply_fixup(codec
, ALC_FIXUP_ACT_INIT
);
3872 hda_call_check_power_status(codec
, 0x01);
3876 static void alc_unsol_event(struct hda_codec
*codec
, unsigned int res
)
3878 struct alc_spec
*spec
= codec
->spec
;
3880 if (spec
->unsol_event
)
3881 spec
->unsol_event(codec
, res
);
3884 #ifdef CONFIG_SND_HDA_POWER_SAVE
3885 static int alc_check_power_status(struct hda_codec
*codec
, hda_nid_t nid
)
3887 struct alc_spec
*spec
= codec
->spec
;
3888 return snd_hda_check_amp_list_power(codec
, &spec
->loopback
, nid
);
3893 * Analog playback callbacks
3895 static int alc880_playback_pcm_open(struct hda_pcm_stream
*hinfo
,
3896 struct hda_codec
*codec
,
3897 struct snd_pcm_substream
*substream
)
3899 struct alc_spec
*spec
= codec
->spec
;
3900 return snd_hda_multi_out_analog_open(codec
, &spec
->multiout
, substream
,
3904 static int alc880_playback_pcm_prepare(struct hda_pcm_stream
*hinfo
,
3905 struct hda_codec
*codec
,
3906 unsigned int stream_tag
,
3907 unsigned int format
,
3908 struct snd_pcm_substream
*substream
)
3910 struct alc_spec
*spec
= codec
->spec
;
3911 return snd_hda_multi_out_analog_prepare(codec
, &spec
->multiout
,
3912 stream_tag
, format
, substream
);
3915 static int alc880_playback_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
3916 struct hda_codec
*codec
,
3917 struct snd_pcm_substream
*substream
)
3919 struct alc_spec
*spec
= codec
->spec
;
3920 return snd_hda_multi_out_analog_cleanup(codec
, &spec
->multiout
);
3926 static int alc880_dig_playback_pcm_open(struct hda_pcm_stream
*hinfo
,
3927 struct hda_codec
*codec
,
3928 struct snd_pcm_substream
*substream
)
3930 struct alc_spec
*spec
= codec
->spec
;
3931 return snd_hda_multi_out_dig_open(codec
, &spec
->multiout
);
3934 static int alc880_dig_playback_pcm_prepare(struct hda_pcm_stream
*hinfo
,
3935 struct hda_codec
*codec
,
3936 unsigned int stream_tag
,
3937 unsigned int format
,
3938 struct snd_pcm_substream
*substream
)
3940 struct alc_spec
*spec
= codec
->spec
;
3941 return snd_hda_multi_out_dig_prepare(codec
, &spec
->multiout
,
3942 stream_tag
, format
, substream
);
3945 static int alc880_dig_playback_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
3946 struct hda_codec
*codec
,
3947 struct snd_pcm_substream
*substream
)
3949 struct alc_spec
*spec
= codec
->spec
;
3950 return snd_hda_multi_out_dig_cleanup(codec
, &spec
->multiout
);
3953 static int alc880_dig_playback_pcm_close(struct hda_pcm_stream
*hinfo
,
3954 struct hda_codec
*codec
,
3955 struct snd_pcm_substream
*substream
)
3957 struct alc_spec
*spec
= codec
->spec
;
3958 return snd_hda_multi_out_dig_close(codec
, &spec
->multiout
);
3964 static int alc880_alt_capture_pcm_prepare(struct hda_pcm_stream
*hinfo
,
3965 struct hda_codec
*codec
,
3966 unsigned int stream_tag
,
3967 unsigned int format
,
3968 struct snd_pcm_substream
*substream
)
3970 struct alc_spec
*spec
= codec
->spec
;
3972 snd_hda_codec_setup_stream(codec
, spec
->adc_nids
[substream
->number
+ 1],
3973 stream_tag
, 0, format
);
3977 static int alc880_alt_capture_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
3978 struct hda_codec
*codec
,
3979 struct snd_pcm_substream
*substream
)
3981 struct alc_spec
*spec
= codec
->spec
;
3983 snd_hda_codec_cleanup_stream(codec
,
3984 spec
->adc_nids
[substream
->number
+ 1]);
3988 /* analog capture with dynamic dual-adc changes */
3989 static int dualmic_capture_pcm_prepare(struct hda_pcm_stream
*hinfo
,
3990 struct hda_codec
*codec
,
3991 unsigned int stream_tag
,
3992 unsigned int format
,
3993 struct snd_pcm_substream
*substream
)
3995 struct alc_spec
*spec
= codec
->spec
;
3996 spec
->cur_adc
= spec
->adc_nids
[spec
->cur_adc_idx
];
3997 spec
->cur_adc_stream_tag
= stream_tag
;
3998 spec
->cur_adc_format
= format
;
3999 snd_hda_codec_setup_stream(codec
, spec
->cur_adc
, stream_tag
, 0, format
);
4003 static int dualmic_capture_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
4004 struct hda_codec
*codec
,
4005 struct snd_pcm_substream
*substream
)
4007 struct alc_spec
*spec
= codec
->spec
;
4008 snd_hda_codec_cleanup_stream(codec
, spec
->cur_adc
);
4013 static struct hda_pcm_stream dualmic_pcm_analog_capture
= {
4017 .nid
= 0, /* fill later */
4019 .prepare
= dualmic_capture_pcm_prepare
,
4020 .cleanup
= dualmic_capture_pcm_cleanup
4026 static struct hda_pcm_stream alc880_pcm_analog_playback
= {
4030 /* NID is set in alc_build_pcms */
4032 .open
= alc880_playback_pcm_open
,
4033 .prepare
= alc880_playback_pcm_prepare
,
4034 .cleanup
= alc880_playback_pcm_cleanup
4038 static struct hda_pcm_stream alc880_pcm_analog_capture
= {
4042 /* NID is set in alc_build_pcms */
4045 static struct hda_pcm_stream alc880_pcm_analog_alt_playback
= {
4049 /* NID is set in alc_build_pcms */
4052 static struct hda_pcm_stream alc880_pcm_analog_alt_capture
= {
4053 .substreams
= 2, /* can be overridden */
4056 /* NID is set in alc_build_pcms */
4058 .prepare
= alc880_alt_capture_pcm_prepare
,
4059 .cleanup
= alc880_alt_capture_pcm_cleanup
4063 static struct hda_pcm_stream alc880_pcm_digital_playback
= {
4067 /* NID is set in alc_build_pcms */
4069 .open
= alc880_dig_playback_pcm_open
,
4070 .close
= alc880_dig_playback_pcm_close
,
4071 .prepare
= alc880_dig_playback_pcm_prepare
,
4072 .cleanup
= alc880_dig_playback_pcm_cleanup
4076 static struct hda_pcm_stream alc880_pcm_digital_capture
= {
4080 /* NID is set in alc_build_pcms */
4083 /* Used by alc_build_pcms to flag that a PCM has no playback stream */
4084 static struct hda_pcm_stream alc_pcm_null_stream
= {
4090 static int alc_build_pcms(struct hda_codec
*codec
)
4092 struct alc_spec
*spec
= codec
->spec
;
4093 struct hda_pcm
*info
= spec
->pcm_rec
;
4096 codec
->num_pcms
= 1;
4097 codec
->pcm_info
= info
;
4099 if (spec
->no_analog
)
4102 snprintf(spec
->stream_name_analog
, sizeof(spec
->stream_name_analog
),
4103 "%s Analog", codec
->chip_name
);
4104 info
->name
= spec
->stream_name_analog
;
4106 if (spec
->stream_analog_playback
) {
4107 if (snd_BUG_ON(!spec
->multiout
.dac_nids
))
4109 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] = *(spec
->stream_analog_playback
);
4110 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].nid
= spec
->multiout
.dac_nids
[0];
4112 if (spec
->stream_analog_capture
) {
4113 if (snd_BUG_ON(!spec
->adc_nids
))
4115 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] = *(spec
->stream_analog_capture
);
4116 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].nid
= spec
->adc_nids
[0];
4119 if (spec
->channel_mode
) {
4120 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].channels_max
= 0;
4121 for (i
= 0; i
< spec
->num_channel_mode
; i
++) {
4122 if (spec
->channel_mode
[i
].channels
> info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].channels_max
) {
4123 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].channels_max
= spec
->channel_mode
[i
].channels
;
4129 /* SPDIF for stream index #1 */
4130 if (spec
->multiout
.dig_out_nid
|| spec
->dig_in_nid
) {
4131 snprintf(spec
->stream_name_digital
,
4132 sizeof(spec
->stream_name_digital
),
4133 "%s Digital", codec
->chip_name
);
4134 codec
->num_pcms
= 2;
4135 codec
->slave_dig_outs
= spec
->multiout
.slave_dig_outs
;
4136 info
= spec
->pcm_rec
+ 1;
4137 info
->name
= spec
->stream_name_digital
;
4138 if (spec
->dig_out_type
)
4139 info
->pcm_type
= spec
->dig_out_type
;
4141 info
->pcm_type
= HDA_PCM_TYPE_SPDIF
;
4142 if (spec
->multiout
.dig_out_nid
&&
4143 spec
->stream_digital_playback
) {
4144 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] = *(spec
->stream_digital_playback
);
4145 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].nid
= spec
->multiout
.dig_out_nid
;
4147 if (spec
->dig_in_nid
&&
4148 spec
->stream_digital_capture
) {
4149 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] = *(spec
->stream_digital_capture
);
4150 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].nid
= spec
->dig_in_nid
;
4152 /* FIXME: do we need this for all Realtek codec models? */
4153 codec
->spdif_status_reset
= 1;
4156 if (spec
->no_analog
)
4159 /* If the use of more than one ADC is requested for the current
4160 * model, configure a second analog capture-only PCM.
4162 /* Additional Analaog capture for index #2 */
4163 if ((spec
->alt_dac_nid
&& spec
->stream_analog_alt_playback
) ||
4164 (spec
->num_adc_nids
> 1 && spec
->stream_analog_alt_capture
)) {
4165 codec
->num_pcms
= 3;
4166 info
= spec
->pcm_rec
+ 2;
4167 info
->name
= spec
->stream_name_analog
;
4168 if (spec
->alt_dac_nid
) {
4169 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] =
4170 *spec
->stream_analog_alt_playback
;
4171 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].nid
=
4174 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] =
4175 alc_pcm_null_stream
;
4176 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].nid
= 0;
4178 if (spec
->num_adc_nids
> 1) {
4179 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] =
4180 *spec
->stream_analog_alt_capture
;
4181 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].nid
=
4183 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].substreams
=
4184 spec
->num_adc_nids
- 1;
4186 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] =
4187 alc_pcm_null_stream
;
4188 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].nid
= 0;
4195 static inline void alc_shutup(struct hda_codec
*codec
)
4197 snd_hda_shutup_pins(codec
);
4200 static void alc_free_kctls(struct hda_codec
*codec
)
4202 struct alc_spec
*spec
= codec
->spec
;
4204 if (spec
->kctls
.list
) {
4205 struct snd_kcontrol_new
*kctl
= spec
->kctls
.list
;
4207 for (i
= 0; i
< spec
->kctls
.used
; i
++)
4208 kfree(kctl
[i
].name
);
4210 snd_array_free(&spec
->kctls
);
4213 static void alc_free(struct hda_codec
*codec
)
4215 struct alc_spec
*spec
= codec
->spec
;
4221 snd_hda_input_jack_free(codec
);
4222 alc_free_kctls(codec
);
4224 snd_hda_detach_beep_device(codec
);
4227 #ifdef CONFIG_SND_HDA_POWER_SAVE
4228 static void alc_power_eapd(struct hda_codec
*codec
)
4230 /* We currently only handle front, HP */
4231 switch (codec
->vendor_id
) {
4233 set_eapd(codec
, 0x0f, 0);
4234 set_eapd(codec
, 0x10, 0);
4249 set_eapd(codec
, 0x14, 0);
4250 set_eapd(codec
, 0x15, 0);
4255 static int alc_suspend(struct hda_codec
*codec
, pm_message_t state
)
4257 struct alc_spec
*spec
= codec
->spec
;
4259 if (spec
&& spec
->power_hook
)
4260 spec
->power_hook(codec
);
4265 #ifdef SND_HDA_NEEDS_RESUME
4266 static int alc_resume(struct hda_codec
*codec
)
4268 codec
->patch_ops
.init(codec
);
4269 snd_hda_codec_resume_amp(codec
);
4270 snd_hda_codec_resume_cache(codec
);
4271 hda_call_check_power_status(codec
, 0x01);
4278 static struct hda_codec_ops alc_patch_ops
= {
4279 .build_controls
= alc_build_controls
,
4280 .build_pcms
= alc_build_pcms
,
4283 .unsol_event
= alc_unsol_event
,
4284 #ifdef SND_HDA_NEEDS_RESUME
4285 .resume
= alc_resume
,
4287 #ifdef CONFIG_SND_HDA_POWER_SAVE
4288 .suspend
= alc_suspend
,
4289 .check_power_status
= alc_check_power_status
,
4291 .reboot_notify
= alc_shutup
,
4294 /* replace the codec chip_name with the given string */
4295 static int alc_codec_rename(struct hda_codec
*codec
, const char *name
)
4297 kfree(codec
->chip_name
);
4298 codec
->chip_name
= kstrdup(name
, GFP_KERNEL
);
4299 if (!codec
->chip_name
) {
4307 * Test configuration for debugging
4309 * Almost all inputs/outputs are enabled. I/O pins can be configured via
4312 #ifdef CONFIG_SND_DEBUG
4313 static hda_nid_t alc880_test_dac_nids
[4] = {
4314 0x02, 0x03, 0x04, 0x05
4317 static struct hda_input_mux alc880_test_capture_source
= {
4326 { "Surround", 0x6 },
4330 static struct hda_channel_mode alc880_test_modes
[4] = {
4337 static int alc_test_pin_ctl_info(struct snd_kcontrol
*kcontrol
,
4338 struct snd_ctl_elem_info
*uinfo
)
4340 static char *texts
[] = {
4341 "N/A", "Line Out", "HP Out",
4342 "In Hi-Z", "In 50%", "In Grd", "In 80%", "In 100%"
4344 uinfo
->type
= SNDRV_CTL_ELEM_TYPE_ENUMERATED
;
4346 uinfo
->value
.enumerated
.items
= 8;
4347 if (uinfo
->value
.enumerated
.item
>= 8)
4348 uinfo
->value
.enumerated
.item
= 7;
4349 strcpy(uinfo
->value
.enumerated
.name
, texts
[uinfo
->value
.enumerated
.item
]);
4353 static int alc_test_pin_ctl_get(struct snd_kcontrol
*kcontrol
,
4354 struct snd_ctl_elem_value
*ucontrol
)
4356 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
4357 hda_nid_t nid
= (hda_nid_t
)kcontrol
->private_value
;
4358 unsigned int pin_ctl
, item
= 0;
4360 pin_ctl
= snd_hda_codec_read(codec
, nid
, 0,
4361 AC_VERB_GET_PIN_WIDGET_CONTROL
, 0);
4362 if (pin_ctl
& AC_PINCTL_OUT_EN
) {
4363 if (pin_ctl
& AC_PINCTL_HP_EN
)
4367 } else if (pin_ctl
& AC_PINCTL_IN_EN
) {
4368 switch (pin_ctl
& AC_PINCTL_VREFEN
) {
4369 case AC_PINCTL_VREF_HIZ
: item
= 3; break;
4370 case AC_PINCTL_VREF_50
: item
= 4; break;
4371 case AC_PINCTL_VREF_GRD
: item
= 5; break;
4372 case AC_PINCTL_VREF_80
: item
= 6; break;
4373 case AC_PINCTL_VREF_100
: item
= 7; break;
4376 ucontrol
->value
.enumerated
.item
[0] = item
;
4380 static int alc_test_pin_ctl_put(struct snd_kcontrol
*kcontrol
,
4381 struct snd_ctl_elem_value
*ucontrol
)
4383 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
4384 hda_nid_t nid
= (hda_nid_t
)kcontrol
->private_value
;
4385 static unsigned int ctls
[] = {
4386 0, AC_PINCTL_OUT_EN
, AC_PINCTL_OUT_EN
| AC_PINCTL_HP_EN
,
4387 AC_PINCTL_IN_EN
| AC_PINCTL_VREF_HIZ
,
4388 AC_PINCTL_IN_EN
| AC_PINCTL_VREF_50
,
4389 AC_PINCTL_IN_EN
| AC_PINCTL_VREF_GRD
,
4390 AC_PINCTL_IN_EN
| AC_PINCTL_VREF_80
,
4391 AC_PINCTL_IN_EN
| AC_PINCTL_VREF_100
,
4393 unsigned int old_ctl
, new_ctl
;
4395 old_ctl
= snd_hda_codec_read(codec
, nid
, 0,
4396 AC_VERB_GET_PIN_WIDGET_CONTROL
, 0);
4397 new_ctl
= ctls
[ucontrol
->value
.enumerated
.item
[0]];
4398 if (old_ctl
!= new_ctl
) {
4400 snd_hda_codec_write_cache(codec
, nid
, 0,
4401 AC_VERB_SET_PIN_WIDGET_CONTROL
,
4403 val
= ucontrol
->value
.enumerated
.item
[0] >= 3 ?
4405 snd_hda_codec_amp_stereo(codec
, nid
, HDA_OUTPUT
, 0,
4412 static int alc_test_pin_src_info(struct snd_kcontrol
*kcontrol
,
4413 struct snd_ctl_elem_info
*uinfo
)
4415 static char *texts
[] = {
4416 "Front", "Surround", "CLFE", "Side"
4418 uinfo
->type
= SNDRV_CTL_ELEM_TYPE_ENUMERATED
;
4420 uinfo
->value
.enumerated
.items
= 4;
4421 if (uinfo
->value
.enumerated
.item
>= 4)
4422 uinfo
->value
.enumerated
.item
= 3;
4423 strcpy(uinfo
->value
.enumerated
.name
, texts
[uinfo
->value
.enumerated
.item
]);
4427 static int alc_test_pin_src_get(struct snd_kcontrol
*kcontrol
,
4428 struct snd_ctl_elem_value
*ucontrol
)
4430 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
4431 hda_nid_t nid
= (hda_nid_t
)kcontrol
->private_value
;
4434 sel
= snd_hda_codec_read(codec
, nid
, 0, AC_VERB_GET_CONNECT_SEL
, 0);
4435 ucontrol
->value
.enumerated
.item
[0] = sel
& 3;
4439 static int alc_test_pin_src_put(struct snd_kcontrol
*kcontrol
,
4440 struct snd_ctl_elem_value
*ucontrol
)
4442 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
4443 hda_nid_t nid
= (hda_nid_t
)kcontrol
->private_value
;
4446 sel
= snd_hda_codec_read(codec
, nid
, 0, AC_VERB_GET_CONNECT_SEL
, 0) & 3;
4447 if (ucontrol
->value
.enumerated
.item
[0] != sel
) {
4448 sel
= ucontrol
->value
.enumerated
.item
[0] & 3;
4449 snd_hda_codec_write_cache(codec
, nid
, 0,
4450 AC_VERB_SET_CONNECT_SEL
, sel
);
4456 #define PIN_CTL_TEST(xname,nid) { \
4457 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
4459 .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
4460 .info = alc_test_pin_ctl_info, \
4461 .get = alc_test_pin_ctl_get, \
4462 .put = alc_test_pin_ctl_put, \
4463 .private_value = nid \
4466 #define PIN_SRC_TEST(xname,nid) { \
4467 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
4469 .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
4470 .info = alc_test_pin_src_info, \
4471 .get = alc_test_pin_src_get, \
4472 .put = alc_test_pin_src_put, \
4473 .private_value = nid \
4476 static struct snd_kcontrol_new alc880_test_mixer
[] = {
4477 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
4478 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
4479 HDA_CODEC_VOLUME("CLFE Playback Volume", 0x0e, 0x0, HDA_OUTPUT
),
4480 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
4481 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
4482 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
4483 HDA_BIND_MUTE("CLFE Playback Switch", 0x0e, 2, HDA_INPUT
),
4484 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
4485 PIN_CTL_TEST("Front Pin Mode", 0x14),
4486 PIN_CTL_TEST("Surround Pin Mode", 0x15),
4487 PIN_CTL_TEST("CLFE Pin Mode", 0x16),
4488 PIN_CTL_TEST("Side Pin Mode", 0x17),
4489 PIN_CTL_TEST("In-1 Pin Mode", 0x18),
4490 PIN_CTL_TEST("In-2 Pin Mode", 0x19),
4491 PIN_CTL_TEST("In-3 Pin Mode", 0x1a),
4492 PIN_CTL_TEST("In-4 Pin Mode", 0x1b),
4493 PIN_SRC_TEST("In-1 Pin Source", 0x18),
4494 PIN_SRC_TEST("In-2 Pin Source", 0x19),
4495 PIN_SRC_TEST("In-3 Pin Source", 0x1a),
4496 PIN_SRC_TEST("In-4 Pin Source", 0x1b),
4497 HDA_CODEC_VOLUME("In-1 Playback Volume", 0x0b, 0x0, HDA_INPUT
),
4498 HDA_CODEC_MUTE("In-1 Playback Switch", 0x0b, 0x0, HDA_INPUT
),
4499 HDA_CODEC_VOLUME("In-2 Playback Volume", 0x0b, 0x1, HDA_INPUT
),
4500 HDA_CODEC_MUTE("In-2 Playback Switch", 0x0b, 0x1, HDA_INPUT
),
4501 HDA_CODEC_VOLUME("In-3 Playback Volume", 0x0b, 0x2, HDA_INPUT
),
4502 HDA_CODEC_MUTE("In-3 Playback Switch", 0x0b, 0x2, HDA_INPUT
),
4503 HDA_CODEC_VOLUME("In-4 Playback Volume", 0x0b, 0x3, HDA_INPUT
),
4504 HDA_CODEC_MUTE("In-4 Playback Switch", 0x0b, 0x3, HDA_INPUT
),
4505 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x4, HDA_INPUT
),
4506 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x4, HDA_INPUT
),
4508 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
4509 .name
= "Channel Mode",
4510 .info
= alc_ch_mode_info
,
4511 .get
= alc_ch_mode_get
,
4512 .put
= alc_ch_mode_put
,
4517 static struct hda_verb alc880_test_init_verbs
[] = {
4518 /* Unmute inputs of 0x0c - 0x0f */
4519 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
4520 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
4521 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
4522 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
4523 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
4524 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
4525 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
4526 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
4527 /* Vol output for 0x0c-0x0f */
4528 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
4529 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
4530 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
4531 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
4532 /* Set output pins 0x14-0x17 */
4533 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
4534 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
4535 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
4536 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
4537 /* Unmute output pins 0x14-0x17 */
4538 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
4539 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
4540 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
4541 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
4542 /* Set input pins 0x18-0x1c */
4543 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
4544 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
4545 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
4546 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
4547 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
4548 /* Mute input pins 0x18-0x1b */
4549 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
4550 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
4551 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
4552 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
4554 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
4555 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
4556 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
4557 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
4558 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
4559 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
4560 /* Analog input/passthru */
4561 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
4562 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
4563 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
4564 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
4565 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
4573 static const char * const alc880_models
[ALC880_MODEL_LAST
] = {
4574 [ALC880_3ST
] = "3stack",
4575 [ALC880_TCL_S700
] = "tcl",
4576 [ALC880_3ST_DIG
] = "3stack-digout",
4577 [ALC880_CLEVO
] = "clevo",
4578 [ALC880_5ST
] = "5stack",
4579 [ALC880_5ST_DIG
] = "5stack-digout",
4580 [ALC880_W810
] = "w810",
4581 [ALC880_Z71V
] = "z71v",
4582 [ALC880_6ST
] = "6stack",
4583 [ALC880_6ST_DIG
] = "6stack-digout",
4584 [ALC880_ASUS
] = "asus",
4585 [ALC880_ASUS_W1V
] = "asus-w1v",
4586 [ALC880_ASUS_DIG
] = "asus-dig",
4587 [ALC880_ASUS_DIG2
] = "asus-dig2",
4588 [ALC880_UNIWILL_DIG
] = "uniwill",
4589 [ALC880_UNIWILL_P53
] = "uniwill-p53",
4590 [ALC880_FUJITSU
] = "fujitsu",
4591 [ALC880_F1734
] = "F1734",
4593 [ALC880_LG_LW
] = "lg-lw",
4594 [ALC880_MEDION_RIM
] = "medion",
4595 #ifdef CONFIG_SND_DEBUG
4596 [ALC880_TEST
] = "test",
4598 [ALC880_AUTO
] = "auto",
4601 static struct snd_pci_quirk alc880_cfg_tbl
[] = {
4602 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_W810
),
4603 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_5ST_DIG
),
4604 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_6ST
),
4605 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_3ST_DIG
),
4606 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_6ST_DIG
),
4607 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_6ST_DIG
),
4608 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_6ST_DIG
),
4609 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG
),
4610 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST
),
4611 SND_PCI_QUIRK(0x1039, 0x1234, NULL
, ALC880_6ST_DIG
),
4612 SND_PCI_QUIRK(0x103c, 0x2a09, "HP", ALC880_5ST
),
4613 SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V
),
4614 SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG
),
4615 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG
),
4616 SND_PCI_QUIRK(0x1043, 0x1113, "ASUS", ALC880_ASUS_DIG
),
4617 SND_PCI_QUIRK(0x1043, 0x1123, "ASUS", ALC880_ASUS_DIG
),
4618 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS", ALC880_ASUS_DIG
),
4619 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_Z71V
),
4620 /* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */
4621 SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG
),
4622 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG
),
4623 SND_PCI_QUIRK(0x1043, 0x814e, "ASUS P5GD1 w/SPDIF", ALC880_6ST_DIG
),
4624 SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG
),
4625 SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST
),
4626 SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST
),
4627 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_ASUS
), /* default ASUS */
4628 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_3ST
),
4629 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_3ST
),
4630 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_5ST
),
4631 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_5ST
),
4632 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_5ST
),
4633 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_6ST_DIG
),
4634 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_6ST_DIG
),
4635 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_6ST_DIG
),
4636 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_6ST_DIG
),
4637 SND_PCI_QUIRK(0x1558, 0x0520, "Clevo m520G", ALC880_CLEVO
),
4638 SND_PCI_QUIRK(0x1558, 0x0660, "Clevo m655n", ALC880_CLEVO
),
4639 SND_PCI_QUIRK(0x1558, 0x5401, "ASUS", ALC880_ASUS_DIG2
),
4640 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_5ST_DIG
),
4641 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_UNIWILL_DIG
),
4642 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_F1734
),
4643 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_UNIWILL
),
4644 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_UNIWILL_P53
),
4645 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_W810
),
4646 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_MEDION_RIM
),
4647 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_5ST_DIG
),
4648 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG
),
4649 SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_F1734
),
4650 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FUJITSU
),
4651 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_F1734
),
4652 SND_PCI_QUIRK(0x1734, 0x10b0, "Fujitsu", ALC880_FUJITSU
),
4653 SND_PCI_QUIRK(0x1854, 0x0018, "LG LW20", ALC880_LG_LW
),
4654 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG
),
4655 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_LG
),
4656 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_LG
),
4657 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_LG_LW
),
4658 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_TCL_S700
),
4659 SND_PCI_QUIRK(0x2668, 0x8086, NULL
, ALC880_6ST_DIG
), /* broken BIOS */
4660 SND_PCI_QUIRK(0x8086, 0x2668, NULL
, ALC880_6ST_DIG
),
4661 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_5ST_DIG
),
4662 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_5ST_DIG
),
4663 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_5ST_DIG
),
4664 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_3ST_DIG
),
4665 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_5ST_DIG
),
4666 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_3ST_DIG
),
4667 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_3ST_DIG
),
4668 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_5ST_DIG
),
4669 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_5ST_DIG
),
4670 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_5ST_DIG
),
4672 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_3ST
),
4673 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_5ST_DIG
),
4674 SND_PCI_QUIRK(0xe803, 0x1019, NULL
, ALC880_6ST_DIG
),
4679 * ALC880 codec presets
4681 static struct alc_config_preset alc880_presets
[] = {
4683 .mixers
= { alc880_three_stack_mixer
},
4684 .init_verbs
= { alc880_volume_init_verbs
,
4685 alc880_pin_3stack_init_verbs
},
4686 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4687 .dac_nids
= alc880_dac_nids
,
4688 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
4689 .channel_mode
= alc880_threestack_modes
,
4691 .input_mux
= &alc880_capture_source
,
4693 [ALC880_3ST_DIG
] = {
4694 .mixers
= { alc880_three_stack_mixer
},
4695 .init_verbs
= { alc880_volume_init_verbs
,
4696 alc880_pin_3stack_init_verbs
},
4697 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4698 .dac_nids
= alc880_dac_nids
,
4699 .dig_out_nid
= ALC880_DIGOUT_NID
,
4700 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
4701 .channel_mode
= alc880_threestack_modes
,
4703 .input_mux
= &alc880_capture_source
,
4705 [ALC880_TCL_S700
] = {
4706 .mixers
= { alc880_tcl_s700_mixer
},
4707 .init_verbs
= { alc880_volume_init_verbs
,
4708 alc880_pin_tcl_S700_init_verbs
,
4709 alc880_gpio2_init_verbs
},
4710 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4711 .dac_nids
= alc880_dac_nids
,
4712 .adc_nids
= alc880_adc_nids_alt
, /* FIXME: correct? */
4713 .num_adc_nids
= 1, /* single ADC */
4715 .num_channel_mode
= ARRAY_SIZE(alc880_2_jack_modes
),
4716 .channel_mode
= alc880_2_jack_modes
,
4717 .input_mux
= &alc880_capture_source
,
4720 .mixers
= { alc880_three_stack_mixer
,
4721 alc880_five_stack_mixer
},
4722 .init_verbs
= { alc880_volume_init_verbs
,
4723 alc880_pin_5stack_init_verbs
},
4724 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4725 .dac_nids
= alc880_dac_nids
,
4726 .num_channel_mode
= ARRAY_SIZE(alc880_fivestack_modes
),
4727 .channel_mode
= alc880_fivestack_modes
,
4728 .input_mux
= &alc880_capture_source
,
4730 [ALC880_5ST_DIG
] = {
4731 .mixers
= { alc880_three_stack_mixer
,
4732 alc880_five_stack_mixer
},
4733 .init_verbs
= { alc880_volume_init_verbs
,
4734 alc880_pin_5stack_init_verbs
},
4735 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4736 .dac_nids
= alc880_dac_nids
,
4737 .dig_out_nid
= ALC880_DIGOUT_NID
,
4738 .num_channel_mode
= ARRAY_SIZE(alc880_fivestack_modes
),
4739 .channel_mode
= alc880_fivestack_modes
,
4740 .input_mux
= &alc880_capture_source
,
4743 .mixers
= { alc880_six_stack_mixer
},
4744 .init_verbs
= { alc880_volume_init_verbs
,
4745 alc880_pin_6stack_init_verbs
},
4746 .num_dacs
= ARRAY_SIZE(alc880_6st_dac_nids
),
4747 .dac_nids
= alc880_6st_dac_nids
,
4748 .num_channel_mode
= ARRAY_SIZE(alc880_sixstack_modes
),
4749 .channel_mode
= alc880_sixstack_modes
,
4750 .input_mux
= &alc880_6stack_capture_source
,
4752 [ALC880_6ST_DIG
] = {
4753 .mixers
= { alc880_six_stack_mixer
},
4754 .init_verbs
= { alc880_volume_init_verbs
,
4755 alc880_pin_6stack_init_verbs
},
4756 .num_dacs
= ARRAY_SIZE(alc880_6st_dac_nids
),
4757 .dac_nids
= alc880_6st_dac_nids
,
4758 .dig_out_nid
= ALC880_DIGOUT_NID
,
4759 .num_channel_mode
= ARRAY_SIZE(alc880_sixstack_modes
),
4760 .channel_mode
= alc880_sixstack_modes
,
4761 .input_mux
= &alc880_6stack_capture_source
,
4764 .mixers
= { alc880_w810_base_mixer
},
4765 .init_verbs
= { alc880_volume_init_verbs
,
4766 alc880_pin_w810_init_verbs
,
4767 alc880_gpio2_init_verbs
},
4768 .num_dacs
= ARRAY_SIZE(alc880_w810_dac_nids
),
4769 .dac_nids
= alc880_w810_dac_nids
,
4770 .dig_out_nid
= ALC880_DIGOUT_NID
,
4771 .num_channel_mode
= ARRAY_SIZE(alc880_w810_modes
),
4772 .channel_mode
= alc880_w810_modes
,
4773 .input_mux
= &alc880_capture_source
,
4776 .mixers
= { alc880_z71v_mixer
},
4777 .init_verbs
= { alc880_volume_init_verbs
,
4778 alc880_pin_z71v_init_verbs
},
4779 .num_dacs
= ARRAY_SIZE(alc880_z71v_dac_nids
),
4780 .dac_nids
= alc880_z71v_dac_nids
,
4781 .dig_out_nid
= ALC880_DIGOUT_NID
,
4783 .num_channel_mode
= ARRAY_SIZE(alc880_2_jack_modes
),
4784 .channel_mode
= alc880_2_jack_modes
,
4785 .input_mux
= &alc880_capture_source
,
4788 .mixers
= { alc880_f1734_mixer
},
4789 .init_verbs
= { alc880_volume_init_verbs
,
4790 alc880_pin_f1734_init_verbs
},
4791 .num_dacs
= ARRAY_SIZE(alc880_f1734_dac_nids
),
4792 .dac_nids
= alc880_f1734_dac_nids
,
4794 .num_channel_mode
= ARRAY_SIZE(alc880_2_jack_modes
),
4795 .channel_mode
= alc880_2_jack_modes
,
4796 .input_mux
= &alc880_f1734_capture_source
,
4797 .unsol_event
= alc880_uniwill_p53_unsol_event
,
4798 .setup
= alc880_uniwill_p53_setup
,
4799 .init_hook
= alc_automute_amp
,
4802 .mixers
= { alc880_asus_mixer
},
4803 .init_verbs
= { alc880_volume_init_verbs
,
4804 alc880_pin_asus_init_verbs
,
4805 alc880_gpio1_init_verbs
},
4806 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4807 .dac_nids
= alc880_asus_dac_nids
,
4808 .num_channel_mode
= ARRAY_SIZE(alc880_asus_modes
),
4809 .channel_mode
= alc880_asus_modes
,
4811 .input_mux
= &alc880_capture_source
,
4813 [ALC880_ASUS_DIG
] = {
4814 .mixers
= { alc880_asus_mixer
},
4815 .init_verbs
= { alc880_volume_init_verbs
,
4816 alc880_pin_asus_init_verbs
,
4817 alc880_gpio1_init_verbs
},
4818 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4819 .dac_nids
= alc880_asus_dac_nids
,
4820 .dig_out_nid
= ALC880_DIGOUT_NID
,
4821 .num_channel_mode
= ARRAY_SIZE(alc880_asus_modes
),
4822 .channel_mode
= alc880_asus_modes
,
4824 .input_mux
= &alc880_capture_source
,
4826 [ALC880_ASUS_DIG2
] = {
4827 .mixers
= { alc880_asus_mixer
},
4828 .init_verbs
= { alc880_volume_init_verbs
,
4829 alc880_pin_asus_init_verbs
,
4830 alc880_gpio2_init_verbs
}, /* use GPIO2 */
4831 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4832 .dac_nids
= alc880_asus_dac_nids
,
4833 .dig_out_nid
= ALC880_DIGOUT_NID
,
4834 .num_channel_mode
= ARRAY_SIZE(alc880_asus_modes
),
4835 .channel_mode
= alc880_asus_modes
,
4837 .input_mux
= &alc880_capture_source
,
4839 [ALC880_ASUS_W1V
] = {
4840 .mixers
= { alc880_asus_mixer
, alc880_asus_w1v_mixer
},
4841 .init_verbs
= { alc880_volume_init_verbs
,
4842 alc880_pin_asus_init_verbs
,
4843 alc880_gpio1_init_verbs
},
4844 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4845 .dac_nids
= alc880_asus_dac_nids
,
4846 .dig_out_nid
= ALC880_DIGOUT_NID
,
4847 .num_channel_mode
= ARRAY_SIZE(alc880_asus_modes
),
4848 .channel_mode
= alc880_asus_modes
,
4850 .input_mux
= &alc880_capture_source
,
4852 [ALC880_UNIWILL_DIG
] = {
4853 .mixers
= { alc880_asus_mixer
},
4854 .init_verbs
= { alc880_volume_init_verbs
,
4855 alc880_pin_asus_init_verbs
},
4856 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4857 .dac_nids
= alc880_asus_dac_nids
,
4858 .dig_out_nid
= ALC880_DIGOUT_NID
,
4859 .num_channel_mode
= ARRAY_SIZE(alc880_asus_modes
),
4860 .channel_mode
= alc880_asus_modes
,
4862 .input_mux
= &alc880_capture_source
,
4864 [ALC880_UNIWILL
] = {
4865 .mixers
= { alc880_uniwill_mixer
},
4866 .init_verbs
= { alc880_volume_init_verbs
,
4867 alc880_uniwill_init_verbs
},
4868 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4869 .dac_nids
= alc880_asus_dac_nids
,
4870 .dig_out_nid
= ALC880_DIGOUT_NID
,
4871 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
4872 .channel_mode
= alc880_threestack_modes
,
4874 .input_mux
= &alc880_capture_source
,
4875 .unsol_event
= alc880_uniwill_unsol_event
,
4876 .setup
= alc880_uniwill_setup
,
4877 .init_hook
= alc880_uniwill_init_hook
,
4879 [ALC880_UNIWILL_P53
] = {
4880 .mixers
= { alc880_uniwill_p53_mixer
},
4881 .init_verbs
= { alc880_volume_init_verbs
,
4882 alc880_uniwill_p53_init_verbs
},
4883 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4884 .dac_nids
= alc880_asus_dac_nids
,
4885 .num_channel_mode
= ARRAY_SIZE(alc880_w810_modes
),
4886 .channel_mode
= alc880_threestack_modes
,
4887 .input_mux
= &alc880_capture_source
,
4888 .unsol_event
= alc880_uniwill_p53_unsol_event
,
4889 .setup
= alc880_uniwill_p53_setup
,
4890 .init_hook
= alc_automute_amp
,
4892 [ALC880_FUJITSU
] = {
4893 .mixers
= { alc880_fujitsu_mixer
},
4894 .init_verbs
= { alc880_volume_init_verbs
,
4895 alc880_uniwill_p53_init_verbs
,
4896 alc880_beep_init_verbs
},
4897 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4898 .dac_nids
= alc880_dac_nids
,
4899 .dig_out_nid
= ALC880_DIGOUT_NID
,
4900 .num_channel_mode
= ARRAY_SIZE(alc880_2_jack_modes
),
4901 .channel_mode
= alc880_2_jack_modes
,
4902 .input_mux
= &alc880_capture_source
,
4903 .unsol_event
= alc880_uniwill_p53_unsol_event
,
4904 .setup
= alc880_uniwill_p53_setup
,
4905 .init_hook
= alc_automute_amp
,
4908 .mixers
= { alc880_three_stack_mixer
},
4909 .init_verbs
= { alc880_volume_init_verbs
,
4910 alc880_pin_clevo_init_verbs
},
4911 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4912 .dac_nids
= alc880_dac_nids
,
4914 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
4915 .channel_mode
= alc880_threestack_modes
,
4917 .input_mux
= &alc880_capture_source
,
4920 .mixers
= { alc880_lg_mixer
},
4921 .init_verbs
= { alc880_volume_init_verbs
,
4922 alc880_lg_init_verbs
},
4923 .num_dacs
= ARRAY_SIZE(alc880_lg_dac_nids
),
4924 .dac_nids
= alc880_lg_dac_nids
,
4925 .dig_out_nid
= ALC880_DIGOUT_NID
,
4926 .num_channel_mode
= ARRAY_SIZE(alc880_lg_ch_modes
),
4927 .channel_mode
= alc880_lg_ch_modes
,
4929 .input_mux
= &alc880_lg_capture_source
,
4930 .unsol_event
= alc_automute_amp_unsol_event
,
4931 .setup
= alc880_lg_setup
,
4932 .init_hook
= alc_automute_amp
,
4933 #ifdef CONFIG_SND_HDA_POWER_SAVE
4934 .loopbacks
= alc880_lg_loopbacks
,
4938 .mixers
= { alc880_lg_lw_mixer
},
4939 .init_verbs
= { alc880_volume_init_verbs
,
4940 alc880_lg_lw_init_verbs
},
4941 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4942 .dac_nids
= alc880_dac_nids
,
4943 .dig_out_nid
= ALC880_DIGOUT_NID
,
4944 .num_channel_mode
= ARRAY_SIZE(alc880_lg_lw_modes
),
4945 .channel_mode
= alc880_lg_lw_modes
,
4946 .input_mux
= &alc880_lg_lw_capture_source
,
4947 .unsol_event
= alc_automute_amp_unsol_event
,
4948 .setup
= alc880_lg_lw_setup
,
4949 .init_hook
= alc_automute_amp
,
4951 [ALC880_MEDION_RIM
] = {
4952 .mixers
= { alc880_medion_rim_mixer
},
4953 .init_verbs
= { alc880_volume_init_verbs
,
4954 alc880_medion_rim_init_verbs
,
4955 alc_gpio2_init_verbs
},
4956 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4957 .dac_nids
= alc880_dac_nids
,
4958 .dig_out_nid
= ALC880_DIGOUT_NID
,
4959 .num_channel_mode
= ARRAY_SIZE(alc880_2_jack_modes
),
4960 .channel_mode
= alc880_2_jack_modes
,
4961 .input_mux
= &alc880_medion_rim_capture_source
,
4962 .unsol_event
= alc880_medion_rim_unsol_event
,
4963 .setup
= alc880_medion_rim_setup
,
4964 .init_hook
= alc880_medion_rim_automute
,
4966 #ifdef CONFIG_SND_DEBUG
4968 .mixers
= { alc880_test_mixer
},
4969 .init_verbs
= { alc880_test_init_verbs
},
4970 .num_dacs
= ARRAY_SIZE(alc880_test_dac_nids
),
4971 .dac_nids
= alc880_test_dac_nids
,
4972 .dig_out_nid
= ALC880_DIGOUT_NID
,
4973 .num_channel_mode
= ARRAY_SIZE(alc880_test_modes
),
4974 .channel_mode
= alc880_test_modes
,
4975 .input_mux
= &alc880_test_capture_source
,
4981 * Automatic parse of I/O pins from the BIOS configuration
4986 ALC_CTL_WIDGET_MUTE
,
4989 static struct snd_kcontrol_new alc880_control_templates
[] = {
4990 HDA_CODEC_VOLUME(NULL
, 0, 0, 0),
4991 HDA_CODEC_MUTE(NULL
, 0, 0, 0),
4992 HDA_BIND_MUTE(NULL
, 0, 0, 0),
4995 /* add dynamic controls */
4996 static int add_control(struct alc_spec
*spec
, int type
, const char *name
,
4997 int cidx
, unsigned long val
)
4999 struct snd_kcontrol_new
*knew
;
5001 snd_array_init(&spec
->kctls
, sizeof(*knew
), 32);
5002 knew
= snd_array_new(&spec
->kctls
);
5005 *knew
= alc880_control_templates
[type
];
5006 knew
->name
= kstrdup(name
, GFP_KERNEL
);
5010 if (get_amp_nid_(val
))
5011 knew
->subdevice
= HDA_SUBDEV_AMP_FLAG
;
5012 knew
->private_value
= val
;
5016 static int add_control_with_pfx(struct alc_spec
*spec
, int type
,
5017 const char *pfx
, const char *dir
,
5018 const char *sfx
, int cidx
, unsigned long val
)
5021 snprintf(name
, sizeof(name
), "%s %s %s", pfx
, dir
, sfx
);
5022 return add_control(spec
, type
, name
, cidx
, val
);
5025 #define add_pb_vol_ctrl(spec, type, pfx, val) \
5026 add_control_with_pfx(spec, type, pfx, "Playback", "Volume", 0, val)
5027 #define add_pb_sw_ctrl(spec, type, pfx, val) \
5028 add_control_with_pfx(spec, type, pfx, "Playback", "Switch", 0, val)
5029 #define __add_pb_vol_ctrl(spec, type, pfx, cidx, val) \
5030 add_control_with_pfx(spec, type, pfx, "Playback", "Volume", cidx, val)
5031 #define __add_pb_sw_ctrl(spec, type, pfx, cidx, val) \
5032 add_control_with_pfx(spec, type, pfx, "Playback", "Switch", cidx, val)
5034 #define alc880_is_fixed_pin(nid) ((nid) >= 0x14 && (nid) <= 0x17)
5035 #define alc880_fixed_pin_idx(nid) ((nid) - 0x14)
5036 #define alc880_is_multi_pin(nid) ((nid) >= 0x18)
5037 #define alc880_multi_pin_idx(nid) ((nid) - 0x18)
5038 #define alc880_idx_to_dac(nid) ((nid) + 0x02)
5039 #define alc880_dac_to_idx(nid) ((nid) - 0x02)
5040 #define alc880_idx_to_mixer(nid) ((nid) + 0x0c)
5041 #define alc880_idx_to_selector(nid) ((nid) + 0x10)
5042 #define ALC880_PIN_CD_NID 0x1c
5044 /* fill in the dac_nids table from the parsed pin configuration */
5045 static int alc880_auto_fill_dac_nids(struct alc_spec
*spec
,
5046 const struct auto_pin_cfg
*cfg
)
5052 memset(assigned
, 0, sizeof(assigned
));
5053 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
5055 /* check the pins hardwired to audio widget */
5056 for (i
= 0; i
< cfg
->line_outs
; i
++) {
5057 nid
= cfg
->line_out_pins
[i
];
5058 if (alc880_is_fixed_pin(nid
)) {
5059 int idx
= alc880_fixed_pin_idx(nid
);
5060 spec
->multiout
.dac_nids
[i
] = alc880_idx_to_dac(idx
);
5064 /* left pins can be connect to any audio widget */
5065 for (i
= 0; i
< cfg
->line_outs
; i
++) {
5066 nid
= cfg
->line_out_pins
[i
];
5067 if (alc880_is_fixed_pin(nid
))
5069 /* search for an empty channel */
5070 for (j
= 0; j
< cfg
->line_outs
; j
++) {
5072 spec
->multiout
.dac_nids
[i
] =
5073 alc880_idx_to_dac(j
);
5079 spec
->multiout
.num_dacs
= cfg
->line_outs
;
5083 static const char *alc_get_line_out_pfx(const struct auto_pin_cfg
*cfg
,
5086 if (!cfg
->hp_outs
&& !cfg
->speaker_outs
&& can_be_master
)
5089 switch (cfg
->line_out_type
) {
5090 case AUTO_PIN_SPEAKER_OUT
:
5091 if (cfg
->line_outs
== 1)
5094 case AUTO_PIN_HP_OUT
:
5097 if (cfg
->line_outs
== 1)
5104 /* add playback controls from the parsed DAC table */
5105 static int alc880_auto_create_multi_out_ctls(struct alc_spec
*spec
,
5106 const struct auto_pin_cfg
*cfg
)
5108 static const char * const chname
[4] = {
5109 "Front", "Surround", NULL
/*CLFE*/, "Side"
5111 const char *pfx
= alc_get_line_out_pfx(cfg
, false);
5115 for (i
= 0; i
< cfg
->line_outs
; i
++) {
5116 if (!spec
->multiout
.dac_nids
[i
])
5118 nid
= alc880_idx_to_mixer(alc880_dac_to_idx(spec
->multiout
.dac_nids
[i
]));
5119 if (!pfx
&& i
== 2) {
5121 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
,
5123 HDA_COMPOSE_AMP_VAL(nid
, 1, 0,
5127 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
,
5129 HDA_COMPOSE_AMP_VAL(nid
, 2, 0,
5133 err
= add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
,
5135 HDA_COMPOSE_AMP_VAL(nid
, 1, 2,
5139 err
= add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
,
5141 HDA_COMPOSE_AMP_VAL(nid
, 2, 2,
5146 const char *name
= pfx
;
5152 err
= __add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
,
5154 HDA_COMPOSE_AMP_VAL(nid
, 3, 0,
5158 err
= __add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
,
5160 HDA_COMPOSE_AMP_VAL(nid
, 3, 2,
5169 /* add playback controls for speaker and HP outputs */
5170 static int alc880_auto_create_extra_out(struct alc_spec
*spec
, hda_nid_t pin
,
5179 if (alc880_is_fixed_pin(pin
)) {
5180 nid
= alc880_idx_to_dac(alc880_fixed_pin_idx(pin
));
5181 /* specify the DAC as the extra output */
5182 if (!spec
->multiout
.hp_nid
)
5183 spec
->multiout
.hp_nid
= nid
;
5185 spec
->multiout
.extra_out_nid
[0] = nid
;
5186 /* control HP volume/switch on the output mixer amp */
5187 nid
= alc880_idx_to_mixer(alc880_fixed_pin_idx(pin
));
5188 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, pfx
,
5189 HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_OUTPUT
));
5192 err
= add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
, pfx
,
5193 HDA_COMPOSE_AMP_VAL(nid
, 3, 2, HDA_INPUT
));
5196 } else if (alc880_is_multi_pin(pin
)) {
5197 /* set manual connection */
5198 /* we have only a switch on HP-out PIN */
5199 err
= add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, pfx
,
5200 HDA_COMPOSE_AMP_VAL(pin
, 3, 0, HDA_OUTPUT
));
5207 /* create input playback/capture controls for the given pin */
5208 static int new_analog_input(struct alc_spec
*spec
, hda_nid_t pin
,
5209 const char *ctlname
, int ctlidx
,
5210 int idx
, hda_nid_t mix_nid
)
5214 err
= __add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, ctlname
, ctlidx
,
5215 HDA_COMPOSE_AMP_VAL(mix_nid
, 3, idx
, HDA_INPUT
));
5218 err
= __add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, ctlname
, ctlidx
,
5219 HDA_COMPOSE_AMP_VAL(mix_nid
, 3, idx
, HDA_INPUT
));
5225 static int alc_is_input_pin(struct hda_codec
*codec
, hda_nid_t nid
)
5227 unsigned int pincap
= snd_hda_query_pin_caps(codec
, nid
);
5228 return (pincap
& AC_PINCAP_IN
) != 0;
5231 /* create playback/capture controls for input pins */
5232 static int alc_auto_create_input_ctls(struct hda_codec
*codec
,
5233 const struct auto_pin_cfg
*cfg
,
5235 hda_nid_t cap1
, hda_nid_t cap2
)
5237 struct alc_spec
*spec
= codec
->spec
;
5238 struct hda_input_mux
*imux
= &spec
->private_imux
[0];
5239 int i
, err
, idx
, type_idx
= 0;
5240 const char *prev_label
= NULL
;
5242 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5246 pin
= cfg
->inputs
[i
].pin
;
5247 if (!alc_is_input_pin(codec
, pin
))
5250 label
= hda_get_autocfg_input_label(codec
, cfg
, i
);
5251 if (prev_label
&& !strcmp(label
, prev_label
))
5258 idx
= get_connection_index(codec
, mixer
, pin
);
5260 err
= new_analog_input(spec
, pin
,
5270 idx
= get_connection_index(codec
, cap1
, pin
);
5271 if (idx
< 0 && cap2
)
5272 idx
= get_connection_index(codec
, cap2
, pin
);
5274 snd_hda_add_imux_item(imux
, label
, idx
, NULL
);
5279 static int alc880_auto_create_input_ctls(struct hda_codec
*codec
,
5280 const struct auto_pin_cfg
*cfg
)
5282 return alc_auto_create_input_ctls(codec
, cfg
, 0x0b, 0x08, 0x09);
5285 static void alc_set_pin_output(struct hda_codec
*codec
, hda_nid_t nid
,
5286 unsigned int pin_type
)
5288 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5291 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_AMP_GAIN_MUTE
,
5295 static void alc880_auto_set_output_and_unmute(struct hda_codec
*codec
,
5296 hda_nid_t nid
, int pin_type
,
5299 alc_set_pin_output(codec
, nid
, pin_type
);
5300 /* need the manual connection? */
5301 if (alc880_is_multi_pin(nid
)) {
5302 struct alc_spec
*spec
= codec
->spec
;
5303 int idx
= alc880_multi_pin_idx(nid
);
5304 snd_hda_codec_write(codec
, alc880_idx_to_selector(idx
), 0,
5305 AC_VERB_SET_CONNECT_SEL
,
5306 alc880_dac_to_idx(spec
->multiout
.dac_nids
[dac_idx
]));
5310 static int get_pin_type(int line_out_type
)
5312 if (line_out_type
== AUTO_PIN_HP_OUT
)
5318 static void alc880_auto_init_multi_out(struct hda_codec
*codec
)
5320 struct alc_spec
*spec
= codec
->spec
;
5323 for (i
= 0; i
< spec
->autocfg
.line_outs
; i
++) {
5324 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
5325 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
5326 alc880_auto_set_output_and_unmute(codec
, nid
, pin_type
, i
);
5330 static void alc880_auto_init_extra_out(struct hda_codec
*codec
)
5332 struct alc_spec
*spec
= codec
->spec
;
5335 pin
= spec
->autocfg
.speaker_pins
[0];
5336 if (pin
) /* connect to front */
5337 alc880_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
, 0);
5338 pin
= spec
->autocfg
.hp_pins
[0];
5339 if (pin
) /* connect to front */
5340 alc880_auto_set_output_and_unmute(codec
, pin
, PIN_HP
, 0);
5343 static void alc880_auto_init_analog_input(struct hda_codec
*codec
)
5345 struct alc_spec
*spec
= codec
->spec
;
5346 struct auto_pin_cfg
*cfg
= &spec
->autocfg
;
5349 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5350 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
5351 if (alc_is_input_pin(codec
, nid
)) {
5352 alc_set_input_pin(codec
, nid
, cfg
->inputs
[i
].type
);
5353 if (nid
!= ALC880_PIN_CD_NID
&&
5354 (get_wcaps(codec
, nid
) & AC_WCAP_OUT_AMP
))
5355 snd_hda_codec_write(codec
, nid
, 0,
5356 AC_VERB_SET_AMP_GAIN_MUTE
,
5362 static void alc880_auto_init_input_src(struct hda_codec
*codec
)
5364 struct alc_spec
*spec
= codec
->spec
;
5367 for (c
= 0; c
< spec
->num_adc_nids
; c
++) {
5368 unsigned int mux_idx
;
5369 const struct hda_input_mux
*imux
;
5370 mux_idx
= c
>= spec
->num_mux_defs
? 0 : c
;
5371 imux
= &spec
->input_mux
[mux_idx
];
5372 if (!imux
->num_items
&& mux_idx
> 0)
5373 imux
= &spec
->input_mux
[0];
5375 snd_hda_codec_write(codec
, spec
->adc_nids
[c
], 0,
5376 AC_VERB_SET_CONNECT_SEL
,
5377 imux
->items
[0].index
);
5381 /* parse the BIOS configuration and set up the alc_spec */
5382 /* return 1 if successful, 0 if the proper config is not found,
5383 * or a negative error code
5385 static int alc880_parse_auto_config(struct hda_codec
*codec
)
5387 struct alc_spec
*spec
= codec
->spec
;
5389 static hda_nid_t alc880_ignore
[] = { 0x1d, 0 };
5391 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
5395 if (!spec
->autocfg
.line_outs
)
5396 return 0; /* can't find valid BIOS pin config */
5398 err
= alc880_auto_fill_dac_nids(spec
, &spec
->autocfg
);
5401 err
= alc880_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
5404 err
= alc880_auto_create_extra_out(spec
,
5405 spec
->autocfg
.speaker_pins
[0],
5409 err
= alc880_auto_create_extra_out(spec
, spec
->autocfg
.hp_pins
[0],
5413 err
= alc880_auto_create_input_ctls(codec
, &spec
->autocfg
);
5417 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
5419 alc_auto_parse_digital(codec
);
5421 if (spec
->kctls
.list
)
5422 add_mixer(spec
, spec
->kctls
.list
);
5424 add_verb(spec
, alc880_volume_init_verbs
);
5426 spec
->num_mux_defs
= 1;
5427 spec
->input_mux
= &spec
->private_imux
[0];
5429 alc_ssid_check(codec
, 0x15, 0x1b, 0x14, 0);
5434 /* additional initialization for auto-configuration model */
5435 static void alc880_auto_init(struct hda_codec
*codec
)
5437 struct alc_spec
*spec
= codec
->spec
;
5438 alc880_auto_init_multi_out(codec
);
5439 alc880_auto_init_extra_out(codec
);
5440 alc880_auto_init_analog_input(codec
);
5441 alc880_auto_init_input_src(codec
);
5442 alc_auto_init_digital(codec
);
5443 if (spec
->unsol_event
)
5444 alc_inithook(codec
);
5447 /* check the ADC/MUX contains all input pins; some ADC/MUX contains only
5448 * one of two digital mic pins, e.g. on ALC272
5450 static void fixup_automic_adc(struct hda_codec
*codec
)
5452 struct alc_spec
*spec
= codec
->spec
;
5455 for (i
= 0; i
< spec
->num_adc_nids
; i
++) {
5456 hda_nid_t cap
= spec
->capsrc_nids
?
5457 spec
->capsrc_nids
[i
] : spec
->adc_nids
[i
];
5460 iidx
= get_connection_index(codec
, cap
, spec
->int_mic
.pin
);
5463 eidx
= get_connection_index(codec
, cap
, spec
->ext_mic
.pin
);
5466 spec
->int_mic
.mux_idx
= iidx
;
5467 spec
->ext_mic
.mux_idx
= eidx
;
5468 if (spec
->capsrc_nids
)
5469 spec
->capsrc_nids
+= i
;
5470 spec
->adc_nids
+= i
;
5471 spec
->num_adc_nids
= 1;
5474 snd_printd(KERN_INFO
"hda_codec: %s: "
5475 "No ADC/MUX containing both 0x%x and 0x%x pins\n",
5476 codec
->chip_name
, spec
->int_mic
.pin
, spec
->ext_mic
.pin
);
5477 spec
->auto_mic
= 0; /* disable auto-mic to be sure */
5480 /* select or unmute the given capsrc route */
5481 static void select_or_unmute_capsrc(struct hda_codec
*codec
, hda_nid_t cap
,
5484 if (get_wcaps_type(get_wcaps(codec
, cap
)) == AC_WID_AUD_MIX
) {
5485 snd_hda_codec_amp_stereo(codec
, cap
, HDA_INPUT
, idx
,
5488 snd_hda_codec_write_cache(codec
, cap
, 0,
5489 AC_VERB_SET_CONNECT_SEL
, idx
);
5493 /* set the default connection to that pin */
5494 static int init_capsrc_for_pin(struct hda_codec
*codec
, hda_nid_t pin
)
5496 struct alc_spec
*spec
= codec
->spec
;
5499 for (i
= 0; i
< spec
->num_adc_nids
; i
++) {
5500 hda_nid_t cap
= spec
->capsrc_nids
?
5501 spec
->capsrc_nids
[i
] : spec
->adc_nids
[i
];
5504 idx
= get_connection_index(codec
, cap
, pin
);
5507 select_or_unmute_capsrc(codec
, cap
, idx
);
5508 return i
; /* return the found index */
5510 return -1; /* not found */
5513 /* choose the ADC/MUX containing the input pin and initialize the setup */
5514 static void fixup_single_adc(struct hda_codec
*codec
)
5516 struct alc_spec
*spec
= codec
->spec
;
5517 struct auto_pin_cfg
*cfg
= &spec
->autocfg
;
5520 /* search for the input pin; there must be only one */
5521 if (cfg
->num_inputs
!= 1)
5523 i
= init_capsrc_for_pin(codec
, cfg
->inputs
[0].pin
);
5525 /* use only this ADC */
5526 if (spec
->capsrc_nids
)
5527 spec
->capsrc_nids
+= i
;
5528 spec
->adc_nids
+= i
;
5529 spec
->num_adc_nids
= 1;
5530 spec
->single_input_src
= 1;
5534 /* initialize dual adcs */
5535 static void fixup_dual_adc_switch(struct hda_codec
*codec
)
5537 struct alc_spec
*spec
= codec
->spec
;
5538 init_capsrc_for_pin(codec
, spec
->ext_mic
.pin
);
5539 init_capsrc_for_pin(codec
, spec
->int_mic
.pin
);
5542 /* initialize some special cases for input sources */
5543 static void alc_init_special_input_src(struct hda_codec
*codec
)
5545 struct alc_spec
*spec
= codec
->spec
;
5546 if (spec
->dual_adc_switch
)
5547 fixup_dual_adc_switch(codec
);
5548 else if (spec
->single_input_src
)
5549 init_capsrc_for_pin(codec
, spec
->autocfg
.inputs
[0].pin
);
5552 static void set_capture_mixer(struct hda_codec
*codec
)
5554 struct alc_spec
*spec
= codec
->spec
;
5555 static struct snd_kcontrol_new
*caps
[2][3] = {
5556 { alc_capture_mixer_nosrc1
,
5557 alc_capture_mixer_nosrc2
,
5558 alc_capture_mixer_nosrc3
},
5559 { alc_capture_mixer1
,
5561 alc_capture_mixer3
},
5563 if (spec
->num_adc_nids
> 0 && spec
->num_adc_nids
<= 3) {
5565 int num_adcs
= spec
->num_adc_nids
;
5566 if (spec
->dual_adc_switch
)
5568 else if (spec
->auto_mic
)
5569 fixup_automic_adc(codec
);
5570 else if (spec
->input_mux
) {
5571 if (spec
->input_mux
->num_items
> 1)
5573 else if (spec
->input_mux
->num_items
== 1)
5574 fixup_single_adc(codec
);
5576 spec
->cap_mixer
= caps
[mux
][num_adcs
- 1];
5580 /* fill adc_nids (and capsrc_nids) containing all active input pins */
5581 static void fillup_priv_adc_nids(struct hda_codec
*codec
, hda_nid_t
*nids
,
5584 struct alc_spec
*spec
= codec
->spec
;
5585 struct auto_pin_cfg
*cfg
= &spec
->autocfg
;
5587 hda_nid_t fallback_adc
= 0, fallback_cap
= 0;
5589 for (n
= 0; n
< num_nids
; n
++) {
5591 hda_nid_t conn
[HDA_MAX_NUM_INPUTS
];
5595 if (get_wcaps_type(get_wcaps(codec
, adc
)) != AC_WID_AUD_IN
)
5598 nconns
= snd_hda_get_connections(codec
, cap
, conn
,
5602 nconns
= snd_hda_get_connections(codec
, cap
, conn
,
5607 if (!fallback_adc
) {
5611 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5612 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
5613 for (j
= 0; j
< nconns
; j
++) {
5620 if (i
>= cfg
->num_inputs
) {
5621 int num_adcs
= spec
->num_adc_nids
;
5622 spec
->private_adc_nids
[num_adcs
] = adc
;
5623 spec
->private_capsrc_nids
[num_adcs
] = cap
;
5624 spec
->num_adc_nids
++;
5625 spec
->adc_nids
= spec
->private_adc_nids
;
5627 spec
->capsrc_nids
= spec
->private_capsrc_nids
;
5630 if (!spec
->num_adc_nids
) {
5631 printk(KERN_WARNING
"hda_codec: %s: no valid ADC found;"
5632 " using fallback 0x%x\n",
5633 codec
->chip_name
, fallback_adc
);
5634 spec
->private_adc_nids
[0] = fallback_adc
;
5635 spec
->adc_nids
= spec
->private_adc_nids
;
5636 if (fallback_adc
!= fallback_cap
) {
5637 spec
->private_capsrc_nids
[0] = fallback_cap
;
5638 spec
->capsrc_nids
= spec
->private_adc_nids
;
5643 #ifdef CONFIG_SND_HDA_INPUT_BEEP
5644 #define set_beep_amp(spec, nid, idx, dir) \
5645 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
5647 static struct snd_pci_quirk beep_white_list
[] = {
5648 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
5649 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
5650 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
5654 static inline int has_cdefine_beep(struct hda_codec
*codec
)
5656 struct alc_spec
*spec
= codec
->spec
;
5657 const struct snd_pci_quirk
*q
;
5658 q
= snd_pci_quirk_lookup(codec
->bus
->pci
, beep_white_list
);
5661 return spec
->cdefine
.enable_pcbeep
;
5664 #define set_beep_amp(spec, nid, idx, dir) /* NOP */
5665 #define has_cdefine_beep(codec) 0
5669 * OK, here we have finally the patch for ALC880
5672 static int patch_alc880(struct hda_codec
*codec
)
5674 struct alc_spec
*spec
;
5678 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
5684 board_config
= snd_hda_check_board_config(codec
, ALC880_MODEL_LAST
,
5687 if (board_config
< 0) {
5688 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
5690 board_config
= ALC880_AUTO
;
5693 if (board_config
== ALC880_AUTO
) {
5694 /* automatic parse from the BIOS config */
5695 err
= alc880_parse_auto_config(codec
);
5701 "hda_codec: Cannot set up configuration "
5702 "from BIOS. Using 3-stack mode...\n");
5703 board_config
= ALC880_3ST
;
5707 err
= snd_hda_attach_beep_device(codec
, 0x1);
5713 if (board_config
!= ALC880_AUTO
)
5714 setup_preset(codec
, &alc880_presets
[board_config
]);
5716 spec
->stream_analog_playback
= &alc880_pcm_analog_playback
;
5717 spec
->stream_analog_capture
= &alc880_pcm_analog_capture
;
5718 spec
->stream_analog_alt_capture
= &alc880_pcm_analog_alt_capture
;
5720 spec
->stream_digital_playback
= &alc880_pcm_digital_playback
;
5721 spec
->stream_digital_capture
= &alc880_pcm_digital_capture
;
5723 if (!spec
->adc_nids
&& spec
->input_mux
) {
5724 /* check whether NID 0x07 is valid */
5725 unsigned int wcap
= get_wcaps(codec
, alc880_adc_nids
[0]);
5727 wcap
= get_wcaps_type(wcap
);
5728 if (wcap
!= AC_WID_AUD_IN
) {
5729 spec
->adc_nids
= alc880_adc_nids_alt
;
5730 spec
->num_adc_nids
= ARRAY_SIZE(alc880_adc_nids_alt
);
5732 spec
->adc_nids
= alc880_adc_nids
;
5733 spec
->num_adc_nids
= ARRAY_SIZE(alc880_adc_nids
);
5736 set_capture_mixer(codec
);
5737 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
5739 spec
->vmaster_nid
= 0x0c;
5741 codec
->patch_ops
= alc_patch_ops
;
5742 if (board_config
== ALC880_AUTO
)
5743 spec
->init_hook
= alc880_auto_init
;
5744 #ifdef CONFIG_SND_HDA_POWER_SAVE
5745 if (!spec
->loopback
.amplist
)
5746 spec
->loopback
.amplist
= alc880_loopbacks
;
5757 static hda_nid_t alc260_dac_nids
[1] = {
5762 static hda_nid_t alc260_adc_nids
[1] = {
5767 static hda_nid_t alc260_adc_nids_alt
[1] = {
5772 /* NIDs used when simultaneous access to both ADCs makes sense. Note that
5773 * alc260_capture_mixer assumes ADC0 (nid 0x04) is the first ADC.
5775 static hda_nid_t alc260_dual_adc_nids
[2] = {
5780 #define ALC260_DIGOUT_NID 0x03
5781 #define ALC260_DIGIN_NID 0x06
5783 static struct hda_input_mux alc260_capture_source
= {
5787 { "Front Mic", 0x1 },
5793 /* On Fujitsu S702x laptops capture only makes sense from Mic/LineIn jack,
5794 * headphone jack and the internal CD lines since these are the only pins at
5795 * which audio can appear. For flexibility, also allow the option of
5796 * recording the mixer output on the second ADC (ADC0 doesn't have a
5797 * connection to the mixer output).
5799 static struct hda_input_mux alc260_fujitsu_capture_sources
[2] = {
5803 { "Mic/Line", 0x0 },
5805 { "Headphone", 0x2 },
5811 { "Mic/Line", 0x0 },
5813 { "Headphone", 0x2 },
5820 /* Acer TravelMate(/Extensa/Aspire) notebooks have similar configuration to
5821 * the Fujitsu S702x, but jacks are marked differently.
5823 static struct hda_input_mux alc260_acer_capture_sources
[2] = {
5830 { "Headphone", 0x5 },
5839 { "Headphone", 0x6 },
5845 /* Maxdata Favorit 100XS */
5846 static struct hda_input_mux alc260_favorit100_capture_sources
[2] = {
5850 { "Line/Mic", 0x0 },
5857 { "Line/Mic", 0x0 },
5865 * This is just place-holder, so there's something for alc_build_pcms to look
5866 * at when it calculates the maximum number of channels. ALC260 has no mixer
5867 * element which allows changing the channel mode, so the verb list is
5870 static struct hda_channel_mode alc260_modes
[1] = {
5875 /* Mixer combinations
5877 * basic: base_output + input + pc_beep + capture
5878 * HP: base_output + input + capture_alt
5879 * HP_3013: hp_3013 + input + capture
5880 * fujitsu: fujitsu + capture
5881 * acer: acer + capture
5884 static struct snd_kcontrol_new alc260_base_output_mixer
[] = {
5885 HDA_CODEC_VOLUME("Front Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5886 HDA_BIND_MUTE("Front Playback Switch", 0x08, 2, HDA_INPUT
),
5887 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x09, 0x0, HDA_OUTPUT
),
5888 HDA_BIND_MUTE("Headphone Playback Switch", 0x09, 2, HDA_INPUT
),
5889 HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT
),
5890 HDA_BIND_MUTE_MONO("Mono Playback Switch", 0x0a, 1, 2, HDA_INPUT
),
5894 static struct snd_kcontrol_new alc260_input_mixer
[] = {
5895 HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT
),
5896 HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT
),
5897 HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT
),
5898 HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT
),
5899 HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT
),
5900 HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT
),
5901 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x07, 0x01, HDA_INPUT
),
5902 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x07, 0x01, HDA_INPUT
),
5906 /* update HP, line and mono out pins according to the master switch */
5907 static void alc260_hp_master_update(struct hda_codec
*codec
,
5908 hda_nid_t hp
, hda_nid_t line
,
5911 struct alc_spec
*spec
= codec
->spec
;
5912 unsigned int val
= spec
->master_sw
? PIN_HP
: 0;
5913 /* change HP and line-out pins */
5914 snd_hda_codec_write(codec
, hp
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5916 snd_hda_codec_write(codec
, line
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5918 /* mono (speaker) depending on the HP jack sense */
5919 val
= (val
&& !spec
->jack_present
) ? PIN_OUT
: 0;
5920 snd_hda_codec_write(codec
, mono
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5924 static int alc260_hp_master_sw_get(struct snd_kcontrol
*kcontrol
,
5925 struct snd_ctl_elem_value
*ucontrol
)
5927 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
5928 struct alc_spec
*spec
= codec
->spec
;
5929 *ucontrol
->value
.integer
.value
= spec
->master_sw
;
5933 static int alc260_hp_master_sw_put(struct snd_kcontrol
*kcontrol
,
5934 struct snd_ctl_elem_value
*ucontrol
)
5936 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
5937 struct alc_spec
*spec
= codec
->spec
;
5938 int val
= !!*ucontrol
->value
.integer
.value
;
5939 hda_nid_t hp
, line
, mono
;
5941 if (val
== spec
->master_sw
)
5943 spec
->master_sw
= val
;
5944 hp
= (kcontrol
->private_value
>> 16) & 0xff;
5945 line
= (kcontrol
->private_value
>> 8) & 0xff;
5946 mono
= kcontrol
->private_value
& 0xff;
5947 alc260_hp_master_update(codec
, hp
, line
, mono
);
5951 static struct snd_kcontrol_new alc260_hp_output_mixer
[] = {
5953 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
5954 .name
= "Master Playback Switch",
5955 .subdevice
= HDA_SUBDEV_NID_FLAG
| 0x11,
5956 .info
= snd_ctl_boolean_mono_info
,
5957 .get
= alc260_hp_master_sw_get
,
5958 .put
= alc260_hp_master_sw_put
,
5959 .private_value
= (0x0f << 16) | (0x10 << 8) | 0x11
5961 HDA_CODEC_VOLUME("Front Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5962 HDA_BIND_MUTE("Front Playback Switch", 0x08, 2, HDA_INPUT
),
5963 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x09, 0x0, HDA_OUTPUT
),
5964 HDA_BIND_MUTE("Headphone Playback Switch", 0x09, 2, HDA_INPUT
),
5965 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0a, 1, 0x0,
5967 HDA_BIND_MUTE_MONO("Speaker Playback Switch", 0x0a, 1, 2, HDA_INPUT
),
5971 static struct hda_verb alc260_hp_unsol_verbs
[] = {
5972 {0x10, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
5976 static void alc260_hp_automute(struct hda_codec
*codec
)
5978 struct alc_spec
*spec
= codec
->spec
;
5980 spec
->jack_present
= snd_hda_jack_detect(codec
, 0x10);
5981 alc260_hp_master_update(codec
, 0x0f, 0x10, 0x11);
5984 static void alc260_hp_unsol_event(struct hda_codec
*codec
, unsigned int res
)
5986 if ((res
>> 26) == ALC880_HP_EVENT
)
5987 alc260_hp_automute(codec
);
5990 static struct snd_kcontrol_new alc260_hp_3013_mixer
[] = {
5992 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
5993 .name
= "Master Playback Switch",
5994 .subdevice
= HDA_SUBDEV_NID_FLAG
| 0x11,
5995 .info
= snd_ctl_boolean_mono_info
,
5996 .get
= alc260_hp_master_sw_get
,
5997 .put
= alc260_hp_master_sw_put
,
5998 .private_value
= (0x15 << 16) | (0x10 << 8) | 0x11
6000 HDA_CODEC_VOLUME("Front Playback Volume", 0x09, 0x0, HDA_OUTPUT
),
6001 HDA_CODEC_MUTE("Front Playback Switch", 0x10, 0x0, HDA_OUTPUT
),
6002 HDA_CODEC_VOLUME("Aux-In Playback Volume", 0x07, 0x06, HDA_INPUT
),
6003 HDA_CODEC_MUTE("Aux-In Playback Switch", 0x07, 0x06, HDA_INPUT
),
6004 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
6005 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
6006 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT
),
6007 HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x11, 1, 0x0, HDA_OUTPUT
),
6011 static struct hda_bind_ctls alc260_dc7600_bind_master_vol
= {
6012 .ops
= &snd_hda_bind_vol
,
6014 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_OUTPUT
),
6015 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_OUTPUT
),
6016 HDA_COMPOSE_AMP_VAL(0x0a, 3, 0, HDA_OUTPUT
),
6021 static struct hda_bind_ctls alc260_dc7600_bind_switch
= {
6022 .ops
= &snd_hda_bind_sw
,
6024 HDA_COMPOSE_AMP_VAL(0x11, 3, 0, HDA_OUTPUT
),
6025 HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT
),
6030 static struct snd_kcontrol_new alc260_hp_dc7600_mixer
[] = {
6031 HDA_BIND_VOL("Master Playback Volume", &alc260_dc7600_bind_master_vol
),
6032 HDA_BIND_SW("LineOut Playback Switch", &alc260_dc7600_bind_switch
),
6033 HDA_CODEC_MUTE("Speaker Playback Switch", 0x0f, 0x0, HDA_OUTPUT
),
6034 HDA_CODEC_MUTE("Headphone Playback Switch", 0x10, 0x0, HDA_OUTPUT
),
6038 static struct hda_verb alc260_hp_3013_unsol_verbs
[] = {
6039 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
6043 static void alc260_hp_3013_automute(struct hda_codec
*codec
)
6045 struct alc_spec
*spec
= codec
->spec
;
6047 spec
->jack_present
= snd_hda_jack_detect(codec
, 0x15);
6048 alc260_hp_master_update(codec
, 0x15, 0x10, 0x11);
6051 static void alc260_hp_3013_unsol_event(struct hda_codec
*codec
,
6054 if ((res
>> 26) == ALC880_HP_EVENT
)
6055 alc260_hp_3013_automute(codec
);
6058 static void alc260_hp_3012_automute(struct hda_codec
*codec
)
6060 unsigned int bits
= snd_hda_jack_detect(codec
, 0x10) ? 0 : PIN_OUT
;
6062 snd_hda_codec_write(codec
, 0x0f, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
6064 snd_hda_codec_write(codec
, 0x11, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
6066 snd_hda_codec_write(codec
, 0x15, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
6070 static void alc260_hp_3012_unsol_event(struct hda_codec
*codec
,
6073 if ((res
>> 26) == ALC880_HP_EVENT
)
6074 alc260_hp_3012_automute(codec
);
6077 /* Fujitsu S702x series laptops. ALC260 pin usage: Mic/Line jack = 0x12,
6078 * HP jack = 0x14, CD audio = 0x16, internal speaker = 0x10.
6080 static struct snd_kcontrol_new alc260_fujitsu_mixer
[] = {
6081 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
6082 HDA_BIND_MUTE("Headphone Playback Switch", 0x08, 2, HDA_INPUT
),
6083 ALC_PIN_MODE("Headphone Jack Mode", 0x14, ALC_PIN_DIR_INOUT
),
6084 HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT
),
6085 HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT
),
6086 HDA_CODEC_VOLUME("Mic/Line Playback Volume", 0x07, 0x0, HDA_INPUT
),
6087 HDA_CODEC_MUTE("Mic/Line Playback Switch", 0x07, 0x0, HDA_INPUT
),
6088 ALC_PIN_MODE("Mic/Line Jack Mode", 0x12, ALC_PIN_DIR_IN
),
6089 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x09, 0x0, HDA_OUTPUT
),
6090 HDA_BIND_MUTE("Speaker Playback Switch", 0x09, 2, HDA_INPUT
),
6094 /* Mixer for Acer TravelMate(/Extensa/Aspire) notebooks. Note that current
6095 * versions of the ALC260 don't act on requests to enable mic bias from NID
6096 * 0x0f (used to drive the headphone jack in these laptops). The ALC260
6097 * datasheet doesn't mention this restriction. At this stage it's not clear
6098 * whether this behaviour is intentional or is a hardware bug in chip
6099 * revisions available in early 2006. Therefore for now allow the
6100 * "Headphone Jack Mode" control to span all choices, but if it turns out
6101 * that the lack of mic bias for this NID is intentional we could change the
6102 * mode from ALC_PIN_DIR_INOUT to ALC_PIN_DIR_INOUT_NOMICBIAS.
6104 * In addition, Acer TravelMate(/Extensa/Aspire) notebooks in early 2006
6105 * don't appear to make the mic bias available from the "line" jack, even
6106 * though the NID used for this jack (0x14) can supply it. The theory is
6107 * that perhaps Acer have included blocking capacitors between the ALC260
6108 * and the output jack. If this turns out to be the case for all such
6109 * models the "Line Jack Mode" mode could be changed from ALC_PIN_DIR_INOUT
6110 * to ALC_PIN_DIR_INOUT_NOMICBIAS.
6112 * The C20x Tablet series have a mono internal speaker which is controlled
6113 * via the chip's Mono sum widget and pin complex, so include the necessary
6114 * controls for such models. On models without a "mono speaker" the control
6115 * won't do anything.
6117 static struct snd_kcontrol_new alc260_acer_mixer
[] = {
6118 HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
6119 HDA_BIND_MUTE("Master Playback Switch", 0x08, 2, HDA_INPUT
),
6120 ALC_PIN_MODE("Headphone Jack Mode", 0x0f, ALC_PIN_DIR_INOUT
),
6121 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0a, 1, 0x0,
6123 HDA_BIND_MUTE_MONO("Speaker Playback Switch", 0x0a, 1, 2,
6125 HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT
),
6126 HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT
),
6127 HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT
),
6128 HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT
),
6129 ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN
),
6130 HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT
),
6131 HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT
),
6132 ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT
),
6136 /* Maxdata Favorit 100XS: one output and one input (0x12) jack
6138 static struct snd_kcontrol_new alc260_favorit100_mixer
[] = {
6139 HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
6140 HDA_BIND_MUTE("Master Playback Switch", 0x08, 2, HDA_INPUT
),
6141 ALC_PIN_MODE("Output Jack Mode", 0x0f, ALC_PIN_DIR_INOUT
),
6142 HDA_CODEC_VOLUME("Line/Mic Playback Volume", 0x07, 0x0, HDA_INPUT
),
6143 HDA_CODEC_MUTE("Line/Mic Playback Switch", 0x07, 0x0, HDA_INPUT
),
6144 ALC_PIN_MODE("Line/Mic Jack Mode", 0x12, ALC_PIN_DIR_IN
),
6148 /* Packard bell V7900 ALC260 pin usage: HP = 0x0f, Mic jack = 0x12,
6149 * Line In jack = 0x14, CD audio = 0x16, pc beep = 0x17.
6151 static struct snd_kcontrol_new alc260_will_mixer
[] = {
6152 HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
6153 HDA_BIND_MUTE("Master Playback Switch", 0x08, 0x2, HDA_INPUT
),
6154 HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT
),
6155 HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT
),
6156 ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN
),
6157 HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT
),
6158 HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT
),
6159 ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT
),
6160 HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT
),
6161 HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT
),
6165 /* Replacer 672V ALC260 pin usage: Mic jack = 0x12,
6166 * Line In jack = 0x14, ATAPI Mic = 0x13, speaker = 0x0f.
6168 static struct snd_kcontrol_new alc260_replacer_672v_mixer
[] = {
6169 HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
6170 HDA_BIND_MUTE("Master Playback Switch", 0x08, 0x2, HDA_INPUT
),
6171 HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT
),
6172 HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT
),
6173 ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN
),
6174 HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x07, 0x1, HDA_INPUT
),
6175 HDA_CODEC_MUTE("ATATI Mic Playback Switch", 0x07, 0x1, HDA_INPUT
),
6176 HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT
),
6177 HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT
),
6178 ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT
),
6183 * initialization verbs
6185 static struct hda_verb alc260_init_verbs
[] = {
6186 /* Line In pin widget for input */
6187 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6188 /* CD pin widget for input */
6189 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6190 /* Mic1 (rear panel) pin widget for input and vref at 80% */
6191 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6192 /* Mic2 (front panel) pin widget for input and vref at 80% */
6193 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6194 /* LINE-2 is used for line-out in rear */
6195 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6196 /* select line-out */
6197 {0x0e, AC_VERB_SET_CONNECT_SEL
, 0x00},
6199 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6201 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
6203 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6204 /* mute capture amp left and right */
6205 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6206 /* set connection select to line in (default select for this ADC) */
6207 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x02},
6208 /* mute capture amp left and right */
6209 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6210 /* set connection select to line in (default select for this ADC) */
6211 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x02},
6212 /* set vol=0 Line-Out mixer amp left and right */
6213 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6214 /* unmute pin widget amp left and right (no gain on this amp) */
6215 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6216 /* set vol=0 HP mixer amp left and right */
6217 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6218 /* unmute pin widget amp left and right (no gain on this amp) */
6219 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6220 /* set vol=0 Mono mixer amp left and right */
6221 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6222 /* unmute pin widget amp left and right (no gain on this amp) */
6223 {0x11, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6224 /* unmute LINE-2 out pin */
6225 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6226 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
6229 /* mute analog inputs */
6230 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6231 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6232 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
6233 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
6234 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
6235 /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
6236 /* mute Front out path */
6237 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6238 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6239 /* mute Headphone out path */
6240 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6241 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6242 /* mute Mono out path */
6243 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6244 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6248 #if 0 /* should be identical with alc260_init_verbs? */
6249 static struct hda_verb alc260_hp_init_verbs
[] = {
6250 /* Headphone and output */
6251 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
6253 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
6254 /* Mic1 (rear panel) pin widget for input and vref at 80% */
6255 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
6256 /* Mic2 (front panel) pin widget for input and vref at 80% */
6257 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
6258 /* Line In pin widget for input */
6259 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
6260 /* Line-2 pin widget for output */
6261 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
6262 /* CD pin widget for input */
6263 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
6264 /* unmute amp left and right */
6265 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000},
6266 /* set connection select to line in (default select for this ADC) */
6267 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x02},
6268 /* unmute Line-Out mixer amp left and right (volume = 0) */
6269 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb000},
6270 /* mute pin widget amp left and right (no gain on this amp) */
6271 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
6272 /* unmute HP mixer amp left and right (volume = 0) */
6273 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb000},
6274 /* mute pin widget amp left and right (no gain on this amp) */
6275 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
6276 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
6279 /* mute analog inputs */
6280 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6281 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6282 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
6283 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
6284 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
6285 /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
6286 /* Unmute Front out path */
6287 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
6288 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
6289 /* Unmute Headphone out path */
6290 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
6291 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
6292 /* Unmute Mono out path */
6293 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
6294 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
6299 static struct hda_verb alc260_hp_3013_init_verbs
[] = {
6300 /* Line out and output */
6301 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
6303 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
6304 /* Mic1 (rear panel) pin widget for input and vref at 80% */
6305 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
6306 /* Mic2 (front panel) pin widget for input and vref at 80% */
6307 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
6308 /* Line In pin widget for input */
6309 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
6310 /* Headphone pin widget for output */
6311 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
6312 /* CD pin widget for input */
6313 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
6314 /* unmute amp left and right */
6315 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000},
6316 /* set connection select to line in (default select for this ADC) */
6317 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x02},
6318 /* unmute Line-Out mixer amp left and right (volume = 0) */
6319 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb000},
6320 /* mute pin widget amp left and right (no gain on this amp) */
6321 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
6322 /* unmute HP mixer amp left and right (volume = 0) */
6323 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb000},
6324 /* mute pin widget amp left and right (no gain on this amp) */
6325 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
6326 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
6329 /* mute analog inputs */
6330 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6331 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6332 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
6333 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
6334 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
6335 /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
6336 /* Unmute Front out path */
6337 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
6338 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
6339 /* Unmute Headphone out path */
6340 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
6341 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
6342 /* Unmute Mono out path */
6343 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
6344 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
6348 /* Initialisation sequence for ALC260 as configured in Fujitsu S702x
6349 * laptops. ALC260 pin usage: Mic/Line jack = 0x12, HP jack = 0x14, CD
6350 * audio = 0x16, internal speaker = 0x10.
6352 static struct hda_verb alc260_fujitsu_init_verbs
[] = {
6353 /* Disable all GPIOs */
6354 {0x01, AC_VERB_SET_GPIO_MASK
, 0},
6355 /* Internal speaker is connected to headphone pin */
6356 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
6357 /* Headphone/Line-out jack connects to Line1 pin; make it an output */
6358 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6359 /* Mic/Line-in jack is connected to mic1 pin, so make it an input */
6360 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6361 /* Ensure all other unused pins are disabled and muted. */
6362 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
6363 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6364 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
6365 {0x11, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6366 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
6367 {0x13, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6368 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
6369 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6371 /* Disable digital (SPDIF) pins */
6372 {0x03, AC_VERB_SET_DIGI_CONVERT_1
, 0},
6373 {0x06, AC_VERB_SET_DIGI_CONVERT_1
, 0},
6375 /* Ensure Line1 pin widget takes its input from the OUT1 sum bus
6376 * when acting as an output.
6378 {0x0d, AC_VERB_SET_CONNECT_SEL
, 0},
6380 /* Start with output sum widgets muted and their output gains at min */
6381 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6382 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6383 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6384 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6385 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6386 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6387 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6388 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6389 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6391 /* Unmute HP pin widget amp left and right (no equiv mixer ctrl) */
6392 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6393 /* Unmute Line1 pin widget output buffer since it starts as an output.
6394 * If the pin mode is changed by the user the pin mode control will
6395 * take care of enabling the pin's input/output buffers as needed.
6396 * Therefore there's no need to enable the input buffer at this
6399 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6400 /* Unmute input buffer of pin widget used for Line-in (no equiv
6403 {0x12, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6405 /* Mute capture amp left and right */
6406 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6407 /* Set ADC connection select to match default mixer setting - line
6410 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x00},
6412 /* Do the same for the second ADC: mute capture input amp and
6413 * set ADC connection to line in (on mic1 pin)
6415 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6416 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x00},
6418 /* Mute all inputs to mixer widget (even unconnected ones) */
6419 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)}, /* mic1 pin */
6420 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)}, /* mic2 pin */
6421 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)}, /* line1 pin */
6422 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)}, /* line2 pin */
6423 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)}, /* CD pin */
6424 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)}, /* Beep-gen pin */
6425 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)}, /* Line-out pin */
6426 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)}, /* HP-pin pin */
6431 /* Initialisation sequence for ALC260 as configured in Acer TravelMate and
6432 * similar laptops (adapted from Fujitsu init verbs).
6434 static struct hda_verb alc260_acer_init_verbs
[] = {
6435 /* On TravelMate laptops, GPIO 0 enables the internal speaker and
6436 * the headphone jack. Turn this on and rely on the standard mute
6437 * methods whenever the user wants to turn these outputs off.
6439 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
6440 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
6441 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
6442 /* Internal speaker/Headphone jack is connected to Line-out pin */
6443 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
6444 /* Internal microphone/Mic jack is connected to Mic1 pin */
6445 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
6446 /* Line In jack is connected to Line1 pin */
6447 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6448 /* Some Acers (eg: C20x Tablets) use Mono pin for internal speaker */
6449 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
6450 /* Ensure all other unused pins are disabled and muted. */
6451 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
6452 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6453 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
6454 {0x13, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6455 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
6456 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6457 /* Disable digital (SPDIF) pins */
6458 {0x03, AC_VERB_SET_DIGI_CONVERT_1
, 0},
6459 {0x06, AC_VERB_SET_DIGI_CONVERT_1
, 0},
6461 /* Ensure Mic1 and Line1 pin widgets take input from the OUT1 sum
6462 * bus when acting as outputs.
6464 {0x0b, AC_VERB_SET_CONNECT_SEL
, 0},
6465 {0x0d, AC_VERB_SET_CONNECT_SEL
, 0},
6467 /* Start with output sum widgets muted and their output gains at min */
6468 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6469 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6470 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6471 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6472 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6473 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6474 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6475 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6476 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6478 /* Unmute Line-out pin widget amp left and right
6479 * (no equiv mixer ctrl)
6481 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6482 /* Unmute mono pin widget amp output (no equiv mixer ctrl) */
6483 {0x11, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6484 /* Unmute Mic1 and Line1 pin widget input buffers since they start as
6485 * inputs. If the pin mode is changed by the user the pin mode control
6486 * will take care of enabling the pin's input/output buffers as needed.
6487 * Therefore there's no need to enable the input buffer at this
6490 {0x12, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6491 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6493 /* Mute capture amp left and right */
6494 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6495 /* Set ADC connection select to match default mixer setting - mic
6498 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x00},
6500 /* Do similar with the second ADC: mute capture input amp and
6501 * set ADC connection to mic to match ALSA's default state.
6503 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6504 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x00},
6506 /* Mute all inputs to mixer widget (even unconnected ones) */
6507 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)}, /* mic1 pin */
6508 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)}, /* mic2 pin */
6509 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)}, /* line1 pin */
6510 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)}, /* line2 pin */
6511 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)}, /* CD pin */
6512 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)}, /* Beep-gen pin */
6513 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)}, /* Line-out pin */
6514 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)}, /* HP-pin pin */
6519 /* Initialisation sequence for Maxdata Favorit 100XS
6520 * (adapted from Acer init verbs).
6522 static struct hda_verb alc260_favorit100_init_verbs
[] = {
6523 /* GPIO 0 enables the output jack.
6524 * Turn this on and rely on the standard mute
6525 * methods whenever the user wants to turn these outputs off.
6527 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
6528 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
6529 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
6530 /* Line/Mic input jack is connected to Mic1 pin */
6531 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
6532 /* Ensure all other unused pins are disabled and muted. */
6533 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
6534 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6535 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
6536 {0x11, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6537 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
6538 {0x13, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6539 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
6540 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6541 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
6542 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6543 /* Disable digital (SPDIF) pins */
6544 {0x03, AC_VERB_SET_DIGI_CONVERT_1
, 0},
6545 {0x06, AC_VERB_SET_DIGI_CONVERT_1
, 0},
6547 /* Ensure Mic1 and Line1 pin widgets take input from the OUT1 sum
6548 * bus when acting as outputs.
6550 {0x0b, AC_VERB_SET_CONNECT_SEL
, 0},
6551 {0x0d, AC_VERB_SET_CONNECT_SEL
, 0},
6553 /* Start with output sum widgets muted and their output gains at min */
6554 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6555 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6556 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6557 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6558 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6559 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6560 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6561 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6562 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6564 /* Unmute Line-out pin widget amp left and right
6565 * (no equiv mixer ctrl)
6567 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6568 /* Unmute Mic1 and Line1 pin widget input buffers since they start as
6569 * inputs. If the pin mode is changed by the user the pin mode control
6570 * will take care of enabling the pin's input/output buffers as needed.
6571 * Therefore there's no need to enable the input buffer at this
6574 {0x12, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6576 /* Mute capture amp left and right */
6577 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6578 /* Set ADC connection select to match default mixer setting - mic
6581 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x00},
6583 /* Do similar with the second ADC: mute capture input amp and
6584 * set ADC connection to mic to match ALSA's default state.
6586 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6587 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x00},
6589 /* Mute all inputs to mixer widget (even unconnected ones) */
6590 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)}, /* mic1 pin */
6591 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)}, /* mic2 pin */
6592 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)}, /* line1 pin */
6593 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)}, /* line2 pin */
6594 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)}, /* CD pin */
6595 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)}, /* Beep-gen pin */
6596 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)}, /* Line-out pin */
6597 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)}, /* HP-pin pin */
6602 static struct hda_verb alc260_will_verbs
[] = {
6603 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
6604 {0x0b, AC_VERB_SET_CONNECT_SEL
, 0x00},
6605 {0x0d, AC_VERB_SET_CONNECT_SEL
, 0x00},
6606 {0x0f, AC_VERB_SET_EAPD_BTLENABLE
, 0x02},
6607 {0x1a, AC_VERB_SET_COEF_INDEX
, 0x07},
6608 {0x1a, AC_VERB_SET_PROC_COEF
, 0x3040},
6612 static struct hda_verb alc260_replacer_672v_verbs
[] = {
6613 {0x0f, AC_VERB_SET_EAPD_BTLENABLE
, 0x02},
6614 {0x1a, AC_VERB_SET_COEF_INDEX
, 0x07},
6615 {0x1a, AC_VERB_SET_PROC_COEF
, 0x3050},
6617 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
6618 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
6619 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
6621 {0x0f, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
6625 /* toggle speaker-output according to the hp-jack state */
6626 static void alc260_replacer_672v_automute(struct hda_codec
*codec
)
6628 unsigned int present
;
6630 /* speaker --> GPIO Data 0, hp or spdif --> GPIO data 1 */
6631 present
= snd_hda_jack_detect(codec
, 0x0f);
6633 snd_hda_codec_write_cache(codec
, 0x01, 0,
6634 AC_VERB_SET_GPIO_DATA
, 1);
6635 snd_hda_codec_write_cache(codec
, 0x0f, 0,
6636 AC_VERB_SET_PIN_WIDGET_CONTROL
,
6639 snd_hda_codec_write_cache(codec
, 0x01, 0,
6640 AC_VERB_SET_GPIO_DATA
, 0);
6641 snd_hda_codec_write_cache(codec
, 0x0f, 0,
6642 AC_VERB_SET_PIN_WIDGET_CONTROL
,
6647 static void alc260_replacer_672v_unsol_event(struct hda_codec
*codec
,
6650 if ((res
>> 26) == ALC880_HP_EVENT
)
6651 alc260_replacer_672v_automute(codec
);
6654 static struct hda_verb alc260_hp_dc7600_verbs
[] = {
6655 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x01},
6656 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
6657 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6658 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
6659 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6660 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6661 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6662 {0x10, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
6663 {0x11, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
6664 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
6668 /* Test configuration for debugging, modelled after the ALC880 test
6671 #ifdef CONFIG_SND_DEBUG
6672 static hda_nid_t alc260_test_dac_nids
[1] = {
6675 static hda_nid_t alc260_test_adc_nids
[2] = {
6678 /* For testing the ALC260, each input MUX needs its own definition since
6679 * the signal assignments are different. This assumes that the first ADC
6682 static struct hda_input_mux alc260_test_capture_sources
[2] = {
6686 { "MIC1 pin", 0x0 },
6687 { "MIC2 pin", 0x1 },
6688 { "LINE1 pin", 0x2 },
6689 { "LINE2 pin", 0x3 },
6691 { "LINE-OUT pin", 0x5 },
6692 { "HP-OUT pin", 0x6 },
6698 { "MIC1 pin", 0x0 },
6699 { "MIC2 pin", 0x1 },
6700 { "LINE1 pin", 0x2 },
6701 { "LINE2 pin", 0x3 },
6704 { "LINE-OUT pin", 0x6 },
6705 { "HP-OUT pin", 0x7 },
6709 static struct snd_kcontrol_new alc260_test_mixer
[] = {
6710 /* Output driver widgets */
6711 HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT
),
6712 HDA_BIND_MUTE_MONO("Mono Playback Switch", 0x0a, 1, 2, HDA_INPUT
),
6713 HDA_CODEC_VOLUME("LOUT2 Playback Volume", 0x09, 0x0, HDA_OUTPUT
),
6714 HDA_BIND_MUTE("LOUT2 Playback Switch", 0x09, 2, HDA_INPUT
),
6715 HDA_CODEC_VOLUME("LOUT1 Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
6716 HDA_BIND_MUTE("LOUT1 Playback Switch", 0x08, 2, HDA_INPUT
),
6718 /* Modes for retasking pin widgets
6719 * Note: the ALC260 doesn't seem to act on requests to enable mic
6720 * bias from NIDs 0x0f and 0x10. The ALC260 datasheet doesn't
6721 * mention this restriction. At this stage it's not clear whether
6722 * this behaviour is intentional or is a hardware bug in chip
6723 * revisions available at least up until early 2006. Therefore for
6724 * now allow the "HP-OUT" and "LINE-OUT" Mode controls to span all
6725 * choices, but if it turns out that the lack of mic bias for these
6726 * NIDs is intentional we could change their modes from
6727 * ALC_PIN_DIR_INOUT to ALC_PIN_DIR_INOUT_NOMICBIAS.
6729 ALC_PIN_MODE("HP-OUT pin mode", 0x10, ALC_PIN_DIR_INOUT
),
6730 ALC_PIN_MODE("LINE-OUT pin mode", 0x0f, ALC_PIN_DIR_INOUT
),
6731 ALC_PIN_MODE("LINE2 pin mode", 0x15, ALC_PIN_DIR_INOUT
),
6732 ALC_PIN_MODE("LINE1 pin mode", 0x14, ALC_PIN_DIR_INOUT
),
6733 ALC_PIN_MODE("MIC2 pin mode", 0x13, ALC_PIN_DIR_INOUT
),
6734 ALC_PIN_MODE("MIC1 pin mode", 0x12, ALC_PIN_DIR_INOUT
),
6736 /* Loopback mixer controls */
6737 HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x07, 0x00, HDA_INPUT
),
6738 HDA_CODEC_MUTE("MIC1 Playback Switch", 0x07, 0x00, HDA_INPUT
),
6739 HDA_CODEC_VOLUME("MIC2 Playback Volume", 0x07, 0x01, HDA_INPUT
),
6740 HDA_CODEC_MUTE("MIC2 Playback Switch", 0x07, 0x01, HDA_INPUT
),
6741 HDA_CODEC_VOLUME("LINE1 Playback Volume", 0x07, 0x02, HDA_INPUT
),
6742 HDA_CODEC_MUTE("LINE1 Playback Switch", 0x07, 0x02, HDA_INPUT
),
6743 HDA_CODEC_VOLUME("LINE2 Playback Volume", 0x07, 0x03, HDA_INPUT
),
6744 HDA_CODEC_MUTE("LINE2 Playback Switch", 0x07, 0x03, HDA_INPUT
),
6745 HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT
),
6746 HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT
),
6747 HDA_CODEC_VOLUME("LINE-OUT loopback Playback Volume", 0x07, 0x06, HDA_INPUT
),
6748 HDA_CODEC_MUTE("LINE-OUT loopback Playback Switch", 0x07, 0x06, HDA_INPUT
),
6749 HDA_CODEC_VOLUME("HP-OUT loopback Playback Volume", 0x07, 0x7, HDA_INPUT
),
6750 HDA_CODEC_MUTE("HP-OUT loopback Playback Switch", 0x07, 0x7, HDA_INPUT
),
6752 /* Controls for GPIO pins, assuming they are configured as outputs */
6753 ALC_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
6754 ALC_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
6755 ALC_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
6756 ALC_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
6758 /* Switches to allow the digital IO pins to be enabled. The datasheet
6759 * is ambigious as to which NID is which; testing on laptops which
6760 * make this output available should provide clarification.
6762 ALC_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x03, 0x01),
6763 ALC_SPDIF_CTRL_SWITCH("SPDIF Capture Switch", 0x06, 0x01),
6765 /* A switch allowing EAPD to be enabled. Some laptops seem to use
6766 * this output to turn on an external amplifier.
6768 ALC_EAPD_CTRL_SWITCH("LINE-OUT EAPD Enable Switch", 0x0f, 0x02),
6769 ALC_EAPD_CTRL_SWITCH("HP-OUT EAPD Enable Switch", 0x10, 0x02),
6773 static struct hda_verb alc260_test_init_verbs
[] = {
6774 /* Enable all GPIOs as outputs with an initial value of 0 */
6775 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x0f},
6776 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
6777 {0x01, AC_VERB_SET_GPIO_MASK
, 0x0f},
6779 /* Enable retasking pins as output, initially without power amp */
6780 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6781 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6782 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6783 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6784 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6785 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6787 /* Disable digital (SPDIF) pins initially, but users can enable
6788 * them via a mixer switch. In the case of SPDIF-out, this initverb
6789 * payload also sets the generation to 0, output to be in "consumer"
6790 * PCM format, copyright asserted, no pre-emphasis and no validity
6793 {0x03, AC_VERB_SET_DIGI_CONVERT_1
, 0},
6794 {0x06, AC_VERB_SET_DIGI_CONVERT_1
, 0},
6796 /* Ensure mic1, mic2, line1 and line2 pin widgets take input from the
6797 * OUT1 sum bus when acting as an output.
6799 {0x0b, AC_VERB_SET_CONNECT_SEL
, 0},
6800 {0x0c, AC_VERB_SET_CONNECT_SEL
, 0},
6801 {0x0d, AC_VERB_SET_CONNECT_SEL
, 0},
6802 {0x0e, AC_VERB_SET_CONNECT_SEL
, 0},
6804 /* Start with output sum widgets muted and their output gains at min */
6805 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6806 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6807 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6808 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6809 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6810 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6811 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6812 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6813 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6815 /* Unmute retasking pin widget output buffers since the default
6816 * state appears to be output. As the pin mode is changed by the
6817 * user the pin mode control will take care of enabling the pin's
6818 * input/output buffers as needed.
6820 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6821 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6822 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6823 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6824 {0x13, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6825 {0x12, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6826 /* Also unmute the mono-out pin widget */
6827 {0x11, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6829 /* Mute capture amp left and right */
6830 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6831 /* Set ADC connection select to match default mixer setting (mic1
6834 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x00},
6836 /* Do the same for the second ADC: mute capture input amp and
6837 * set ADC connection to mic1 pin
6839 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6840 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x00},
6842 /* Mute all inputs to mixer widget (even unconnected ones) */
6843 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)}, /* mic1 pin */
6844 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)}, /* mic2 pin */
6845 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)}, /* line1 pin */
6846 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)}, /* line2 pin */
6847 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)}, /* CD pin */
6848 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)}, /* Beep-gen pin */
6849 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)}, /* Line-out pin */
6850 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)}, /* HP-pin pin */
6856 #define alc260_pcm_analog_playback alc880_pcm_analog_alt_playback
6857 #define alc260_pcm_analog_capture alc880_pcm_analog_capture
6859 #define alc260_pcm_digital_playback alc880_pcm_digital_playback
6860 #define alc260_pcm_digital_capture alc880_pcm_digital_capture
6863 * for BIOS auto-configuration
6866 static int alc260_add_playback_controls(struct alc_spec
*spec
, hda_nid_t nid
,
6867 const char *pfx
, int *vol_bits
)
6870 unsigned long vol_val
, sw_val
;
6873 if (nid
>= 0x0f && nid
< 0x11) {
6874 nid_vol
= nid
- 0x7;
6875 vol_val
= HDA_COMPOSE_AMP_VAL(nid_vol
, 3, 0, HDA_OUTPUT
);
6876 sw_val
= HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_OUTPUT
);
6877 } else if (nid
== 0x11) {
6878 nid_vol
= nid
- 0x7;
6879 vol_val
= HDA_COMPOSE_AMP_VAL(nid_vol
, 2, 0, HDA_OUTPUT
);
6880 sw_val
= HDA_COMPOSE_AMP_VAL(nid
, 2, 0, HDA_OUTPUT
);
6881 } else if (nid
>= 0x12 && nid
<= 0x15) {
6883 vol_val
= HDA_COMPOSE_AMP_VAL(nid_vol
, 3, 0, HDA_OUTPUT
);
6884 sw_val
= HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_OUTPUT
);
6888 if (!(*vol_bits
& (1 << nid_vol
))) {
6889 /* first control for the volume widget */
6890 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, pfx
, vol_val
);
6893 *vol_bits
|= (1 << nid_vol
);
6895 err
= add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, pfx
, sw_val
);
6901 /* add playback controls from the parsed DAC table */
6902 static int alc260_auto_create_multi_out_ctls(struct alc_spec
*spec
,
6903 const struct auto_pin_cfg
*cfg
)
6909 spec
->multiout
.num_dacs
= 1;
6910 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
6911 spec
->multiout
.dac_nids
[0] = 0x02;
6913 nid
= cfg
->line_out_pins
[0];
6916 if (!cfg
->speaker_pins
[0] && !cfg
->hp_pins
[0])
6918 else if (cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
6922 err
= alc260_add_playback_controls(spec
, nid
, pfx
, &vols
);
6927 nid
= cfg
->speaker_pins
[0];
6929 err
= alc260_add_playback_controls(spec
, nid
, "Speaker", &vols
);
6934 nid
= cfg
->hp_pins
[0];
6936 err
= alc260_add_playback_controls(spec
, nid
, "Headphone",
6944 /* create playback/capture controls for input pins */
6945 static int alc260_auto_create_input_ctls(struct hda_codec
*codec
,
6946 const struct auto_pin_cfg
*cfg
)
6948 return alc_auto_create_input_ctls(codec
, cfg
, 0x07, 0x04, 0x05);
6951 static void alc260_auto_set_output_and_unmute(struct hda_codec
*codec
,
6952 hda_nid_t nid
, int pin_type
,
6955 alc_set_pin_output(codec
, nid
, pin_type
);
6956 /* need the manual connection? */
6958 int idx
= nid
- 0x12;
6959 snd_hda_codec_write(codec
, idx
+ 0x0b, 0,
6960 AC_VERB_SET_CONNECT_SEL
, sel_idx
);
6964 static void alc260_auto_init_multi_out(struct hda_codec
*codec
)
6966 struct alc_spec
*spec
= codec
->spec
;
6969 nid
= spec
->autocfg
.line_out_pins
[0];
6971 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
6972 alc260_auto_set_output_and_unmute(codec
, nid
, pin_type
, 0);
6975 nid
= spec
->autocfg
.speaker_pins
[0];
6977 alc260_auto_set_output_and_unmute(codec
, nid
, PIN_OUT
, 0);
6979 nid
= spec
->autocfg
.hp_pins
[0];
6981 alc260_auto_set_output_and_unmute(codec
, nid
, PIN_HP
, 0);
6984 #define ALC260_PIN_CD_NID 0x16
6985 static void alc260_auto_init_analog_input(struct hda_codec
*codec
)
6987 struct alc_spec
*spec
= codec
->spec
;
6988 struct auto_pin_cfg
*cfg
= &spec
->autocfg
;
6991 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
6992 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
6994 alc_set_input_pin(codec
, nid
, cfg
->inputs
[i
].type
);
6995 if (nid
!= ALC260_PIN_CD_NID
&&
6996 (get_wcaps(codec
, nid
) & AC_WCAP_OUT_AMP
))
6997 snd_hda_codec_write(codec
, nid
, 0,
6998 AC_VERB_SET_AMP_GAIN_MUTE
,
7004 #define alc260_auto_init_input_src alc880_auto_init_input_src
7007 * generic initialization of ADC, input mixers and output mixers
7009 static struct hda_verb alc260_volume_init_verbs
[] = {
7011 * Unmute ADC0-1 and set the default input to mic-in
7013 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x00},
7014 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7015 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x00},
7016 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7018 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
7020 * Note: PASD motherboards uses the Line In 2 as the input for
7021 * front panel mic (mic 2)
7023 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
7024 /* mute analog inputs */
7025 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7026 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7027 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7028 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7029 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7032 * Set up output mixers (0x08 - 0x0a)
7034 /* set vol=0 to output mixers */
7035 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7036 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7037 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7038 /* set up input amps for analog loopback */
7039 /* Amp Indices: DAC = 0, mixer = 1 */
7040 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7041 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7042 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7043 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7044 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7045 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7050 static int alc260_parse_auto_config(struct hda_codec
*codec
)
7052 struct alc_spec
*spec
= codec
->spec
;
7054 static hda_nid_t alc260_ignore
[] = { 0x17, 0 };
7056 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
7060 err
= alc260_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
7063 if (!spec
->kctls
.list
)
7064 return 0; /* can't find valid BIOS pin config */
7065 err
= alc260_auto_create_input_ctls(codec
, &spec
->autocfg
);
7069 spec
->multiout
.max_channels
= 2;
7071 if (spec
->autocfg
.dig_outs
)
7072 spec
->multiout
.dig_out_nid
= ALC260_DIGOUT_NID
;
7073 if (spec
->kctls
.list
)
7074 add_mixer(spec
, spec
->kctls
.list
);
7076 add_verb(spec
, alc260_volume_init_verbs
);
7078 spec
->num_mux_defs
= 1;
7079 spec
->input_mux
= &spec
->private_imux
[0];
7081 alc_ssid_check(codec
, 0x10, 0x15, 0x0f, 0);
7086 /* additional initialization for auto-configuration model */
7087 static void alc260_auto_init(struct hda_codec
*codec
)
7089 struct alc_spec
*spec
= codec
->spec
;
7090 alc260_auto_init_multi_out(codec
);
7091 alc260_auto_init_analog_input(codec
);
7092 alc260_auto_init_input_src(codec
);
7093 alc_auto_init_digital(codec
);
7094 if (spec
->unsol_event
)
7095 alc_inithook(codec
);
7098 #ifdef CONFIG_SND_HDA_POWER_SAVE
7099 static struct hda_amp_list alc260_loopbacks
[] = {
7100 { 0x07, HDA_INPUT
, 0 },
7101 { 0x07, HDA_INPUT
, 1 },
7102 { 0x07, HDA_INPUT
, 2 },
7103 { 0x07, HDA_INPUT
, 3 },
7104 { 0x07, HDA_INPUT
, 4 },
7116 static const struct alc_fixup alc260_fixups
[] = {
7117 [PINFIX_HP_DC5750
] = {
7118 .type
= ALC_FIXUP_PINS
,
7119 .v
.pins
= (const struct alc_pincfg
[]) {
7120 { 0x11, 0x90130110 }, /* speaker */
7126 static struct snd_pci_quirk alc260_fixup_tbl
[] = {
7127 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", PINFIX_HP_DC5750
),
7132 * ALC260 configurations
7134 static const char * const alc260_models
[ALC260_MODEL_LAST
] = {
7135 [ALC260_BASIC
] = "basic",
7137 [ALC260_HP_3013
] = "hp-3013",
7138 [ALC260_HP_DC7600
] = "hp-dc7600",
7139 [ALC260_FUJITSU_S702X
] = "fujitsu",
7140 [ALC260_ACER
] = "acer",
7141 [ALC260_WILL
] = "will",
7142 [ALC260_REPLACER_672V
] = "replacer",
7143 [ALC260_FAVORIT100
] = "favorit100",
7144 #ifdef CONFIG_SND_DEBUG
7145 [ALC260_TEST
] = "test",
7147 [ALC260_AUTO
] = "auto",
7150 static struct snd_pci_quirk alc260_cfg_tbl
[] = {
7151 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_ACER
),
7152 SND_PCI_QUIRK(0x1025, 0x007f, "Acer", ALC260_WILL
),
7153 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER
),
7154 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FAVORIT100
),
7155 SND_PCI_QUIRK(0x103c, 0x2808, "HP d5700", ALC260_HP_3013
),
7156 SND_PCI_QUIRK(0x103c, 0x280a, "HP d5750", ALC260_AUTO
), /* no quirk */
7157 SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013
),
7158 SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP_3013
),
7159 SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_DC7600
),
7160 SND_PCI_QUIRK(0x103c, 0x3013, "HP", ALC260_HP_3013
),
7161 SND_PCI_QUIRK(0x103c, 0x3014, "HP", ALC260_HP
),
7162 SND_PCI_QUIRK(0x103c, 0x3015, "HP", ALC260_HP
),
7163 SND_PCI_QUIRK(0x103c, 0x3016, "HP", ALC260_HP
),
7164 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_BASIC
),
7165 SND_PCI_QUIRK(0x104d, 0x81cc, "Sony VAIO", ALC260_BASIC
),
7166 SND_PCI_QUIRK(0x104d, 0x81cd, "Sony VAIO", ALC260_BASIC
),
7167 SND_PCI_QUIRK(0x10cf, 0x1326, "Fujitsu S702X", ALC260_FUJITSU_S702X
),
7168 SND_PCI_QUIRK(0x152d, 0x0729, "CTL U553W", ALC260_BASIC
),
7169 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_REPLACER_672V
),
7170 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_WILL
),
7174 static struct alc_config_preset alc260_presets
[] = {
7176 .mixers
= { alc260_base_output_mixer
,
7177 alc260_input_mixer
},
7178 .init_verbs
= { alc260_init_verbs
},
7179 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
7180 .dac_nids
= alc260_dac_nids
,
7181 .num_adc_nids
= ARRAY_SIZE(alc260_dual_adc_nids
),
7182 .adc_nids
= alc260_dual_adc_nids
,
7183 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
7184 .channel_mode
= alc260_modes
,
7185 .input_mux
= &alc260_capture_source
,
7188 .mixers
= { alc260_hp_output_mixer
,
7189 alc260_input_mixer
},
7190 .init_verbs
= { alc260_init_verbs
,
7191 alc260_hp_unsol_verbs
},
7192 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
7193 .dac_nids
= alc260_dac_nids
,
7194 .num_adc_nids
= ARRAY_SIZE(alc260_adc_nids_alt
),
7195 .adc_nids
= alc260_adc_nids_alt
,
7196 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
7197 .channel_mode
= alc260_modes
,
7198 .input_mux
= &alc260_capture_source
,
7199 .unsol_event
= alc260_hp_unsol_event
,
7200 .init_hook
= alc260_hp_automute
,
7202 [ALC260_HP_DC7600
] = {
7203 .mixers
= { alc260_hp_dc7600_mixer
,
7204 alc260_input_mixer
},
7205 .init_verbs
= { alc260_init_verbs
,
7206 alc260_hp_dc7600_verbs
},
7207 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
7208 .dac_nids
= alc260_dac_nids
,
7209 .num_adc_nids
= ARRAY_SIZE(alc260_adc_nids_alt
),
7210 .adc_nids
= alc260_adc_nids_alt
,
7211 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
7212 .channel_mode
= alc260_modes
,
7213 .input_mux
= &alc260_capture_source
,
7214 .unsol_event
= alc260_hp_3012_unsol_event
,
7215 .init_hook
= alc260_hp_3012_automute
,
7217 [ALC260_HP_3013
] = {
7218 .mixers
= { alc260_hp_3013_mixer
,
7219 alc260_input_mixer
},
7220 .init_verbs
= { alc260_hp_3013_init_verbs
,
7221 alc260_hp_3013_unsol_verbs
},
7222 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
7223 .dac_nids
= alc260_dac_nids
,
7224 .num_adc_nids
= ARRAY_SIZE(alc260_adc_nids_alt
),
7225 .adc_nids
= alc260_adc_nids_alt
,
7226 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
7227 .channel_mode
= alc260_modes
,
7228 .input_mux
= &alc260_capture_source
,
7229 .unsol_event
= alc260_hp_3013_unsol_event
,
7230 .init_hook
= alc260_hp_3013_automute
,
7232 [ALC260_FUJITSU_S702X
] = {
7233 .mixers
= { alc260_fujitsu_mixer
},
7234 .init_verbs
= { alc260_fujitsu_init_verbs
},
7235 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
7236 .dac_nids
= alc260_dac_nids
,
7237 .num_adc_nids
= ARRAY_SIZE(alc260_dual_adc_nids
),
7238 .adc_nids
= alc260_dual_adc_nids
,
7239 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
7240 .channel_mode
= alc260_modes
,
7241 .num_mux_defs
= ARRAY_SIZE(alc260_fujitsu_capture_sources
),
7242 .input_mux
= alc260_fujitsu_capture_sources
,
7245 .mixers
= { alc260_acer_mixer
},
7246 .init_verbs
= { alc260_acer_init_verbs
},
7247 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
7248 .dac_nids
= alc260_dac_nids
,
7249 .num_adc_nids
= ARRAY_SIZE(alc260_dual_adc_nids
),
7250 .adc_nids
= alc260_dual_adc_nids
,
7251 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
7252 .channel_mode
= alc260_modes
,
7253 .num_mux_defs
= ARRAY_SIZE(alc260_acer_capture_sources
),
7254 .input_mux
= alc260_acer_capture_sources
,
7256 [ALC260_FAVORIT100
] = {
7257 .mixers
= { alc260_favorit100_mixer
},
7258 .init_verbs
= { alc260_favorit100_init_verbs
},
7259 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
7260 .dac_nids
= alc260_dac_nids
,
7261 .num_adc_nids
= ARRAY_SIZE(alc260_dual_adc_nids
),
7262 .adc_nids
= alc260_dual_adc_nids
,
7263 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
7264 .channel_mode
= alc260_modes
,
7265 .num_mux_defs
= ARRAY_SIZE(alc260_favorit100_capture_sources
),
7266 .input_mux
= alc260_favorit100_capture_sources
,
7269 .mixers
= { alc260_will_mixer
},
7270 .init_verbs
= { alc260_init_verbs
, alc260_will_verbs
},
7271 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
7272 .dac_nids
= alc260_dac_nids
,
7273 .num_adc_nids
= ARRAY_SIZE(alc260_adc_nids
),
7274 .adc_nids
= alc260_adc_nids
,
7275 .dig_out_nid
= ALC260_DIGOUT_NID
,
7276 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
7277 .channel_mode
= alc260_modes
,
7278 .input_mux
= &alc260_capture_source
,
7280 [ALC260_REPLACER_672V
] = {
7281 .mixers
= { alc260_replacer_672v_mixer
},
7282 .init_verbs
= { alc260_init_verbs
, alc260_replacer_672v_verbs
},
7283 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
7284 .dac_nids
= alc260_dac_nids
,
7285 .num_adc_nids
= ARRAY_SIZE(alc260_adc_nids
),
7286 .adc_nids
= alc260_adc_nids
,
7287 .dig_out_nid
= ALC260_DIGOUT_NID
,
7288 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
7289 .channel_mode
= alc260_modes
,
7290 .input_mux
= &alc260_capture_source
,
7291 .unsol_event
= alc260_replacer_672v_unsol_event
,
7292 .init_hook
= alc260_replacer_672v_automute
,
7294 #ifdef CONFIG_SND_DEBUG
7296 .mixers
= { alc260_test_mixer
},
7297 .init_verbs
= { alc260_test_init_verbs
},
7298 .num_dacs
= ARRAY_SIZE(alc260_test_dac_nids
),
7299 .dac_nids
= alc260_test_dac_nids
,
7300 .num_adc_nids
= ARRAY_SIZE(alc260_test_adc_nids
),
7301 .adc_nids
= alc260_test_adc_nids
,
7302 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
7303 .channel_mode
= alc260_modes
,
7304 .num_mux_defs
= ARRAY_SIZE(alc260_test_capture_sources
),
7305 .input_mux
= alc260_test_capture_sources
,
7310 static int patch_alc260(struct hda_codec
*codec
)
7312 struct alc_spec
*spec
;
7313 int err
, board_config
;
7315 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
7321 board_config
= snd_hda_check_board_config(codec
, ALC260_MODEL_LAST
,
7324 if (board_config
< 0) {
7325 snd_printd(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
7327 board_config
= ALC260_AUTO
;
7330 if (board_config
== ALC260_AUTO
) {
7331 alc_pick_fixup(codec
, NULL
, alc260_fixup_tbl
, alc260_fixups
);
7332 alc_apply_fixup(codec
, ALC_FIXUP_ACT_PRE_PROBE
);
7335 if (board_config
== ALC260_AUTO
) {
7336 /* automatic parse from the BIOS config */
7337 err
= alc260_parse_auto_config(codec
);
7343 "hda_codec: Cannot set up configuration "
7344 "from BIOS. Using base mode...\n");
7345 board_config
= ALC260_BASIC
;
7349 err
= snd_hda_attach_beep_device(codec
, 0x1);
7355 if (board_config
!= ALC260_AUTO
)
7356 setup_preset(codec
, &alc260_presets
[board_config
]);
7358 spec
->stream_analog_playback
= &alc260_pcm_analog_playback
;
7359 spec
->stream_analog_capture
= &alc260_pcm_analog_capture
;
7360 spec
->stream_analog_alt_capture
= &alc260_pcm_analog_capture
;
7362 spec
->stream_digital_playback
= &alc260_pcm_digital_playback
;
7363 spec
->stream_digital_capture
= &alc260_pcm_digital_capture
;
7365 if (!spec
->adc_nids
&& spec
->input_mux
) {
7366 /* check whether NID 0x04 is valid */
7367 unsigned int wcap
= get_wcaps(codec
, 0x04);
7368 wcap
= get_wcaps_type(wcap
);
7370 if (wcap
!= AC_WID_AUD_IN
|| spec
->input_mux
->num_items
== 1) {
7371 spec
->adc_nids
= alc260_adc_nids_alt
;
7372 spec
->num_adc_nids
= ARRAY_SIZE(alc260_adc_nids_alt
);
7374 spec
->adc_nids
= alc260_adc_nids
;
7375 spec
->num_adc_nids
= ARRAY_SIZE(alc260_adc_nids
);
7378 set_capture_mixer(codec
);
7379 set_beep_amp(spec
, 0x07, 0x05, HDA_INPUT
);
7381 alc_apply_fixup(codec
, ALC_FIXUP_ACT_PROBE
);
7383 spec
->vmaster_nid
= 0x08;
7385 codec
->patch_ops
= alc_patch_ops
;
7386 if (board_config
== ALC260_AUTO
)
7387 spec
->init_hook
= alc260_auto_init
;
7388 #ifdef CONFIG_SND_HDA_POWER_SAVE
7389 if (!spec
->loopback
.amplist
)
7390 spec
->loopback
.amplist
= alc260_loopbacks
;
7398 * ALC882/883/885/888/889 support
7400 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
7401 * configuration. Each pin widget can choose any input DACs and a mixer.
7402 * Each ADC is connected from a mixer of all inputs. This makes possible
7403 * 6-channel independent captures.
7405 * In addition, an independent DAC for the multi-playback (not used in this
7408 #define ALC882_DIGOUT_NID 0x06
7409 #define ALC882_DIGIN_NID 0x0a
7410 #define ALC883_DIGOUT_NID ALC882_DIGOUT_NID
7411 #define ALC883_DIGIN_NID ALC882_DIGIN_NID
7412 #define ALC1200_DIGOUT_NID 0x10
7415 static struct hda_channel_mode alc882_ch_modes
[1] = {
7420 static hda_nid_t alc882_dac_nids
[4] = {
7421 /* front, rear, clfe, rear_surr */
7422 0x02, 0x03, 0x04, 0x05
7424 #define alc883_dac_nids alc882_dac_nids
7427 #define alc882_adc_nids alc880_adc_nids
7428 #define alc882_adc_nids_alt alc880_adc_nids_alt
7429 #define alc883_adc_nids alc882_adc_nids_alt
7430 static hda_nid_t alc883_adc_nids_alt
[1] = { 0x08 };
7431 static hda_nid_t alc883_adc_nids_rev
[2] = { 0x09, 0x08 };
7432 #define alc889_adc_nids alc880_adc_nids
7434 static hda_nid_t alc882_capsrc_nids
[3] = { 0x24, 0x23, 0x22 };
7435 static hda_nid_t alc882_capsrc_nids_alt
[2] = { 0x23, 0x22 };
7436 #define alc883_capsrc_nids alc882_capsrc_nids_alt
7437 static hda_nid_t alc883_capsrc_nids_rev
[2] = { 0x22, 0x23 };
7438 #define alc889_capsrc_nids alc882_capsrc_nids
7441 /* FIXME: should be a matrix-type input source selection */
7443 static struct hda_input_mux alc882_capture_source
= {
7447 { "Front Mic", 0x1 },
7453 #define alc883_capture_source alc882_capture_source
7455 static struct hda_input_mux alc889_capture_source
= {
7458 { "Front Mic", 0x0 },
7464 static struct hda_input_mux mb5_capture_source
= {
7473 static struct hda_input_mux macmini3_capture_source
= {
7481 static struct hda_input_mux alc883_3stack_6ch_intel
= {
7485 { "Front Mic", 0x0 },
7491 static struct hda_input_mux alc883_lenovo_101e_capture_source
= {
7499 static struct hda_input_mux alc883_lenovo_nb0763_capture_source
= {
7503 { "Internal Mic", 0x1 },
7509 static struct hda_input_mux alc883_fujitsu_pi2515_capture_source
= {
7513 { "Internal Mic", 0x1 },
7517 static struct hda_input_mux alc883_lenovo_sky_capture_source
= {
7521 { "Front Mic", 0x1 },
7526 static struct hda_input_mux alc883_asus_eee1601_capture_source
= {
7534 static struct hda_input_mux alc889A_mb31_capture_source
= {
7538 /* Front Mic (0x01) unused */
7540 /* Line 2 (0x03) unused */
7541 /* CD (0x04) unused? */
7545 static struct hda_input_mux alc889A_imac91_capture_source
= {
7549 { "Line", 0x2 }, /* Not sure! */
7556 static struct hda_channel_mode alc883_3ST_2ch_modes
[1] = {
7563 static struct hda_verb alc882_3ST_ch2_init
[] = {
7564 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7565 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7566 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7567 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7574 static struct hda_verb alc882_3ST_ch4_init
[] = {
7575 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7576 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7577 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7578 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7579 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
7586 static struct hda_verb alc882_3ST_ch6_init
[] = {
7587 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7588 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7589 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
7590 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7591 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7592 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
7596 static struct hda_channel_mode alc882_3ST_6ch_modes
[3] = {
7597 { 2, alc882_3ST_ch2_init
},
7598 { 4, alc882_3ST_ch4_init
},
7599 { 6, alc882_3ST_ch6_init
},
7602 #define alc883_3ST_6ch_modes alc882_3ST_6ch_modes
7607 static struct hda_verb alc883_3ST_ch2_clevo_init
[] = {
7608 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7609 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7610 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7611 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7612 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7619 static struct hda_verb alc883_3ST_ch4_clevo_init
[] = {
7620 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7621 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7622 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7623 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7624 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7625 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
7632 static struct hda_verb alc883_3ST_ch6_clevo_init
[] = {
7633 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7634 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7635 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7636 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
7637 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7638 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7639 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
7643 static struct hda_channel_mode alc883_3ST_6ch_clevo_modes
[3] = {
7644 { 2, alc883_3ST_ch2_clevo_init
},
7645 { 4, alc883_3ST_ch4_clevo_init
},
7646 { 6, alc883_3ST_ch6_clevo_init
},
7653 static struct hda_verb alc882_sixstack_ch6_init
[] = {
7654 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
7655 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7656 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7657 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7664 static struct hda_verb alc882_sixstack_ch8_init
[] = {
7665 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7666 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7667 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7668 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7672 static struct hda_channel_mode alc882_sixstack_modes
[2] = {
7673 { 6, alc882_sixstack_ch6_init
},
7674 { 8, alc882_sixstack_ch8_init
},
7678 /* Macbook Air 2,1 */
7680 static struct hda_channel_mode alc885_mba21_ch_modes
[1] = {
7685 * macbook pro ALC885 can switch LineIn to LineOut without losing Mic
7691 static struct hda_verb alc885_mbp_ch2_init
[] = {
7692 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7693 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7694 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7701 static struct hda_verb alc885_mbp_ch4_init
[] = {
7702 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7703 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7704 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
7705 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7706 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7710 static struct hda_channel_mode alc885_mbp_4ch_modes
[2] = {
7711 { 2, alc885_mbp_ch2_init
},
7712 { 4, alc885_mbp_ch4_init
},
7717 * Speakers/Woofer/HP = Front
7720 static struct hda_verb alc885_mb5_ch2_init
[] = {
7721 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7722 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7728 * Speakers/HP = Front
7732 static struct hda_verb alc885_mb5_ch6_init
[] = {
7733 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7734 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7735 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
7739 static struct hda_channel_mode alc885_mb5_6ch_modes
[2] = {
7740 { 2, alc885_mb5_ch2_init
},
7741 { 6, alc885_mb5_ch6_init
},
7744 #define alc885_macmini3_6ch_modes alc885_mb5_6ch_modes
7749 static struct hda_verb alc883_4ST_ch2_init
[] = {
7750 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7751 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7752 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7753 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7754 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7755 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7762 static struct hda_verb alc883_4ST_ch4_init
[] = {
7763 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7764 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7765 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7766 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7767 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7768 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7769 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
7776 static struct hda_verb alc883_4ST_ch6_init
[] = {
7777 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7778 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7779 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7780 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7781 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
7782 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7783 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7784 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
7791 static struct hda_verb alc883_4ST_ch8_init
[] = {
7792 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7793 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7794 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x03 },
7795 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7796 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7797 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
7798 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7799 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7800 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
7804 static struct hda_channel_mode alc883_4ST_8ch_modes
[4] = {
7805 { 2, alc883_4ST_ch2_init
},
7806 { 4, alc883_4ST_ch4_init
},
7807 { 6, alc883_4ST_ch6_init
},
7808 { 8, alc883_4ST_ch8_init
},
7815 static struct hda_verb alc883_3ST_ch2_intel_init
[] = {
7816 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7817 { 0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7818 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7819 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7826 static struct hda_verb alc883_3ST_ch4_intel_init
[] = {
7827 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7828 { 0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7829 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7830 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7831 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
7838 static struct hda_verb alc883_3ST_ch6_intel_init
[] = {
7839 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7840 { 0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7841 { 0x19, AC_VERB_SET_CONNECT_SEL
, 0x02 },
7842 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7843 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7844 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
7848 static struct hda_channel_mode alc883_3ST_6ch_intel_modes
[3] = {
7849 { 2, alc883_3ST_ch2_intel_init
},
7850 { 4, alc883_3ST_ch4_intel_init
},
7851 { 6, alc883_3ST_ch6_intel_init
},
7857 static struct hda_verb alc889_ch2_intel_init
[] = {
7858 { 0x14, AC_VERB_SET_CONNECT_SEL
, 0x00 },
7859 { 0x19, AC_VERB_SET_CONNECT_SEL
, 0x00 },
7860 { 0x16, AC_VERB_SET_CONNECT_SEL
, 0x00 },
7861 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x00 },
7862 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7863 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7870 static struct hda_verb alc889_ch6_intel_init
[] = {
7871 { 0x14, AC_VERB_SET_CONNECT_SEL
, 0x00 },
7872 { 0x19, AC_VERB_SET_CONNECT_SEL
, 0x01 },
7873 { 0x16, AC_VERB_SET_CONNECT_SEL
, 0x02 },
7874 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x03 },
7875 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7876 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7883 static struct hda_verb alc889_ch8_intel_init
[] = {
7884 { 0x14, AC_VERB_SET_CONNECT_SEL
, 0x00 },
7885 { 0x19, AC_VERB_SET_CONNECT_SEL
, 0x01 },
7886 { 0x16, AC_VERB_SET_CONNECT_SEL
, 0x02 },
7887 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x03 },
7888 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x03 },
7889 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7890 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7894 static struct hda_channel_mode alc889_8ch_intel_modes
[3] = {
7895 { 2, alc889_ch2_intel_init
},
7896 { 6, alc889_ch6_intel_init
},
7897 { 8, alc889_ch8_intel_init
},
7903 static struct hda_verb alc883_sixstack_ch6_init
[] = {
7904 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
7905 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7906 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7907 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7914 static struct hda_verb alc883_sixstack_ch8_init
[] = {
7915 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7916 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7917 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7918 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7922 static struct hda_channel_mode alc883_sixstack_modes
[2] = {
7923 { 6, alc883_sixstack_ch6_init
},
7924 { 8, alc883_sixstack_ch8_init
},
7928 /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
7929 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
7931 static struct snd_kcontrol_new alc882_base_mixer
[] = {
7932 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7933 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7934 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7935 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
7936 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
7937 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
7938 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
7939 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
7940 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
7941 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
7942 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7943 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7944 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7945 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7946 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7947 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7948 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
7949 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7950 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7951 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
7952 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7956 /* Macbook Air 2,1 same control for HP and internal Speaker */
7958 static struct snd_kcontrol_new alc885_mba21_mixer
[] = {
7959 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT
),
7960 HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 0x02, HDA_OUTPUT
),
7965 static struct snd_kcontrol_new alc885_mbp3_mixer
[] = {
7966 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT
),
7967 HDA_BIND_MUTE ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT
),
7968 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0e, 0x00, HDA_OUTPUT
),
7969 HDA_BIND_MUTE ("Headphone Playback Switch", 0x0e, 0x02, HDA_INPUT
),
7970 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT
),
7971 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7972 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7973 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT
),
7974 HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT
),
7975 HDA_CODEC_VOLUME("Line Boost Volume", 0x1a, 0x00, HDA_INPUT
),
7976 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0x00, HDA_INPUT
),
7980 static struct snd_kcontrol_new alc885_mb5_mixer
[] = {
7981 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT
),
7982 HDA_BIND_MUTE ("Front Playback Switch", 0x0c, 0x02, HDA_INPUT
),
7983 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT
),
7984 HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT
),
7985 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT
),
7986 HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT
),
7987 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0f, 0x00, HDA_OUTPUT
),
7988 HDA_BIND_MUTE ("Headphone Playback Switch", 0x0f, 0x02, HDA_INPUT
),
7989 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x07, HDA_INPUT
),
7990 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x07, HDA_INPUT
),
7991 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
7992 HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
7993 HDA_CODEC_VOLUME("Line Boost Volume", 0x15, 0x00, HDA_INPUT
),
7994 HDA_CODEC_VOLUME("Mic Boost Volume", 0x19, 0x00, HDA_INPUT
),
7998 static struct snd_kcontrol_new alc885_macmini3_mixer
[] = {
7999 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT
),
8000 HDA_BIND_MUTE ("Front Playback Switch", 0x0c, 0x02, HDA_INPUT
),
8001 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT
),
8002 HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT
),
8003 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT
),
8004 HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT
),
8005 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0f, 0x00, HDA_OUTPUT
),
8006 HDA_BIND_MUTE ("Headphone Playback Switch", 0x0f, 0x02, HDA_INPUT
),
8007 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x07, HDA_INPUT
),
8008 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x07, HDA_INPUT
),
8009 HDA_CODEC_VOLUME("Line Boost Volume", 0x15, 0x00, HDA_INPUT
),
8013 static struct snd_kcontrol_new alc885_imac91_mixer
[] = {
8014 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT
),
8015 HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT
),
8020 static struct snd_kcontrol_new alc882_w2jc_mixer
[] = {
8021 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8022 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8023 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8024 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8025 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8026 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8027 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8028 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
8029 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8033 static struct snd_kcontrol_new alc882_targa_mixer
[] = {
8034 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8035 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8036 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
8037 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8038 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8039 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8040 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8041 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8042 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8043 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
8044 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
8045 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
8046 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
8050 /* Pin assignment: Front=0x14, HP = 0x15, Front = 0x16, ???
8051 * Front Mic=0x18, Line In = 0x1a, Line In = 0x1b, CD = 0x1c
8053 static struct snd_kcontrol_new alc882_asus_a7j_mixer
[] = {
8054 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8055 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
8056 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
8057 HDA_CODEC_MUTE("Mobile Front Playback Switch", 0x16, 0x0, HDA_OUTPUT
),
8058 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8059 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8060 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8061 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8062 HDA_CODEC_VOLUME("Mobile Line Playback Volume", 0x0b, 0x03, HDA_INPUT
),
8063 HDA_CODEC_MUTE("Mobile Line Playback Switch", 0x0b, 0x03, HDA_INPUT
),
8064 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8065 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8066 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
8070 static struct snd_kcontrol_new alc882_asus_a7m_mixer
[] = {
8071 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8072 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8073 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
8074 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8075 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8076 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8077 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8078 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8079 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
8080 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8084 static struct snd_kcontrol_new alc882_chmode_mixer
[] = {
8086 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
8087 .name
= "Channel Mode",
8088 .info
= alc_ch_mode_info
,
8089 .get
= alc_ch_mode_get
,
8090 .put
= alc_ch_mode_put
,
8095 static struct hda_verb alc882_base_init_verbs
[] = {
8096 /* Front mixer: unmute input/output amp left and right (volume = 0) */
8097 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8098 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8100 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8101 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8103 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8104 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8106 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8107 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8109 /* Front Pin: output 0 (0x0c) */
8110 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8111 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8112 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
8113 /* Rear Pin: output 1 (0x0d) */
8114 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8115 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8116 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
8117 /* CLFE Pin: output 2 (0x0e) */
8118 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8119 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8120 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x02},
8121 /* Side Pin: output 3 (0x0f) */
8122 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8123 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8124 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
8125 /* Mic (rear) pin: input vref at 80% */
8126 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
8127 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8128 /* Front Mic pin: input vref at 80% */
8129 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
8130 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8131 /* Line In pin: input */
8132 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
8133 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8134 /* Line-2 In: Headphone output (output 0 - 0x0c) */
8135 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8136 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8137 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
8138 /* CD pin widget for input */
8139 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
8141 /* FIXME: use matrix-type input source selection */
8142 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
8144 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8146 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8147 /* ADC2: mute amp left and right */
8148 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8149 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
8150 /* ADC3: mute amp left and right */
8151 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8152 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
8157 static struct hda_verb alc882_adc1_init_verbs
[] = {
8158 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
8159 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8160 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
8161 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
8162 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
8163 /* ADC1: mute amp left and right */
8164 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8165 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
8169 static struct hda_verb alc882_eapd_verbs
[] = {
8170 /* change to EAPD mode */
8171 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
8172 {0x20, AC_VERB_SET_PROC_COEF
, 0x3060},
8176 static struct hda_verb alc889_eapd_verbs
[] = {
8177 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
8178 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
8182 static struct hda_verb alc_hp15_unsol_verbs
[] = {
8183 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
8184 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8188 static struct hda_verb alc885_init_verbs
[] = {
8189 /* Front mixer: unmute input/output amp left and right (volume = 0) */
8190 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8191 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8193 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8194 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8196 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8197 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8199 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8200 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8202 /* Front HP Pin: output 0 (0x0c) */
8203 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8204 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8205 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8206 /* Front Pin: output 0 (0x0c) */
8207 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8208 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8209 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
8210 /* Rear Pin: output 1 (0x0d) */
8211 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8212 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8213 {0x19, AC_VERB_SET_CONNECT_SEL
, 0x01},
8214 /* CLFE Pin: output 2 (0x0e) */
8215 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8216 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8217 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x02},
8218 /* Side Pin: output 3 (0x0f) */
8219 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8220 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8221 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
8222 /* Mic (rear) pin: input vref at 80% */
8223 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
8224 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8225 /* Front Mic pin: input vref at 80% */
8226 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
8227 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8228 /* Line In pin: input */
8229 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
8230 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8232 /* Mixer elements: 0x18, , 0x1a, 0x1b */
8234 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8236 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8238 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8239 /* ADC2: mute amp left and right */
8240 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8241 /* ADC3: mute amp left and right */
8242 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8247 static struct hda_verb alc885_init_input_verbs
[] = {
8248 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8249 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
8250 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
8255 /* Unmute Selector 24h and set the default input to front mic */
8256 static struct hda_verb alc889_init_input_verbs
[] = {
8257 {0x24, AC_VERB_SET_CONNECT_SEL
, 0x00},
8258 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8263 #define alc883_init_verbs alc882_base_init_verbs
8266 static struct snd_kcontrol_new alc882_macpro_mixer
[] = {
8267 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8268 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8269 HDA_CODEC_MUTE("Headphone Playback Switch", 0x18, 0x0, HDA_OUTPUT
),
8270 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT
),
8271 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT
),
8272 /* FIXME: this looks suspicious...
8273 HDA_CODEC_VOLUME("Beep Playback Volume", 0x0b, 0x02, HDA_INPUT),
8274 HDA_CODEC_MUTE("Beep Playback Switch", 0x0b, 0x02, HDA_INPUT),
8279 static struct hda_verb alc882_macpro_init_verbs
[] = {
8280 /* Front mixer: unmute input/output amp left and right (volume = 0) */
8281 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8282 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8283 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8284 /* Front Pin: output 0 (0x0c) */
8285 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8286 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8287 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8288 /* Front Mic pin: input vref at 80% */
8289 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
8290 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8291 /* Speaker: output */
8292 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8293 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8294 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x04},
8295 /* Headphone output (output 0 - 0x0c) */
8296 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8297 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8298 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x00},
8300 /* FIXME: use matrix-type input source selection */
8301 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
8302 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
8303 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8304 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
8305 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
8306 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
8308 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8309 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
8310 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
8311 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
8313 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8314 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
8315 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
8316 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
8317 /* ADC1: mute amp left and right */
8318 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8319 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
8320 /* ADC2: mute amp left and right */
8321 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8322 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
8323 /* ADC3: mute amp left and right */
8324 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8325 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
8331 static struct hda_verb alc885_mb5_init_verbs
[] = {
8333 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8334 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8335 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8336 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8338 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8339 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8340 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8341 /* Surround mixer */
8342 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8343 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8344 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8346 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8347 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8348 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8350 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8351 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8352 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8353 /* Front Pin (0x0c) */
8354 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
| 0x01},
8355 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8356 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x00},
8357 /* LFE Pin (0x0e) */
8358 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
| 0x01},
8359 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8360 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x02},
8362 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8363 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8364 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x03},
8365 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8366 /* Front Mic pin: input vref at 80% */
8367 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
8368 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8370 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
8371 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8373 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0x1)},
8374 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0x7)},
8375 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0x4)},
8380 static struct hda_verb alc885_macmini3_init_verbs
[] = {
8382 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8383 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8384 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8385 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8387 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8388 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8389 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8390 /* Surround mixer */
8391 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8392 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8393 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8395 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8396 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8397 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8399 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8400 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8401 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8402 /* Front Pin (0x0c) */
8403 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
| 0x01},
8404 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8405 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x00},
8406 /* LFE Pin (0x0e) */
8407 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
| 0x01},
8408 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8409 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x02},
8411 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8412 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8413 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x03},
8414 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8416 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
8417 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8419 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8420 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
8421 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
8422 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
8427 static struct hda_verb alc885_mba21_init_verbs
[] = {
8428 /*Internal and HP Speaker Mixer*/
8429 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8430 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8431 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8432 /*Internal Speaker Pin (0x0c)*/
8433 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, (PIN_OUT
| AC_PINCTL_VREF_50
) },
8434 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8435 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x00},
8436 /* HP Pin: output 0 (0x0e) */
8437 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc4},
8438 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8439 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
8440 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, (ALC880_HP_EVENT
| AC_USRSP_EN
)},
8441 /* Line in (is hp when jack connected)*/
8442 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, AC_PINCTL_VREF_50
},
8443 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8449 /* Macbook Pro rev3 */
8450 static struct hda_verb alc885_mbp3_init_verbs
[] = {
8451 /* Front mixer: unmute input/output amp left and right (volume = 0) */
8452 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8453 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8454 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8456 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8457 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8458 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8460 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8461 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8462 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8463 /* Front Pin: output 0 (0x0c) */
8464 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8465 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8466 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
8467 /* HP Pin: output 0 (0x0e) */
8468 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc4},
8469 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8470 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x02},
8471 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8472 /* Mic (rear) pin: input vref at 80% */
8473 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
8474 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8475 /* Front Mic pin: input vref at 80% */
8476 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
8477 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8478 /* Line In pin: use output 1 when in LineOut mode */
8479 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
8480 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8481 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01},
8483 /* FIXME: use matrix-type input source selection */
8484 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
8485 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
8486 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8487 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
8488 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
8489 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
8491 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8492 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
8493 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
8494 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
8496 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8497 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
8498 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
8499 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
8500 /* ADC1: mute amp left and right */
8501 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8502 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
8503 /* ADC2: mute amp left and right */
8504 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8505 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
8506 /* ADC3: mute amp left and right */
8507 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8508 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
8514 static struct hda_verb alc885_imac91_init_verbs
[] = {
8515 /* Internal Speaker Pin (0x0c) */
8516 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, (PIN_OUT
| AC_PINCTL_VREF_50
) },
8517 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8518 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x00},
8519 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, (PIN_OUT
| AC_PINCTL_VREF_50
) },
8520 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8521 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x00},
8523 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8524 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8525 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
8526 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, (ALC880_HP_EVENT
| AC_USRSP_EN
)},
8528 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, AC_PINCTL_VREF_50
},
8529 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8530 /* Front Mic pin: input vref at 80% */
8531 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
8532 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8534 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8535 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8536 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8537 /* Line-Out mixer: unmute input/output amp left and right (volume = 0) */
8538 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8539 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8540 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8541 /* 0x24 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In */
8542 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8543 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
8544 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
8545 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
8546 /* 0x23 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In */
8547 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8548 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
8549 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
8550 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
8551 /* 0x22 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In */
8552 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8553 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
8554 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
8555 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
8556 /* 0x07 [Audio Input] wcaps 0x10011b: Stereo Amp-In */
8557 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8558 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
8559 /* 0x08 [Audio Input] wcaps 0x10011b: Stereo Amp-In */
8560 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8561 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
8562 /* 0x09 [Audio Input] wcaps 0x10011b: Stereo Amp-In */
8563 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8564 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
8568 /* iMac 24 mixer. */
8569 static struct snd_kcontrol_new alc885_imac24_mixer
[] = {
8570 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x00, HDA_OUTPUT
),
8571 HDA_CODEC_MUTE("Master Playback Switch", 0x0c, 0x00, HDA_INPUT
),
8575 /* iMac 24 init verbs. */
8576 static struct hda_verb alc885_imac24_init_verbs
[] = {
8577 /* Internal speakers: output 0 (0x0c) */
8578 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8579 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8580 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x00},
8581 /* Internal speakers: output 0 (0x0c) */
8582 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8583 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8584 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x00},
8585 /* Headphone: output 0 (0x0c) */
8586 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8587 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8588 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
8589 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8590 /* Front Mic: input vref at 80% */
8591 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
8592 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8596 /* Toggle speaker-output according to the hp-jack state */
8597 static void alc885_imac24_setup(struct hda_codec
*codec
)
8599 struct alc_spec
*spec
= codec
->spec
;
8601 spec
->autocfg
.hp_pins
[0] = 0x14;
8602 spec
->autocfg
.speaker_pins
[0] = 0x18;
8603 spec
->autocfg
.speaker_pins
[1] = 0x1a;
8606 #define alc885_mb5_setup alc885_imac24_setup
8607 #define alc885_macmini3_setup alc885_imac24_setup
8609 /* Macbook Air 2,1 */
8610 static void alc885_mba21_setup(struct hda_codec
*codec
)
8612 struct alc_spec
*spec
= codec
->spec
;
8614 spec
->autocfg
.hp_pins
[0] = 0x14;
8615 spec
->autocfg
.speaker_pins
[0] = 0x18;
8620 static void alc885_mbp3_setup(struct hda_codec
*codec
)
8622 struct alc_spec
*spec
= codec
->spec
;
8624 spec
->autocfg
.hp_pins
[0] = 0x15;
8625 spec
->autocfg
.speaker_pins
[0] = 0x14;
8628 static void alc885_imac91_setup(struct hda_codec
*codec
)
8630 struct alc_spec
*spec
= codec
->spec
;
8632 spec
->autocfg
.hp_pins
[0] = 0x14;
8633 spec
->autocfg
.speaker_pins
[0] = 0x18;
8634 spec
->autocfg
.speaker_pins
[1] = 0x1a;
8637 static struct hda_verb alc882_targa_verbs
[] = {
8638 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8639 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8641 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8642 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8644 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* mic/clfe */
8645 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* line/surround */
8646 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
8648 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8652 /* toggle speaker-output according to the hp-jack state */
8653 static void alc882_targa_automute(struct hda_codec
*codec
)
8655 struct alc_spec
*spec
= codec
->spec
;
8656 alc_automute_amp(codec
);
8657 snd_hda_codec_write_cache(codec
, 1, 0, AC_VERB_SET_GPIO_DATA
,
8658 spec
->jack_present
? 1 : 3);
8661 static void alc882_targa_setup(struct hda_codec
*codec
)
8663 struct alc_spec
*spec
= codec
->spec
;
8665 spec
->autocfg
.hp_pins
[0] = 0x14;
8666 spec
->autocfg
.speaker_pins
[0] = 0x1b;
8669 static void alc882_targa_unsol_event(struct hda_codec
*codec
, unsigned int res
)
8671 if ((res
>> 26) == ALC880_HP_EVENT
)
8672 alc882_targa_automute(codec
);
8675 static struct hda_verb alc882_asus_a7j_verbs
[] = {
8676 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8677 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8679 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8680 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8681 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8683 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Front */
8684 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
8685 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Front */
8687 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* mic/clfe */
8688 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* line/surround */
8689 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
8693 static struct hda_verb alc882_asus_a7m_verbs
[] = {
8694 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8695 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8697 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8698 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8699 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8701 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Front */
8702 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
8703 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Front */
8705 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* mic/clfe */
8706 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* line/surround */
8707 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
8711 static void alc882_gpio_mute(struct hda_codec
*codec
, int pin
, int muted
)
8713 unsigned int gpiostate
, gpiomask
, gpiodir
;
8715 gpiostate
= snd_hda_codec_read(codec
, codec
->afg
, 0,
8716 AC_VERB_GET_GPIO_DATA
, 0);
8719 gpiostate
|= (1 << pin
);
8721 gpiostate
&= ~(1 << pin
);
8723 gpiomask
= snd_hda_codec_read(codec
, codec
->afg
, 0,
8724 AC_VERB_GET_GPIO_MASK
, 0);
8725 gpiomask
|= (1 << pin
);
8727 gpiodir
= snd_hda_codec_read(codec
, codec
->afg
, 0,
8728 AC_VERB_GET_GPIO_DIRECTION
, 0);
8729 gpiodir
|= (1 << pin
);
8732 snd_hda_codec_write(codec
, codec
->afg
, 0,
8733 AC_VERB_SET_GPIO_MASK
, gpiomask
);
8734 snd_hda_codec_write(codec
, codec
->afg
, 0,
8735 AC_VERB_SET_GPIO_DIRECTION
, gpiodir
);
8739 snd_hda_codec_write(codec
, codec
->afg
, 0,
8740 AC_VERB_SET_GPIO_DATA
, gpiostate
);
8743 /* set up GPIO at initialization */
8744 static void alc885_macpro_init_hook(struct hda_codec
*codec
)
8746 alc882_gpio_mute(codec
, 0, 0);
8747 alc882_gpio_mute(codec
, 1, 0);
8750 /* set up GPIO and update auto-muting at initialization */
8751 static void alc885_imac24_init_hook(struct hda_codec
*codec
)
8753 alc885_macpro_init_hook(codec
);
8754 alc_automute_amp(codec
);
8758 * generic initialization of ADC, input mixers and output mixers
8760 static struct hda_verb alc883_auto_init_verbs
[] = {
8762 * Unmute ADC0-2 and set the default input to mic-in
8764 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
8765 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8766 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
8767 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8770 * Set up output mixers (0x0c - 0x0f)
8772 /* set vol=0 to output mixers */
8773 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8774 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8775 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8776 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
8777 /* set up input amps for analog loopback */
8778 /* Amp Indices: DAC = 0, mixer = 1 */
8779 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8780 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8781 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8782 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8783 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8784 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8785 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8786 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8787 {0x26, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8788 {0x26, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8790 /* FIXME: use matrix-type input source selection */
8791 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
8793 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8795 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8799 /* 2ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:front) */
8800 static struct hda_verb alc889A_mb31_ch2_init
[] = {
8801 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP as front */
8802 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Subwoofer on */
8803 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* Line as input */
8804 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
}, /* Line off */
8808 /* 4ch mode (Speaker:front, Subwoofer:CLFE, Line:CLFE, Headphones:front) */
8809 static struct hda_verb alc889A_mb31_ch4_init
[] = {
8810 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP as front */
8811 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Subwoofer on */
8812 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
}, /* Line as output */
8813 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Line on */
8817 /* 5ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:rear) */
8818 static struct hda_verb alc889A_mb31_ch5_init
[] = {
8819 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* HP as rear */
8820 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Subwoofer on */
8821 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* Line as input */
8822 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
}, /* Line off */
8826 /* 6ch mode (Speaker:front, Subwoofer:off, Line:CLFE, Headphones:Rear) */
8827 static struct hda_verb alc889A_mb31_ch6_init
[] = {
8828 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* HP as front */
8829 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
}, /* Subwoofer off */
8830 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
}, /* Line as output */
8831 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Line on */
8835 static struct hda_channel_mode alc889A_mb31_6ch_modes
[4] = {
8836 { 2, alc889A_mb31_ch2_init
},
8837 { 4, alc889A_mb31_ch4_init
},
8838 { 5, alc889A_mb31_ch5_init
},
8839 { 6, alc889A_mb31_ch6_init
},
8842 static struct hda_verb alc883_medion_eapd_verbs
[] = {
8843 /* eanable EAPD on medion laptop */
8844 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
8845 {0x20, AC_VERB_SET_PROC_COEF
, 0x3070},
8849 #define alc883_base_mixer alc882_base_mixer
8851 static struct snd_kcontrol_new alc883_mitac_mixer
[] = {
8852 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8853 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8854 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
8855 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
8856 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
8857 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
8858 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
8859 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8860 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
8861 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8862 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
8863 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
8864 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
8868 static struct snd_kcontrol_new alc883_clevo_m720_mixer
[] = {
8869 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8870 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
8871 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
8872 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
8873 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8874 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
8875 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8876 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
8877 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
8878 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
8882 static struct snd_kcontrol_new alc883_2ch_fujitsu_pi2515_mixer
[] = {
8883 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8884 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
8885 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
8886 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
8887 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8888 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
8889 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8890 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
8891 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
8892 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
8896 static struct snd_kcontrol_new alc883_3ST_2ch_mixer
[] = {
8897 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8898 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8899 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
8900 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8901 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8902 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8903 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8904 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8905 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
8906 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8907 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
8908 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
8909 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
8913 static struct snd_kcontrol_new alc883_3ST_6ch_mixer
[] = {
8914 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8915 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8916 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
8917 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
8918 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
8919 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
8920 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
8921 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
8922 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
8923 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8924 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8925 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8926 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8927 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8928 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
8929 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8930 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
8931 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
8932 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
8936 static struct snd_kcontrol_new alc883_3ST_6ch_intel_mixer
[] = {
8937 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8938 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8939 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
8940 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
8941 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
8943 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
8944 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
8945 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
8946 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
8947 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8948 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8949 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8950 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8951 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
8952 HDA_CODEC_VOLUME("Mic Boost Volume", 0x19, 0, HDA_INPUT
),
8953 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
8954 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8955 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x18, 0, HDA_INPUT
),
8956 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8960 static struct snd_kcontrol_new alc885_8ch_intel_mixer
[] = {
8961 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8962 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8963 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
8964 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
8965 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
8967 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
8968 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
8969 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
8970 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
8971 HDA_BIND_MUTE("Speaker Playback Switch", 0x0f, 2, HDA_INPUT
),
8972 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
8973 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8974 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8975 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x3, HDA_INPUT
),
8976 HDA_CODEC_VOLUME("Mic Boost Volume", 0x1b, 0, HDA_INPUT
),
8977 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x3, HDA_INPUT
),
8978 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8979 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x18, 0, HDA_INPUT
),
8980 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8984 static struct snd_kcontrol_new alc883_fivestack_mixer
[] = {
8985 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8986 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8987 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
8988 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
8989 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
8990 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
8991 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
8992 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
8993 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
8994 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8995 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8996 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8997 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8998 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8999 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
9000 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
9001 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
9002 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
9003 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
9007 static struct snd_kcontrol_new alc883_targa_mixer
[] = {
9008 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
9009 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
9010 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
9011 HDA_CODEC_MUTE("Speaker Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
9012 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
9013 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
9014 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
9015 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
9016 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
9017 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
9018 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
9019 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
9020 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
9021 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
9022 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
9023 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
9024 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
9028 static struct snd_kcontrol_new alc883_targa_2ch_mixer
[] = {
9029 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
9030 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
9031 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
9032 HDA_CODEC_MUTE("Speaker Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
9033 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
9034 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
9035 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
9036 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
9037 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
9038 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
9039 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
9040 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
9044 static struct snd_kcontrol_new alc883_targa_8ch_mixer
[] = {
9045 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
9046 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
9047 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
9048 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
9049 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
9053 static struct snd_kcontrol_new alc883_lenovo_101e_2ch_mixer
[] = {
9054 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
9055 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
9056 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
9057 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
9058 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
9059 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
9060 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
9061 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
9065 static struct snd_kcontrol_new alc883_lenovo_nb0763_mixer
[] = {
9066 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
9067 HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 2, HDA_INPUT
),
9068 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
9069 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
9070 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
9071 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
9072 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
9073 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
9074 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
9078 static struct snd_kcontrol_new alc883_medion_wim2160_mixer
[] = {
9079 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
9080 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
9081 HDA_CODEC_MUTE("Speaker Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
9082 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x0, HDA_OUTPUT
),
9083 HDA_CODEC_VOLUME("Line Playback Volume", 0x08, 0x0, HDA_INPUT
),
9084 HDA_CODEC_MUTE("Line Playback Switch", 0x08, 0x0, HDA_INPUT
),
9088 static struct hda_verb alc883_medion_wim2160_verbs
[] = {
9089 /* Unmute front mixer */
9090 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
9091 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
9093 /* Set speaker pin to front mixer */
9094 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
9096 /* Init headphone pin */
9097 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
9098 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
9099 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x00},
9100 {0x1a, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9105 /* toggle speaker-output according to the hp-jack state */
9106 static void alc883_medion_wim2160_setup(struct hda_codec
*codec
)
9108 struct alc_spec
*spec
= codec
->spec
;
9110 spec
->autocfg
.hp_pins
[0] = 0x1a;
9111 spec
->autocfg
.speaker_pins
[0] = 0x15;
9114 static struct snd_kcontrol_new alc883_acer_aspire_mixer
[] = {
9115 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
9116 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
9117 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
9118 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
9119 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
9120 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
9121 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
9122 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
9126 static struct snd_kcontrol_new alc888_acer_aspire_6530_mixer
[] = {
9127 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
9128 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
9129 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
9130 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
9131 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
9132 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
9133 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
9134 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
9135 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
9139 static struct snd_kcontrol_new alc888_lenovo_sky_mixer
[] = {
9140 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
9141 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
9142 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0e, 0x0, HDA_OUTPUT
),
9143 HDA_BIND_MUTE("Surround Playback Switch", 0x0e, 2, HDA_INPUT
),
9144 HDA_CODEC_VOLUME_MONO("Center Playback Volume",
9145 0x0d, 1, 0x0, HDA_OUTPUT
),
9146 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT
),
9147 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT
),
9148 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT
),
9149 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
9150 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
9151 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
9152 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
9153 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
9154 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
9155 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
9156 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
9157 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
9158 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
9159 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
9160 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
9164 static struct snd_kcontrol_new alc889A_mb31_mixer
[] = {
9166 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT
),
9167 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 0x02, HDA_INPUT
),
9168 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT
),
9169 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT
),
9170 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x00,
9172 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x02, HDA_INPUT
),
9173 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x00, HDA_OUTPUT
),
9174 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x02, HDA_INPUT
),
9175 /* Output switches */
9176 HDA_CODEC_MUTE("Enable Speaker", 0x14, 0x00, HDA_OUTPUT
),
9177 HDA_CODEC_MUTE("Enable Headphones", 0x15, 0x00, HDA_OUTPUT
),
9178 HDA_CODEC_MUTE_MONO("Enable LFE", 0x16, 2, 0x00, HDA_OUTPUT
),
9180 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0x00, HDA_INPUT
),
9181 HDA_CODEC_VOLUME("Line Boost Volume", 0x1a, 0x00, HDA_INPUT
),
9183 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT
),
9184 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT
),
9185 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
9186 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
9190 static struct snd_kcontrol_new alc883_vaiott_mixer
[] = {
9191 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
9192 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
9193 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
9194 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
9195 HDA_CODEC_VOLUME("Mic Boost Volume", 0x19, 0, HDA_INPUT
),
9196 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
9200 static struct hda_bind_ctls alc883_bind_cap_vol
= {
9201 .ops
= &snd_hda_bind_vol
,
9203 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT
),
9204 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT
),
9209 static struct hda_bind_ctls alc883_bind_cap_switch
= {
9210 .ops
= &snd_hda_bind_sw
,
9212 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT
),
9213 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT
),
9218 static struct snd_kcontrol_new alc883_asus_eee1601_mixer
[] = {
9219 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
9220 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
9221 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
9222 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
9223 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
9224 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
9225 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
9226 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
9230 static struct snd_kcontrol_new alc883_asus_eee1601_cap_mixer
[] = {
9231 HDA_BIND_VOL("Capture Volume", &alc883_bind_cap_vol
),
9232 HDA_BIND_SW("Capture Switch", &alc883_bind_cap_switch
),
9234 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
9235 /* .name = "Capture Source", */
9236 .name
= "Input Source",
9238 .info
= alc_mux_enum_info
,
9239 .get
= alc_mux_enum_get
,
9240 .put
= alc_mux_enum_put
,
9245 static struct snd_kcontrol_new alc883_chmode_mixer
[] = {
9247 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
9248 .name
= "Channel Mode",
9249 .info
= alc_ch_mode_info
,
9250 .get
= alc_ch_mode_get
,
9251 .put
= alc_ch_mode_put
,
9256 /* toggle speaker-output according to the hp-jack state */
9257 static void alc883_mitac_setup(struct hda_codec
*codec
)
9259 struct alc_spec
*spec
= codec
->spec
;
9261 spec
->autocfg
.hp_pins
[0] = 0x15;
9262 spec
->autocfg
.speaker_pins
[0] = 0x14;
9263 spec
->autocfg
.speaker_pins
[1] = 0x17;
9266 static struct hda_verb alc883_mitac_verbs
[] = {
9268 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
9269 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
9271 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x02},
9272 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9274 /* enable unsolicited event */
9275 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9276 /* {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_MIC_EVENT | AC_USRSP_EN}, */
9281 static struct hda_verb alc883_clevo_m540r_verbs
[] = {
9283 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
9284 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
9286 /*{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},*/
9288 /* enable unsolicited event */
9290 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
9291 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_MIC_EVENT | AC_USRSP_EN},
9297 static struct hda_verb alc883_clevo_m720_verbs
[] = {
9299 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
9300 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
9302 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x01},
9303 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9305 /* enable unsolicited event */
9306 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9307 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_MIC_EVENT
| AC_USRSP_EN
},
9312 static struct hda_verb alc883_2ch_fujitsu_pi2515_verbs
[] = {
9314 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
9315 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
9317 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
9318 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9320 /* enable unsolicited event */
9321 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9326 static struct hda_verb alc883_targa_verbs
[] = {
9327 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
9328 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
9330 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
9331 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9333 /* Connect Line-Out side jack (SPDIF) to Side */
9334 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9335 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
9336 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
9337 /* Connect Mic jack to CLFE */
9338 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9339 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
9340 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02},
9341 /* Connect Line-in jack to Surround */
9342 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9343 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
9344 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01},
9345 /* Connect HP out jack to Front */
9346 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9347 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
9348 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
9350 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9355 static struct hda_verb alc883_lenovo_101e_verbs
[] = {
9356 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
9357 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_FRONT_EVENT
|AC_USRSP_EN
},
9358 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
|AC_USRSP_EN
},
9362 static struct hda_verb alc883_lenovo_nb0763_verbs
[] = {
9363 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
9364 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
9365 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9366 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
9370 static struct hda_verb alc888_lenovo_ms7195_verbs
[] = {
9371 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
9372 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
9373 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
9374 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_FRONT_EVENT
| AC_USRSP_EN
},
9375 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9379 static struct hda_verb alc883_haier_w66_verbs
[] = {
9380 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
9381 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
9383 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9385 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
9386 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
9387 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9388 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
9392 static struct hda_verb alc888_lenovo_sky_verbs
[] = {
9393 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
9394 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
9395 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
9396 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
9397 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
9398 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9399 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x00},
9400 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9404 static struct hda_verb alc888_6st_dell_verbs
[] = {
9405 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9409 static struct hda_verb alc883_vaiott_verbs
[] = {
9411 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
9412 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
9414 /* enable unsolicited event */
9415 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9420 static void alc888_3st_hp_setup(struct hda_codec
*codec
)
9422 struct alc_spec
*spec
= codec
->spec
;
9424 spec
->autocfg
.hp_pins
[0] = 0x1b;
9425 spec
->autocfg
.speaker_pins
[0] = 0x14;
9426 spec
->autocfg
.speaker_pins
[1] = 0x16;
9427 spec
->autocfg
.speaker_pins
[2] = 0x18;
9430 static struct hda_verb alc888_3st_hp_verbs
[] = {
9431 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Front: output 0 (0x0c) */
9432 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Rear : output 1 (0x0d) */
9433 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* CLFE : output 2 (0x0e) */
9434 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9441 static struct hda_verb alc888_3st_hp_2ch_init
[] = {
9442 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
9443 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
9444 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
9445 { 0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
9452 static struct hda_verb alc888_3st_hp_4ch_init
[] = {
9453 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
9454 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
9455 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9456 { 0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
9457 { 0x16, AC_VERB_SET_CONNECT_SEL
, 0x01 },
9464 static struct hda_verb alc888_3st_hp_6ch_init
[] = {
9465 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9466 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
9467 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
9468 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9469 { 0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
9470 { 0x16, AC_VERB_SET_CONNECT_SEL
, 0x01 },
9474 static struct hda_channel_mode alc888_3st_hp_modes
[3] = {
9475 { 2, alc888_3st_hp_2ch_init
},
9476 { 4, alc888_3st_hp_4ch_init
},
9477 { 6, alc888_3st_hp_6ch_init
},
9480 /* toggle front-jack and RCA according to the hp-jack state */
9481 static void alc888_lenovo_ms7195_front_automute(struct hda_codec
*codec
)
9483 unsigned int present
= snd_hda_jack_detect(codec
, 0x1b);
9485 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
9486 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
9487 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
9488 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
9491 /* toggle RCA according to the front-jack state */
9492 static void alc888_lenovo_ms7195_rca_automute(struct hda_codec
*codec
)
9494 unsigned int present
= snd_hda_jack_detect(codec
, 0x14);
9496 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
9497 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
9500 static void alc883_lenovo_ms7195_unsol_event(struct hda_codec
*codec
,
9503 if ((res
>> 26) == ALC880_HP_EVENT
)
9504 alc888_lenovo_ms7195_front_automute(codec
);
9505 if ((res
>> 26) == ALC880_FRONT_EVENT
)
9506 alc888_lenovo_ms7195_rca_automute(codec
);
9509 /* toggle speaker-output according to the hp-jack state */
9510 static void alc883_lenovo_nb0763_setup(struct hda_codec
*codec
)
9512 struct alc_spec
*spec
= codec
->spec
;
9514 spec
->autocfg
.hp_pins
[0] = 0x14;
9515 spec
->autocfg
.speaker_pins
[0] = 0x15;
9518 /* toggle speaker-output according to the hp-jack state */
9519 #define alc883_targa_init_hook alc882_targa_init_hook
9520 #define alc883_targa_unsol_event alc882_targa_unsol_event
9522 static void alc883_clevo_m720_setup(struct hda_codec
*codec
)
9524 struct alc_spec
*spec
= codec
->spec
;
9526 spec
->autocfg
.hp_pins
[0] = 0x15;
9527 spec
->autocfg
.speaker_pins
[0] = 0x14;
9530 static void alc883_clevo_m720_init_hook(struct hda_codec
*codec
)
9532 alc_automute_amp(codec
);
9533 alc88x_simple_mic_automute(codec
);
9536 static void alc883_clevo_m720_unsol_event(struct hda_codec
*codec
,
9539 switch (res
>> 26) {
9540 case ALC880_MIC_EVENT
:
9541 alc88x_simple_mic_automute(codec
);
9544 alc_automute_amp_unsol_event(codec
, res
);
9549 /* toggle speaker-output according to the hp-jack state */
9550 static void alc883_2ch_fujitsu_pi2515_setup(struct hda_codec
*codec
)
9552 struct alc_spec
*spec
= codec
->spec
;
9554 spec
->autocfg
.hp_pins
[0] = 0x14;
9555 spec
->autocfg
.speaker_pins
[0] = 0x15;
9558 static void alc883_haier_w66_setup(struct hda_codec
*codec
)
9560 struct alc_spec
*spec
= codec
->spec
;
9562 spec
->autocfg
.hp_pins
[0] = 0x1b;
9563 spec
->autocfg
.speaker_pins
[0] = 0x14;
9566 static void alc883_lenovo_101e_ispeaker_automute(struct hda_codec
*codec
)
9568 int bits
= snd_hda_jack_detect(codec
, 0x14) ? HDA_AMP_MUTE
: 0;
9570 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
9571 HDA_AMP_MUTE
, bits
);
9574 static void alc883_lenovo_101e_all_automute(struct hda_codec
*codec
)
9576 int bits
= snd_hda_jack_detect(codec
, 0x1b) ? HDA_AMP_MUTE
: 0;
9578 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
9579 HDA_AMP_MUTE
, bits
);
9580 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
9581 HDA_AMP_MUTE
, bits
);
9584 static void alc883_lenovo_101e_unsol_event(struct hda_codec
*codec
,
9587 if ((res
>> 26) == ALC880_HP_EVENT
)
9588 alc883_lenovo_101e_all_automute(codec
);
9589 if ((res
>> 26) == ALC880_FRONT_EVENT
)
9590 alc883_lenovo_101e_ispeaker_automute(codec
);
9593 /* toggle speaker-output according to the hp-jack state */
9594 static void alc883_acer_aspire_setup(struct hda_codec
*codec
)
9596 struct alc_spec
*spec
= codec
->spec
;
9598 spec
->autocfg
.hp_pins
[0] = 0x14;
9599 spec
->autocfg
.speaker_pins
[0] = 0x15;
9600 spec
->autocfg
.speaker_pins
[1] = 0x16;
9603 static struct hda_verb alc883_acer_eapd_verbs
[] = {
9604 /* HP Pin: output 0 (0x0c) */
9605 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
9606 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
9607 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
9608 /* Front Pin: output 0 (0x0c) */
9609 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9610 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
9611 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9612 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x00},
9613 /* eanable EAPD on medion laptop */
9614 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
9615 {0x20, AC_VERB_SET_PROC_COEF
, 0x3050},
9616 /* enable unsolicited event */
9617 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9621 static void alc888_6st_dell_setup(struct hda_codec
*codec
)
9623 struct alc_spec
*spec
= codec
->spec
;
9625 spec
->autocfg
.hp_pins
[0] = 0x1b;
9626 spec
->autocfg
.speaker_pins
[0] = 0x14;
9627 spec
->autocfg
.speaker_pins
[1] = 0x15;
9628 spec
->autocfg
.speaker_pins
[2] = 0x16;
9629 spec
->autocfg
.speaker_pins
[3] = 0x17;
9632 static void alc888_lenovo_sky_setup(struct hda_codec
*codec
)
9634 struct alc_spec
*spec
= codec
->spec
;
9636 spec
->autocfg
.hp_pins
[0] = 0x1b;
9637 spec
->autocfg
.speaker_pins
[0] = 0x14;
9638 spec
->autocfg
.speaker_pins
[1] = 0x15;
9639 spec
->autocfg
.speaker_pins
[2] = 0x16;
9640 spec
->autocfg
.speaker_pins
[3] = 0x17;
9641 spec
->autocfg
.speaker_pins
[4] = 0x1a;
9644 static void alc883_vaiott_setup(struct hda_codec
*codec
)
9646 struct alc_spec
*spec
= codec
->spec
;
9648 spec
->autocfg
.hp_pins
[0] = 0x15;
9649 spec
->autocfg
.speaker_pins
[0] = 0x14;
9650 spec
->autocfg
.speaker_pins
[1] = 0x17;
9653 static struct hda_verb alc888_asus_m90v_verbs
[] = {
9654 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
9655 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
9656 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
9657 /* enable unsolicited event */
9658 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9659 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_MIC_EVENT
| AC_USRSP_EN
},
9663 static void alc883_mode2_setup(struct hda_codec
*codec
)
9665 struct alc_spec
*spec
= codec
->spec
;
9667 spec
->autocfg
.hp_pins
[0] = 0x1b;
9668 spec
->autocfg
.speaker_pins
[0] = 0x14;
9669 spec
->autocfg
.speaker_pins
[1] = 0x15;
9670 spec
->autocfg
.speaker_pins
[2] = 0x16;
9671 spec
->ext_mic
.pin
= 0x18;
9672 spec
->int_mic
.pin
= 0x19;
9673 spec
->ext_mic
.mux_idx
= 0;
9674 spec
->int_mic
.mux_idx
= 1;
9678 static struct hda_verb alc888_asus_eee1601_verbs
[] = {
9679 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
9680 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
9681 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
9682 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
9683 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
9684 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0b},
9685 {0x20, AC_VERB_SET_PROC_COEF
, 0x0838},
9686 /* enable unsolicited event */
9687 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9691 static void alc883_eee1601_inithook(struct hda_codec
*codec
)
9693 struct alc_spec
*spec
= codec
->spec
;
9695 spec
->autocfg
.hp_pins
[0] = 0x14;
9696 spec
->autocfg
.speaker_pins
[0] = 0x1b;
9697 alc_automute_pin(codec
);
9700 static struct hda_verb alc889A_mb31_verbs
[] = {
9701 /* Init rear pin (used as headphone output) */
9702 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc4}, /* Apple Headphones */
9703 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Connect to front */
9704 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
9705 /* Init line pin (used as output in 4ch and 6ch mode) */
9706 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* Connect to CLFE */
9707 /* Init line 2 pin (used as headphone out by default) */
9708 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* Use as input */
9709 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
}, /* Mute output */
9713 /* Mute speakers according to the headphone jack state */
9714 static void alc889A_mb31_automute(struct hda_codec
*codec
)
9716 unsigned int present
;
9718 /* Mute only in 2ch or 4ch mode */
9719 if (snd_hda_codec_read(codec
, 0x15, 0, AC_VERB_GET_CONNECT_SEL
, 0)
9721 present
= snd_hda_jack_detect(codec
, 0x15);
9722 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
9723 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
9724 snd_hda_codec_amp_stereo(codec
, 0x16, HDA_OUTPUT
, 0,
9725 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
9729 static void alc889A_mb31_unsol_event(struct hda_codec
*codec
, unsigned int res
)
9731 if ((res
>> 26) == ALC880_HP_EVENT
)
9732 alc889A_mb31_automute(codec
);
9736 #ifdef CONFIG_SND_HDA_POWER_SAVE
9737 #define alc882_loopbacks alc880_loopbacks
9740 /* pcm configuration: identical with ALC880 */
9741 #define alc882_pcm_analog_playback alc880_pcm_analog_playback
9742 #define alc882_pcm_analog_capture alc880_pcm_analog_capture
9743 #define alc882_pcm_digital_playback alc880_pcm_digital_playback
9744 #define alc882_pcm_digital_capture alc880_pcm_digital_capture
9746 static hda_nid_t alc883_slave_dig_outs
[] = {
9747 ALC1200_DIGOUT_NID
, 0,
9750 static hda_nid_t alc1200_slave_dig_outs
[] = {
9751 ALC883_DIGOUT_NID
, 0,
9755 * configuration and preset
9757 static const char * const alc882_models
[ALC882_MODEL_LAST
] = {
9758 [ALC882_3ST_DIG
] = "3stack-dig",
9759 [ALC882_6ST_DIG
] = "6stack-dig",
9760 [ALC882_ARIMA
] = "arima",
9761 [ALC882_W2JC
] = "w2jc",
9762 [ALC882_TARGA
] = "targa",
9763 [ALC882_ASUS_A7J
] = "asus-a7j",
9764 [ALC882_ASUS_A7M
] = "asus-a7m",
9765 [ALC885_MACPRO
] = "macpro",
9766 [ALC885_MB5
] = "mb5",
9767 [ALC885_MACMINI3
] = "macmini3",
9768 [ALC885_MBA21
] = "mba21",
9769 [ALC885_MBP3
] = "mbp3",
9770 [ALC885_IMAC24
] = "imac24",
9771 [ALC885_IMAC91
] = "imac91",
9772 [ALC883_3ST_2ch_DIG
] = "3stack-2ch-dig",
9773 [ALC883_3ST_6ch_DIG
] = "3stack-6ch-dig",
9774 [ALC883_3ST_6ch
] = "3stack-6ch",
9775 [ALC883_6ST_DIG
] = "alc883-6stack-dig",
9776 [ALC883_TARGA_DIG
] = "targa-dig",
9777 [ALC883_TARGA_2ch_DIG
] = "targa-2ch-dig",
9778 [ALC883_TARGA_8ch_DIG
] = "targa-8ch-dig",
9779 [ALC883_ACER
] = "acer",
9780 [ALC883_ACER_ASPIRE
] = "acer-aspire",
9781 [ALC888_ACER_ASPIRE_4930G
] = "acer-aspire-4930g",
9782 [ALC888_ACER_ASPIRE_6530G
] = "acer-aspire-6530g",
9783 [ALC888_ACER_ASPIRE_8930G
] = "acer-aspire-8930g",
9784 [ALC888_ACER_ASPIRE_7730G
] = "acer-aspire-7730g",
9785 [ALC883_MEDION
] = "medion",
9786 [ALC883_MEDION_WIM2160
] = "medion-wim2160",
9787 [ALC883_LAPTOP_EAPD
] = "laptop-eapd",
9788 [ALC883_LENOVO_101E_2ch
] = "lenovo-101e",
9789 [ALC883_LENOVO_NB0763
] = "lenovo-nb0763",
9790 [ALC888_LENOVO_MS7195_DIG
] = "lenovo-ms7195-dig",
9791 [ALC888_LENOVO_SKY
] = "lenovo-sky",
9792 [ALC883_HAIER_W66
] = "haier-w66",
9793 [ALC888_3ST_HP
] = "3stack-hp",
9794 [ALC888_6ST_DELL
] = "6stack-dell",
9795 [ALC883_MITAC
] = "mitac",
9796 [ALC883_CLEVO_M540R
] = "clevo-m540r",
9797 [ALC883_CLEVO_M720
] = "clevo-m720",
9798 [ALC883_FUJITSU_PI2515
] = "fujitsu-pi2515",
9799 [ALC888_FUJITSU_XA3530
] = "fujitsu-xa3530",
9800 [ALC883_3ST_6ch_INTEL
] = "3stack-6ch-intel",
9801 [ALC889A_INTEL
] = "intel-alc889a",
9802 [ALC889_INTEL
] = "intel-x58",
9803 [ALC1200_ASUS_P5Q
] = "asus-p5q",
9804 [ALC889A_MB31
] = "mb31",
9805 [ALC883_SONY_VAIO_TT
] = "sony-vaio-tt",
9806 [ALC882_AUTO
] = "auto",
9809 static struct snd_pci_quirk alc882_cfg_tbl
[] = {
9810 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG
),
9812 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE
),
9813 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_ACER_ASPIRE
),
9814 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_ACER_ASPIRE
),
9815 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE
),
9816 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE
),
9817 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE
),
9818 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
9819 ALC888_ACER_ASPIRE_4930G
),
9820 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
9821 ALC888_ACER_ASPIRE_4930G
),
9822 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
9823 ALC888_ACER_ASPIRE_8930G
),
9824 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
9825 ALC888_ACER_ASPIRE_8930G
),
9826 SND_PCI_QUIRK(0x1025, 0x0157, "Acer X3200", ALC882_AUTO
),
9827 SND_PCI_QUIRK(0x1025, 0x0158, "Acer AX1700-U3700A", ALC882_AUTO
),
9828 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
9829 ALC888_ACER_ASPIRE_6530G
),
9830 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
9831 ALC888_ACER_ASPIRE_6530G
),
9832 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
9833 ALC888_ACER_ASPIRE_7730G
),
9834 /* default Acer -- disabled as it causes more problems.
9835 * model=auto should work fine now
9837 /* SND_PCI_QUIRK_VENDOR(0x1025, "Acer laptop", ALC883_ACER), */
9839 SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL
),
9841 SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG
),
9842 SND_PCI_QUIRK(0x103c, 0x2a4f, "HP Samba", ALC888_3ST_HP
),
9843 SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP
),
9844 SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG
),
9845 SND_PCI_QUIRK(0x103c, 0x2a66, "HP Acacia", ALC888_3ST_HP
),
9846 SND_PCI_QUIRK(0x103c, 0x2a72, "HP Educ.ar", ALC888_3ST_HP
),
9848 SND_PCI_QUIRK(0x1043, 0x060d, "Asus A7J", ALC882_ASUS_A7J
),
9849 SND_PCI_QUIRK(0x1043, 0x1243, "Asus A7J", ALC882_ASUS_A7J
),
9850 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_ASUS_A7M
),
9851 SND_PCI_QUIRK(0x1043, 0x1873, "Asus M90V", ALC888_ASUS_M90V
),
9852 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC
),
9853 SND_PCI_QUIRK(0x1043, 0x817f, "Asus P5LD2", ALC882_6ST_DIG
),
9854 SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG
),
9855 SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG
),
9856 SND_PCI_QUIRK(0x1043, 0x8284, "Asus Z37E", ALC883_6ST_DIG
),
9857 SND_PCI_QUIRK(0x1043, 0x82fe, "Asus P5Q-EM HDMI", ALC1200_ASUS_P5Q
),
9858 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_ASUS_EEE1601
),
9860 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC883_SONY_VAIO_TT
),
9861 SND_PCI_QUIRK(0x105b, 0x0ce8, "Foxconn P35AX-S", ALC883_6ST_DIG
),
9862 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG
),
9863 SND_PCI_QUIRK(0x1071, 0x8227, "Mitac 82801H", ALC883_MITAC
),
9864 SND_PCI_QUIRK(0x1071, 0x8253, "Mitac 8252d", ALC883_MITAC
),
9865 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD
),
9866 SND_PCI_QUIRK(0x10f1, 0x2350, "TYAN-S2350", ALC888_6ST_DELL
),
9867 SND_PCI_QUIRK(0x108e, 0x534d, NULL
, ALC883_3ST_6ch
),
9869 SND_PCI_QUIRK(0x1462, 0x0349, "MSI", ALC883_TARGA_2ch_DIG
),
9870 SND_PCI_QUIRK(0x1462, 0x040d, "MSI", ALC883_TARGA_2ch_DIG
),
9871 SND_PCI_QUIRK(0x1462, 0x0579, "MSI", ALC883_TARGA_2ch_DIG
),
9872 SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA
), /* MSI-1049 T8 */
9873 SND_PCI_QUIRK(0x1462, 0x2fb3, "MSI", ALC882_AUTO
),
9874 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG
),
9875 SND_PCI_QUIRK(0x1462, 0x3729, "MSI S420", ALC883_TARGA_DIG
),
9876 SND_PCI_QUIRK(0x1462, 0x3783, "NEC S970", ALC883_TARGA_DIG
),
9877 SND_PCI_QUIRK(0x1462, 0x3b7f, "MSI", ALC883_TARGA_2ch_DIG
),
9878 SND_PCI_QUIRK(0x1462, 0x3ef9, "MSI", ALC883_TARGA_DIG
),
9879 SND_PCI_QUIRK(0x1462, 0x3fc1, "MSI", ALC883_TARGA_DIG
),
9880 SND_PCI_QUIRK(0x1462, 0x3fc3, "MSI", ALC883_TARGA_DIG
),
9881 SND_PCI_QUIRK(0x1462, 0x3fcc, "MSI", ALC883_TARGA_DIG
),
9882 SND_PCI_QUIRK(0x1462, 0x3fdf, "MSI", ALC883_TARGA_DIG
),
9883 SND_PCI_QUIRK(0x1462, 0x42cd, "MSI", ALC883_TARGA_DIG
),
9884 SND_PCI_QUIRK(0x1462, 0x4314, "MSI", ALC883_TARGA_DIG
),
9885 SND_PCI_QUIRK(0x1462, 0x4319, "MSI", ALC883_TARGA_DIG
),
9886 SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG
),
9887 SND_PCI_QUIRK(0x1462, 0x4570, "MSI Wind Top AE2220", ALC883_TARGA_DIG
),
9888 SND_PCI_QUIRK(0x1462, 0x6510, "MSI GX620", ALC883_TARGA_8ch_DIG
),
9889 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC883_6ST_DIG
),
9890 SND_PCI_QUIRK(0x1462, 0x7187, "MSI", ALC883_6ST_DIG
),
9891 SND_PCI_QUIRK(0x1462, 0x7250, "MSI", ALC883_6ST_DIG
),
9892 SND_PCI_QUIRK(0x1462, 0x7260, "MSI 7260", ALC883_TARGA_DIG
),
9893 SND_PCI_QUIRK(0x1462, 0x7267, "MSI", ALC883_3ST_6ch_DIG
),
9894 SND_PCI_QUIRK(0x1462, 0x7280, "MSI", ALC883_6ST_DIG
),
9895 SND_PCI_QUIRK(0x1462, 0x7327, "MSI", ALC883_6ST_DIG
),
9896 SND_PCI_QUIRK(0x1462, 0x7350, "MSI", ALC883_6ST_DIG
),
9897 SND_PCI_QUIRK(0x1462, 0x7437, "MSI NetOn AP1900", ALC883_TARGA_DIG
),
9898 SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG
),
9899 SND_PCI_QUIRK(0x1462, 0xaa08, "MSI", ALC883_TARGA_2ch_DIG
),
9901 SND_PCI_QUIRK(0x147b, 0x1083, "Abit IP35-PRO", ALC883_6ST_DIG
),
9902 SND_PCI_QUIRK(0x1558, 0x0571, "Clevo laptop M570U", ALC883_3ST_6ch_DIG
),
9903 SND_PCI_QUIRK(0x1558, 0x0721, "Clevo laptop M720R", ALC883_CLEVO_M720
),
9904 SND_PCI_QUIRK(0x1558, 0x0722, "Clevo laptop M720SR", ALC883_CLEVO_M720
),
9905 SND_PCI_QUIRK(0x1558, 0x5409, "Clevo laptop M540R", ALC883_CLEVO_M540R
),
9906 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC883_LAPTOP_EAPD
),
9907 SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch
),
9908 /* SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA), */
9909 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION
),
9910 SND_PCI_QUIRK_MASK(0x1734, 0xfff0, 0x1100, "FSC AMILO Xi/Pi25xx",
9911 ALC883_FUJITSU_PI2515
),
9912 SND_PCI_QUIRK_MASK(0x1734, 0xfff0, 0x1130, "Fujitsu AMILO Xa35xx",
9913 ALC888_FUJITSU_XA3530
),
9914 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch
),
9915 SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763
),
9916 SND_PCI_QUIRK(0x17aa, 0x3bfc, "Lenovo NB0763", ALC883_LENOVO_NB0763
),
9917 SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763
),
9918 SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY
),
9919 SND_PCI_QUIRK(0x17c0, 0x4085, "MEDION MD96630", ALC888_LENOVO_MS7195_DIG
),
9920 SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG
),
9921 SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66
),
9923 SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL
),
9924 SND_PCI_QUIRK(0x8086, 0x0002, "DG33FBC", ALC883_3ST_6ch_INTEL
),
9925 SND_PCI_QUIRK(0x8086, 0x2503, "82801H", ALC883_MITAC
),
9926 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_INTEL
),
9927 SND_PCI_QUIRK(0x8086, 0x0021, "Intel IbexPeak", ALC889A_INTEL
),
9928 SND_PCI_QUIRK(0x8086, 0x3b56, "Intel IbexPeak", ALC889A_INTEL
),
9929 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC882_6ST_DIG
),
9934 /* codec SSID table for Intel Mac */
9935 static struct snd_pci_quirk alc882_ssid_cfg_tbl
[] = {
9936 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC885_MBP3
),
9937 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC885_MBP3
),
9938 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC885_MBP3
),
9939 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC885_MACPRO
),
9940 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_IMAC24
),
9941 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_IMAC24
),
9942 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC885_MBP3
),
9943 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889A_MB31
),
9944 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_ASUS_A7M
),
9945 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC885_MBP3
),
9946 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC885_MBA21
),
9947 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889A_MB31
),
9948 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3
),
9949 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24
),
9950 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC885_IMAC91
),
9951 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5
),
9952 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC885_MB5
),
9953 /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2,
9954 * so apparently no perfect solution yet
9956 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC885_MB5
),
9957 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC885_MB5
),
9958 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC885_MACMINI3
),
9962 static struct alc_config_preset alc882_presets
[] = {
9963 [ALC882_3ST_DIG
] = {
9964 .mixers
= { alc882_base_mixer
},
9965 .init_verbs
= { alc882_base_init_verbs
,
9966 alc882_adc1_init_verbs
},
9967 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
9968 .dac_nids
= alc882_dac_nids
,
9969 .dig_out_nid
= ALC882_DIGOUT_NID
,
9970 .dig_in_nid
= ALC882_DIGIN_NID
,
9971 .num_channel_mode
= ARRAY_SIZE(alc882_ch_modes
),
9972 .channel_mode
= alc882_ch_modes
,
9974 .input_mux
= &alc882_capture_source
,
9976 [ALC882_6ST_DIG
] = {
9977 .mixers
= { alc882_base_mixer
, alc882_chmode_mixer
},
9978 .init_verbs
= { alc882_base_init_verbs
,
9979 alc882_adc1_init_verbs
},
9980 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
9981 .dac_nids
= alc882_dac_nids
,
9982 .dig_out_nid
= ALC882_DIGOUT_NID
,
9983 .dig_in_nid
= ALC882_DIGIN_NID
,
9984 .num_channel_mode
= ARRAY_SIZE(alc882_sixstack_modes
),
9985 .channel_mode
= alc882_sixstack_modes
,
9986 .input_mux
= &alc882_capture_source
,
9989 .mixers
= { alc882_base_mixer
, alc882_chmode_mixer
},
9990 .init_verbs
= { alc882_base_init_verbs
, alc882_adc1_init_verbs
,
9991 alc882_eapd_verbs
},
9992 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
9993 .dac_nids
= alc882_dac_nids
,
9994 .num_channel_mode
= ARRAY_SIZE(alc882_sixstack_modes
),
9995 .channel_mode
= alc882_sixstack_modes
,
9996 .input_mux
= &alc882_capture_source
,
9999 .mixers
= { alc882_w2jc_mixer
, alc882_chmode_mixer
},
10000 .init_verbs
= { alc882_base_init_verbs
, alc882_adc1_init_verbs
,
10001 alc882_eapd_verbs
, alc880_gpio1_init_verbs
},
10002 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
10003 .dac_nids
= alc882_dac_nids
,
10004 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
10005 .channel_mode
= alc880_threestack_modes
,
10007 .input_mux
= &alc882_capture_source
,
10008 .dig_out_nid
= ALC882_DIGOUT_NID
,
10011 .mixers
= { alc885_mba21_mixer
},
10012 .init_verbs
= { alc885_mba21_init_verbs
, alc880_gpio1_init_verbs
},
10014 .dac_nids
= alc882_dac_nids
,
10015 .channel_mode
= alc885_mba21_ch_modes
,
10016 .num_channel_mode
= ARRAY_SIZE(alc885_mba21_ch_modes
),
10017 .input_mux
= &alc882_capture_source
,
10018 .unsol_event
= alc_automute_amp_unsol_event
,
10019 .setup
= alc885_mba21_setup
,
10020 .init_hook
= alc_automute_amp
,
10023 .mixers
= { alc885_mbp3_mixer
, alc882_chmode_mixer
},
10024 .init_verbs
= { alc885_mbp3_init_verbs
,
10025 alc880_gpio1_init_verbs
},
10027 .dac_nids
= alc882_dac_nids
,
10029 .channel_mode
= alc885_mbp_4ch_modes
,
10030 .num_channel_mode
= ARRAY_SIZE(alc885_mbp_4ch_modes
),
10031 .input_mux
= &alc882_capture_source
,
10032 .dig_out_nid
= ALC882_DIGOUT_NID
,
10033 .dig_in_nid
= ALC882_DIGIN_NID
,
10034 .unsol_event
= alc_automute_amp_unsol_event
,
10035 .setup
= alc885_mbp3_setup
,
10036 .init_hook
= alc_automute_amp
,
10039 .mixers
= { alc885_mb5_mixer
, alc882_chmode_mixer
},
10040 .init_verbs
= { alc885_mb5_init_verbs
,
10041 alc880_gpio1_init_verbs
},
10042 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
10043 .dac_nids
= alc882_dac_nids
,
10044 .channel_mode
= alc885_mb5_6ch_modes
,
10045 .num_channel_mode
= ARRAY_SIZE(alc885_mb5_6ch_modes
),
10046 .input_mux
= &mb5_capture_source
,
10047 .dig_out_nid
= ALC882_DIGOUT_NID
,
10048 .dig_in_nid
= ALC882_DIGIN_NID
,
10049 .unsol_event
= alc_automute_amp_unsol_event
,
10050 .setup
= alc885_mb5_setup
,
10051 .init_hook
= alc_automute_amp
,
10053 [ALC885_MACMINI3
] = {
10054 .mixers
= { alc885_macmini3_mixer
, alc882_chmode_mixer
},
10055 .init_verbs
= { alc885_macmini3_init_verbs
,
10056 alc880_gpio1_init_verbs
},
10057 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
10058 .dac_nids
= alc882_dac_nids
,
10059 .channel_mode
= alc885_macmini3_6ch_modes
,
10060 .num_channel_mode
= ARRAY_SIZE(alc885_macmini3_6ch_modes
),
10061 .input_mux
= &macmini3_capture_source
,
10062 .dig_out_nid
= ALC882_DIGOUT_NID
,
10063 .dig_in_nid
= ALC882_DIGIN_NID
,
10064 .unsol_event
= alc_automute_amp_unsol_event
,
10065 .setup
= alc885_macmini3_setup
,
10066 .init_hook
= alc_automute_amp
,
10068 [ALC885_MACPRO
] = {
10069 .mixers
= { alc882_macpro_mixer
},
10070 .init_verbs
= { alc882_macpro_init_verbs
},
10071 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
10072 .dac_nids
= alc882_dac_nids
,
10073 .dig_out_nid
= ALC882_DIGOUT_NID
,
10074 .dig_in_nid
= ALC882_DIGIN_NID
,
10075 .num_channel_mode
= ARRAY_SIZE(alc882_ch_modes
),
10076 .channel_mode
= alc882_ch_modes
,
10077 .input_mux
= &alc882_capture_source
,
10078 .init_hook
= alc885_macpro_init_hook
,
10080 [ALC885_IMAC24
] = {
10081 .mixers
= { alc885_imac24_mixer
},
10082 .init_verbs
= { alc885_imac24_init_verbs
},
10083 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
10084 .dac_nids
= alc882_dac_nids
,
10085 .dig_out_nid
= ALC882_DIGOUT_NID
,
10086 .dig_in_nid
= ALC882_DIGIN_NID
,
10087 .num_channel_mode
= ARRAY_SIZE(alc882_ch_modes
),
10088 .channel_mode
= alc882_ch_modes
,
10089 .input_mux
= &alc882_capture_source
,
10090 .unsol_event
= alc_automute_amp_unsol_event
,
10091 .setup
= alc885_imac24_setup
,
10092 .init_hook
= alc885_imac24_init_hook
,
10094 [ALC885_IMAC91
] = {
10095 .mixers
= {alc885_imac91_mixer
},
10096 .init_verbs
= { alc885_imac91_init_verbs
,
10097 alc880_gpio1_init_verbs
},
10098 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
10099 .dac_nids
= alc882_dac_nids
,
10100 .channel_mode
= alc885_mba21_ch_modes
,
10101 .num_channel_mode
= ARRAY_SIZE(alc885_mba21_ch_modes
),
10102 .input_mux
= &alc889A_imac91_capture_source
,
10103 .dig_out_nid
= ALC882_DIGOUT_NID
,
10104 .dig_in_nid
= ALC882_DIGIN_NID
,
10105 .unsol_event
= alc_automute_amp_unsol_event
,
10106 .setup
= alc885_imac91_setup
,
10107 .init_hook
= alc_automute_amp
,
10110 .mixers
= { alc882_targa_mixer
, alc882_chmode_mixer
},
10111 .init_verbs
= { alc882_base_init_verbs
, alc882_adc1_init_verbs
,
10112 alc880_gpio3_init_verbs
, alc882_targa_verbs
},
10113 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
10114 .dac_nids
= alc882_dac_nids
,
10115 .dig_out_nid
= ALC882_DIGOUT_NID
,
10116 .num_adc_nids
= ARRAY_SIZE(alc882_adc_nids
),
10117 .adc_nids
= alc882_adc_nids
,
10118 .capsrc_nids
= alc882_capsrc_nids
,
10119 .num_channel_mode
= ARRAY_SIZE(alc882_3ST_6ch_modes
),
10120 .channel_mode
= alc882_3ST_6ch_modes
,
10122 .input_mux
= &alc882_capture_source
,
10123 .unsol_event
= alc882_targa_unsol_event
,
10124 .setup
= alc882_targa_setup
,
10125 .init_hook
= alc882_targa_automute
,
10127 [ALC882_ASUS_A7J
] = {
10128 .mixers
= { alc882_asus_a7j_mixer
, alc882_chmode_mixer
},
10129 .init_verbs
= { alc882_base_init_verbs
, alc882_adc1_init_verbs
,
10130 alc882_asus_a7j_verbs
},
10131 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
10132 .dac_nids
= alc882_dac_nids
,
10133 .dig_out_nid
= ALC882_DIGOUT_NID
,
10134 .num_adc_nids
= ARRAY_SIZE(alc882_adc_nids
),
10135 .adc_nids
= alc882_adc_nids
,
10136 .capsrc_nids
= alc882_capsrc_nids
,
10137 .num_channel_mode
= ARRAY_SIZE(alc882_3ST_6ch_modes
),
10138 .channel_mode
= alc882_3ST_6ch_modes
,
10140 .input_mux
= &alc882_capture_source
,
10142 [ALC882_ASUS_A7M
] = {
10143 .mixers
= { alc882_asus_a7m_mixer
, alc882_chmode_mixer
},
10144 .init_verbs
= { alc882_base_init_verbs
, alc882_adc1_init_verbs
,
10145 alc882_eapd_verbs
, alc880_gpio1_init_verbs
,
10146 alc882_asus_a7m_verbs
},
10147 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
10148 .dac_nids
= alc882_dac_nids
,
10149 .dig_out_nid
= ALC882_DIGOUT_NID
,
10150 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
10151 .channel_mode
= alc880_threestack_modes
,
10153 .input_mux
= &alc882_capture_source
,
10155 [ALC883_3ST_2ch_DIG
] = {
10156 .mixers
= { alc883_3ST_2ch_mixer
},
10157 .init_verbs
= { alc883_init_verbs
},
10158 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10159 .dac_nids
= alc883_dac_nids
,
10160 .dig_out_nid
= ALC883_DIGOUT_NID
,
10161 .dig_in_nid
= ALC883_DIGIN_NID
,
10162 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
10163 .channel_mode
= alc883_3ST_2ch_modes
,
10164 .input_mux
= &alc883_capture_source
,
10166 [ALC883_3ST_6ch_DIG
] = {
10167 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
10168 .init_verbs
= { alc883_init_verbs
},
10169 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10170 .dac_nids
= alc883_dac_nids
,
10171 .dig_out_nid
= ALC883_DIGOUT_NID
,
10172 .dig_in_nid
= ALC883_DIGIN_NID
,
10173 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
10174 .channel_mode
= alc883_3ST_6ch_modes
,
10176 .input_mux
= &alc883_capture_source
,
10178 [ALC883_3ST_6ch
] = {
10179 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
10180 .init_verbs
= { alc883_init_verbs
},
10181 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10182 .dac_nids
= alc883_dac_nids
,
10183 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
10184 .channel_mode
= alc883_3ST_6ch_modes
,
10186 .input_mux
= &alc883_capture_source
,
10188 [ALC883_3ST_6ch_INTEL
] = {
10189 .mixers
= { alc883_3ST_6ch_intel_mixer
, alc883_chmode_mixer
},
10190 .init_verbs
= { alc883_init_verbs
},
10191 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10192 .dac_nids
= alc883_dac_nids
,
10193 .dig_out_nid
= ALC883_DIGOUT_NID
,
10194 .dig_in_nid
= ALC883_DIGIN_NID
,
10195 .slave_dig_outs
= alc883_slave_dig_outs
,
10196 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_intel_modes
),
10197 .channel_mode
= alc883_3ST_6ch_intel_modes
,
10199 .input_mux
= &alc883_3stack_6ch_intel
,
10201 [ALC889A_INTEL
] = {
10202 .mixers
= { alc885_8ch_intel_mixer
, alc883_chmode_mixer
},
10203 .init_verbs
= { alc885_init_verbs
, alc885_init_input_verbs
,
10204 alc_hp15_unsol_verbs
},
10205 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10206 .dac_nids
= alc883_dac_nids
,
10207 .num_adc_nids
= ARRAY_SIZE(alc889_adc_nids
),
10208 .adc_nids
= alc889_adc_nids
,
10209 .dig_out_nid
= ALC883_DIGOUT_NID
,
10210 .dig_in_nid
= ALC883_DIGIN_NID
,
10211 .slave_dig_outs
= alc883_slave_dig_outs
,
10212 .num_channel_mode
= ARRAY_SIZE(alc889_8ch_intel_modes
),
10213 .channel_mode
= alc889_8ch_intel_modes
,
10214 .capsrc_nids
= alc889_capsrc_nids
,
10215 .input_mux
= &alc889_capture_source
,
10216 .setup
= alc889_automute_setup
,
10217 .init_hook
= alc_automute_amp
,
10218 .unsol_event
= alc_automute_amp_unsol_event
,
10222 .mixers
= { alc885_8ch_intel_mixer
, alc883_chmode_mixer
},
10223 .init_verbs
= { alc885_init_verbs
, alc889_init_input_verbs
,
10224 alc889_eapd_verbs
, alc_hp15_unsol_verbs
},
10225 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10226 .dac_nids
= alc883_dac_nids
,
10227 .num_adc_nids
= ARRAY_SIZE(alc889_adc_nids
),
10228 .adc_nids
= alc889_adc_nids
,
10229 .dig_out_nid
= ALC883_DIGOUT_NID
,
10230 .dig_in_nid
= ALC883_DIGIN_NID
,
10231 .slave_dig_outs
= alc883_slave_dig_outs
,
10232 .num_channel_mode
= ARRAY_SIZE(alc889_8ch_intel_modes
),
10233 .channel_mode
= alc889_8ch_intel_modes
,
10234 .capsrc_nids
= alc889_capsrc_nids
,
10235 .input_mux
= &alc889_capture_source
,
10236 .setup
= alc889_automute_setup
,
10237 .init_hook
= alc889_intel_init_hook
,
10238 .unsol_event
= alc_automute_amp_unsol_event
,
10241 [ALC883_6ST_DIG
] = {
10242 .mixers
= { alc883_base_mixer
, alc883_chmode_mixer
},
10243 .init_verbs
= { alc883_init_verbs
},
10244 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10245 .dac_nids
= alc883_dac_nids
,
10246 .dig_out_nid
= ALC883_DIGOUT_NID
,
10247 .dig_in_nid
= ALC883_DIGIN_NID
,
10248 .num_channel_mode
= ARRAY_SIZE(alc883_sixstack_modes
),
10249 .channel_mode
= alc883_sixstack_modes
,
10250 .input_mux
= &alc883_capture_source
,
10252 [ALC883_TARGA_DIG
] = {
10253 .mixers
= { alc883_targa_mixer
, alc883_chmode_mixer
},
10254 .init_verbs
= { alc883_init_verbs
, alc880_gpio3_init_verbs
,
10255 alc883_targa_verbs
},
10256 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10257 .dac_nids
= alc883_dac_nids
,
10258 .dig_out_nid
= ALC883_DIGOUT_NID
,
10259 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
10260 .channel_mode
= alc883_3ST_6ch_modes
,
10262 .input_mux
= &alc883_capture_source
,
10263 .unsol_event
= alc883_targa_unsol_event
,
10264 .setup
= alc882_targa_setup
,
10265 .init_hook
= alc882_targa_automute
,
10267 [ALC883_TARGA_2ch_DIG
] = {
10268 .mixers
= { alc883_targa_2ch_mixer
},
10269 .init_verbs
= { alc883_init_verbs
, alc880_gpio3_init_verbs
,
10270 alc883_targa_verbs
},
10271 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10272 .dac_nids
= alc883_dac_nids
,
10273 .adc_nids
= alc883_adc_nids_alt
,
10274 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_alt
),
10275 .capsrc_nids
= alc883_capsrc_nids
,
10276 .dig_out_nid
= ALC883_DIGOUT_NID
,
10277 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
10278 .channel_mode
= alc883_3ST_2ch_modes
,
10279 .input_mux
= &alc883_capture_source
,
10280 .unsol_event
= alc883_targa_unsol_event
,
10281 .setup
= alc882_targa_setup
,
10282 .init_hook
= alc882_targa_automute
,
10284 [ALC883_TARGA_8ch_DIG
] = {
10285 .mixers
= { alc883_targa_mixer
, alc883_targa_8ch_mixer
,
10286 alc883_chmode_mixer
},
10287 .init_verbs
= { alc883_init_verbs
, alc880_gpio3_init_verbs
,
10288 alc883_targa_verbs
},
10289 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10290 .dac_nids
= alc883_dac_nids
,
10291 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_rev
),
10292 .adc_nids
= alc883_adc_nids_rev
,
10293 .capsrc_nids
= alc883_capsrc_nids_rev
,
10294 .dig_out_nid
= ALC883_DIGOUT_NID
,
10295 .dig_in_nid
= ALC883_DIGIN_NID
,
10296 .num_channel_mode
= ARRAY_SIZE(alc883_4ST_8ch_modes
),
10297 .channel_mode
= alc883_4ST_8ch_modes
,
10299 .input_mux
= &alc883_capture_source
,
10300 .unsol_event
= alc883_targa_unsol_event
,
10301 .setup
= alc882_targa_setup
,
10302 .init_hook
= alc882_targa_automute
,
10305 .mixers
= { alc883_base_mixer
},
10306 /* On TravelMate laptops, GPIO 0 enables the internal speaker
10307 * and the headphone jack. Turn this on and rely on the
10308 * standard mute methods whenever the user wants to turn
10309 * these outputs off.
10311 .init_verbs
= { alc883_init_verbs
, alc880_gpio1_init_verbs
},
10312 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10313 .dac_nids
= alc883_dac_nids
,
10314 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
10315 .channel_mode
= alc883_3ST_2ch_modes
,
10316 .input_mux
= &alc883_capture_source
,
10318 [ALC883_ACER_ASPIRE
] = {
10319 .mixers
= { alc883_acer_aspire_mixer
},
10320 .init_verbs
= { alc883_init_verbs
, alc883_acer_eapd_verbs
},
10321 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10322 .dac_nids
= alc883_dac_nids
,
10323 .dig_out_nid
= ALC883_DIGOUT_NID
,
10324 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
10325 .channel_mode
= alc883_3ST_2ch_modes
,
10326 .input_mux
= &alc883_capture_source
,
10327 .unsol_event
= alc_automute_amp_unsol_event
,
10328 .setup
= alc883_acer_aspire_setup
,
10329 .init_hook
= alc_automute_amp
,
10331 [ALC888_ACER_ASPIRE_4930G
] = {
10332 .mixers
= { alc888_acer_aspire_4930g_mixer
,
10333 alc883_chmode_mixer
},
10334 .init_verbs
= { alc883_init_verbs
, alc880_gpio1_init_verbs
,
10335 alc888_acer_aspire_4930g_verbs
},
10336 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10337 .dac_nids
= alc883_dac_nids
,
10338 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_rev
),
10339 .adc_nids
= alc883_adc_nids_rev
,
10340 .capsrc_nids
= alc883_capsrc_nids_rev
,
10341 .dig_out_nid
= ALC883_DIGOUT_NID
,
10342 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
10343 .channel_mode
= alc883_3ST_6ch_modes
,
10345 .const_channel_count
= 6,
10347 ARRAY_SIZE(alc888_2_capture_sources
),
10348 .input_mux
= alc888_2_capture_sources
,
10349 .unsol_event
= alc_automute_amp_unsol_event
,
10350 .setup
= alc888_acer_aspire_4930g_setup
,
10351 .init_hook
= alc_automute_amp
,
10353 [ALC888_ACER_ASPIRE_6530G
] = {
10354 .mixers
= { alc888_acer_aspire_6530_mixer
},
10355 .init_verbs
= { alc883_init_verbs
, alc880_gpio1_init_verbs
,
10356 alc888_acer_aspire_6530g_verbs
},
10357 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10358 .dac_nids
= alc883_dac_nids
,
10359 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_rev
),
10360 .adc_nids
= alc883_adc_nids_rev
,
10361 .capsrc_nids
= alc883_capsrc_nids_rev
,
10362 .dig_out_nid
= ALC883_DIGOUT_NID
,
10363 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
10364 .channel_mode
= alc883_3ST_2ch_modes
,
10366 ARRAY_SIZE(alc888_2_capture_sources
),
10367 .input_mux
= alc888_acer_aspire_6530_sources
,
10368 .unsol_event
= alc_automute_amp_unsol_event
,
10369 .setup
= alc888_acer_aspire_6530g_setup
,
10370 .init_hook
= alc_automute_amp
,
10372 [ALC888_ACER_ASPIRE_8930G
] = {
10373 .mixers
= { alc889_acer_aspire_8930g_mixer
,
10374 alc883_chmode_mixer
},
10375 .init_verbs
= { alc883_init_verbs
, alc880_gpio1_init_verbs
,
10376 alc889_acer_aspire_8930g_verbs
,
10377 alc889_eapd_verbs
},
10378 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10379 .dac_nids
= alc883_dac_nids
,
10380 .num_adc_nids
= ARRAY_SIZE(alc889_adc_nids
),
10381 .adc_nids
= alc889_adc_nids
,
10382 .capsrc_nids
= alc889_capsrc_nids
,
10383 .dig_out_nid
= ALC883_DIGOUT_NID
,
10384 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
10385 .channel_mode
= alc883_3ST_6ch_modes
,
10387 .const_channel_count
= 6,
10389 ARRAY_SIZE(alc889_capture_sources
),
10390 .input_mux
= alc889_capture_sources
,
10391 .unsol_event
= alc_automute_amp_unsol_event
,
10392 .setup
= alc889_acer_aspire_8930g_setup
,
10393 .init_hook
= alc_automute_amp
,
10394 #ifdef CONFIG_SND_HDA_POWER_SAVE
10395 .power_hook
= alc_power_eapd
,
10398 [ALC888_ACER_ASPIRE_7730G
] = {
10399 .mixers
= { alc883_3ST_6ch_mixer
,
10400 alc883_chmode_mixer
},
10401 .init_verbs
= { alc883_init_verbs
, alc880_gpio1_init_verbs
,
10402 alc888_acer_aspire_7730G_verbs
},
10403 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10404 .dac_nids
= alc883_dac_nids
,
10405 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_rev
),
10406 .adc_nids
= alc883_adc_nids_rev
,
10407 .capsrc_nids
= alc883_capsrc_nids_rev
,
10408 .dig_out_nid
= ALC883_DIGOUT_NID
,
10409 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
10410 .channel_mode
= alc883_3ST_6ch_modes
,
10412 .const_channel_count
= 6,
10413 .input_mux
= &alc883_capture_source
,
10414 .unsol_event
= alc_automute_amp_unsol_event
,
10415 .setup
= alc888_acer_aspire_7730g_setup
,
10416 .init_hook
= alc_automute_amp
,
10418 [ALC883_MEDION
] = {
10419 .mixers
= { alc883_fivestack_mixer
,
10420 alc883_chmode_mixer
},
10421 .init_verbs
= { alc883_init_verbs
,
10422 alc883_medion_eapd_verbs
},
10423 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10424 .dac_nids
= alc883_dac_nids
,
10425 .adc_nids
= alc883_adc_nids_alt
,
10426 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_alt
),
10427 .capsrc_nids
= alc883_capsrc_nids
,
10428 .num_channel_mode
= ARRAY_SIZE(alc883_sixstack_modes
),
10429 .channel_mode
= alc883_sixstack_modes
,
10430 .input_mux
= &alc883_capture_source
,
10432 [ALC883_MEDION_WIM2160
] = {
10433 .mixers
= { alc883_medion_wim2160_mixer
},
10434 .init_verbs
= { alc883_init_verbs
, alc883_medion_wim2160_verbs
},
10435 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10436 .dac_nids
= alc883_dac_nids
,
10437 .dig_out_nid
= ALC883_DIGOUT_NID
,
10438 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids
),
10439 .adc_nids
= alc883_adc_nids
,
10440 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
10441 .channel_mode
= alc883_3ST_2ch_modes
,
10442 .input_mux
= &alc883_capture_source
,
10443 .unsol_event
= alc_automute_amp_unsol_event
,
10444 .setup
= alc883_medion_wim2160_setup
,
10445 .init_hook
= alc_automute_amp
,
10447 [ALC883_LAPTOP_EAPD
] = {
10448 .mixers
= { alc883_base_mixer
},
10449 .init_verbs
= { alc883_init_verbs
, alc882_eapd_verbs
},
10450 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10451 .dac_nids
= alc883_dac_nids
,
10452 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
10453 .channel_mode
= alc883_3ST_2ch_modes
,
10454 .input_mux
= &alc883_capture_source
,
10456 [ALC883_CLEVO_M540R
] = {
10457 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
10458 .init_verbs
= { alc883_init_verbs
, alc883_clevo_m540r_verbs
},
10459 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10460 .dac_nids
= alc883_dac_nids
,
10461 .dig_out_nid
= ALC883_DIGOUT_NID
,
10462 .dig_in_nid
= ALC883_DIGIN_NID
,
10463 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_clevo_modes
),
10464 .channel_mode
= alc883_3ST_6ch_clevo_modes
,
10466 .input_mux
= &alc883_capture_source
,
10467 /* This machine has the hardware HP auto-muting, thus
10468 * we need no software mute via unsol event
10471 [ALC883_CLEVO_M720
] = {
10472 .mixers
= { alc883_clevo_m720_mixer
},
10473 .init_verbs
= { alc883_init_verbs
, alc883_clevo_m720_verbs
},
10474 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10475 .dac_nids
= alc883_dac_nids
,
10476 .dig_out_nid
= ALC883_DIGOUT_NID
,
10477 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
10478 .channel_mode
= alc883_3ST_2ch_modes
,
10479 .input_mux
= &alc883_capture_source
,
10480 .unsol_event
= alc883_clevo_m720_unsol_event
,
10481 .setup
= alc883_clevo_m720_setup
,
10482 .init_hook
= alc883_clevo_m720_init_hook
,
10484 [ALC883_LENOVO_101E_2ch
] = {
10485 .mixers
= { alc883_lenovo_101e_2ch_mixer
},
10486 .init_verbs
= { alc883_init_verbs
, alc883_lenovo_101e_verbs
},
10487 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10488 .dac_nids
= alc883_dac_nids
,
10489 .adc_nids
= alc883_adc_nids_alt
,
10490 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_alt
),
10491 .capsrc_nids
= alc883_capsrc_nids
,
10492 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
10493 .channel_mode
= alc883_3ST_2ch_modes
,
10494 .input_mux
= &alc883_lenovo_101e_capture_source
,
10495 .unsol_event
= alc883_lenovo_101e_unsol_event
,
10496 .init_hook
= alc883_lenovo_101e_all_automute
,
10498 [ALC883_LENOVO_NB0763
] = {
10499 .mixers
= { alc883_lenovo_nb0763_mixer
},
10500 .init_verbs
= { alc883_init_verbs
, alc883_lenovo_nb0763_verbs
},
10501 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10502 .dac_nids
= alc883_dac_nids
,
10503 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
10504 .channel_mode
= alc883_3ST_2ch_modes
,
10506 .input_mux
= &alc883_lenovo_nb0763_capture_source
,
10507 .unsol_event
= alc_automute_amp_unsol_event
,
10508 .setup
= alc883_lenovo_nb0763_setup
,
10509 .init_hook
= alc_automute_amp
,
10511 [ALC888_LENOVO_MS7195_DIG
] = {
10512 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
10513 .init_verbs
= { alc883_init_verbs
, alc888_lenovo_ms7195_verbs
},
10514 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10515 .dac_nids
= alc883_dac_nids
,
10516 .dig_out_nid
= ALC883_DIGOUT_NID
,
10517 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
10518 .channel_mode
= alc883_3ST_6ch_modes
,
10520 .input_mux
= &alc883_capture_source
,
10521 .unsol_event
= alc883_lenovo_ms7195_unsol_event
,
10522 .init_hook
= alc888_lenovo_ms7195_front_automute
,
10524 [ALC883_HAIER_W66
] = {
10525 .mixers
= { alc883_targa_2ch_mixer
},
10526 .init_verbs
= { alc883_init_verbs
, alc883_haier_w66_verbs
},
10527 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10528 .dac_nids
= alc883_dac_nids
,
10529 .dig_out_nid
= ALC883_DIGOUT_NID
,
10530 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
10531 .channel_mode
= alc883_3ST_2ch_modes
,
10532 .input_mux
= &alc883_capture_source
,
10533 .unsol_event
= alc_automute_amp_unsol_event
,
10534 .setup
= alc883_haier_w66_setup
,
10535 .init_hook
= alc_automute_amp
,
10537 [ALC888_3ST_HP
] = {
10538 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
10539 .init_verbs
= { alc883_init_verbs
, alc888_3st_hp_verbs
},
10540 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10541 .dac_nids
= alc883_dac_nids
,
10542 .num_channel_mode
= ARRAY_SIZE(alc888_3st_hp_modes
),
10543 .channel_mode
= alc888_3st_hp_modes
,
10545 .input_mux
= &alc883_capture_source
,
10546 .unsol_event
= alc_automute_amp_unsol_event
,
10547 .setup
= alc888_3st_hp_setup
,
10548 .init_hook
= alc_automute_amp
,
10550 [ALC888_6ST_DELL
] = {
10551 .mixers
= { alc883_base_mixer
, alc883_chmode_mixer
},
10552 .init_verbs
= { alc883_init_verbs
, alc888_6st_dell_verbs
},
10553 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10554 .dac_nids
= alc883_dac_nids
,
10555 .dig_out_nid
= ALC883_DIGOUT_NID
,
10556 .dig_in_nid
= ALC883_DIGIN_NID
,
10557 .num_channel_mode
= ARRAY_SIZE(alc883_sixstack_modes
),
10558 .channel_mode
= alc883_sixstack_modes
,
10559 .input_mux
= &alc883_capture_source
,
10560 .unsol_event
= alc_automute_amp_unsol_event
,
10561 .setup
= alc888_6st_dell_setup
,
10562 .init_hook
= alc_automute_amp
,
10565 .mixers
= { alc883_mitac_mixer
},
10566 .init_verbs
= { alc883_init_verbs
, alc883_mitac_verbs
},
10567 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10568 .dac_nids
= alc883_dac_nids
,
10569 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
10570 .channel_mode
= alc883_3ST_2ch_modes
,
10571 .input_mux
= &alc883_capture_source
,
10572 .unsol_event
= alc_automute_amp_unsol_event
,
10573 .setup
= alc883_mitac_setup
,
10574 .init_hook
= alc_automute_amp
,
10576 [ALC883_FUJITSU_PI2515
] = {
10577 .mixers
= { alc883_2ch_fujitsu_pi2515_mixer
},
10578 .init_verbs
= { alc883_init_verbs
,
10579 alc883_2ch_fujitsu_pi2515_verbs
},
10580 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10581 .dac_nids
= alc883_dac_nids
,
10582 .dig_out_nid
= ALC883_DIGOUT_NID
,
10583 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
10584 .channel_mode
= alc883_3ST_2ch_modes
,
10585 .input_mux
= &alc883_fujitsu_pi2515_capture_source
,
10586 .unsol_event
= alc_automute_amp_unsol_event
,
10587 .setup
= alc883_2ch_fujitsu_pi2515_setup
,
10588 .init_hook
= alc_automute_amp
,
10590 [ALC888_FUJITSU_XA3530
] = {
10591 .mixers
= { alc888_base_mixer
, alc883_chmode_mixer
},
10592 .init_verbs
= { alc883_init_verbs
,
10593 alc888_fujitsu_xa3530_verbs
},
10594 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10595 .dac_nids
= alc883_dac_nids
,
10596 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_rev
),
10597 .adc_nids
= alc883_adc_nids_rev
,
10598 .capsrc_nids
= alc883_capsrc_nids_rev
,
10599 .dig_out_nid
= ALC883_DIGOUT_NID
,
10600 .num_channel_mode
= ARRAY_SIZE(alc888_4ST_8ch_intel_modes
),
10601 .channel_mode
= alc888_4ST_8ch_intel_modes
,
10603 ARRAY_SIZE(alc888_2_capture_sources
),
10604 .input_mux
= alc888_2_capture_sources
,
10605 .unsol_event
= alc_automute_amp_unsol_event
,
10606 .setup
= alc888_fujitsu_xa3530_setup
,
10607 .init_hook
= alc_automute_amp
,
10609 [ALC888_LENOVO_SKY
] = {
10610 .mixers
= { alc888_lenovo_sky_mixer
, alc883_chmode_mixer
},
10611 .init_verbs
= { alc883_init_verbs
, alc888_lenovo_sky_verbs
},
10612 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10613 .dac_nids
= alc883_dac_nids
,
10614 .dig_out_nid
= ALC883_DIGOUT_NID
,
10615 .num_channel_mode
= ARRAY_SIZE(alc883_sixstack_modes
),
10616 .channel_mode
= alc883_sixstack_modes
,
10618 .input_mux
= &alc883_lenovo_sky_capture_source
,
10619 .unsol_event
= alc_automute_amp_unsol_event
,
10620 .setup
= alc888_lenovo_sky_setup
,
10621 .init_hook
= alc_automute_amp
,
10623 [ALC888_ASUS_M90V
] = {
10624 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
10625 .init_verbs
= { alc883_init_verbs
, alc888_asus_m90v_verbs
},
10626 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10627 .dac_nids
= alc883_dac_nids
,
10628 .dig_out_nid
= ALC883_DIGOUT_NID
,
10629 .dig_in_nid
= ALC883_DIGIN_NID
,
10630 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
10631 .channel_mode
= alc883_3ST_6ch_modes
,
10633 .input_mux
= &alc883_fujitsu_pi2515_capture_source
,
10634 .unsol_event
= alc_sku_unsol_event
,
10635 .setup
= alc883_mode2_setup
,
10636 .init_hook
= alc_inithook
,
10638 [ALC888_ASUS_EEE1601
] = {
10639 .mixers
= { alc883_asus_eee1601_mixer
},
10640 .cap_mixer
= alc883_asus_eee1601_cap_mixer
,
10641 .init_verbs
= { alc883_init_verbs
, alc888_asus_eee1601_verbs
},
10642 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10643 .dac_nids
= alc883_dac_nids
,
10644 .dig_out_nid
= ALC883_DIGOUT_NID
,
10645 .dig_in_nid
= ALC883_DIGIN_NID
,
10646 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
10647 .channel_mode
= alc883_3ST_2ch_modes
,
10649 .input_mux
= &alc883_asus_eee1601_capture_source
,
10650 .unsol_event
= alc_sku_unsol_event
,
10651 .init_hook
= alc883_eee1601_inithook
,
10653 [ALC1200_ASUS_P5Q
] = {
10654 .mixers
= { alc883_base_mixer
, alc883_chmode_mixer
},
10655 .init_verbs
= { alc883_init_verbs
},
10656 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10657 .dac_nids
= alc883_dac_nids
,
10658 .dig_out_nid
= ALC1200_DIGOUT_NID
,
10659 .dig_in_nid
= ALC883_DIGIN_NID
,
10660 .slave_dig_outs
= alc1200_slave_dig_outs
,
10661 .num_channel_mode
= ARRAY_SIZE(alc883_sixstack_modes
),
10662 .channel_mode
= alc883_sixstack_modes
,
10663 .input_mux
= &alc883_capture_source
,
10666 .mixers
= { alc889A_mb31_mixer
, alc883_chmode_mixer
},
10667 .init_verbs
= { alc883_init_verbs
, alc889A_mb31_verbs
,
10668 alc880_gpio1_init_verbs
},
10669 .adc_nids
= alc883_adc_nids
,
10670 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids
),
10671 .capsrc_nids
= alc883_capsrc_nids
,
10672 .dac_nids
= alc883_dac_nids
,
10673 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10674 .channel_mode
= alc889A_mb31_6ch_modes
,
10675 .num_channel_mode
= ARRAY_SIZE(alc889A_mb31_6ch_modes
),
10676 .input_mux
= &alc889A_mb31_capture_source
,
10677 .dig_out_nid
= ALC883_DIGOUT_NID
,
10678 .unsol_event
= alc889A_mb31_unsol_event
,
10679 .init_hook
= alc889A_mb31_automute
,
10681 [ALC883_SONY_VAIO_TT
] = {
10682 .mixers
= { alc883_vaiott_mixer
},
10683 .init_verbs
= { alc883_init_verbs
, alc883_vaiott_verbs
},
10684 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
10685 .dac_nids
= alc883_dac_nids
,
10686 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
10687 .channel_mode
= alc883_3ST_2ch_modes
,
10688 .input_mux
= &alc883_capture_source
,
10689 .unsol_event
= alc_automute_amp_unsol_event
,
10690 .setup
= alc883_vaiott_setup
,
10691 .init_hook
= alc_automute_amp
,
10700 PINFIX_ABIT_AW9D_MAX
,
10701 PINFIX_LENOVO_Y530
,
10703 PINFIX_ACER_ASPIRE_7736
,
10704 PINFIX_GIGABYTE_880GM
,
10707 static const struct alc_fixup alc882_fixups
[] = {
10708 [PINFIX_ABIT_AW9D_MAX
] = {
10709 .type
= ALC_FIXUP_PINS
,
10710 .v
.pins
= (const struct alc_pincfg
[]) {
10711 { 0x15, 0x01080104 }, /* side */
10712 { 0x16, 0x01011012 }, /* rear */
10713 { 0x17, 0x01016011 }, /* clfe */
10717 [PINFIX_LENOVO_Y530
] = {
10718 .type
= ALC_FIXUP_PINS
,
10719 .v
.pins
= (const struct alc_pincfg
[]) {
10720 { 0x15, 0x99130112 }, /* rear int speakers */
10721 { 0x16, 0x99130111 }, /* subwoofer */
10725 [PINFIX_PB_M5210
] = {
10726 .type
= ALC_FIXUP_VERBS
,
10727 .v
.verbs
= (const struct hda_verb
[]) {
10728 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
10732 [PINFIX_ACER_ASPIRE_7736
] = {
10733 .type
= ALC_FIXUP_SKU
,
10734 .v
.sku
= ALC_FIXUP_SKU_IGNORE
,
10736 [PINFIX_GIGABYTE_880GM
] = {
10737 .type
= ALC_FIXUP_PINS
,
10738 .v
.pins
= (const struct alc_pincfg
[]) {
10739 { 0x14, 0x1114410 }, /* set as speaker */
10745 static struct snd_pci_quirk alc882_fixup_tbl
[] = {
10746 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", PINFIX_PB_M5210
),
10747 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", PINFIX_LENOVO_Y530
),
10748 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX
),
10749 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", PINFIX_ACER_ASPIRE_7736
),
10750 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte", PINFIX_GIGABYTE_880GM
),
10755 * BIOS auto configuration
10757 static int alc882_auto_create_input_ctls(struct hda_codec
*codec
,
10758 const struct auto_pin_cfg
*cfg
)
10760 return alc_auto_create_input_ctls(codec
, cfg
, 0x0b, 0x23, 0x22);
10763 static void alc882_auto_set_output_and_unmute(struct hda_codec
*codec
,
10764 hda_nid_t nid
, int pin_type
,
10769 /* set as output */
10770 alc_set_pin_output(codec
, nid
, pin_type
);
10774 else if (dac
>= 0x02 && dac
<= 0x05)
10778 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_CONNECT_SEL
, idx
);
10781 static void alc882_auto_init_multi_out(struct hda_codec
*codec
)
10783 struct alc_spec
*spec
= codec
->spec
;
10786 for (i
= 0; i
<= HDA_SIDE
; i
++) {
10787 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
10788 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
10790 alc882_auto_set_output_and_unmute(codec
, nid
, pin_type
,
10791 spec
->multiout
.dac_nids
[i
]);
10795 static void alc882_auto_init_hp_out(struct hda_codec
*codec
)
10797 struct alc_spec
*spec
= codec
->spec
;
10798 hda_nid_t pin
, dac
;
10801 if (spec
->autocfg
.line_out_type
!= AUTO_PIN_HP_OUT
) {
10802 for (i
= 0; i
< ARRAY_SIZE(spec
->autocfg
.hp_pins
); i
++) {
10803 pin
= spec
->autocfg
.hp_pins
[i
];
10806 dac
= spec
->multiout
.hp_nid
;
10808 dac
= spec
->multiout
.dac_nids
[0]; /* to front */
10809 alc882_auto_set_output_and_unmute(codec
, pin
, PIN_HP
, dac
);
10813 if (spec
->autocfg
.line_out_type
!= AUTO_PIN_SPEAKER_OUT
) {
10814 for (i
= 0; i
< ARRAY_SIZE(spec
->autocfg
.speaker_pins
); i
++) {
10815 pin
= spec
->autocfg
.speaker_pins
[i
];
10818 dac
= spec
->multiout
.extra_out_nid
[0];
10820 dac
= spec
->multiout
.dac_nids
[0]; /* to front */
10821 alc882_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
, dac
);
10826 static void alc882_auto_init_analog_input(struct hda_codec
*codec
)
10828 struct alc_spec
*spec
= codec
->spec
;
10829 struct auto_pin_cfg
*cfg
= &spec
->autocfg
;
10832 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
10833 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
10834 alc_set_input_pin(codec
, nid
, cfg
->inputs
[i
].type
);
10835 if (get_wcaps(codec
, nid
) & AC_WCAP_OUT_AMP
)
10836 snd_hda_codec_write(codec
, nid
, 0,
10837 AC_VERB_SET_AMP_GAIN_MUTE
,
10842 static void alc882_auto_init_input_src(struct hda_codec
*codec
)
10844 struct alc_spec
*spec
= codec
->spec
;
10847 for (c
= 0; c
< spec
->num_adc_nids
; c
++) {
10848 hda_nid_t conn_list
[HDA_MAX_NUM_INPUTS
];
10849 hda_nid_t nid
= spec
->capsrc_nids
[c
];
10850 unsigned int mux_idx
;
10851 const struct hda_input_mux
*imux
;
10852 int conns
, mute
, idx
, item
;
10854 conns
= snd_hda_get_connections(codec
, nid
, conn_list
,
10855 ARRAY_SIZE(conn_list
));
10858 mux_idx
= c
>= spec
->num_mux_defs
? 0 : c
;
10859 imux
= &spec
->input_mux
[mux_idx
];
10860 if (!imux
->num_items
&& mux_idx
> 0)
10861 imux
= &spec
->input_mux
[0];
10862 for (idx
= 0; idx
< conns
; idx
++) {
10863 /* if the current connection is the selected one,
10864 * unmute it as default - otherwise mute it
10866 mute
= AMP_IN_MUTE(idx
);
10867 for (item
= 0; item
< imux
->num_items
; item
++) {
10868 if (imux
->items
[item
].index
== idx
) {
10869 if (spec
->cur_mux
[c
] == item
)
10870 mute
= AMP_IN_UNMUTE(idx
);
10874 /* check if we have a selector or mixer
10875 * we could check for the widget type instead, but
10876 * just check for Amp-In presence (in case of mixer
10877 * without amp-in there is something wrong, this
10878 * function shouldn't be used or capsrc nid is wrong)
10880 if (get_wcaps(codec
, nid
) & AC_WCAP_IN_AMP
)
10881 snd_hda_codec_write(codec
, nid
, 0,
10882 AC_VERB_SET_AMP_GAIN_MUTE
,
10884 else if (mute
!= AMP_IN_MUTE(idx
))
10885 snd_hda_codec_write(codec
, nid
, 0,
10886 AC_VERB_SET_CONNECT_SEL
,
10892 /* add mic boosts if needed */
10893 static int alc_auto_add_mic_boost(struct hda_codec
*codec
)
10895 struct alc_spec
*spec
= codec
->spec
;
10896 struct auto_pin_cfg
*cfg
= &spec
->autocfg
;
10900 const char *prev_label
= NULL
;
10902 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
10903 if (cfg
->inputs
[i
].type
> AUTO_PIN_MIC
)
10905 nid
= cfg
->inputs
[i
].pin
;
10906 if (get_wcaps(codec
, nid
) & AC_WCAP_IN_AMP
) {
10908 char boost_label
[32];
10910 label
= hda_get_autocfg_input_label(codec
, cfg
, i
);
10911 if (prev_label
&& !strcmp(label
, prev_label
))
10915 prev_label
= label
;
10917 snprintf(boost_label
, sizeof(boost_label
),
10918 "%s Boost Volume", label
);
10919 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
,
10920 boost_label
, type_idx
,
10921 HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_INPUT
));
10929 /* almost identical with ALC880 parser... */
10930 static int alc882_parse_auto_config(struct hda_codec
*codec
)
10932 struct alc_spec
*spec
= codec
->spec
;
10933 static hda_nid_t alc882_ignore
[] = { 0x1d, 0 };
10936 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
10940 if (!spec
->autocfg
.line_outs
)
10941 return 0; /* can't find valid BIOS pin config */
10943 err
= alc880_auto_fill_dac_nids(spec
, &spec
->autocfg
);
10946 err
= alc880_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
10949 err
= alc880_auto_create_extra_out(spec
, spec
->autocfg
.hp_pins
[0],
10953 err
= alc880_auto_create_extra_out(spec
,
10954 spec
->autocfg
.speaker_pins
[0],
10958 err
= alc882_auto_create_input_ctls(codec
, &spec
->autocfg
);
10962 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
10964 alc_auto_parse_digital(codec
);
10966 if (spec
->kctls
.list
)
10967 add_mixer(spec
, spec
->kctls
.list
);
10969 add_verb(spec
, alc883_auto_init_verbs
);
10970 /* if ADC 0x07 is available, initialize it, too */
10971 if (get_wcaps_type(get_wcaps(codec
, 0x07)) == AC_WID_AUD_IN
)
10972 add_verb(spec
, alc882_adc1_init_verbs
);
10974 spec
->num_mux_defs
= 1;
10975 spec
->input_mux
= &spec
->private_imux
[0];
10977 alc_ssid_check(codec
, 0x15, 0x1b, 0x14, 0);
10979 err
= alc_auto_add_mic_boost(codec
);
10983 return 1; /* config found */
10986 /* additional initialization for auto-configuration model */
10987 static void alc882_auto_init(struct hda_codec
*codec
)
10989 struct alc_spec
*spec
= codec
->spec
;
10990 alc882_auto_init_multi_out(codec
);
10991 alc882_auto_init_hp_out(codec
);
10992 alc882_auto_init_analog_input(codec
);
10993 alc882_auto_init_input_src(codec
);
10994 alc_auto_init_digital(codec
);
10995 if (spec
->unsol_event
)
10996 alc_inithook(codec
);
10999 static int patch_alc882(struct hda_codec
*codec
)
11001 struct alc_spec
*spec
;
11002 int err
, board_config
;
11004 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
11008 codec
->spec
= spec
;
11010 switch (codec
->vendor_id
) {
11015 /* ALC883 and variants */
11016 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
11020 board_config
= snd_hda_check_board_config(codec
, ALC882_MODEL_LAST
,
11024 if (board_config
< 0 || board_config
>= ALC882_MODEL_LAST
)
11025 board_config
= snd_hda_check_board_codec_sid_config(codec
,
11026 ALC882_MODEL_LAST
, alc882_models
, alc882_ssid_cfg_tbl
);
11028 if (board_config
< 0 || board_config
>= ALC882_MODEL_LAST
) {
11029 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
11031 board_config
= ALC882_AUTO
;
11034 if (board_config
== ALC882_AUTO
) {
11035 alc_pick_fixup(codec
, NULL
, alc882_fixup_tbl
, alc882_fixups
);
11036 alc_apply_fixup(codec
, ALC_FIXUP_ACT_PRE_PROBE
);
11039 alc_auto_parse_customize_define(codec
);
11041 if (board_config
== ALC882_AUTO
) {
11042 /* automatic parse from the BIOS config */
11043 err
= alc882_parse_auto_config(codec
);
11049 "hda_codec: Cannot set up configuration "
11050 "from BIOS. Using base mode...\n");
11051 board_config
= ALC882_3ST_DIG
;
11055 if (has_cdefine_beep(codec
)) {
11056 err
= snd_hda_attach_beep_device(codec
, 0x1);
11063 if (board_config
!= ALC882_AUTO
)
11064 setup_preset(codec
, &alc882_presets
[board_config
]);
11066 spec
->stream_analog_playback
= &alc882_pcm_analog_playback
;
11067 spec
->stream_analog_capture
= &alc882_pcm_analog_capture
;
11068 /* FIXME: setup DAC5 */
11069 /*spec->stream_analog_alt_playback = &alc880_pcm_analog_alt_playback;*/
11070 spec
->stream_analog_alt_capture
= &alc880_pcm_analog_alt_capture
;
11072 spec
->stream_digital_playback
= &alc882_pcm_digital_playback
;
11073 spec
->stream_digital_capture
= &alc882_pcm_digital_capture
;
11075 if (!spec
->adc_nids
&& spec
->input_mux
) {
11077 spec
->num_adc_nids
= 0;
11078 for (i
= 0; i
< ARRAY_SIZE(alc882_adc_nids
); i
++) {
11079 const struct hda_input_mux
*imux
= spec
->input_mux
;
11081 hda_nid_t items
[16];
11082 hda_nid_t nid
= alc882_adc_nids
[i
];
11083 unsigned int wcap
= get_wcaps(codec
, nid
);
11085 wcap
= get_wcaps_type(wcap
);
11086 if (wcap
!= AC_WID_AUD_IN
)
11088 spec
->private_adc_nids
[spec
->num_adc_nids
] = nid
;
11089 err
= snd_hda_get_connections(codec
, nid
, &cap
, 1);
11092 err
= snd_hda_get_connections(codec
, cap
, items
,
11093 ARRAY_SIZE(items
));
11096 for (j
= 0; j
< imux
->num_items
; j
++)
11097 if (imux
->items
[j
].index
>= err
)
11099 if (j
< imux
->num_items
)
11101 spec
->private_capsrc_nids
[spec
->num_adc_nids
] = cap
;
11102 spec
->num_adc_nids
++;
11104 spec
->adc_nids
= spec
->private_adc_nids
;
11105 spec
->capsrc_nids
= spec
->private_capsrc_nids
;
11108 set_capture_mixer(codec
);
11110 if (has_cdefine_beep(codec
))
11111 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
11113 alc_apply_fixup(codec
, ALC_FIXUP_ACT_PROBE
);
11115 spec
->vmaster_nid
= 0x0c;
11117 codec
->patch_ops
= alc_patch_ops
;
11118 if (board_config
== ALC882_AUTO
)
11119 spec
->init_hook
= alc882_auto_init
;
11121 alc_init_jacks(codec
);
11122 #ifdef CONFIG_SND_HDA_POWER_SAVE
11123 if (!spec
->loopback
.amplist
)
11124 spec
->loopback
.amplist
= alc882_loopbacks
;
11135 #define ALC262_DIGOUT_NID ALC880_DIGOUT_NID
11136 #define ALC262_DIGIN_NID ALC880_DIGIN_NID
11138 #define alc262_dac_nids alc260_dac_nids
11139 #define alc262_adc_nids alc882_adc_nids
11140 #define alc262_adc_nids_alt alc882_adc_nids_alt
11141 #define alc262_capsrc_nids alc882_capsrc_nids
11142 #define alc262_capsrc_nids_alt alc882_capsrc_nids_alt
11144 #define alc262_modes alc260_modes
11145 #define alc262_capture_source alc882_capture_source
11147 static hda_nid_t alc262_dmic_adc_nids
[1] = {
11152 static hda_nid_t alc262_dmic_capsrc_nids
[1] = { 0x22 };
11154 static struct snd_kcontrol_new alc262_base_mixer
[] = {
11155 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
11156 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
11157 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
11158 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
11159 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
11160 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
11161 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
11162 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
11163 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
11164 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
11165 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
11166 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
11167 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0D, 0x0, HDA_OUTPUT
),
11168 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
11169 HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
11170 HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x16, 2, 0x0, HDA_OUTPUT
),
11174 /* update HP, line and mono-out pins according to the master switch */
11175 static void alc262_hp_master_update(struct hda_codec
*codec
)
11177 struct alc_spec
*spec
= codec
->spec
;
11178 int val
= spec
->master_sw
;
11180 /* HP & line-out */
11181 snd_hda_codec_write_cache(codec
, 0x1b, 0,
11182 AC_VERB_SET_PIN_WIDGET_CONTROL
,
11184 snd_hda_codec_write_cache(codec
, 0x15, 0,
11185 AC_VERB_SET_PIN_WIDGET_CONTROL
,
11187 /* mono (speaker) depending on the HP jack sense */
11188 val
= val
&& !spec
->jack_present
;
11189 snd_hda_codec_write_cache(codec
, 0x16, 0,
11190 AC_VERB_SET_PIN_WIDGET_CONTROL
,
11191 val
? PIN_OUT
: 0);
11194 static void alc262_hp_bpc_automute(struct hda_codec
*codec
)
11196 struct alc_spec
*spec
= codec
->spec
;
11198 spec
->jack_present
= snd_hda_jack_detect(codec
, 0x1b);
11199 alc262_hp_master_update(codec
);
11202 static void alc262_hp_bpc_unsol_event(struct hda_codec
*codec
, unsigned int res
)
11204 if ((res
>> 26) != ALC880_HP_EVENT
)
11206 alc262_hp_bpc_automute(codec
);
11209 static void alc262_hp_wildwest_automute(struct hda_codec
*codec
)
11211 struct alc_spec
*spec
= codec
->spec
;
11213 spec
->jack_present
= snd_hda_jack_detect(codec
, 0x15);
11214 alc262_hp_master_update(codec
);
11217 static void alc262_hp_wildwest_unsol_event(struct hda_codec
*codec
,
11220 if ((res
>> 26) != ALC880_HP_EVENT
)
11222 alc262_hp_wildwest_automute(codec
);
11225 #define alc262_hp_master_sw_get alc260_hp_master_sw_get
11227 static int alc262_hp_master_sw_put(struct snd_kcontrol
*kcontrol
,
11228 struct snd_ctl_elem_value
*ucontrol
)
11230 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
11231 struct alc_spec
*spec
= codec
->spec
;
11232 int val
= !!*ucontrol
->value
.integer
.value
;
11234 if (val
== spec
->master_sw
)
11236 spec
->master_sw
= val
;
11237 alc262_hp_master_update(codec
);
11241 #define ALC262_HP_MASTER_SWITCH \
11243 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
11244 .name = "Master Playback Switch", \
11245 .info = snd_ctl_boolean_mono_info, \
11246 .get = alc262_hp_master_sw_get, \
11247 .put = alc262_hp_master_sw_put, \
11250 .iface = NID_MAPPING, \
11251 .name = "Master Playback Switch", \
11252 .private_value = 0x15 | (0x16 << 8) | (0x1b << 16), \
11256 static struct snd_kcontrol_new alc262_HP_BPC_mixer
[] = {
11257 ALC262_HP_MASTER_SWITCH
,
11258 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
11259 HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
11260 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
11261 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0e, 2, 0x0,
11263 HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x16, 2, 0x0,
11265 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
11266 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
11267 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
11268 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
11269 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
11270 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
11271 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
11272 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
11273 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
11274 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
11275 HDA_CODEC_VOLUME("AUX IN Playback Volume", 0x0b, 0x06, HDA_INPUT
),
11276 HDA_CODEC_MUTE("AUX IN Playback Switch", 0x0b, 0x06, HDA_INPUT
),
11280 static struct snd_kcontrol_new alc262_HP_BPC_WildWest_mixer
[] = {
11281 ALC262_HP_MASTER_SWITCH
,
11282 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
11283 HDA_CODEC_MUTE("Front Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
11284 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
11285 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
11286 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0e, 2, 0x0,
11288 HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x16, 2, 0x0,
11290 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x02, HDA_INPUT
),
11291 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x02, HDA_INPUT
),
11292 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x1a, 0, HDA_INPUT
),
11293 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT
),
11294 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT
),
11295 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
11296 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
11300 static struct snd_kcontrol_new alc262_HP_BPC_WildWest_option_mixer
[] = {
11301 HDA_CODEC_VOLUME("Rear Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
11302 HDA_CODEC_MUTE("Rear Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
11303 HDA_CODEC_VOLUME("Rear Mic Boost Volume", 0x18, 0, HDA_INPUT
),
11307 /* mute/unmute internal speaker according to the hp jack and mute state */
11308 static void alc262_hp_t5735_setup(struct hda_codec
*codec
)
11310 struct alc_spec
*spec
= codec
->spec
;
11312 spec
->autocfg
.hp_pins
[0] = 0x15;
11313 spec
->autocfg
.speaker_pins
[0] = 0x14;
11316 static struct snd_kcontrol_new alc262_hp_t5735_mixer
[] = {
11317 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
11318 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
11319 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
11320 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
11321 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
11322 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
11323 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
11327 static struct hda_verb alc262_hp_t5735_verbs
[] = {
11328 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
11329 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
11331 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
11335 static struct snd_kcontrol_new alc262_hp_rp5700_mixer
[] = {
11336 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
11337 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
11338 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0e, 0x0, HDA_OUTPUT
),
11339 HDA_CODEC_MUTE("Speaker Playback Switch", 0x16, 0x0, HDA_OUTPUT
),
11340 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT
),
11341 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT
),
11345 static struct hda_verb alc262_hp_rp5700_verbs
[] = {
11346 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
11347 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
11348 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
11349 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
11350 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
11351 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
11352 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
11353 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
11354 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x00 << 8))},
11355 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x00 << 8))},
11359 static struct hda_input_mux alc262_hp_rp5700_capture_source
= {
11366 /* bind hp and internal speaker mute (with plug check) as master switch */
11367 static void alc262_hippo_master_update(struct hda_codec
*codec
)
11369 struct alc_spec
*spec
= codec
->spec
;
11370 hda_nid_t hp_nid
= spec
->autocfg
.hp_pins
[0];
11371 hda_nid_t line_nid
= spec
->autocfg
.line_out_pins
[0];
11372 hda_nid_t speaker_nid
= spec
->autocfg
.speaker_pins
[0];
11376 mute
= spec
->master_sw
? 0 : HDA_AMP_MUTE
;
11377 snd_hda_codec_amp_stereo(codec
, hp_nid
, HDA_OUTPUT
, 0,
11378 HDA_AMP_MUTE
, mute
);
11379 /* mute internal speaker per jack sense */
11380 if (spec
->jack_present
)
11381 mute
= HDA_AMP_MUTE
;
11383 snd_hda_codec_amp_stereo(codec
, line_nid
, HDA_OUTPUT
, 0,
11384 HDA_AMP_MUTE
, mute
);
11385 if (speaker_nid
&& speaker_nid
!= line_nid
)
11386 snd_hda_codec_amp_stereo(codec
, speaker_nid
, HDA_OUTPUT
, 0,
11387 HDA_AMP_MUTE
, mute
);
11390 #define alc262_hippo_master_sw_get alc262_hp_master_sw_get
11392 static int alc262_hippo_master_sw_put(struct snd_kcontrol
*kcontrol
,
11393 struct snd_ctl_elem_value
*ucontrol
)
11395 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
11396 struct alc_spec
*spec
= codec
->spec
;
11397 int val
= !!*ucontrol
->value
.integer
.value
;
11399 if (val
== spec
->master_sw
)
11401 spec
->master_sw
= val
;
11402 alc262_hippo_master_update(codec
);
11406 #define ALC262_HIPPO_MASTER_SWITCH \
11408 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
11409 .name = "Master Playback Switch", \
11410 .info = snd_ctl_boolean_mono_info, \
11411 .get = alc262_hippo_master_sw_get, \
11412 .put = alc262_hippo_master_sw_put, \
11415 .iface = NID_MAPPING, \
11416 .name = "Master Playback Switch", \
11417 .subdevice = SUBDEV_HP(0) | (SUBDEV_LINE(0) << 8) | \
11418 (SUBDEV_SPEAKER(0) << 16), \
11421 static struct snd_kcontrol_new alc262_hippo_mixer
[] = {
11422 ALC262_HIPPO_MASTER_SWITCH
,
11423 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
11424 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
11425 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
11426 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
11427 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
11428 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
11429 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
11430 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
11431 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
11432 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
11433 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
11434 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
11438 static struct snd_kcontrol_new alc262_hippo1_mixer
[] = {
11439 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
11440 ALC262_HIPPO_MASTER_SWITCH
,
11441 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
11442 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
11443 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
11444 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
11445 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
11446 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
11447 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
11448 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
11449 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
11450 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
11454 /* mute/unmute internal speaker according to the hp jack and mute state */
11455 static void alc262_hippo_automute(struct hda_codec
*codec
)
11457 struct alc_spec
*spec
= codec
->spec
;
11458 hda_nid_t hp_nid
= spec
->autocfg
.hp_pins
[0];
11460 spec
->jack_present
= snd_hda_jack_detect(codec
, hp_nid
);
11461 alc262_hippo_master_update(codec
);
11464 static void alc262_hippo_unsol_event(struct hda_codec
*codec
, unsigned int res
)
11466 if ((res
>> 26) != ALC880_HP_EVENT
)
11468 alc262_hippo_automute(codec
);
11471 static void alc262_hippo_setup(struct hda_codec
*codec
)
11473 struct alc_spec
*spec
= codec
->spec
;
11475 spec
->autocfg
.hp_pins
[0] = 0x15;
11476 spec
->autocfg
.speaker_pins
[0] = 0x14;
11479 static void alc262_hippo1_setup(struct hda_codec
*codec
)
11481 struct alc_spec
*spec
= codec
->spec
;
11483 spec
->autocfg
.hp_pins
[0] = 0x1b;
11484 spec
->autocfg
.speaker_pins
[0] = 0x14;
11488 static struct snd_kcontrol_new alc262_sony_mixer
[] = {
11489 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
11490 ALC262_HIPPO_MASTER_SWITCH
,
11491 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
11492 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
11493 HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
11494 HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
11498 static struct snd_kcontrol_new alc262_benq_t31_mixer
[] = {
11499 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
11500 ALC262_HIPPO_MASTER_SWITCH
,
11501 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
11502 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
11503 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
11504 HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
11505 HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
11509 static struct snd_kcontrol_new alc262_tyan_mixer
[] = {
11510 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
11511 HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT
),
11512 HDA_CODEC_VOLUME("Aux Playback Volume", 0x0b, 0x06, HDA_INPUT
),
11513 HDA_CODEC_MUTE("Aux Playback Switch", 0x0b, 0x06, HDA_INPUT
),
11514 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
11515 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
11516 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
11517 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
11518 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
11519 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
11520 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
11521 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
11525 static struct hda_verb alc262_tyan_verbs
[] = {
11526 /* Headphone automute */
11527 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
11528 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
11529 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
11531 /* P11 AUX_IN, white 4-pin connector */
11532 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
11533 {0x14, AC_VERB_SET_CONFIG_DEFAULT_BYTES_1
, 0xe1},
11534 {0x14, AC_VERB_SET_CONFIG_DEFAULT_BYTES_2
, 0x93},
11535 {0x14, AC_VERB_SET_CONFIG_DEFAULT_BYTES_3
, 0x19},
11540 /* unsolicited event for HP jack sensing */
11541 static void alc262_tyan_setup(struct hda_codec
*codec
)
11543 struct alc_spec
*spec
= codec
->spec
;
11545 spec
->autocfg
.hp_pins
[0] = 0x1b;
11546 spec
->autocfg
.speaker_pins
[0] = 0x15;
11550 #define alc262_capture_mixer alc882_capture_mixer
11551 #define alc262_capture_alt_mixer alc882_capture_alt_mixer
11554 * generic initialization of ADC, input mixers and output mixers
11556 static struct hda_verb alc262_init_verbs
[] = {
11558 * Unmute ADC0-2 and set the default input to mic-in
11560 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
11561 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11562 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
11563 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11564 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
11565 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11567 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
11569 * Note: PASD motherboards uses the Line In 2 as the input for
11570 * front panel mic (mic 2)
11572 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
11573 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
11574 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
11575 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
11576 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
11577 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
11580 * Set up output mixers (0x0c - 0x0e)
11582 /* set vol=0 to output mixers */
11583 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11584 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11585 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11586 /* set up input amps for analog loopback */
11587 /* Amp Indices: DAC = 0, mixer = 1 */
11588 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11589 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11590 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11591 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11592 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11593 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11595 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
11596 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
11597 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
11598 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
11599 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
11600 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
11602 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
11603 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
11604 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
11605 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
11606 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
11608 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
11609 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
11611 /* FIXME: use matrix-type input source selection */
11612 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
11613 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
11614 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11615 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
11616 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
11617 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
11619 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11620 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
11621 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
11622 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
11624 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11625 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
11626 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
11627 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
11632 static struct hda_verb alc262_eapd_verbs
[] = {
11633 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
11634 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
11638 static struct hda_verb alc262_hippo1_unsol_verbs
[] = {
11639 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
11640 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
11641 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
11643 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
11644 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
11648 static struct hda_verb alc262_sony_unsol_verbs
[] = {
11649 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
11650 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
11651 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24}, // Front Mic
11653 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
11654 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
11658 static struct snd_kcontrol_new alc262_toshiba_s06_mixer
[] = {
11659 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
11660 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
11661 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
11662 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
11663 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
11667 static struct hda_verb alc262_toshiba_s06_verbs
[] = {
11668 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
11669 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
11670 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
11671 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
11672 {0x22, AC_VERB_SET_CONNECT_SEL
, 0x09},
11673 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
11674 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
11675 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
11679 static void alc262_toshiba_s06_setup(struct hda_codec
*codec
)
11681 struct alc_spec
*spec
= codec
->spec
;
11683 spec
->autocfg
.hp_pins
[0] = 0x15;
11684 spec
->autocfg
.speaker_pins
[0] = 0x14;
11685 spec
->ext_mic
.pin
= 0x18;
11686 spec
->ext_mic
.mux_idx
= 0;
11687 spec
->int_mic
.pin
= 0x12;
11688 spec
->int_mic
.mux_idx
= 9;
11689 spec
->auto_mic
= 1;
11695 * 0x16 = internal speaker
11696 * 0x18 = external mic
11699 static struct snd_kcontrol_new alc262_nec_mixer
[] = {
11700 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
11701 HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x16, 0, 0x0, HDA_OUTPUT
),
11703 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
11704 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
11705 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
11707 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
11708 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
11712 static struct hda_verb alc262_nec_verbs
[] = {
11713 /* Unmute Speaker */
11714 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
11717 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
11718 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
11720 /* External mic to headphone */
11721 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11722 /* External mic to speaker */
11723 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11729 * 0x14 = headphone/spdif-out, 0x15 = internal speaker,
11730 * 0x1b = port replicator headphone out
11733 #define ALC_HP_EVENT 0x37
11735 static struct hda_verb alc262_fujitsu_unsol_verbs
[] = {
11736 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC_HP_EVENT
},
11737 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
11738 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC_HP_EVENT
},
11739 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
11743 static struct hda_verb alc262_lenovo_3000_unsol_verbs
[] = {
11744 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC_HP_EVENT
},
11745 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
11749 static struct hda_verb alc262_lenovo_3000_init_verbs
[] = {
11750 /* Front Mic pin: input vref at 50% */
11751 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
11752 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
11756 static struct hda_input_mux alc262_fujitsu_capture_source
= {
11760 { "Internal Mic", 0x1 },
11765 static struct hda_input_mux alc262_HP_capture_source
= {
11769 { "Front Mic", 0x1 },
11776 static struct hda_input_mux alc262_HP_D7000_capture_source
= {
11780 { "Front Mic", 0x2 },
11786 /* mute/unmute internal speaker according to the hp jacks and mute state */
11787 static void alc262_fujitsu_automute(struct hda_codec
*codec
, int force
)
11789 struct alc_spec
*spec
= codec
->spec
;
11792 if (force
|| !spec
->sense_updated
) {
11793 spec
->jack_present
= snd_hda_jack_detect(codec
, 0x14) ||
11794 snd_hda_jack_detect(codec
, 0x1b);
11795 spec
->sense_updated
= 1;
11797 /* unmute internal speaker only if both HPs are unplugged and
11798 * master switch is on
11800 if (spec
->jack_present
)
11801 mute
= HDA_AMP_MUTE
;
11803 mute
= snd_hda_codec_amp_read(codec
, 0x14, 0, HDA_OUTPUT
, 0);
11804 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
11805 HDA_AMP_MUTE
, mute
);
11808 /* unsolicited event for HP jack sensing */
11809 static void alc262_fujitsu_unsol_event(struct hda_codec
*codec
,
11812 if ((res
>> 26) != ALC_HP_EVENT
)
11814 alc262_fujitsu_automute(codec
, 1);
11817 static void alc262_fujitsu_init_hook(struct hda_codec
*codec
)
11819 alc262_fujitsu_automute(codec
, 1);
11822 /* bind volumes of both NID 0x0c and 0x0d */
11823 static struct hda_bind_ctls alc262_fujitsu_bind_master_vol
= {
11824 .ops
= &snd_hda_bind_vol
,
11826 HDA_COMPOSE_AMP_VAL(0x0c, 3, 0, HDA_OUTPUT
),
11827 HDA_COMPOSE_AMP_VAL(0x0d, 3, 0, HDA_OUTPUT
),
11832 /* mute/unmute internal speaker according to the hp jack and mute state */
11833 static void alc262_lenovo_3000_automute(struct hda_codec
*codec
, int force
)
11835 struct alc_spec
*spec
= codec
->spec
;
11838 if (force
|| !spec
->sense_updated
) {
11839 spec
->jack_present
= snd_hda_jack_detect(codec
, 0x1b);
11840 spec
->sense_updated
= 1;
11842 if (spec
->jack_present
) {
11843 /* mute internal speaker */
11844 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
11845 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
11846 snd_hda_codec_amp_stereo(codec
, 0x16, HDA_OUTPUT
, 0,
11847 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
11849 /* unmute internal speaker if necessary */
11850 mute
= snd_hda_codec_amp_read(codec
, 0x1b, 0, HDA_OUTPUT
, 0);
11851 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
11852 HDA_AMP_MUTE
, mute
);
11853 snd_hda_codec_amp_stereo(codec
, 0x16, HDA_OUTPUT
, 0,
11854 HDA_AMP_MUTE
, mute
);
11858 /* unsolicited event for HP jack sensing */
11859 static void alc262_lenovo_3000_unsol_event(struct hda_codec
*codec
,
11862 if ((res
>> 26) != ALC_HP_EVENT
)
11864 alc262_lenovo_3000_automute(codec
, 1);
11867 static int amp_stereo_mute_update(struct hda_codec
*codec
, hda_nid_t nid
,
11868 int dir
, int idx
, long *valp
)
11872 for (i
= 0; i
< 2; i
++, valp
++)
11873 change
|= snd_hda_codec_amp_update(codec
, nid
, i
, dir
, idx
,
11875 *valp
? 0 : HDA_AMP_MUTE
);
11879 /* bind hp and internal speaker mute (with plug check) */
11880 static int alc262_fujitsu_master_sw_put(struct snd_kcontrol
*kcontrol
,
11881 struct snd_ctl_elem_value
*ucontrol
)
11883 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
11884 long *valp
= ucontrol
->value
.integer
.value
;
11887 change
= amp_stereo_mute_update(codec
, 0x14, HDA_OUTPUT
, 0, valp
);
11888 change
|= amp_stereo_mute_update(codec
, 0x1b, HDA_OUTPUT
, 0, valp
);
11890 alc262_fujitsu_automute(codec
, 0);
11894 static struct snd_kcontrol_new alc262_fujitsu_mixer
[] = {
11895 HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol
),
11897 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
11898 .name
= "Master Playback Switch",
11899 .subdevice
= HDA_SUBDEV_AMP_FLAG
,
11900 .info
= snd_hda_mixer_amp_switch_info
,
11901 .get
= snd_hda_mixer_amp_switch_get
,
11902 .put
= alc262_fujitsu_master_sw_put
,
11903 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
11906 .iface
= NID_MAPPING
,
11907 .name
= "Master Playback Switch",
11908 .private_value
= 0x1b,
11910 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
11911 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
11912 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
11913 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
11914 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
11915 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
11916 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
11917 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
11921 /* bind hp and internal speaker mute (with plug check) */
11922 static int alc262_lenovo_3000_master_sw_put(struct snd_kcontrol
*kcontrol
,
11923 struct snd_ctl_elem_value
*ucontrol
)
11925 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
11926 long *valp
= ucontrol
->value
.integer
.value
;
11929 change
= amp_stereo_mute_update(codec
, 0x1b, HDA_OUTPUT
, 0, valp
);
11931 alc262_lenovo_3000_automute(codec
, 0);
11935 static struct snd_kcontrol_new alc262_lenovo_3000_mixer
[] = {
11936 HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol
),
11938 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
11939 .name
= "Master Playback Switch",
11940 .subdevice
= HDA_SUBDEV_AMP_FLAG
,
11941 .info
= snd_hda_mixer_amp_switch_info
,
11942 .get
= snd_hda_mixer_amp_switch_get
,
11943 .put
= alc262_lenovo_3000_master_sw_put
,
11944 .private_value
= HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_OUTPUT
),
11946 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
11947 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
11948 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
11949 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
11950 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
11951 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
11952 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
11953 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
11957 static struct snd_kcontrol_new alc262_toshiba_rx1_mixer
[] = {
11958 HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol
),
11959 ALC262_HIPPO_MASTER_SWITCH
,
11960 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
11961 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
11962 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
11963 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
11964 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
11965 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
11969 /* additional init verbs for Benq laptops */
11970 static struct hda_verb alc262_EAPD_verbs
[] = {
11971 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
11972 {0x20, AC_VERB_SET_PROC_COEF
, 0x3070},
11976 static struct hda_verb alc262_benq_t31_EAPD_verbs
[] = {
11977 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
11978 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
11980 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
11981 {0x20, AC_VERB_SET_PROC_COEF
, 0x3050},
11985 /* Samsung Q1 Ultra Vista model setup */
11986 static struct snd_kcontrol_new alc262_ultra_mixer
[] = {
11987 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
11988 HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT
),
11989 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
11990 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
11991 HDA_CODEC_VOLUME("Mic Boost Volume", 0x19, 0, HDA_INPUT
),
11992 HDA_CODEC_VOLUME("Headphone Mic Boost Volume", 0x15, 0, HDA_INPUT
),
11996 static struct hda_verb alc262_ultra_verbs
[] = {
11998 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
11999 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
12000 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12002 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
12003 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12004 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12005 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
12007 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
12008 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12009 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12010 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
12011 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
12013 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
12014 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
12015 /* ADC, choose mic */
12016 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
12017 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
12018 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
12019 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
12020 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
12021 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
12022 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)},
12023 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)},
12024 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)},
12025 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(8)},
12029 /* mute/unmute internal speaker according to the hp jack and mute state */
12030 static void alc262_ultra_automute(struct hda_codec
*codec
)
12032 struct alc_spec
*spec
= codec
->spec
;
12036 /* auto-mute only when HP is used as HP */
12037 if (!spec
->cur_mux
[0]) {
12038 spec
->jack_present
= snd_hda_jack_detect(codec
, 0x15);
12039 if (spec
->jack_present
)
12040 mute
= HDA_AMP_MUTE
;
12042 /* mute/unmute internal speaker */
12043 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
12044 HDA_AMP_MUTE
, mute
);
12045 /* mute/unmute HP */
12046 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
12047 HDA_AMP_MUTE
, mute
? 0 : HDA_AMP_MUTE
);
12050 /* unsolicited event for HP jack sensing */
12051 static void alc262_ultra_unsol_event(struct hda_codec
*codec
,
12054 if ((res
>> 26) != ALC880_HP_EVENT
)
12056 alc262_ultra_automute(codec
);
12059 static struct hda_input_mux alc262_ultra_capture_source
= {
12063 { "Headphone", 0x7 },
12067 static int alc262_ultra_mux_enum_put(struct snd_kcontrol
*kcontrol
,
12068 struct snd_ctl_elem_value
*ucontrol
)
12070 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
12071 struct alc_spec
*spec
= codec
->spec
;
12074 ret
= alc_mux_enum_put(kcontrol
, ucontrol
);
12077 /* reprogram the HP pin as mic or HP according to the input source */
12078 snd_hda_codec_write_cache(codec
, 0x15, 0,
12079 AC_VERB_SET_PIN_WIDGET_CONTROL
,
12080 spec
->cur_mux
[0] ? PIN_VREF80
: PIN_HP
);
12081 alc262_ultra_automute(codec
); /* mute/unmute HP */
12085 static struct snd_kcontrol_new alc262_ultra_capture_mixer
[] = {
12086 HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT
),
12087 HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT
),
12089 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
12090 .name
= "Capture Source",
12091 .info
= alc_mux_enum_info
,
12092 .get
= alc_mux_enum_get
,
12093 .put
= alc262_ultra_mux_enum_put
,
12096 .iface
= NID_MAPPING
,
12097 .name
= "Capture Source",
12098 .private_value
= 0x15,
12103 /* We use two mixers depending on the output pin; 0x16 is a mono output
12104 * and thus it's bound with a different mixer.
12105 * This function returns which mixer amp should be used.
12107 static int alc262_check_volbit(hda_nid_t nid
)
12111 else if (nid
== 0x16)
12117 static int alc262_add_out_vol_ctl(struct alc_spec
*spec
, hda_nid_t nid
,
12118 const char *pfx
, int *vbits
, int idx
)
12123 vbit
= alc262_check_volbit(nid
);
12126 if (*vbits
& vbit
) /* a volume control for this mixer already there */
12130 val
= HDA_COMPOSE_AMP_VAL(0x0e, 2, 0, HDA_OUTPUT
);
12132 val
= HDA_COMPOSE_AMP_VAL(0x0c, 3, 0, HDA_OUTPUT
);
12133 return __add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, pfx
, idx
, val
);
12136 static int alc262_add_out_sw_ctl(struct alc_spec
*spec
, hda_nid_t nid
,
12137 const char *pfx
, int idx
)
12144 val
= HDA_COMPOSE_AMP_VAL(nid
, 2, 0, HDA_OUTPUT
);
12146 val
= HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_OUTPUT
);
12147 return __add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, pfx
, idx
, val
);
12150 /* add playback controls from the parsed DAC table */
12151 static int alc262_auto_create_multi_out_ctls(struct alc_spec
*spec
,
12152 const struct auto_pin_cfg
*cfg
)
12158 spec
->multiout
.num_dacs
= 1; /* only use one dac */
12159 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
12160 spec
->multiout
.dac_nids
[0] = 2;
12162 pfx
= alc_get_line_out_pfx(cfg
, true);
12165 for (i
= 0; i
< 2; i
++) {
12166 err
= alc262_add_out_sw_ctl(spec
, cfg
->line_out_pins
[i
], pfx
, i
);
12169 if (cfg
->line_out_type
!= AUTO_PIN_SPEAKER_OUT
) {
12170 err
= alc262_add_out_sw_ctl(spec
, cfg
->speaker_pins
[i
],
12175 if (cfg
->line_out_type
!= AUTO_PIN_HP_OUT
) {
12176 err
= alc262_add_out_sw_ctl(spec
, cfg
->hp_pins
[i
],
12183 vbits
= alc262_check_volbit(cfg
->line_out_pins
[0]) |
12184 alc262_check_volbit(cfg
->speaker_pins
[0]) |
12185 alc262_check_volbit(cfg
->hp_pins
[0]);
12186 if (vbits
== 1 || vbits
== 2)
12187 pfx
= "Master"; /* only one mixer is used */
12189 for (i
= 0; i
< 2; i
++) {
12190 err
= alc262_add_out_vol_ctl(spec
, cfg
->line_out_pins
[i
], pfx
,
12194 if (cfg
->line_out_type
!= AUTO_PIN_SPEAKER_OUT
) {
12195 err
= alc262_add_out_vol_ctl(spec
, cfg
->speaker_pins
[i
],
12196 "Speaker", &vbits
, i
);
12200 if (cfg
->line_out_type
!= AUTO_PIN_HP_OUT
) {
12201 err
= alc262_add_out_vol_ctl(spec
, cfg
->hp_pins
[i
],
12202 "Headphone", &vbits
, i
);
12210 #define alc262_auto_create_input_ctls \
12211 alc882_auto_create_input_ctls
12214 * generic initialization of ADC, input mixers and output mixers
12216 static struct hda_verb alc262_volume_init_verbs
[] = {
12218 * Unmute ADC0-2 and set the default input to mic-in
12220 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
12221 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12222 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
12223 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12224 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
12225 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12227 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
12229 * Note: PASD motherboards uses the Line In 2 as the input for
12230 * front panel mic (mic 2)
12232 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
12233 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
12234 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
12235 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
12236 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
12237 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
12240 * Set up output mixers (0x0c - 0x0f)
12242 /* set vol=0 to output mixers */
12243 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12244 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12245 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12247 /* set up input amps for analog loopback */
12248 /* Amp Indices: DAC = 0, mixer = 1 */
12249 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12250 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
12251 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12252 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
12253 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12254 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
12256 /* FIXME: use matrix-type input source selection */
12257 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
12258 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
12259 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
12260 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
12261 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
12262 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
12264 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
12265 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
12266 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
12267 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
12269 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
12270 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
12271 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
12272 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
12277 static struct hda_verb alc262_HP_BPC_init_verbs
[] = {
12279 * Unmute ADC0-2 and set the default input to mic-in
12281 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
12282 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12283 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
12284 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12285 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
12286 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12288 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
12290 * Note: PASD motherboards uses the Line In 2 as the input for
12291 * front panel mic (mic 2)
12293 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
12294 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
12295 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
12296 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
12297 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
12298 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
12299 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)},
12300 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)},
12303 * Set up output mixers (0x0c - 0x0e)
12305 /* set vol=0 to output mixers */
12306 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12307 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12308 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12310 /* set up input amps for analog loopback */
12311 /* Amp Indices: DAC = 0, mixer = 1 */
12312 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12313 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
12314 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12315 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
12316 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12317 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
12319 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
12320 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
12321 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
12323 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
12324 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
12326 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
12327 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
12329 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
12330 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
12331 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
12332 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
12333 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
12335 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
12336 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
12337 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
12338 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
12339 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
12340 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
12343 /* FIXME: use matrix-type input source selection */
12344 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 0b, 12 */
12345 /* Input mixer1: only unmute Mic */
12346 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
12347 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8))},
12348 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
12349 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
12350 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
12351 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x05 << 8))},
12352 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x06 << 8))},
12353 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x07 << 8))},
12354 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x08 << 8))},
12356 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
12357 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8))},
12358 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
12359 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
12360 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
12361 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x05 << 8))},
12362 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x06 << 8))},
12363 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x07 << 8))},
12364 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x08 << 8))},
12366 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
12367 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8))},
12368 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
12369 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
12370 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
12371 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x05 << 8))},
12372 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x06 << 8))},
12373 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x07 << 8))},
12374 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x08 << 8))},
12376 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
12381 static struct hda_verb alc262_HP_BPC_WildWest_init_verbs
[] = {
12383 * Unmute ADC0-2 and set the default input to mic-in
12385 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
12386 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12387 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
12388 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12389 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
12390 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12392 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
12394 * Note: PASD motherboards uses the Line In 2 as the input for front
12395 * panel mic (mic 2)
12397 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
12398 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
12399 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
12400 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
12401 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
12402 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
12403 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)},
12404 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)},
12405 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)},
12407 * Set up output mixers (0x0c - 0x0e)
12409 /* set vol=0 to output mixers */
12410 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12411 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12412 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12414 /* set up input amps for analog loopback */
12415 /* Amp Indices: DAC = 0, mixer = 1 */
12416 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12417 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
12418 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12419 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
12420 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12421 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
12424 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
}, /* HP */
12425 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
}, /* Mono */
12426 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
}, /* rear MIC */
12427 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* Line in */
12428 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
}, /* Front MIC */
12429 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
}, /* Line out */
12430 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* CD in */
12432 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
12433 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
12435 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
12436 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
12438 /* {0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0x7023 }, */
12439 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
12440 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
12441 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7023 },
12442 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
12443 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
12445 /* FIXME: use matrix-type input source selection */
12446 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
12447 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
12448 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))}, /*rear MIC*/
12449 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))}, /*Line in*/
12450 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x02 << 8))}, /*F MIC*/
12451 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x03 << 8))}, /*Front*/
12452 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x04 << 8))}, /*CD*/
12453 /* {0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x06 << 8))}, */
12454 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x07 << 8))}, /*HP*/
12456 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
12457 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
12458 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x02 << 8))},
12459 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x03 << 8))},
12460 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x04 << 8))},
12461 /* {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x06 << 8))}, */
12462 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x07 << 8))},
12464 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
12465 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
12466 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x02 << 8))},
12467 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x03 << 8))},
12468 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x04 << 8))},
12469 /* {0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x06 << 8))}, */
12470 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x07 << 8))},
12472 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
12477 static struct hda_verb alc262_toshiba_rx1_unsol_verbs
[] = {
12479 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
}, /* Front Speaker */
12480 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
12481 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x01},
12483 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
}, /* MIC jack */
12484 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
}, /* Front MIC */
12485 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0) },
12486 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0) },
12488 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
}, /* HP jack */
12489 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
12490 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
12501 static const struct alc_fixup alc262_fixups
[] = {
12502 [PINFIX_FSC_H270
] = {
12503 .type
= ALC_FIXUP_PINS
,
12504 .v
.pins
= (const struct alc_pincfg
[]) {
12505 { 0x14, 0x99130110 }, /* speaker */
12506 { 0x15, 0x0221142f }, /* front HP */
12507 { 0x1b, 0x0121141f }, /* rear HP */
12513 static struct snd_pci_quirk alc262_fixup_tbl
[] = {
12514 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", PINFIX_FSC_H270
),
12519 #ifdef CONFIG_SND_HDA_POWER_SAVE
12520 #define alc262_loopbacks alc880_loopbacks
12523 /* pcm configuration: identical with ALC880 */
12524 #define alc262_pcm_analog_playback alc880_pcm_analog_playback
12525 #define alc262_pcm_analog_capture alc880_pcm_analog_capture
12526 #define alc262_pcm_digital_playback alc880_pcm_digital_playback
12527 #define alc262_pcm_digital_capture alc880_pcm_digital_capture
12530 * BIOS auto configuration
12532 static int alc262_parse_auto_config(struct hda_codec
*codec
)
12534 struct alc_spec
*spec
= codec
->spec
;
12536 static hda_nid_t alc262_ignore
[] = { 0x1d, 0 };
12538 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
12542 if (!spec
->autocfg
.line_outs
) {
12543 if (spec
->autocfg
.dig_outs
|| spec
->autocfg
.dig_in_pin
) {
12544 spec
->multiout
.max_channels
= 2;
12545 spec
->no_analog
= 1;
12548 return 0; /* can't find valid BIOS pin config */
12550 err
= alc262_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
12553 err
= alc262_auto_create_input_ctls(codec
, &spec
->autocfg
);
12557 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
12560 alc_auto_parse_digital(codec
);
12562 if (spec
->kctls
.list
)
12563 add_mixer(spec
, spec
->kctls
.list
);
12565 add_verb(spec
, alc262_volume_init_verbs
);
12566 spec
->num_mux_defs
= 1;
12567 spec
->input_mux
= &spec
->private_imux
[0];
12569 err
= alc_auto_add_mic_boost(codec
);
12573 alc_ssid_check(codec
, 0x15, 0x1b, 0x14, 0);
12578 #define alc262_auto_init_multi_out alc882_auto_init_multi_out
12579 #define alc262_auto_init_hp_out alc882_auto_init_hp_out
12580 #define alc262_auto_init_analog_input alc882_auto_init_analog_input
12581 #define alc262_auto_init_input_src alc882_auto_init_input_src
12584 /* init callback for auto-configuration model -- overriding the default init */
12585 static void alc262_auto_init(struct hda_codec
*codec
)
12587 struct alc_spec
*spec
= codec
->spec
;
12588 alc262_auto_init_multi_out(codec
);
12589 alc262_auto_init_hp_out(codec
);
12590 alc262_auto_init_analog_input(codec
);
12591 alc262_auto_init_input_src(codec
);
12592 alc_auto_init_digital(codec
);
12593 if (spec
->unsol_event
)
12594 alc_inithook(codec
);
12598 * configuration and preset
12600 static const char * const alc262_models
[ALC262_MODEL_LAST
] = {
12601 [ALC262_BASIC
] = "basic",
12602 [ALC262_HIPPO
] = "hippo",
12603 [ALC262_HIPPO_1
] = "hippo_1",
12604 [ALC262_FUJITSU
] = "fujitsu",
12605 [ALC262_HP_BPC
] = "hp-bpc",
12606 [ALC262_HP_BPC_D7000_WL
]= "hp-bpc-d7000",
12607 [ALC262_HP_TC_T5735
] = "hp-tc-t5735",
12608 [ALC262_HP_RP5700
] = "hp-rp5700",
12609 [ALC262_BENQ_ED8
] = "benq",
12610 [ALC262_BENQ_T31
] = "benq-t31",
12611 [ALC262_SONY_ASSAMD
] = "sony-assamd",
12612 [ALC262_TOSHIBA_S06
] = "toshiba-s06",
12613 [ALC262_TOSHIBA_RX1
] = "toshiba-rx1",
12614 [ALC262_ULTRA
] = "ultra",
12615 [ALC262_LENOVO_3000
] = "lenovo-3000",
12616 [ALC262_NEC
] = "nec",
12617 [ALC262_TYAN
] = "tyan",
12618 [ALC262_AUTO
] = "auto",
12621 static struct snd_pci_quirk alc262_cfg_tbl
[] = {
12622 SND_PCI_QUIRK(0x1002, 0x437b, "Hippo", ALC262_HIPPO
),
12623 SND_PCI_QUIRK(0x1033, 0x8895, "NEC Versa S9100", ALC262_NEC
),
12624 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1200, "HP xw series",
12626 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1300, "HP xw series",
12628 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1500, "HP z series",
12630 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series",
12632 SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL
),
12633 SND_PCI_QUIRK(0x103c, 0x2801, "HP D7000", ALC262_HP_BPC_D7000_WF
),
12634 SND_PCI_QUIRK(0x103c, 0x2802, "HP D7000", ALC262_HP_BPC_D7000_WL
),
12635 SND_PCI_QUIRK(0x103c, 0x2803, "HP D7000", ALC262_HP_BPC_D7000_WF
),
12636 SND_PCI_QUIRK(0x103c, 0x2804, "HP D7000", ALC262_HP_BPC_D7000_WL
),
12637 SND_PCI_QUIRK(0x103c, 0x2805, "HP D7000", ALC262_HP_BPC_D7000_WF
),
12638 SND_PCI_QUIRK(0x103c, 0x2806, "HP D7000", ALC262_HP_BPC_D7000_WL
),
12639 SND_PCI_QUIRK(0x103c, 0x2807, "HP D7000", ALC262_HP_BPC_D7000_WF
),
12640 SND_PCI_QUIRK(0x103c, 0x280c, "HP xw4400", ALC262_HP_BPC
),
12641 SND_PCI_QUIRK(0x103c, 0x3014, "HP xw6400", ALC262_HP_BPC
),
12642 SND_PCI_QUIRK(0x103c, 0x3015, "HP xw8400", ALC262_HP_BPC
),
12643 SND_PCI_QUIRK(0x103c, 0x302f, "HP Thin Client T5735",
12644 ALC262_HP_TC_T5735
),
12645 SND_PCI_QUIRK(0x103c, 0x2817, "HP RP5700", ALC262_HP_RP5700
),
12646 SND_PCI_QUIRK(0x104d, 0x1f00, "Sony ASSAMD", ALC262_SONY_ASSAMD
),
12647 SND_PCI_QUIRK(0x104d, 0x8203, "Sony UX-90", ALC262_HIPPO
),
12648 SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD
),
12649 SND_PCI_QUIRK(0x104d, 0x9016, "Sony VAIO", ALC262_AUTO
), /* dig-only */
12650 SND_PCI_QUIRK(0x104d, 0x9025, "Sony VAIO Z21MN", ALC262_TOSHIBA_S06
),
12651 SND_PCI_QUIRK(0x104d, 0x9035, "Sony VAIO VGN-FW170J", ALC262_AUTO
),
12652 SND_PCI_QUIRK(0x104d, 0x9047, "Sony VAIO Type G", ALC262_AUTO
),
12653 #if 0 /* disable the quirk since model=auto works better in recent versions */
12654 SND_PCI_QUIRK_MASK(0x104d, 0xff00, 0x9000, "Sony VAIO",
12655 ALC262_SONY_ASSAMD
),
12657 SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1",
12658 ALC262_TOSHIBA_RX1
),
12659 SND_PCI_QUIRK(0x1179, 0xff7b, "Toshiba S06", ALC262_TOSHIBA_S06
),
12660 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU
),
12661 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU
),
12662 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_TYAN
),
12663 SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc032, "Samsung Q1",
12665 SND_PCI_QUIRK(0x144d, 0xc510, "Samsung Q45", ALC262_HIPPO
),
12666 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000 y410", ALC262_LENOVO_3000
),
12667 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8
),
12668 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_BENQ_T31
),
12669 SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1
),
12673 static struct alc_config_preset alc262_presets
[] = {
12675 .mixers
= { alc262_base_mixer
},
12676 .init_verbs
= { alc262_init_verbs
},
12677 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12678 .dac_nids
= alc262_dac_nids
,
12680 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12681 .channel_mode
= alc262_modes
,
12682 .input_mux
= &alc262_capture_source
,
12685 .mixers
= { alc262_hippo_mixer
},
12686 .init_verbs
= { alc262_init_verbs
, alc_hp15_unsol_verbs
},
12687 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12688 .dac_nids
= alc262_dac_nids
,
12690 .dig_out_nid
= ALC262_DIGOUT_NID
,
12691 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12692 .channel_mode
= alc262_modes
,
12693 .input_mux
= &alc262_capture_source
,
12694 .unsol_event
= alc262_hippo_unsol_event
,
12695 .setup
= alc262_hippo_setup
,
12696 .init_hook
= alc262_hippo_automute
,
12698 [ALC262_HIPPO_1
] = {
12699 .mixers
= { alc262_hippo1_mixer
},
12700 .init_verbs
= { alc262_init_verbs
, alc262_hippo1_unsol_verbs
},
12701 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12702 .dac_nids
= alc262_dac_nids
,
12704 .dig_out_nid
= ALC262_DIGOUT_NID
,
12705 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12706 .channel_mode
= alc262_modes
,
12707 .input_mux
= &alc262_capture_source
,
12708 .unsol_event
= alc262_hippo_unsol_event
,
12709 .setup
= alc262_hippo1_setup
,
12710 .init_hook
= alc262_hippo_automute
,
12712 [ALC262_FUJITSU
] = {
12713 .mixers
= { alc262_fujitsu_mixer
},
12714 .init_verbs
= { alc262_init_verbs
, alc262_EAPD_verbs
,
12715 alc262_fujitsu_unsol_verbs
},
12716 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12717 .dac_nids
= alc262_dac_nids
,
12719 .dig_out_nid
= ALC262_DIGOUT_NID
,
12720 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12721 .channel_mode
= alc262_modes
,
12722 .input_mux
= &alc262_fujitsu_capture_source
,
12723 .unsol_event
= alc262_fujitsu_unsol_event
,
12724 .init_hook
= alc262_fujitsu_init_hook
,
12726 [ALC262_HP_BPC
] = {
12727 .mixers
= { alc262_HP_BPC_mixer
},
12728 .init_verbs
= { alc262_HP_BPC_init_verbs
},
12729 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12730 .dac_nids
= alc262_dac_nids
,
12732 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12733 .channel_mode
= alc262_modes
,
12734 .input_mux
= &alc262_HP_capture_source
,
12735 .unsol_event
= alc262_hp_bpc_unsol_event
,
12736 .init_hook
= alc262_hp_bpc_automute
,
12738 [ALC262_HP_BPC_D7000_WF
] = {
12739 .mixers
= { alc262_HP_BPC_WildWest_mixer
},
12740 .init_verbs
= { alc262_HP_BPC_WildWest_init_verbs
},
12741 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12742 .dac_nids
= alc262_dac_nids
,
12744 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12745 .channel_mode
= alc262_modes
,
12746 .input_mux
= &alc262_HP_D7000_capture_source
,
12747 .unsol_event
= alc262_hp_wildwest_unsol_event
,
12748 .init_hook
= alc262_hp_wildwest_automute
,
12750 [ALC262_HP_BPC_D7000_WL
] = {
12751 .mixers
= { alc262_HP_BPC_WildWest_mixer
,
12752 alc262_HP_BPC_WildWest_option_mixer
},
12753 .init_verbs
= { alc262_HP_BPC_WildWest_init_verbs
},
12754 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12755 .dac_nids
= alc262_dac_nids
,
12757 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12758 .channel_mode
= alc262_modes
,
12759 .input_mux
= &alc262_HP_D7000_capture_source
,
12760 .unsol_event
= alc262_hp_wildwest_unsol_event
,
12761 .init_hook
= alc262_hp_wildwest_automute
,
12763 [ALC262_HP_TC_T5735
] = {
12764 .mixers
= { alc262_hp_t5735_mixer
},
12765 .init_verbs
= { alc262_init_verbs
, alc262_hp_t5735_verbs
},
12766 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12767 .dac_nids
= alc262_dac_nids
,
12769 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12770 .channel_mode
= alc262_modes
,
12771 .input_mux
= &alc262_capture_source
,
12772 .unsol_event
= alc_sku_unsol_event
,
12773 .setup
= alc262_hp_t5735_setup
,
12774 .init_hook
= alc_inithook
,
12776 [ALC262_HP_RP5700
] = {
12777 .mixers
= { alc262_hp_rp5700_mixer
},
12778 .init_verbs
= { alc262_init_verbs
, alc262_hp_rp5700_verbs
},
12779 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12780 .dac_nids
= alc262_dac_nids
,
12781 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12782 .channel_mode
= alc262_modes
,
12783 .input_mux
= &alc262_hp_rp5700_capture_source
,
12785 [ALC262_BENQ_ED8
] = {
12786 .mixers
= { alc262_base_mixer
},
12787 .init_verbs
= { alc262_init_verbs
, alc262_EAPD_verbs
},
12788 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12789 .dac_nids
= alc262_dac_nids
,
12791 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12792 .channel_mode
= alc262_modes
,
12793 .input_mux
= &alc262_capture_source
,
12795 [ALC262_SONY_ASSAMD
] = {
12796 .mixers
= { alc262_sony_mixer
},
12797 .init_verbs
= { alc262_init_verbs
, alc262_sony_unsol_verbs
},
12798 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12799 .dac_nids
= alc262_dac_nids
,
12801 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12802 .channel_mode
= alc262_modes
,
12803 .input_mux
= &alc262_capture_source
,
12804 .unsol_event
= alc262_hippo_unsol_event
,
12805 .setup
= alc262_hippo_setup
,
12806 .init_hook
= alc262_hippo_automute
,
12808 [ALC262_BENQ_T31
] = {
12809 .mixers
= { alc262_benq_t31_mixer
},
12810 .init_verbs
= { alc262_init_verbs
, alc262_benq_t31_EAPD_verbs
,
12811 alc_hp15_unsol_verbs
},
12812 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12813 .dac_nids
= alc262_dac_nids
,
12815 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12816 .channel_mode
= alc262_modes
,
12817 .input_mux
= &alc262_capture_source
,
12818 .unsol_event
= alc262_hippo_unsol_event
,
12819 .setup
= alc262_hippo_setup
,
12820 .init_hook
= alc262_hippo_automute
,
12823 .mixers
= { alc262_ultra_mixer
},
12824 .cap_mixer
= alc262_ultra_capture_mixer
,
12825 .init_verbs
= { alc262_ultra_verbs
},
12826 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12827 .dac_nids
= alc262_dac_nids
,
12828 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12829 .channel_mode
= alc262_modes
,
12830 .input_mux
= &alc262_ultra_capture_source
,
12831 .adc_nids
= alc262_adc_nids
, /* ADC0 */
12832 .capsrc_nids
= alc262_capsrc_nids
,
12833 .num_adc_nids
= 1, /* single ADC */
12834 .unsol_event
= alc262_ultra_unsol_event
,
12835 .init_hook
= alc262_ultra_automute
,
12837 [ALC262_LENOVO_3000
] = {
12838 .mixers
= { alc262_lenovo_3000_mixer
},
12839 .init_verbs
= { alc262_init_verbs
, alc262_EAPD_verbs
,
12840 alc262_lenovo_3000_unsol_verbs
,
12841 alc262_lenovo_3000_init_verbs
},
12842 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12843 .dac_nids
= alc262_dac_nids
,
12845 .dig_out_nid
= ALC262_DIGOUT_NID
,
12846 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12847 .channel_mode
= alc262_modes
,
12848 .input_mux
= &alc262_fujitsu_capture_source
,
12849 .unsol_event
= alc262_lenovo_3000_unsol_event
,
12852 .mixers
= { alc262_nec_mixer
},
12853 .init_verbs
= { alc262_nec_verbs
},
12854 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12855 .dac_nids
= alc262_dac_nids
,
12857 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12858 .channel_mode
= alc262_modes
,
12859 .input_mux
= &alc262_capture_source
,
12861 [ALC262_TOSHIBA_S06
] = {
12862 .mixers
= { alc262_toshiba_s06_mixer
},
12863 .init_verbs
= { alc262_init_verbs
, alc262_toshiba_s06_verbs
,
12864 alc262_eapd_verbs
},
12865 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12866 .capsrc_nids
= alc262_dmic_capsrc_nids
,
12867 .dac_nids
= alc262_dac_nids
,
12868 .adc_nids
= alc262_dmic_adc_nids
, /* ADC0 */
12869 .num_adc_nids
= 1, /* single ADC */
12870 .dig_out_nid
= ALC262_DIGOUT_NID
,
12871 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12872 .channel_mode
= alc262_modes
,
12873 .unsol_event
= alc_sku_unsol_event
,
12874 .setup
= alc262_toshiba_s06_setup
,
12875 .init_hook
= alc_inithook
,
12877 [ALC262_TOSHIBA_RX1
] = {
12878 .mixers
= { alc262_toshiba_rx1_mixer
},
12879 .init_verbs
= { alc262_init_verbs
, alc262_toshiba_rx1_unsol_verbs
},
12880 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12881 .dac_nids
= alc262_dac_nids
,
12883 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12884 .channel_mode
= alc262_modes
,
12885 .input_mux
= &alc262_capture_source
,
12886 .unsol_event
= alc262_hippo_unsol_event
,
12887 .setup
= alc262_hippo_setup
,
12888 .init_hook
= alc262_hippo_automute
,
12891 .mixers
= { alc262_tyan_mixer
},
12892 .init_verbs
= { alc262_init_verbs
, alc262_tyan_verbs
},
12893 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
12894 .dac_nids
= alc262_dac_nids
,
12896 .dig_out_nid
= ALC262_DIGOUT_NID
,
12897 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
12898 .channel_mode
= alc262_modes
,
12899 .input_mux
= &alc262_capture_source
,
12900 .unsol_event
= alc_automute_amp_unsol_event
,
12901 .setup
= alc262_tyan_setup
,
12902 .init_hook
= alc_automute_amp
,
12906 static int patch_alc262(struct hda_codec
*codec
)
12908 struct alc_spec
*spec
;
12912 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
12916 codec
->spec
= spec
;
12918 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
12923 snd_hda_codec_write(codec
, 0x1a, 0, AC_VERB_SET_COEF_INDEX
, 7);
12924 tmp
= snd_hda_codec_read(codec
, 0x20, 0, AC_VERB_GET_PROC_COEF
, 0);
12925 snd_hda_codec_write(codec
, 0x1a, 0, AC_VERB_SET_COEF_INDEX
, 7);
12926 snd_hda_codec_write(codec
, 0x1a, 0, AC_VERB_SET_PROC_COEF
, tmp
| 0x80);
12929 alc_auto_parse_customize_define(codec
);
12931 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
12933 board_config
= snd_hda_check_board_config(codec
, ALC262_MODEL_LAST
,
12937 if (board_config
< 0) {
12938 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
12940 board_config
= ALC262_AUTO
;
12943 if (board_config
== ALC262_AUTO
) {
12944 alc_pick_fixup(codec
, NULL
, alc262_fixup_tbl
, alc262_fixups
);
12945 alc_apply_fixup(codec
, ALC_FIXUP_ACT_PRE_PROBE
);
12948 if (board_config
== ALC262_AUTO
) {
12949 /* automatic parse from the BIOS config */
12950 err
= alc262_parse_auto_config(codec
);
12956 "hda_codec: Cannot set up configuration "
12957 "from BIOS. Using base mode...\n");
12958 board_config
= ALC262_BASIC
;
12962 if (!spec
->no_analog
&& has_cdefine_beep(codec
)) {
12963 err
= snd_hda_attach_beep_device(codec
, 0x1);
12970 if (board_config
!= ALC262_AUTO
)
12971 setup_preset(codec
, &alc262_presets
[board_config
]);
12973 spec
->stream_analog_playback
= &alc262_pcm_analog_playback
;
12974 spec
->stream_analog_capture
= &alc262_pcm_analog_capture
;
12976 spec
->stream_digital_playback
= &alc262_pcm_digital_playback
;
12977 spec
->stream_digital_capture
= &alc262_pcm_digital_capture
;
12979 if (!spec
->adc_nids
&& spec
->input_mux
) {
12981 /* check whether the digital-mic has to be supported */
12982 for (i
= 0; i
< spec
->input_mux
->num_items
; i
++) {
12983 if (spec
->input_mux
->items
[i
].index
>= 9)
12986 if (i
< spec
->input_mux
->num_items
) {
12987 /* use only ADC0 */
12988 spec
->adc_nids
= alc262_dmic_adc_nids
;
12989 spec
->num_adc_nids
= 1;
12990 spec
->capsrc_nids
= alc262_dmic_capsrc_nids
;
12992 /* all analog inputs */
12993 /* check whether NID 0x07 is valid */
12994 unsigned int wcap
= get_wcaps(codec
, 0x07);
12997 wcap
= get_wcaps_type(wcap
);
12998 if (wcap
!= AC_WID_AUD_IN
) {
12999 spec
->adc_nids
= alc262_adc_nids_alt
;
13000 spec
->num_adc_nids
=
13001 ARRAY_SIZE(alc262_adc_nids_alt
);
13002 spec
->capsrc_nids
= alc262_capsrc_nids_alt
;
13004 spec
->adc_nids
= alc262_adc_nids
;
13005 spec
->num_adc_nids
=
13006 ARRAY_SIZE(alc262_adc_nids
);
13007 spec
->capsrc_nids
= alc262_capsrc_nids
;
13011 if (!spec
->cap_mixer
&& !spec
->no_analog
)
13012 set_capture_mixer(codec
);
13013 if (!spec
->no_analog
&& has_cdefine_beep(codec
))
13014 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
13016 alc_apply_fixup(codec
, ALC_FIXUP_ACT_PROBE
);
13018 spec
->vmaster_nid
= 0x0c;
13020 codec
->patch_ops
= alc_patch_ops
;
13021 if (board_config
== ALC262_AUTO
)
13022 spec
->init_hook
= alc262_auto_init
;
13024 alc_init_jacks(codec
);
13025 #ifdef CONFIG_SND_HDA_POWER_SAVE
13026 if (!spec
->loopback
.amplist
)
13027 spec
->loopback
.amplist
= alc262_loopbacks
;
13034 * ALC268 channel source setting (2 channel)
13036 #define ALC268_DIGOUT_NID ALC880_DIGOUT_NID
13037 #define alc268_modes alc260_modes
13039 static hda_nid_t alc268_dac_nids
[2] = {
13044 static hda_nid_t alc268_adc_nids
[2] = {
13049 static hda_nid_t alc268_adc_nids_alt
[1] = {
13054 static hda_nid_t alc268_capsrc_nids
[2] = { 0x23, 0x24 };
13056 static struct snd_kcontrol_new alc268_base_mixer
[] = {
13057 /* output mixer control */
13058 HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT
),
13059 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
13060 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT
),
13061 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
13062 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
13063 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
13064 HDA_CODEC_VOLUME("Line In Boost Volume", 0x1a, 0, HDA_INPUT
),
13068 static struct snd_kcontrol_new alc268_toshiba_mixer
[] = {
13069 /* output mixer control */
13070 HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT
),
13071 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT
),
13072 ALC262_HIPPO_MASTER_SWITCH
,
13073 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
13074 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
13075 HDA_CODEC_VOLUME("Line In Boost Volume", 0x1a, 0, HDA_INPUT
),
13079 /* bind Beep switches of both NID 0x0f and 0x10 */
13080 static struct hda_bind_ctls alc268_bind_beep_sw
= {
13081 .ops
= &snd_hda_bind_sw
,
13083 HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT
),
13084 HDA_COMPOSE_AMP_VAL(0x10, 3, 1, HDA_INPUT
),
13089 static struct snd_kcontrol_new alc268_beep_mixer
[] = {
13090 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT
),
13091 HDA_BIND_SW("Beep Playback Switch", &alc268_bind_beep_sw
),
13095 static struct hda_verb alc268_eapd_verbs
[] = {
13096 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
13097 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
13101 /* Toshiba specific */
13102 static struct hda_verb alc268_toshiba_verbs
[] = {
13103 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
13107 /* Acer specific */
13108 /* bind volumes of both NID 0x02 and 0x03 */
13109 static struct hda_bind_ctls alc268_acer_bind_master_vol
= {
13110 .ops
= &snd_hda_bind_vol
,
13112 HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT
),
13113 HDA_COMPOSE_AMP_VAL(0x03, 3, 0, HDA_OUTPUT
),
13118 /* mute/unmute internal speaker according to the hp jack and mute state */
13119 static void alc268_acer_automute(struct hda_codec
*codec
, int force
)
13121 struct alc_spec
*spec
= codec
->spec
;
13124 if (force
|| !spec
->sense_updated
) {
13125 spec
->jack_present
= snd_hda_jack_detect(codec
, 0x14);
13126 spec
->sense_updated
= 1;
13128 if (spec
->jack_present
)
13129 mute
= HDA_AMP_MUTE
; /* mute internal speaker */
13130 else /* unmute internal speaker if necessary */
13131 mute
= snd_hda_codec_amp_read(codec
, 0x14, 0, HDA_OUTPUT
, 0);
13132 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
13133 HDA_AMP_MUTE
, mute
);
13137 /* bind hp and internal speaker mute (with plug check) */
13138 static int alc268_acer_master_sw_put(struct snd_kcontrol
*kcontrol
,
13139 struct snd_ctl_elem_value
*ucontrol
)
13141 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
13142 long *valp
= ucontrol
->value
.integer
.value
;
13145 change
= amp_stereo_mute_update(codec
, 0x14, HDA_OUTPUT
, 0, valp
);
13147 alc268_acer_automute(codec
, 0);
13151 static struct snd_kcontrol_new alc268_acer_aspire_one_mixer
[] = {
13152 /* output mixer control */
13153 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol
),
13155 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
13156 .name
= "Master Playback Switch",
13157 .subdevice
= HDA_SUBDEV_AMP_FLAG
,
13158 .info
= snd_hda_mixer_amp_switch_info
,
13159 .get
= snd_hda_mixer_amp_switch_get
,
13160 .put
= alc268_acer_master_sw_put
,
13161 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
13163 HDA_CODEC_VOLUME("Mic Boost Capture Volume", 0x18, 0, HDA_INPUT
),
13167 static struct snd_kcontrol_new alc268_acer_mixer
[] = {
13168 /* output mixer control */
13169 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol
),
13171 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
13172 .name
= "Master Playback Switch",
13173 .subdevice
= HDA_SUBDEV_AMP_FLAG
,
13174 .info
= snd_hda_mixer_amp_switch_info
,
13175 .get
= snd_hda_mixer_amp_switch_get
,
13176 .put
= alc268_acer_master_sw_put
,
13177 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
13179 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
13180 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
13181 HDA_CODEC_VOLUME("Line In Boost Volume", 0x1a, 0, HDA_INPUT
),
13185 static struct snd_kcontrol_new alc268_acer_dmic_mixer
[] = {
13186 /* output mixer control */
13187 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol
),
13189 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
13190 .name
= "Master Playback Switch",
13191 .subdevice
= HDA_SUBDEV_AMP_FLAG
,
13192 .info
= snd_hda_mixer_amp_switch_info
,
13193 .get
= snd_hda_mixer_amp_switch_get
,
13194 .put
= alc268_acer_master_sw_put
,
13195 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
13197 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
13198 HDA_CODEC_VOLUME("Line In Boost Volume", 0x1a, 0, HDA_INPUT
),
13202 static struct hda_verb alc268_acer_aspire_one_verbs
[] = {
13203 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13204 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
13205 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
13206 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
13207 {0x23, AC_VERB_SET_CONNECT_SEL
, 0x06},
13208 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, 0xa017},
13212 static struct hda_verb alc268_acer_verbs
[] = {
13213 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* internal dmic? */
13214 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13215 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
13216 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
13217 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
13218 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
13219 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
13223 /* unsolicited event for HP jack sensing */
13224 #define alc268_toshiba_unsol_event alc262_hippo_unsol_event
13225 #define alc268_toshiba_setup alc262_hippo_setup
13226 #define alc268_toshiba_automute alc262_hippo_automute
13228 static void alc268_acer_unsol_event(struct hda_codec
*codec
,
13231 if ((res
>> 26) != ALC880_HP_EVENT
)
13233 alc268_acer_automute(codec
, 1);
13236 static void alc268_acer_init_hook(struct hda_codec
*codec
)
13238 alc268_acer_automute(codec
, 1);
13241 /* toggle speaker-output according to the hp-jack state */
13242 static void alc268_aspire_one_speaker_automute(struct hda_codec
*codec
)
13244 unsigned int present
;
13245 unsigned char bits
;
13247 present
= snd_hda_jack_detect(codec
, 0x15);
13248 bits
= present
? HDA_AMP_MUTE
: 0;
13249 snd_hda_codec_amp_stereo(codec
, 0x0f, HDA_INPUT
, 0,
13250 HDA_AMP_MUTE
, bits
);
13251 snd_hda_codec_amp_stereo(codec
, 0x0f, HDA_INPUT
, 1,
13252 HDA_AMP_MUTE
, bits
);
13255 static void alc268_acer_lc_unsol_event(struct hda_codec
*codec
,
13258 switch (res
>> 26) {
13259 case ALC880_HP_EVENT
:
13260 alc268_aspire_one_speaker_automute(codec
);
13262 case ALC880_MIC_EVENT
:
13263 alc_mic_automute(codec
);
13268 static void alc268_acer_lc_setup(struct hda_codec
*codec
)
13270 struct alc_spec
*spec
= codec
->spec
;
13271 spec
->ext_mic
.pin
= 0x18;
13272 spec
->ext_mic
.mux_idx
= 0;
13273 spec
->int_mic
.pin
= 0x12;
13274 spec
->int_mic
.mux_idx
= 6;
13275 spec
->auto_mic
= 1;
13278 static void alc268_acer_lc_init_hook(struct hda_codec
*codec
)
13280 alc268_aspire_one_speaker_automute(codec
);
13281 alc_mic_automute(codec
);
13284 static struct snd_kcontrol_new alc268_dell_mixer
[] = {
13285 /* output mixer control */
13286 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
13287 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
13288 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
13289 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
13290 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
13291 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
13295 static struct hda_verb alc268_dell_verbs
[] = {
13296 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
13297 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
13298 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
13299 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_MIC_EVENT
| AC_USRSP_EN
},
13303 /* mute/unmute internal speaker according to the hp jack and mute state */
13304 static void alc268_dell_setup(struct hda_codec
*codec
)
13306 struct alc_spec
*spec
= codec
->spec
;
13308 spec
->autocfg
.hp_pins
[0] = 0x15;
13309 spec
->autocfg
.speaker_pins
[0] = 0x14;
13310 spec
->ext_mic
.pin
= 0x18;
13311 spec
->ext_mic
.mux_idx
= 0;
13312 spec
->int_mic
.pin
= 0x19;
13313 spec
->int_mic
.mux_idx
= 1;
13314 spec
->auto_mic
= 1;
13317 static struct snd_kcontrol_new alc267_quanta_il1_mixer
[] = {
13318 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x2, 0x0, HDA_OUTPUT
),
13319 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
13320 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT
),
13321 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
13322 HDA_CODEC_VOLUME("Mic Capture Volume", 0x23, 0x0, HDA_OUTPUT
),
13323 HDA_BIND_MUTE("Mic Capture Switch", 0x23, 2, HDA_OUTPUT
),
13324 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
13325 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
13329 static struct hda_verb alc267_quanta_il1_verbs
[] = {
13330 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
13331 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_MIC_EVENT
| AC_USRSP_EN
},
13335 static void alc267_quanta_il1_setup(struct hda_codec
*codec
)
13337 struct alc_spec
*spec
= codec
->spec
;
13338 spec
->autocfg
.hp_pins
[0] = 0x15;
13339 spec
->autocfg
.speaker_pins
[0] = 0x14;
13340 spec
->ext_mic
.pin
= 0x18;
13341 spec
->ext_mic
.mux_idx
= 0;
13342 spec
->int_mic
.pin
= 0x19;
13343 spec
->int_mic
.mux_idx
= 1;
13344 spec
->auto_mic
= 1;
13348 * generic initialization of ADC, input mixers and output mixers
13350 static struct hda_verb alc268_base_init_verbs
[] = {
13351 /* Unmute DAC0-1 and set vol = 0 */
13352 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
13353 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
13356 * Set up output mixers (0x0c - 0x0e)
13358 /* set vol=0 to output mixers */
13359 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13360 {0x0e, AC_VERB_SET_CONNECT_SEL
, 0x00},
13362 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13363 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13365 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
13366 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
13367 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
13368 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
13369 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
13370 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
13371 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
13372 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
13374 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13375 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13376 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13377 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13378 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13380 /* set PCBEEP vol = 0, mute connections */
13381 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13382 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
13383 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
13385 /* Unmute Selector 23h,24h and set the default input to mic-in */
13387 {0x23, AC_VERB_SET_CONNECT_SEL
, 0x00},
13388 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13389 {0x24, AC_VERB_SET_CONNECT_SEL
, 0x00},
13390 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13396 * generic initialization of ADC, input mixers and output mixers
13398 static struct hda_verb alc268_volume_init_verbs
[] = {
13399 /* set output DAC */
13400 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
13401 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
13403 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
13404 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
13405 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
13406 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
13407 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
13409 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13410 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13411 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13413 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13414 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13416 /* set PCBEEP vol = 0, mute connections */
13417 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13418 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
13419 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
13424 static struct snd_kcontrol_new alc268_capture_nosrc_mixer
[] = {
13425 HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT
),
13426 HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT
),
13430 static struct snd_kcontrol_new alc268_capture_alt_mixer
[] = {
13431 HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT
),
13432 HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT
),
13437 static struct snd_kcontrol_new alc268_capture_mixer
[] = {
13438 HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT
),
13439 HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT
),
13440 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x24, 0x0, HDA_OUTPUT
),
13441 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x24, 0x0, HDA_OUTPUT
),
13446 static struct hda_input_mux alc268_capture_source
= {
13450 { "Front Mic", 0x1 },
13456 static struct hda_input_mux alc268_acer_capture_source
= {
13460 { "Internal Mic", 0x1 },
13465 static struct hda_input_mux alc268_acer_dmic_capture_source
= {
13469 { "Internal Mic", 0x6 },
13474 #ifdef CONFIG_SND_DEBUG
13475 static struct snd_kcontrol_new alc268_test_mixer
[] = {
13476 /* Volume widgets */
13477 HDA_CODEC_VOLUME("LOUT1 Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
13478 HDA_CODEC_VOLUME("LOUT2 Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
13479 HDA_BIND_MUTE_MONO("Mono sum Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
13480 HDA_BIND_MUTE("LINE-OUT sum Playback Switch", 0x0f, 2, HDA_INPUT
),
13481 HDA_BIND_MUTE("HP-OUT sum Playback Switch", 0x10, 2, HDA_INPUT
),
13482 HDA_BIND_MUTE("LINE-OUT Playback Switch", 0x14, 2, HDA_OUTPUT
),
13483 HDA_BIND_MUTE("HP-OUT Playback Switch", 0x15, 2, HDA_OUTPUT
),
13484 HDA_BIND_MUTE("Mono Playback Switch", 0x16, 2, HDA_OUTPUT
),
13485 HDA_CODEC_VOLUME("MIC1 Capture Volume", 0x18, 0x0, HDA_INPUT
),
13486 HDA_BIND_MUTE("MIC1 Capture Switch", 0x18, 2, HDA_OUTPUT
),
13487 HDA_CODEC_VOLUME("MIC2 Capture Volume", 0x19, 0x0, HDA_INPUT
),
13488 HDA_CODEC_VOLUME("LINE1 Capture Volume", 0x1a, 0x0, HDA_INPUT
),
13489 HDA_BIND_MUTE("LINE1 Capture Switch", 0x1a, 2, HDA_OUTPUT
),
13490 /* The below appears problematic on some hardwares */
13491 /*HDA_CODEC_VOLUME("PCBEEP Playback Volume", 0x1d, 0x0, HDA_INPUT),*/
13492 HDA_CODEC_VOLUME("PCM-IN1 Capture Volume", 0x23, 0x0, HDA_OUTPUT
),
13493 HDA_BIND_MUTE("PCM-IN1 Capture Switch", 0x23, 2, HDA_OUTPUT
),
13494 HDA_CODEC_VOLUME("PCM-IN2 Capture Volume", 0x24, 0x0, HDA_OUTPUT
),
13495 HDA_BIND_MUTE("PCM-IN2 Capture Switch", 0x24, 2, HDA_OUTPUT
),
13497 /* Modes for retasking pin widgets */
13498 ALC_PIN_MODE("LINE-OUT pin mode", 0x14, ALC_PIN_DIR_INOUT
),
13499 ALC_PIN_MODE("HP-OUT pin mode", 0x15, ALC_PIN_DIR_INOUT
),
13500 ALC_PIN_MODE("MIC1 pin mode", 0x18, ALC_PIN_DIR_INOUT
),
13501 ALC_PIN_MODE("LINE1 pin mode", 0x1a, ALC_PIN_DIR_INOUT
),
13503 /* Controls for GPIO pins, assuming they are configured as outputs */
13504 ALC_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
13505 ALC_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
13506 ALC_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
13507 ALC_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
13509 /* Switches to allow the digital SPDIF output pin to be enabled.
13510 * The ALC268 does not have an SPDIF input.
13512 ALC_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x06, 0x01),
13514 /* A switch allowing EAPD to be enabled. Some laptops seem to use
13515 * this output to turn on an external amplifier.
13517 ALC_EAPD_CTRL_SWITCH("LINE-OUT EAPD Enable Switch", 0x0f, 0x02),
13518 ALC_EAPD_CTRL_SWITCH("HP-OUT EAPD Enable Switch", 0x10, 0x02),
13524 /* create input playback/capture controls for the given pin */
13525 static int alc268_new_analog_output(struct alc_spec
*spec
, hda_nid_t nid
,
13526 const char *ctlname
, int idx
)
13537 case 0x1a: /* ALC259/269 only */
13538 case 0x1b: /* ALC259/269 only */
13539 case 0x21: /* ALC269vb has this pin, too */
13543 snd_printd(KERN_WARNING
"hda_codec: "
13544 "ignoring pin 0x%x as unknown\n", nid
);
13547 if (spec
->multiout
.dac_nids
[0] != dac
&&
13548 spec
->multiout
.dac_nids
[1] != dac
) {
13549 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, ctlname
,
13550 HDA_COMPOSE_AMP_VAL(dac
, 3, idx
,
13554 spec
->multiout
.dac_nids
[spec
->multiout
.num_dacs
++] = dac
;
13558 err
= add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, ctlname
,
13559 HDA_COMPOSE_AMP_VAL(nid
, 3, idx
, HDA_OUTPUT
));
13561 err
= add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, ctlname
,
13562 HDA_COMPOSE_AMP_VAL(nid
, 2, idx
, HDA_OUTPUT
));
13568 /* add playback controls from the parsed DAC table */
13569 static int alc268_auto_create_multi_out_ctls(struct alc_spec
*spec
,
13570 const struct auto_pin_cfg
*cfg
)
13575 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
13577 nid
= cfg
->line_out_pins
[0];
13580 if (cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
13584 err
= alc268_new_analog_output(spec
, nid
, name
, 0);
13589 nid
= cfg
->speaker_pins
[0];
13591 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, "Speaker",
13592 HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_INPUT
));
13596 err
= alc268_new_analog_output(spec
, nid
, "Speaker", 0);
13600 nid
= cfg
->hp_pins
[0];
13602 err
= alc268_new_analog_output(spec
, nid
, "Headphone", 0);
13607 nid
= cfg
->line_out_pins
[1] | cfg
->line_out_pins
[2];
13609 err
= add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, "Mono",
13610 HDA_COMPOSE_AMP_VAL(nid
, 2, 0, HDA_OUTPUT
));
13617 /* create playback/capture controls for input pins */
13618 static int alc268_auto_create_input_ctls(struct hda_codec
*codec
,
13619 const struct auto_pin_cfg
*cfg
)
13621 return alc_auto_create_input_ctls(codec
, cfg
, 0, 0x23, 0x24);
13624 static void alc268_auto_set_output_and_unmute(struct hda_codec
*codec
,
13625 hda_nid_t nid
, int pin_type
)
13629 alc_set_pin_output(codec
, nid
, pin_type
);
13630 if (nid
== 0x14 || nid
== 0x16)
13634 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_CONNECT_SEL
, idx
);
13637 static void alc268_auto_init_multi_out(struct hda_codec
*codec
)
13639 struct alc_spec
*spec
= codec
->spec
;
13642 for (i
= 0; i
< spec
->autocfg
.line_outs
; i
++) {
13643 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
13644 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
13645 alc268_auto_set_output_and_unmute(codec
, nid
, pin_type
);
13649 static void alc268_auto_init_hp_out(struct hda_codec
*codec
)
13651 struct alc_spec
*spec
= codec
->spec
;
13655 for (i
= 0; i
< spec
->autocfg
.hp_outs
; i
++) {
13656 pin
= spec
->autocfg
.hp_pins
[i
];
13657 alc268_auto_set_output_and_unmute(codec
, pin
, PIN_HP
);
13659 for (i
= 0; i
< spec
->autocfg
.speaker_outs
; i
++) {
13660 pin
= spec
->autocfg
.speaker_pins
[i
];
13661 alc268_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
);
13663 if (spec
->autocfg
.mono_out_pin
)
13664 snd_hda_codec_write(codec
, spec
->autocfg
.mono_out_pin
, 0,
13665 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
13668 static void alc268_auto_init_mono_speaker_out(struct hda_codec
*codec
)
13670 struct alc_spec
*spec
= codec
->spec
;
13671 hda_nid_t speaker_nid
= spec
->autocfg
.speaker_pins
[0];
13672 hda_nid_t hp_nid
= spec
->autocfg
.hp_pins
[0];
13673 hda_nid_t line_nid
= spec
->autocfg
.line_out_pins
[0];
13674 unsigned int dac_vol1
, dac_vol2
;
13676 if (line_nid
== 0x1d || speaker_nid
== 0x1d) {
13677 snd_hda_codec_write(codec
, speaker_nid
, 0,
13678 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
13679 /* mute mixer inputs from 0x1d */
13680 snd_hda_codec_write(codec
, 0x0f, 0,
13681 AC_VERB_SET_AMP_GAIN_MUTE
,
13683 snd_hda_codec_write(codec
, 0x10, 0,
13684 AC_VERB_SET_AMP_GAIN_MUTE
,
13687 /* unmute mixer inputs from 0x1d */
13688 snd_hda_codec_write(codec
, 0x0f, 0,
13689 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1));
13690 snd_hda_codec_write(codec
, 0x10, 0,
13691 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1));
13694 dac_vol1
= dac_vol2
= 0xb000 | 0x40; /* set max volume */
13695 if (line_nid
== 0x14)
13696 dac_vol2
= AMP_OUT_ZERO
;
13697 else if (line_nid
== 0x15)
13698 dac_vol1
= AMP_OUT_ZERO
;
13699 if (hp_nid
== 0x14)
13700 dac_vol2
= AMP_OUT_ZERO
;
13701 else if (hp_nid
== 0x15)
13702 dac_vol1
= AMP_OUT_ZERO
;
13703 if (line_nid
!= 0x16 || hp_nid
!= 0x16 ||
13704 spec
->autocfg
.line_out_pins
[1] != 0x16 ||
13705 spec
->autocfg
.line_out_pins
[2] != 0x16)
13706 dac_vol1
= dac_vol2
= AMP_OUT_ZERO
;
13708 snd_hda_codec_write(codec
, 0x02, 0,
13709 AC_VERB_SET_AMP_GAIN_MUTE
, dac_vol1
);
13710 snd_hda_codec_write(codec
, 0x03, 0,
13711 AC_VERB_SET_AMP_GAIN_MUTE
, dac_vol2
);
13714 /* pcm configuration: identical with ALC880 */
13715 #define alc268_pcm_analog_playback alc880_pcm_analog_playback
13716 #define alc268_pcm_analog_capture alc880_pcm_analog_capture
13717 #define alc268_pcm_analog_alt_capture alc880_pcm_analog_alt_capture
13718 #define alc268_pcm_digital_playback alc880_pcm_digital_playback
13721 * BIOS auto configuration
13723 static int alc268_parse_auto_config(struct hda_codec
*codec
)
13725 struct alc_spec
*spec
= codec
->spec
;
13727 static hda_nid_t alc268_ignore
[] = { 0 };
13729 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
13733 if (!spec
->autocfg
.line_outs
) {
13734 if (spec
->autocfg
.dig_outs
|| spec
->autocfg
.dig_in_pin
) {
13735 spec
->multiout
.max_channels
= 2;
13736 spec
->no_analog
= 1;
13739 return 0; /* can't find valid BIOS pin config */
13741 err
= alc268_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
13744 err
= alc268_auto_create_input_ctls(codec
, &spec
->autocfg
);
13748 spec
->multiout
.max_channels
= 2;
13751 /* digital only support output */
13752 alc_auto_parse_digital(codec
);
13753 if (spec
->kctls
.list
)
13754 add_mixer(spec
, spec
->kctls
.list
);
13756 if (!spec
->no_analog
&& spec
->autocfg
.speaker_pins
[0] != 0x1d)
13757 add_mixer(spec
, alc268_beep_mixer
);
13759 add_verb(spec
, alc268_volume_init_verbs
);
13760 spec
->num_mux_defs
= 2;
13761 spec
->input_mux
= &spec
->private_imux
[0];
13763 err
= alc_auto_add_mic_boost(codec
);
13767 alc_ssid_check(codec
, 0x15, 0x1b, 0x14, 0);
13772 #define alc268_auto_init_analog_input alc882_auto_init_analog_input
13773 #define alc268_auto_init_input_src alc882_auto_init_input_src
13775 /* init callback for auto-configuration model -- overriding the default init */
13776 static void alc268_auto_init(struct hda_codec
*codec
)
13778 struct alc_spec
*spec
= codec
->spec
;
13779 alc268_auto_init_multi_out(codec
);
13780 alc268_auto_init_hp_out(codec
);
13781 alc268_auto_init_mono_speaker_out(codec
);
13782 alc268_auto_init_analog_input(codec
);
13783 alc268_auto_init_input_src(codec
);
13784 alc_auto_init_digital(codec
);
13785 if (spec
->unsol_event
)
13786 alc_inithook(codec
);
13790 * configuration and preset
13792 static const char * const alc268_models
[ALC268_MODEL_LAST
] = {
13793 [ALC267_QUANTA_IL1
] = "quanta-il1",
13794 [ALC268_3ST
] = "3stack",
13795 [ALC268_TOSHIBA
] = "toshiba",
13796 [ALC268_ACER
] = "acer",
13797 [ALC268_ACER_DMIC
] = "acer-dmic",
13798 [ALC268_ACER_ASPIRE_ONE
] = "acer-aspire",
13799 [ALC268_DELL
] = "dell",
13800 [ALC268_ZEPTO
] = "zepto",
13801 #ifdef CONFIG_SND_DEBUG
13802 [ALC268_TEST
] = "test",
13804 [ALC268_AUTO
] = "auto",
13807 static struct snd_pci_quirk alc268_cfg_tbl
[] = {
13808 SND_PCI_QUIRK(0x1025, 0x011e, "Acer Aspire 5720z", ALC268_ACER
),
13809 SND_PCI_QUIRK(0x1025, 0x0126, "Acer", ALC268_ACER
),
13810 SND_PCI_QUIRK(0x1025, 0x012e, "Acer Aspire 5310", ALC268_ACER
),
13811 SND_PCI_QUIRK(0x1025, 0x0130, "Acer Extensa 5210", ALC268_ACER
),
13812 SND_PCI_QUIRK(0x1025, 0x0136, "Acer Aspire 5315", ALC268_ACER
),
13813 SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One",
13814 ALC268_ACER_ASPIRE_ONE
),
13815 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL
),
13816 SND_PCI_QUIRK_MASK(0x1028, 0xfff0, 0x02b0,
13817 "Dell Inspiron Mini9/Vostro A90", ALC268_DELL
),
13818 /* almost compatible with toshiba but with optional digital outs;
13819 * auto-probing seems working fine
13821 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x3000, "HP TX25xx series",
13823 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST
),
13824 SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO
),
13825 SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA
),
13826 SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER
),
13827 SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1
),
13831 /* Toshiba laptops have no unique PCI SSID but only codec SSID */
13832 static struct snd_pci_quirk alc268_ssid_cfg_tbl
[] = {
13833 SND_PCI_QUIRK(0x1179, 0xff0a, "TOSHIBA X-200", ALC268_AUTO
),
13834 SND_PCI_QUIRK(0x1179, 0xff0e, "TOSHIBA X-200 HDMI", ALC268_AUTO
),
13835 SND_PCI_QUIRK_MASK(0x1179, 0xff00, 0xff00, "TOSHIBA A/Lx05",
13840 static struct alc_config_preset alc268_presets
[] = {
13841 [ALC267_QUANTA_IL1
] = {
13842 .mixers
= { alc267_quanta_il1_mixer
, alc268_beep_mixer
,
13843 alc268_capture_nosrc_mixer
},
13844 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
13845 alc267_quanta_il1_verbs
},
13846 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
13847 .dac_nids
= alc268_dac_nids
,
13848 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
13849 .adc_nids
= alc268_adc_nids_alt
,
13851 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
13852 .channel_mode
= alc268_modes
,
13853 .unsol_event
= alc_sku_unsol_event
,
13854 .setup
= alc267_quanta_il1_setup
,
13855 .init_hook
= alc_inithook
,
13858 .mixers
= { alc268_base_mixer
, alc268_capture_alt_mixer
,
13859 alc268_beep_mixer
},
13860 .init_verbs
= { alc268_base_init_verbs
},
13861 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
13862 .dac_nids
= alc268_dac_nids
,
13863 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
13864 .adc_nids
= alc268_adc_nids_alt
,
13865 .capsrc_nids
= alc268_capsrc_nids
,
13867 .dig_out_nid
= ALC268_DIGOUT_NID
,
13868 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
13869 .channel_mode
= alc268_modes
,
13870 .input_mux
= &alc268_capture_source
,
13872 [ALC268_TOSHIBA
] = {
13873 .mixers
= { alc268_toshiba_mixer
, alc268_capture_alt_mixer
,
13874 alc268_beep_mixer
},
13875 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
13876 alc268_toshiba_verbs
},
13877 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
13878 .dac_nids
= alc268_dac_nids
,
13879 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
13880 .adc_nids
= alc268_adc_nids_alt
,
13881 .capsrc_nids
= alc268_capsrc_nids
,
13883 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
13884 .channel_mode
= alc268_modes
,
13885 .input_mux
= &alc268_capture_source
,
13886 .unsol_event
= alc268_toshiba_unsol_event
,
13887 .setup
= alc268_toshiba_setup
,
13888 .init_hook
= alc268_toshiba_automute
,
13891 .mixers
= { alc268_acer_mixer
, alc268_capture_alt_mixer
,
13892 alc268_beep_mixer
},
13893 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
13894 alc268_acer_verbs
},
13895 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
13896 .dac_nids
= alc268_dac_nids
,
13897 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
13898 .adc_nids
= alc268_adc_nids_alt
,
13899 .capsrc_nids
= alc268_capsrc_nids
,
13901 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
13902 .channel_mode
= alc268_modes
,
13903 .input_mux
= &alc268_acer_capture_source
,
13904 .unsol_event
= alc268_acer_unsol_event
,
13905 .init_hook
= alc268_acer_init_hook
,
13907 [ALC268_ACER_DMIC
] = {
13908 .mixers
= { alc268_acer_dmic_mixer
, alc268_capture_alt_mixer
,
13909 alc268_beep_mixer
},
13910 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
13911 alc268_acer_verbs
},
13912 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
13913 .dac_nids
= alc268_dac_nids
,
13914 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
13915 .adc_nids
= alc268_adc_nids_alt
,
13916 .capsrc_nids
= alc268_capsrc_nids
,
13918 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
13919 .channel_mode
= alc268_modes
,
13920 .input_mux
= &alc268_acer_dmic_capture_source
,
13921 .unsol_event
= alc268_acer_unsol_event
,
13922 .init_hook
= alc268_acer_init_hook
,
13924 [ALC268_ACER_ASPIRE_ONE
] = {
13925 .mixers
= { alc268_acer_aspire_one_mixer
,
13927 alc268_capture_nosrc_mixer
},
13928 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
13929 alc268_acer_aspire_one_verbs
},
13930 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
13931 .dac_nids
= alc268_dac_nids
,
13932 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
13933 .adc_nids
= alc268_adc_nids_alt
,
13934 .capsrc_nids
= alc268_capsrc_nids
,
13936 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
13937 .channel_mode
= alc268_modes
,
13938 .unsol_event
= alc268_acer_lc_unsol_event
,
13939 .setup
= alc268_acer_lc_setup
,
13940 .init_hook
= alc268_acer_lc_init_hook
,
13943 .mixers
= { alc268_dell_mixer
, alc268_beep_mixer
,
13944 alc268_capture_nosrc_mixer
},
13945 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
13946 alc268_dell_verbs
},
13947 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
13948 .dac_nids
= alc268_dac_nids
,
13949 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
13950 .adc_nids
= alc268_adc_nids_alt
,
13951 .capsrc_nids
= alc268_capsrc_nids
,
13953 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
13954 .channel_mode
= alc268_modes
,
13955 .unsol_event
= alc_sku_unsol_event
,
13956 .setup
= alc268_dell_setup
,
13957 .init_hook
= alc_inithook
,
13960 .mixers
= { alc268_base_mixer
, alc268_capture_alt_mixer
,
13961 alc268_beep_mixer
},
13962 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
13963 alc268_toshiba_verbs
},
13964 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
13965 .dac_nids
= alc268_dac_nids
,
13966 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
13967 .adc_nids
= alc268_adc_nids_alt
,
13968 .capsrc_nids
= alc268_capsrc_nids
,
13970 .dig_out_nid
= ALC268_DIGOUT_NID
,
13971 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
13972 .channel_mode
= alc268_modes
,
13973 .input_mux
= &alc268_capture_source
,
13974 .setup
= alc268_toshiba_setup
,
13975 .init_hook
= alc268_toshiba_automute
,
13977 #ifdef CONFIG_SND_DEBUG
13979 .mixers
= { alc268_test_mixer
, alc268_capture_mixer
},
13980 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
13981 alc268_volume_init_verbs
},
13982 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
13983 .dac_nids
= alc268_dac_nids
,
13984 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
13985 .adc_nids
= alc268_adc_nids_alt
,
13986 .capsrc_nids
= alc268_capsrc_nids
,
13988 .dig_out_nid
= ALC268_DIGOUT_NID
,
13989 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
13990 .channel_mode
= alc268_modes
,
13991 .input_mux
= &alc268_capture_source
,
13996 static int patch_alc268(struct hda_codec
*codec
)
13998 struct alc_spec
*spec
;
14000 int i
, has_beep
, err
;
14002 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
14006 codec
->spec
= spec
;
14008 board_config
= snd_hda_check_board_config(codec
, ALC268_MODEL_LAST
,
14012 if (board_config
< 0 || board_config
>= ALC268_MODEL_LAST
)
14013 board_config
= snd_hda_check_board_codec_sid_config(codec
,
14014 ALC268_MODEL_LAST
, alc268_models
, alc268_ssid_cfg_tbl
);
14016 if (board_config
< 0 || board_config
>= ALC268_MODEL_LAST
) {
14017 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
14019 board_config
= ALC268_AUTO
;
14022 if (board_config
== ALC268_AUTO
) {
14023 /* automatic parse from the BIOS config */
14024 err
= alc268_parse_auto_config(codec
);
14030 "hda_codec: Cannot set up configuration "
14031 "from BIOS. Using base mode...\n");
14032 board_config
= ALC268_3ST
;
14036 if (board_config
!= ALC268_AUTO
)
14037 setup_preset(codec
, &alc268_presets
[board_config
]);
14039 spec
->stream_analog_playback
= &alc268_pcm_analog_playback
;
14040 spec
->stream_analog_capture
= &alc268_pcm_analog_capture
;
14041 spec
->stream_analog_alt_capture
= &alc268_pcm_analog_alt_capture
;
14043 spec
->stream_digital_playback
= &alc268_pcm_digital_playback
;
14046 for (i
= 0; i
< spec
->num_mixers
; i
++) {
14047 if (spec
->mixers
[i
] == alc268_beep_mixer
) {
14054 err
= snd_hda_attach_beep_device(codec
, 0x1);
14059 if (!query_amp_caps(codec
, 0x1d, HDA_INPUT
))
14060 /* override the amp caps for beep generator */
14061 snd_hda_override_amp_caps(codec
, 0x1d, HDA_INPUT
,
14062 (0x0c << AC_AMPCAP_OFFSET_SHIFT
) |
14063 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT
) |
14064 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
14065 (0 << AC_AMPCAP_MUTE_SHIFT
));
14068 if (!spec
->no_analog
&& !spec
->adc_nids
&& spec
->input_mux
) {
14069 /* check whether NID 0x07 is valid */
14070 unsigned int wcap
= get_wcaps(codec
, 0x07);
14072 spec
->capsrc_nids
= alc268_capsrc_nids
;
14074 wcap
= get_wcaps_type(wcap
);
14075 if (spec
->auto_mic
||
14076 wcap
!= AC_WID_AUD_IN
|| spec
->input_mux
->num_items
== 1) {
14077 spec
->adc_nids
= alc268_adc_nids_alt
;
14078 spec
->num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
);
14079 if (spec
->auto_mic
)
14080 fixup_automic_adc(codec
);
14081 if (spec
->auto_mic
|| spec
->input_mux
->num_items
== 1)
14082 add_mixer(spec
, alc268_capture_nosrc_mixer
);
14084 add_mixer(spec
, alc268_capture_alt_mixer
);
14086 spec
->adc_nids
= alc268_adc_nids
;
14087 spec
->num_adc_nids
= ARRAY_SIZE(alc268_adc_nids
);
14088 add_mixer(spec
, alc268_capture_mixer
);
14092 spec
->vmaster_nid
= 0x02;
14094 codec
->patch_ops
= alc_patch_ops
;
14095 if (board_config
== ALC268_AUTO
)
14096 spec
->init_hook
= alc268_auto_init
;
14098 alc_init_jacks(codec
);
14104 * ALC269 channel source setting (2 channel)
14106 #define ALC269_DIGOUT_NID ALC880_DIGOUT_NID
14108 #define alc269_dac_nids alc260_dac_nids
14110 static hda_nid_t alc269_adc_nids
[1] = {
14115 static hda_nid_t alc269_capsrc_nids
[1] = {
14119 static hda_nid_t alc269vb_adc_nids
[1] = {
14124 static hda_nid_t alc269vb_capsrc_nids
[1] = {
14128 static hda_nid_t alc269_adc_candidates
[] = {
14132 #define alc269_modes alc260_modes
14133 #define alc269_capture_source alc880_lg_lw_capture_source
14135 static struct snd_kcontrol_new alc269_base_mixer
[] = {
14136 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
14137 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
14138 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
14139 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
14140 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
14141 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
14142 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
14143 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
14144 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
14145 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
14146 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
14147 HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x16, 2, 0x0, HDA_OUTPUT
),
14151 static struct snd_kcontrol_new alc269_quanta_fl1_mixer
[] = {
14152 /* output mixer control */
14153 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol
),
14155 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
14156 .name
= "Master Playback Switch",
14157 .subdevice
= HDA_SUBDEV_AMP_FLAG
,
14158 .info
= snd_hda_mixer_amp_switch_info
,
14159 .get
= snd_hda_mixer_amp_switch_get
,
14160 .put
= alc268_acer_master_sw_put
,
14161 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
14163 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
14164 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
14165 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
14166 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
14167 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
14168 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
14172 static struct snd_kcontrol_new alc269_lifebook_mixer
[] = {
14173 /* output mixer control */
14174 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol
),
14176 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
14177 .name
= "Master Playback Switch",
14178 .subdevice
= HDA_SUBDEV_AMP_FLAG
,
14179 .info
= snd_hda_mixer_amp_switch_info
,
14180 .get
= snd_hda_mixer_amp_switch_get
,
14181 .put
= alc268_acer_master_sw_put
,
14182 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
14184 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
14185 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
14186 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
14187 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
14188 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
14189 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
14190 HDA_CODEC_VOLUME("Dock Mic Playback Volume", 0x0b, 0x03, HDA_INPUT
),
14191 HDA_CODEC_MUTE("Dock Mic Playback Switch", 0x0b, 0x03, HDA_INPUT
),
14192 HDA_CODEC_VOLUME("Dock Mic Boost Volume", 0x1b, 0, HDA_INPUT
),
14196 static struct snd_kcontrol_new alc269_laptop_mixer
[] = {
14197 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
14198 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
14199 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
14200 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
14204 static struct snd_kcontrol_new alc269vb_laptop_mixer
[] = {
14205 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
14206 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
14207 HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT
),
14208 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
14212 static struct snd_kcontrol_new alc269_asus_mixer
[] = {
14213 HDA_CODEC_VOLUME("Master Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
14214 HDA_CODEC_MUTE("Master Playback Switch", 0x0c, 0x0, HDA_INPUT
),
14218 /* capture mixer elements */
14219 static struct snd_kcontrol_new alc269_laptop_analog_capture_mixer
[] = {
14220 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT
),
14221 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT
),
14222 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
14223 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
14227 static struct snd_kcontrol_new alc269_laptop_digital_capture_mixer
[] = {
14228 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT
),
14229 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT
),
14230 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
14234 static struct snd_kcontrol_new alc269vb_laptop_analog_capture_mixer
[] = {
14235 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT
),
14236 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT
),
14237 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
14238 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
14242 static struct snd_kcontrol_new alc269vb_laptop_digital_capture_mixer
[] = {
14243 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT
),
14244 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT
),
14245 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
14250 #define alc269_fujitsu_mixer alc269_laptop_mixer
14252 static struct hda_verb alc269_quanta_fl1_verbs
[] = {
14253 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
14254 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14255 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
14256 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
14257 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
14258 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14262 static struct hda_verb alc269_lifebook_verbs
[] = {
14263 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
14264 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01},
14265 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14266 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
14267 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
14268 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14269 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
14270 {0x1a, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
14271 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
14272 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14276 /* toggle speaker-output according to the hp-jack state */
14277 static void alc269_quanta_fl1_speaker_automute(struct hda_codec
*codec
)
14279 unsigned int present
;
14280 unsigned char bits
;
14282 present
= snd_hda_jack_detect(codec
, 0x15);
14283 bits
= present
? HDA_AMP_MUTE
: 0;
14284 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
14285 HDA_AMP_MUTE
, bits
);
14286 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
14287 HDA_AMP_MUTE
, bits
);
14289 snd_hda_codec_write(codec
, 0x20, 0,
14290 AC_VERB_SET_COEF_INDEX
, 0x0c);
14291 snd_hda_codec_write(codec
, 0x20, 0,
14292 AC_VERB_SET_PROC_COEF
, 0x680);
14294 snd_hda_codec_write(codec
, 0x20, 0,
14295 AC_VERB_SET_COEF_INDEX
, 0x0c);
14296 snd_hda_codec_write(codec
, 0x20, 0,
14297 AC_VERB_SET_PROC_COEF
, 0x480);
14300 /* toggle speaker-output according to the hp-jacks state */
14301 static void alc269_lifebook_speaker_automute(struct hda_codec
*codec
)
14303 unsigned int present
;
14304 unsigned char bits
;
14306 /* Check laptop headphone socket */
14307 present
= snd_hda_jack_detect(codec
, 0x15);
14309 /* Check port replicator headphone socket */
14310 present
|= snd_hda_jack_detect(codec
, 0x1a);
14312 bits
= present
? HDA_AMP_MUTE
: 0;
14313 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
14314 HDA_AMP_MUTE
, bits
);
14315 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
14316 HDA_AMP_MUTE
, bits
);
14318 snd_hda_codec_write(codec
, 0x20, 0,
14319 AC_VERB_SET_COEF_INDEX
, 0x0c);
14320 snd_hda_codec_write(codec
, 0x20, 0,
14321 AC_VERB_SET_PROC_COEF
, 0x680);
14323 snd_hda_codec_write(codec
, 0x20, 0,
14324 AC_VERB_SET_COEF_INDEX
, 0x0c);
14325 snd_hda_codec_write(codec
, 0x20, 0,
14326 AC_VERB_SET_PROC_COEF
, 0x480);
14329 static void alc269_lifebook_mic_autoswitch(struct hda_codec
*codec
)
14331 unsigned int present_laptop
;
14332 unsigned int present_dock
;
14334 present_laptop
= snd_hda_jack_detect(codec
, 0x18);
14335 present_dock
= snd_hda_jack_detect(codec
, 0x1b);
14337 /* Laptop mic port overrides dock mic port, design decision */
14339 snd_hda_codec_write(codec
, 0x23, 0,
14340 AC_VERB_SET_CONNECT_SEL
, 0x3);
14341 if (present_laptop
)
14342 snd_hda_codec_write(codec
, 0x23, 0,
14343 AC_VERB_SET_CONNECT_SEL
, 0x0);
14344 if (!present_dock
&& !present_laptop
)
14345 snd_hda_codec_write(codec
, 0x23, 0,
14346 AC_VERB_SET_CONNECT_SEL
, 0x1);
14349 static void alc269_quanta_fl1_unsol_event(struct hda_codec
*codec
,
14352 switch (res
>> 26) {
14353 case ALC880_HP_EVENT
:
14354 alc269_quanta_fl1_speaker_automute(codec
);
14356 case ALC880_MIC_EVENT
:
14357 alc_mic_automute(codec
);
14362 static void alc269_lifebook_unsol_event(struct hda_codec
*codec
,
14365 if ((res
>> 26) == ALC880_HP_EVENT
)
14366 alc269_lifebook_speaker_automute(codec
);
14367 if ((res
>> 26) == ALC880_MIC_EVENT
)
14368 alc269_lifebook_mic_autoswitch(codec
);
14371 static void alc269_quanta_fl1_setup(struct hda_codec
*codec
)
14373 struct alc_spec
*spec
= codec
->spec
;
14374 spec
->autocfg
.hp_pins
[0] = 0x15;
14375 spec
->autocfg
.speaker_pins
[0] = 0x14;
14376 spec
->ext_mic
.pin
= 0x18;
14377 spec
->ext_mic
.mux_idx
= 0;
14378 spec
->int_mic
.pin
= 0x19;
14379 spec
->int_mic
.mux_idx
= 1;
14380 spec
->auto_mic
= 1;
14383 static void alc269_quanta_fl1_init_hook(struct hda_codec
*codec
)
14385 alc269_quanta_fl1_speaker_automute(codec
);
14386 alc_mic_automute(codec
);
14389 static void alc269_lifebook_init_hook(struct hda_codec
*codec
)
14391 alc269_lifebook_speaker_automute(codec
);
14392 alc269_lifebook_mic_autoswitch(codec
);
14395 static struct hda_verb alc269_laptop_dmic_init_verbs
[] = {
14396 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
14397 {0x23, AC_VERB_SET_CONNECT_SEL
, 0x05},
14398 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb026 },
14399 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7019 | (0x00 << 8))},
14400 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14401 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
14402 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
14406 static struct hda_verb alc269_laptop_amic_init_verbs
[] = {
14407 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
14408 {0x23, AC_VERB_SET_CONNECT_SEL
, 0x01},
14409 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb026 },
14410 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x701b | (0x00 << 8))},
14411 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
14412 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
14416 static struct hda_verb alc269vb_laptop_dmic_init_verbs
[] = {
14417 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01},
14418 {0x22, AC_VERB_SET_CONNECT_SEL
, 0x06},
14419 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb026 },
14420 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7019 | (0x00 << 8))},
14421 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14422 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
14423 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
14427 static struct hda_verb alc269vb_laptop_amic_init_verbs
[] = {
14428 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01},
14429 {0x22, AC_VERB_SET_CONNECT_SEL
, 0x01},
14430 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb026 },
14431 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7019 | (0x00 << 8))},
14432 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14433 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
14434 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
14438 static struct hda_verb alc271_acer_dmic_verbs
[] = {
14439 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0d},
14440 {0x20, AC_VERB_SET_PROC_COEF
, 0x4000},
14441 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14442 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14443 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
14444 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14445 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x00},
14446 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
14447 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
14448 {0x22, AC_VERB_SET_CONNECT_SEL
, 6},
14452 /* toggle speaker-output according to the hp-jack state */
14453 static void alc269_speaker_automute(struct hda_codec
*codec
)
14455 struct alc_spec
*spec
= codec
->spec
;
14456 unsigned int nid
= spec
->autocfg
.hp_pins
[0];
14457 unsigned int present
;
14458 unsigned char bits
;
14460 present
= snd_hda_jack_detect(codec
, nid
);
14461 bits
= present
? HDA_AMP_MUTE
: 0;
14462 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
14463 HDA_AMP_MUTE
, bits
);
14464 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
14465 HDA_AMP_MUTE
, bits
);
14466 snd_hda_input_jack_report(codec
, nid
);
14469 /* unsolicited event for HP jack sensing */
14470 static void alc269_laptop_unsol_event(struct hda_codec
*codec
,
14473 switch (res
>> 26) {
14474 case ALC880_HP_EVENT
:
14475 alc269_speaker_automute(codec
);
14477 case ALC880_MIC_EVENT
:
14478 alc_mic_automute(codec
);
14483 static void alc269_laptop_amic_setup(struct hda_codec
*codec
)
14485 struct alc_spec
*spec
= codec
->spec
;
14486 spec
->autocfg
.hp_pins
[0] = 0x15;
14487 spec
->autocfg
.speaker_pins
[0] = 0x14;
14488 spec
->ext_mic
.pin
= 0x18;
14489 spec
->ext_mic
.mux_idx
= 0;
14490 spec
->int_mic
.pin
= 0x19;
14491 spec
->int_mic
.mux_idx
= 1;
14492 spec
->auto_mic
= 1;
14495 static void alc269_laptop_dmic_setup(struct hda_codec
*codec
)
14497 struct alc_spec
*spec
= codec
->spec
;
14498 spec
->autocfg
.hp_pins
[0] = 0x15;
14499 spec
->autocfg
.speaker_pins
[0] = 0x14;
14500 spec
->ext_mic
.pin
= 0x18;
14501 spec
->ext_mic
.mux_idx
= 0;
14502 spec
->int_mic
.pin
= 0x12;
14503 spec
->int_mic
.mux_idx
= 5;
14504 spec
->auto_mic
= 1;
14507 static void alc269vb_laptop_amic_setup(struct hda_codec
*codec
)
14509 struct alc_spec
*spec
= codec
->spec
;
14510 spec
->autocfg
.hp_pins
[0] = 0x21;
14511 spec
->autocfg
.speaker_pins
[0] = 0x14;
14512 spec
->ext_mic
.pin
= 0x18;
14513 spec
->ext_mic
.mux_idx
= 0;
14514 spec
->int_mic
.pin
= 0x19;
14515 spec
->int_mic
.mux_idx
= 1;
14516 spec
->auto_mic
= 1;
14519 static void alc269vb_laptop_dmic_setup(struct hda_codec
*codec
)
14521 struct alc_spec
*spec
= codec
->spec
;
14522 spec
->autocfg
.hp_pins
[0] = 0x21;
14523 spec
->autocfg
.speaker_pins
[0] = 0x14;
14524 spec
->ext_mic
.pin
= 0x18;
14525 spec
->ext_mic
.mux_idx
= 0;
14526 spec
->int_mic
.pin
= 0x12;
14527 spec
->int_mic
.mux_idx
= 6;
14528 spec
->auto_mic
= 1;
14531 static void alc269_laptop_inithook(struct hda_codec
*codec
)
14533 alc269_speaker_automute(codec
);
14534 alc_mic_automute(codec
);
14538 * generic initialization of ADC, input mixers and output mixers
14540 static struct hda_verb alc269_init_verbs
[] = {
14542 * Unmute ADC0 and set the default input to mic-in
14544 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14547 * Set up output mixers (0x02 - 0x03)
14549 /* set vol=0 to output mixers */
14550 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
14551 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
14553 /* set up input amps for analog loopback */
14554 /* Amp Indices: DAC = 0, mixer = 1 */
14555 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14556 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14557 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14558 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14559 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14560 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14562 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14563 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
14564 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14565 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
14566 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
14567 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14568 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14570 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14571 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14573 /* FIXME: use Mux-type input source selection */
14574 /* Mixer elements: 0x18, 19, 1a, 1b, 1d, 0b */
14575 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
14576 {0x23, AC_VERB_SET_CONNECT_SEL
, 0x00},
14579 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
14583 static struct hda_verb alc269vb_init_verbs
[] = {
14585 * Unmute ADC0 and set the default input to mic-in
14587 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14590 * Set up output mixers (0x02 - 0x03)
14592 /* set vol=0 to output mixers */
14593 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
14594 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
14596 /* set up input amps for analog loopback */
14597 /* Amp Indices: DAC = 0, mixer = 1 */
14598 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14599 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14600 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14601 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14602 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14603 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14605 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14606 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
14607 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14608 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
14609 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
14610 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14611 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14613 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14614 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14616 /* FIXME: use Mux-type input source selection */
14617 /* Mixer elements: 0x18, 19, 1a, 1b, 1d, 0b */
14618 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
14619 {0x22, AC_VERB_SET_CONNECT_SEL
, 0x00},
14622 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
14626 #define alc269_auto_create_multi_out_ctls \
14627 alc268_auto_create_multi_out_ctls
14628 #define alc269_auto_create_input_ctls \
14629 alc268_auto_create_input_ctls
14631 #ifdef CONFIG_SND_HDA_POWER_SAVE
14632 #define alc269_loopbacks alc880_loopbacks
14635 /* pcm configuration: identical with ALC880 */
14636 #define alc269_pcm_analog_playback alc880_pcm_analog_playback
14637 #define alc269_pcm_analog_capture alc880_pcm_analog_capture
14638 #define alc269_pcm_digital_playback alc880_pcm_digital_playback
14639 #define alc269_pcm_digital_capture alc880_pcm_digital_capture
14641 static struct hda_pcm_stream alc269_44k_pcm_analog_playback
= {
14645 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
14646 /* NID is set in alc_build_pcms */
14648 .open
= alc880_playback_pcm_open
,
14649 .prepare
= alc880_playback_pcm_prepare
,
14650 .cleanup
= alc880_playback_pcm_cleanup
14654 static struct hda_pcm_stream alc269_44k_pcm_analog_capture
= {
14658 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
14659 /* NID is set in alc_build_pcms */
14662 #ifdef CONFIG_SND_HDA_POWER_SAVE
14663 static int alc269_mic2_for_mute_led(struct hda_codec
*codec
)
14665 switch (codec
->subsystem_id
) {
14672 static int alc269_mic2_mute_check_ps(struct hda_codec
*codec
, hda_nid_t nid
)
14674 /* update mute-LED according to the speaker mute state */
14675 if (nid
== 0x01 || nid
== 0x14) {
14677 if (snd_hda_codec_amp_read(codec
, 0x14, 0, HDA_OUTPUT
, 0) &
14682 /* mic2 vref pin is used for mute LED control */
14683 snd_hda_codec_update_cache(codec
, 0x19, 0,
14684 AC_VERB_SET_PIN_WIDGET_CONTROL
,
14687 return alc_check_power_status(codec
, nid
);
14689 #endif /* CONFIG_SND_HDA_POWER_SAVE */
14691 static int alc275_setup_dual_adc(struct hda_codec
*codec
)
14693 struct alc_spec
*spec
= codec
->spec
;
14695 if (codec
->vendor_id
!= 0x10ec0275 || !spec
->auto_mic
)
14697 if ((spec
->ext_mic
.pin
>= 0x18 && spec
->int_mic
.pin
<= 0x13) ||
14698 (spec
->ext_mic
.pin
<= 0x12 && spec
->int_mic
.pin
>= 0x18)) {
14699 if (spec
->ext_mic
.pin
<= 0x12) {
14700 spec
->private_adc_nids
[0] = 0x08;
14701 spec
->private_adc_nids
[1] = 0x11;
14702 spec
->private_capsrc_nids
[0] = 0x23;
14703 spec
->private_capsrc_nids
[1] = 0x22;
14705 spec
->private_adc_nids
[0] = 0x11;
14706 spec
->private_adc_nids
[1] = 0x08;
14707 spec
->private_capsrc_nids
[0] = 0x22;
14708 spec
->private_capsrc_nids
[1] = 0x23;
14710 spec
->adc_nids
= spec
->private_adc_nids
;
14711 spec
->capsrc_nids
= spec
->private_capsrc_nids
;
14712 spec
->num_adc_nids
= 2;
14713 spec
->dual_adc_switch
= 1;
14714 snd_printdd("realtek: enabling dual ADC switchg (%02x:%02x)\n",
14715 spec
->adc_nids
[0], spec
->adc_nids
[1]);
14721 /* different alc269-variants */
14723 ALC269_TYPE_NORMAL
,
14724 ALC269_TYPE_ALC258
,
14725 ALC269_TYPE_ALC259
,
14726 ALC269_TYPE_ALC269VB
,
14727 ALC269_TYPE_ALC270
,
14728 ALC269_TYPE_ALC271X
,
14732 * BIOS auto configuration
14734 static int alc269_parse_auto_config(struct hda_codec
*codec
)
14736 struct alc_spec
*spec
= codec
->spec
;
14738 static hda_nid_t alc269_ignore
[] = { 0x1d, 0 };
14740 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
14745 err
= alc269_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
14748 if (spec
->codec_variant
== ALC269_TYPE_NORMAL
)
14749 err
= alc269_auto_create_input_ctls(codec
, &spec
->autocfg
);
14751 err
= alc_auto_create_input_ctls(codec
, &spec
->autocfg
, 0,
14756 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
14758 alc_auto_parse_digital(codec
);
14760 if (spec
->kctls
.list
)
14761 add_mixer(spec
, spec
->kctls
.list
);
14763 if (spec
->codec_variant
!= ALC269_TYPE_NORMAL
) {
14764 add_verb(spec
, alc269vb_init_verbs
);
14765 alc_ssid_check(codec
, 0, 0x1b, 0x14, 0x21);
14767 add_verb(spec
, alc269_init_verbs
);
14768 alc_ssid_check(codec
, 0x15, 0x1b, 0x14, 0);
14771 spec
->num_mux_defs
= 1;
14772 spec
->input_mux
= &spec
->private_imux
[0];
14774 if (!alc275_setup_dual_adc(codec
))
14775 fillup_priv_adc_nids(codec
, alc269_adc_candidates
,
14776 sizeof(alc269_adc_candidates
));
14778 err
= alc_auto_add_mic_boost(codec
);
14782 if (!spec
->cap_mixer
&& !spec
->no_analog
)
14783 set_capture_mixer(codec
);
14788 #define alc269_auto_init_multi_out alc268_auto_init_multi_out
14789 #define alc269_auto_init_hp_out alc268_auto_init_hp_out
14790 #define alc269_auto_init_analog_input alc882_auto_init_analog_input
14791 #define alc269_auto_init_input_src alc882_auto_init_input_src
14794 /* init callback for auto-configuration model -- overriding the default init */
14795 static void alc269_auto_init(struct hda_codec
*codec
)
14797 struct alc_spec
*spec
= codec
->spec
;
14798 alc269_auto_init_multi_out(codec
);
14799 alc269_auto_init_hp_out(codec
);
14800 alc269_auto_init_analog_input(codec
);
14801 if (!spec
->dual_adc_switch
)
14802 alc269_auto_init_input_src(codec
);
14803 alc_auto_init_digital(codec
);
14804 if (spec
->unsol_event
)
14805 alc_inithook(codec
);
14808 #ifdef SND_HDA_NEEDS_RESUME
14809 static void alc269_toggle_power_output(struct hda_codec
*codec
, int power_up
)
14811 int val
= alc_read_coef_idx(codec
, 0x04);
14816 alc_write_coef_idx(codec
, 0x04, val
);
14819 #ifdef CONFIG_SND_HDA_POWER_SAVE
14820 static int alc269_suspend(struct hda_codec
*codec
, pm_message_t state
)
14822 struct alc_spec
*spec
= codec
->spec
;
14824 if ((alc_read_coef_idx(codec
, 0) & 0x00ff) == 0x017)
14825 alc269_toggle_power_output(codec
, 0);
14826 if ((alc_read_coef_idx(codec
, 0) & 0x00ff) == 0x018) {
14827 alc269_toggle_power_output(codec
, 0);
14832 if (spec
&& spec
->power_hook
)
14833 spec
->power_hook(codec
);
14836 #endif /* CONFIG_SND_HDA_POWER_SAVE */
14838 static int alc269_resume(struct hda_codec
*codec
)
14840 if ((alc_read_coef_idx(codec
, 0) & 0x00ff) == 0x018) {
14841 alc269_toggle_power_output(codec
, 0);
14845 codec
->patch_ops
.init(codec
);
14847 if ((alc_read_coef_idx(codec
, 0) & 0x00ff) == 0x017) {
14848 alc269_toggle_power_output(codec
, 1);
14852 if ((alc_read_coef_idx(codec
, 0) & 0x00ff) == 0x018)
14853 alc269_toggle_power_output(codec
, 1);
14855 snd_hda_codec_resume_amp(codec
);
14856 snd_hda_codec_resume_cache(codec
);
14857 hda_call_check_power_status(codec
, 0x01);
14860 #endif /* SND_HDA_NEEDS_RESUME */
14862 static void alc269_fixup_hweq(struct hda_codec
*codec
,
14863 const struct alc_fixup
*fix
, int action
)
14867 if (action
!= ALC_FIXUP_ACT_INIT
)
14869 coef
= alc_read_coef_idx(codec
, 0x1e);
14870 alc_write_coef_idx(codec
, 0x1e, coef
| 0x80);
14874 ALC269_FIXUP_SONY_VAIO
,
14875 ALC275_FIXUP_SONY_VAIO_GPIO2
,
14876 ALC269_FIXUP_DELL_M101Z
,
14877 ALC269_FIXUP_SKU_IGNORE
,
14878 ALC269_FIXUP_ASUS_G73JW
,
14879 ALC269_FIXUP_LENOVO_EAPD
,
14880 ALC275_FIXUP_SONY_HWEQ
,
14883 static const struct alc_fixup alc269_fixups
[] = {
14884 [ALC269_FIXUP_SONY_VAIO
] = {
14885 .type
= ALC_FIXUP_VERBS
,
14886 .v
.verbs
= (const struct hda_verb
[]) {
14887 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREFGRD
},
14891 [ALC275_FIXUP_SONY_VAIO_GPIO2
] = {
14892 .type
= ALC_FIXUP_VERBS
,
14893 .v
.verbs
= (const struct hda_verb
[]) {
14894 {0x01, AC_VERB_SET_GPIO_MASK
, 0x04},
14895 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04},
14896 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
14900 .chain_id
= ALC269_FIXUP_SONY_VAIO
14902 [ALC269_FIXUP_DELL_M101Z
] = {
14903 .type
= ALC_FIXUP_VERBS
,
14904 .v
.verbs
= (const struct hda_verb
[]) {
14905 /* Enables internal speaker */
14906 {0x20, AC_VERB_SET_COEF_INDEX
, 13},
14907 {0x20, AC_VERB_SET_PROC_COEF
, 0x4040},
14911 [ALC269_FIXUP_SKU_IGNORE
] = {
14912 .type
= ALC_FIXUP_SKU
,
14913 .v
.sku
= ALC_FIXUP_SKU_IGNORE
,
14915 [ALC269_FIXUP_ASUS_G73JW
] = {
14916 .type
= ALC_FIXUP_PINS
,
14917 .v
.pins
= (const struct alc_pincfg
[]) {
14918 { 0x17, 0x99130111 }, /* subwoofer */
14922 [ALC269_FIXUP_LENOVO_EAPD
] = {
14923 .type
= ALC_FIXUP_VERBS
,
14924 .v
.verbs
= (const struct hda_verb
[]) {
14925 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
14929 [ALC275_FIXUP_SONY_HWEQ
] = {
14930 .type
= ALC_FIXUP_FUNC
,
14931 .v
.func
= alc269_fixup_hweq
,
14933 .chain_id
= ALC275_FIXUP_SONY_VAIO_GPIO2
14937 static struct snd_pci_quirk alc269_fixup_tbl
[] = {
14938 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2
),
14939 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
14940 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
14941 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO
),
14942 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z
),
14943 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE
),
14944 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE
),
14945 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE
),
14946 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE
),
14947 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE
),
14948 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW
),
14949 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD
),
14955 * configuration and preset
14957 static const char * const alc269_models
[ALC269_MODEL_LAST
] = {
14958 [ALC269_BASIC
] = "basic",
14959 [ALC269_QUANTA_FL1
] = "quanta",
14960 [ALC269_AMIC
] = "laptop-amic",
14961 [ALC269_DMIC
] = "laptop-dmic",
14962 [ALC269_FUJITSU
] = "fujitsu",
14963 [ALC269_LIFEBOOK
] = "lifebook",
14964 [ALC269_AUTO
] = "auto",
14967 static struct snd_pci_quirk alc269_cfg_tbl
[] = {
14968 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1
),
14969 SND_PCI_QUIRK(0x1025, 0x047c, "ACER ZGA", ALC271_ACER
),
14970 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
14972 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269VB_AMIC
),
14973 SND_PCI_QUIRK(0x1043, 0x1113, "ASUS N63Jn", ALC269VB_AMIC
),
14974 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269VB_AMIC
),
14975 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_AMIC
),
14976 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269VB_AMIC
),
14977 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269VB_AMIC
),
14978 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269VB_AMIC
),
14979 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269VB_AMIC
),
14980 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_AMIC
),
14981 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269VB_AMIC
),
14982 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_AMIC
),
14983 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_AMIC
),
14984 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_AMIC
),
14985 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_AMIC
),
14986 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_AMIC
),
14987 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_AMIC
),
14988 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_AMIC
),
14989 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_AMIC
),
14990 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_AMIC
),
14991 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_AMIC
),
14992 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_AMIC
),
14993 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_AMIC
),
14994 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_AMIC
),
14995 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_AMIC
),
14996 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_AMIC
),
14997 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_AMIC
),
14998 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_AMIC
),
14999 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_AMIC
),
15000 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_AMIC
),
15001 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_AMIC
),
15002 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_AMIC
),
15003 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_DMIC
),
15004 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_AMIC
),
15005 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_AMIC
),
15006 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_AMIC
),
15007 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_AMIC
),
15008 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901",
15010 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101",
15012 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_DMIC
),
15013 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_DMIC
),
15014 SND_PCI_QUIRK(0x104d, 0x9071, "Sony VAIO", ALC269_AUTO
),
15015 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK
),
15016 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_DMIC
),
15017 SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU
),
15018 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_AMIC
),
15019 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_AMIC
),
15020 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_DMIC
),
15021 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_DMIC
),
15025 static struct alc_config_preset alc269_presets
[] = {
15027 .mixers
= { alc269_base_mixer
},
15028 .init_verbs
= { alc269_init_verbs
},
15029 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
15030 .dac_nids
= alc269_dac_nids
,
15032 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
15033 .channel_mode
= alc269_modes
,
15034 .input_mux
= &alc269_capture_source
,
15036 [ALC269_QUANTA_FL1
] = {
15037 .mixers
= { alc269_quanta_fl1_mixer
},
15038 .init_verbs
= { alc269_init_verbs
, alc269_quanta_fl1_verbs
},
15039 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
15040 .dac_nids
= alc269_dac_nids
,
15042 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
15043 .channel_mode
= alc269_modes
,
15044 .input_mux
= &alc269_capture_source
,
15045 .unsol_event
= alc269_quanta_fl1_unsol_event
,
15046 .setup
= alc269_quanta_fl1_setup
,
15047 .init_hook
= alc269_quanta_fl1_init_hook
,
15050 .mixers
= { alc269_laptop_mixer
},
15051 .cap_mixer
= alc269_laptop_analog_capture_mixer
,
15052 .init_verbs
= { alc269_init_verbs
,
15053 alc269_laptop_amic_init_verbs
},
15054 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
15055 .dac_nids
= alc269_dac_nids
,
15057 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
15058 .channel_mode
= alc269_modes
,
15059 .unsol_event
= alc269_laptop_unsol_event
,
15060 .setup
= alc269_laptop_amic_setup
,
15061 .init_hook
= alc269_laptop_inithook
,
15064 .mixers
= { alc269_laptop_mixer
},
15065 .cap_mixer
= alc269_laptop_digital_capture_mixer
,
15066 .init_verbs
= { alc269_init_verbs
,
15067 alc269_laptop_dmic_init_verbs
},
15068 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
15069 .dac_nids
= alc269_dac_nids
,
15071 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
15072 .channel_mode
= alc269_modes
,
15073 .unsol_event
= alc269_laptop_unsol_event
,
15074 .setup
= alc269_laptop_dmic_setup
,
15075 .init_hook
= alc269_laptop_inithook
,
15077 [ALC269VB_AMIC
] = {
15078 .mixers
= { alc269vb_laptop_mixer
},
15079 .cap_mixer
= alc269vb_laptop_analog_capture_mixer
,
15080 .init_verbs
= { alc269vb_init_verbs
,
15081 alc269vb_laptop_amic_init_verbs
},
15082 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
15083 .dac_nids
= alc269_dac_nids
,
15085 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
15086 .channel_mode
= alc269_modes
,
15087 .unsol_event
= alc269_laptop_unsol_event
,
15088 .setup
= alc269vb_laptop_amic_setup
,
15089 .init_hook
= alc269_laptop_inithook
,
15091 [ALC269VB_DMIC
] = {
15092 .mixers
= { alc269vb_laptop_mixer
},
15093 .cap_mixer
= alc269vb_laptop_digital_capture_mixer
,
15094 .init_verbs
= { alc269vb_init_verbs
,
15095 alc269vb_laptop_dmic_init_verbs
},
15096 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
15097 .dac_nids
= alc269_dac_nids
,
15099 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
15100 .channel_mode
= alc269_modes
,
15101 .unsol_event
= alc269_laptop_unsol_event
,
15102 .setup
= alc269vb_laptop_dmic_setup
,
15103 .init_hook
= alc269_laptop_inithook
,
15105 [ALC269_FUJITSU
] = {
15106 .mixers
= { alc269_fujitsu_mixer
},
15107 .cap_mixer
= alc269_laptop_digital_capture_mixer
,
15108 .init_verbs
= { alc269_init_verbs
,
15109 alc269_laptop_dmic_init_verbs
},
15110 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
15111 .dac_nids
= alc269_dac_nids
,
15113 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
15114 .channel_mode
= alc269_modes
,
15115 .unsol_event
= alc269_laptop_unsol_event
,
15116 .setup
= alc269_laptop_dmic_setup
,
15117 .init_hook
= alc269_laptop_inithook
,
15119 [ALC269_LIFEBOOK
] = {
15120 .mixers
= { alc269_lifebook_mixer
},
15121 .init_verbs
= { alc269_init_verbs
, alc269_lifebook_verbs
},
15122 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
15123 .dac_nids
= alc269_dac_nids
,
15125 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
15126 .channel_mode
= alc269_modes
,
15127 .input_mux
= &alc269_capture_source
,
15128 .unsol_event
= alc269_lifebook_unsol_event
,
15129 .init_hook
= alc269_lifebook_init_hook
,
15132 .mixers
= { alc269_asus_mixer
},
15133 .cap_mixer
= alc269vb_laptop_digital_capture_mixer
,
15134 .init_verbs
= { alc269_init_verbs
, alc271_acer_dmic_verbs
},
15135 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
15136 .dac_nids
= alc269_dac_nids
,
15137 .adc_nids
= alc262_dmic_adc_nids
,
15138 .num_adc_nids
= ARRAY_SIZE(alc262_dmic_adc_nids
),
15139 .capsrc_nids
= alc262_dmic_capsrc_nids
,
15140 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
15141 .channel_mode
= alc269_modes
,
15142 .input_mux
= &alc269_capture_source
,
15143 .dig_out_nid
= ALC880_DIGOUT_NID
,
15144 .unsol_event
= alc_sku_unsol_event
,
15145 .setup
= alc269vb_laptop_dmic_setup
,
15146 .init_hook
= alc_inithook
,
15150 static int alc269_fill_coef(struct hda_codec
*codec
)
15154 if ((alc_read_coef_idx(codec
, 0) & 0x00ff) < 0x015) {
15155 alc_write_coef_idx(codec
, 0xf, 0x960b);
15156 alc_write_coef_idx(codec
, 0xe, 0x8817);
15159 if ((alc_read_coef_idx(codec
, 0) & 0x00ff) == 0x016) {
15160 alc_write_coef_idx(codec
, 0xf, 0x960b);
15161 alc_write_coef_idx(codec
, 0xe, 0x8814);
15164 if ((alc_read_coef_idx(codec
, 0) & 0x00ff) == 0x017) {
15165 val
= alc_read_coef_idx(codec
, 0x04);
15166 /* Power up output pin */
15167 alc_write_coef_idx(codec
, 0x04, val
| (1<<11));
15170 if ((alc_read_coef_idx(codec
, 0) & 0x00ff) == 0x018) {
15171 val
= alc_read_coef_idx(codec
, 0xd);
15172 if ((val
& 0x0c00) >> 10 != 0x1) {
15173 /* Capless ramp up clock control */
15174 alc_write_coef_idx(codec
, 0xd, val
| 1<<10);
15176 val
= alc_read_coef_idx(codec
, 0x17);
15177 if ((val
& 0x01c0) >> 6 != 0x4) {
15178 /* Class D power on reset */
15179 alc_write_coef_idx(codec
, 0x17, val
| 1<<7);
15185 static int patch_alc269(struct hda_codec
*codec
)
15187 struct alc_spec
*spec
;
15188 int board_config
, coef
;
15191 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
15195 codec
->spec
= spec
;
15197 alc_auto_parse_customize_define(codec
);
15199 if (codec
->vendor_id
== 0x10ec0269) {
15200 coef
= alc_read_coef_idx(codec
, 0);
15201 if ((coef
& 0x00f0) == 0x0010) {
15202 if (codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
15203 spec
->cdefine
.platform_type
== 1) {
15204 alc_codec_rename(codec
, "ALC271X");
15205 spec
->codec_variant
= ALC269_TYPE_ALC271X
;
15206 } else if ((coef
& 0xf000) == 0x1000) {
15207 spec
->codec_variant
= ALC269_TYPE_ALC270
;
15208 } else if ((coef
& 0xf000) == 0x2000) {
15209 alc_codec_rename(codec
, "ALC259");
15210 spec
->codec_variant
= ALC269_TYPE_ALC259
;
15211 } else if ((coef
& 0xf000) == 0x3000) {
15212 alc_codec_rename(codec
, "ALC258");
15213 spec
->codec_variant
= ALC269_TYPE_ALC258
;
15215 alc_codec_rename(codec
, "ALC269VB");
15216 spec
->codec_variant
= ALC269_TYPE_ALC269VB
;
15219 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
15220 alc269_fill_coef(codec
);
15223 board_config
= snd_hda_check_board_config(codec
, ALC269_MODEL_LAST
,
15227 if (board_config
< 0) {
15228 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
15230 board_config
= ALC269_AUTO
;
15233 if (board_config
== ALC269_AUTO
) {
15234 alc_pick_fixup(codec
, NULL
, alc269_fixup_tbl
, alc269_fixups
);
15235 alc_apply_fixup(codec
, ALC_FIXUP_ACT_PRE_PROBE
);
15238 if (board_config
== ALC269_AUTO
) {
15239 /* automatic parse from the BIOS config */
15240 err
= alc269_parse_auto_config(codec
);
15246 "hda_codec: Cannot set up configuration "
15247 "from BIOS. Using base mode...\n");
15248 board_config
= ALC269_BASIC
;
15252 if (has_cdefine_beep(codec
)) {
15253 err
= snd_hda_attach_beep_device(codec
, 0x1);
15260 if (board_config
!= ALC269_AUTO
)
15261 setup_preset(codec
, &alc269_presets
[board_config
]);
15263 if (board_config
== ALC269_QUANTA_FL1
) {
15264 /* Due to a hardware problem on Lenovo Ideadpad, we need to
15265 * fix the sample rate of analog I/O to 44.1kHz
15267 spec
->stream_analog_playback
= &alc269_44k_pcm_analog_playback
;
15268 spec
->stream_analog_capture
= &alc269_44k_pcm_analog_capture
;
15269 } else if (spec
->dual_adc_switch
) {
15270 spec
->stream_analog_playback
= &alc269_pcm_analog_playback
;
15271 /* switch ADC dynamically */
15272 spec
->stream_analog_capture
= &dualmic_pcm_analog_capture
;
15274 spec
->stream_analog_playback
= &alc269_pcm_analog_playback
;
15275 spec
->stream_analog_capture
= &alc269_pcm_analog_capture
;
15277 spec
->stream_digital_playback
= &alc269_pcm_digital_playback
;
15278 spec
->stream_digital_capture
= &alc269_pcm_digital_capture
;
15280 if (!spec
->adc_nids
) { /* wasn't filled automatically? use default */
15281 if (spec
->codec_variant
== ALC269_TYPE_NORMAL
) {
15282 spec
->adc_nids
= alc269_adc_nids
;
15283 spec
->num_adc_nids
= ARRAY_SIZE(alc269_adc_nids
);
15284 spec
->capsrc_nids
= alc269_capsrc_nids
;
15286 spec
->adc_nids
= alc269vb_adc_nids
;
15287 spec
->num_adc_nids
= ARRAY_SIZE(alc269vb_adc_nids
);
15288 spec
->capsrc_nids
= alc269vb_capsrc_nids
;
15292 if (!spec
->cap_mixer
)
15293 set_capture_mixer(codec
);
15294 if (has_cdefine_beep(codec
))
15295 set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
15297 alc_apply_fixup(codec
, ALC_FIXUP_ACT_PROBE
);
15299 spec
->vmaster_nid
= 0x02;
15301 codec
->patch_ops
= alc_patch_ops
;
15302 #ifdef CONFIG_SND_HDA_POWER_SAVE
15303 codec
->patch_ops
.suspend
= alc269_suspend
;
15305 #ifdef SND_HDA_NEEDS_RESUME
15306 codec
->patch_ops
.resume
= alc269_resume
;
15308 if (board_config
== ALC269_AUTO
)
15309 spec
->init_hook
= alc269_auto_init
;
15311 alc_init_jacks(codec
);
15312 #ifdef CONFIG_SND_HDA_POWER_SAVE
15313 if (!spec
->loopback
.amplist
)
15314 spec
->loopback
.amplist
= alc269_loopbacks
;
15315 if (alc269_mic2_for_mute_led(codec
))
15316 codec
->patch_ops
.check_power_status
= alc269_mic2_mute_check_ps
;
15323 * ALC861 channel source setting (2/6 channel selection for 3-stack)
15327 * set the path ways for 2 channel output
15328 * need to set the codec line out and mic 1 pin widgets to inputs
15330 static struct hda_verb alc861_threestack_ch2_init
[] = {
15331 /* set pin widget 1Ah (line in) for input */
15332 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
15333 /* set pin widget 18h (mic1/2) for input, for mic also enable
15336 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
15338 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c },
15340 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8)) }, /*mic*/
15341 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x02 << 8)) }, /*line-in*/
15347 * need to set the codec line out and mic 1 pin widgets to outputs
15349 static struct hda_verb alc861_threestack_ch6_init
[] = {
15350 /* set pin widget 1Ah (line in) for output (Back Surround)*/
15351 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
15352 /* set pin widget 18h (mic1) for output (CLFE)*/
15353 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
15355 { 0x0c, AC_VERB_SET_CONNECT_SEL
, 0x00 },
15356 { 0x0d, AC_VERB_SET_CONNECT_SEL
, 0x00 },
15358 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb080 },
15360 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8)) }, /*mic*/
15361 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8)) }, /*line in*/
15366 static struct hda_channel_mode alc861_threestack_modes
[2] = {
15367 { 2, alc861_threestack_ch2_init
},
15368 { 6, alc861_threestack_ch6_init
},
15370 /* Set mic1 as input and unmute the mixer */
15371 static struct hda_verb alc861_uniwill_m31_ch2_init
[] = {
15372 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
15373 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8)) }, /*mic*/
15376 /* Set mic1 as output and mute mixer */
15377 static struct hda_verb alc861_uniwill_m31_ch4_init
[] = {
15378 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
15379 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8)) }, /*mic*/
15383 static struct hda_channel_mode alc861_uniwill_m31_modes
[2] = {
15384 { 2, alc861_uniwill_m31_ch2_init
},
15385 { 4, alc861_uniwill_m31_ch4_init
},
15388 /* Set mic1 and line-in as input and unmute the mixer */
15389 static struct hda_verb alc861_asus_ch2_init
[] = {
15390 /* set pin widget 1Ah (line in) for input */
15391 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
15392 /* set pin widget 18h (mic1/2) for input, for mic also enable
15395 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
15397 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c },
15399 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8)) }, /*mic*/
15400 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x02 << 8)) }, /*line-in*/
15404 /* Set mic1 nad line-in as output and mute mixer */
15405 static struct hda_verb alc861_asus_ch6_init
[] = {
15406 /* set pin widget 1Ah (line in) for output (Back Surround)*/
15407 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
15408 /* { 0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, */
15409 /* set pin widget 18h (mic1) for output (CLFE)*/
15410 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
15411 /* { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, */
15412 { 0x0c, AC_VERB_SET_CONNECT_SEL
, 0x00 },
15413 { 0x0d, AC_VERB_SET_CONNECT_SEL
, 0x00 },
15415 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb080 },
15417 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8)) }, /*mic*/
15418 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8)) }, /*line in*/
15423 static struct hda_channel_mode alc861_asus_modes
[2] = {
15424 { 2, alc861_asus_ch2_init
},
15425 { 6, alc861_asus_ch6_init
},
15430 static struct snd_kcontrol_new alc861_base_mixer
[] = {
15431 /* output mixer control */
15432 HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT
),
15433 HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT
),
15434 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT
),
15435 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT
),
15436 HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT
),
15438 /*Input mixer control */
15439 /* HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT),
15440 HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT), */
15441 HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT
),
15442 HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT
),
15443 HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT
),
15444 HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT
),
15445 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT
),
15446 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT
),
15447 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT
),
15448 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT
),
15453 static struct snd_kcontrol_new alc861_3ST_mixer
[] = {
15454 /* output mixer control */
15455 HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT
),
15456 HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT
),
15457 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT
),
15458 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT
),
15459 /*HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT), */
15461 /* Input mixer control */
15462 /* HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT),
15463 HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT), */
15464 HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT
),
15465 HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT
),
15466 HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT
),
15467 HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT
),
15468 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT
),
15469 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT
),
15470 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT
),
15471 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT
),
15474 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
15475 .name
= "Channel Mode",
15476 .info
= alc_ch_mode_info
,
15477 .get
= alc_ch_mode_get
,
15478 .put
= alc_ch_mode_put
,
15479 .private_value
= ARRAY_SIZE(alc861_threestack_modes
),
15484 static struct snd_kcontrol_new alc861_toshiba_mixer
[] = {
15485 /* output mixer control */
15486 HDA_CODEC_MUTE("Master Playback Switch", 0x03, 0x0, HDA_OUTPUT
),
15487 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT
),
15488 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT
),
15493 static struct snd_kcontrol_new alc861_uniwill_m31_mixer
[] = {
15494 /* output mixer control */
15495 HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT
),
15496 HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT
),
15497 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT
),
15498 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT
),
15499 /*HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT), */
15501 /* Input mixer control */
15502 /* HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT),
15503 HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT), */
15504 HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT
),
15505 HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT
),
15506 HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT
),
15507 HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT
),
15508 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT
),
15509 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT
),
15510 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT
),
15511 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT
),
15514 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
15515 .name
= "Channel Mode",
15516 .info
= alc_ch_mode_info
,
15517 .get
= alc_ch_mode_get
,
15518 .put
= alc_ch_mode_put
,
15519 .private_value
= ARRAY_SIZE(alc861_uniwill_m31_modes
),
15524 static struct snd_kcontrol_new alc861_asus_mixer
[] = {
15525 /* output mixer control */
15526 HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT
),
15527 HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT
),
15528 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT
),
15529 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT
),
15530 HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT
),
15532 /* Input mixer control */
15533 HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT
),
15534 HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
15535 HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT
),
15536 HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT
),
15537 HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT
),
15538 HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT
),
15539 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT
),
15540 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT
),
15541 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT
),
15542 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_OUTPUT
),
15545 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
15546 .name
= "Channel Mode",
15547 .info
= alc_ch_mode_info
,
15548 .get
= alc_ch_mode_get
,
15549 .put
= alc_ch_mode_put
,
15550 .private_value
= ARRAY_SIZE(alc861_asus_modes
),
15555 /* additional mixer */
15556 static struct snd_kcontrol_new alc861_asus_laptop_mixer
[] = {
15557 HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT
),
15558 HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT
),
15563 * generic initialization of ADC, input mixers and output mixers
15565 static struct hda_verb alc861_base_init_verbs
[] = {
15567 * Unmute ADC0 and set the default input to mic-in
15569 /* port-A for surround (rear panel) */
15570 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
15571 { 0x0e, AC_VERB_SET_CONNECT_SEL
, 0x00 },
15572 /* port-B for mic-in (rear panel) with vref */
15573 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
15574 /* port-C for line-in (rear panel) */
15575 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
15576 /* port-D for Front */
15577 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
15578 { 0x0b, AC_VERB_SET_CONNECT_SEL
, 0x00 },
15579 /* port-E for HP out (front panel) */
15580 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0 },
15581 /* route front PCM to HP */
15582 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
15583 /* port-F for mic-in (front panel) with vref */
15584 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
15585 /* port-G for CLFE (rear panel) */
15586 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
15587 { 0x1f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
15588 /* port-H for side (rear panel) */
15589 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
15590 { 0x20, AC_VERB_SET_CONNECT_SEL
, 0x00 },
15592 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
15593 /* route front mic to ADC1*/
15594 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
15595 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15597 /* Unmute DAC0~3 & spdif out*/
15598 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15599 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15600 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15601 {0x06, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15602 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15604 /* Unmute Mixer 14 (mic) 1c (Line in)*/
15605 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15606 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15607 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15608 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15610 /* Unmute Stereo Mixer 15 */
15611 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15612 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15613 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
15614 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c}, /* Output 0~12 step */
15616 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15617 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15618 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15619 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15620 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15621 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15622 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15623 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15624 /* hp used DAC 3 (Front) */
15625 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
15626 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
15631 static struct hda_verb alc861_threestack_init_verbs
[] = {
15633 * Unmute ADC0 and set the default input to mic-in
15635 /* port-A for surround (rear panel) */
15636 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
15637 /* port-B for mic-in (rear panel) with vref */
15638 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
15639 /* port-C for line-in (rear panel) */
15640 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
15641 /* port-D for Front */
15642 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
15643 { 0x0b, AC_VERB_SET_CONNECT_SEL
, 0x00 },
15644 /* port-E for HP out (front panel) */
15645 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0 },
15646 /* route front PCM to HP */
15647 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
15648 /* port-F for mic-in (front panel) with vref */
15649 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
15650 /* port-G for CLFE (rear panel) */
15651 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
15652 /* port-H for side (rear panel) */
15653 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
15655 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
15656 /* route front mic to ADC1*/
15657 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
15658 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15659 /* Unmute DAC0~3 & spdif out*/
15660 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15661 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15662 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15663 {0x06, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15664 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15666 /* Unmute Mixer 14 (mic) 1c (Line in)*/
15667 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15668 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15669 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15670 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15672 /* Unmute Stereo Mixer 15 */
15673 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15674 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15675 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
15676 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c}, /* Output 0~12 step */
15678 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15679 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15680 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15681 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15682 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15683 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15684 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15685 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15686 /* hp used DAC 3 (Front) */
15687 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
15688 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
15692 static struct hda_verb alc861_uniwill_m31_init_verbs
[] = {
15694 * Unmute ADC0 and set the default input to mic-in
15696 /* port-A for surround (rear panel) */
15697 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
15698 /* port-B for mic-in (rear panel) with vref */
15699 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
15700 /* port-C for line-in (rear panel) */
15701 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
15702 /* port-D for Front */
15703 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
15704 { 0x0b, AC_VERB_SET_CONNECT_SEL
, 0x00 },
15705 /* port-E for HP out (front panel) */
15706 /* this has to be set to VREF80 */
15707 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
15708 /* route front PCM to HP */
15709 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
15710 /* port-F for mic-in (front panel) with vref */
15711 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
15712 /* port-G for CLFE (rear panel) */
15713 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
15714 /* port-H for side (rear panel) */
15715 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
15717 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
15718 /* route front mic to ADC1*/
15719 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
15720 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15721 /* Unmute DAC0~3 & spdif out*/
15722 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15723 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15724 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15725 {0x06, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15726 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15728 /* Unmute Mixer 14 (mic) 1c (Line in)*/
15729 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15730 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15731 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15732 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15734 /* Unmute Stereo Mixer 15 */
15735 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15736 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15737 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
15738 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c}, /* Output 0~12 step */
15740 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15741 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15742 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15743 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15744 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15745 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15746 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15747 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15748 /* hp used DAC 3 (Front) */
15749 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
15750 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
15754 static struct hda_verb alc861_asus_init_verbs
[] = {
15756 * Unmute ADC0 and set the default input to mic-in
15758 /* port-A for surround (rear panel)
15759 * according to codec#0 this is the HP jack
15761 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0 }, /* was 0x00 */
15762 /* route front PCM to HP */
15763 { 0x0e, AC_VERB_SET_CONNECT_SEL
, 0x01 },
15764 /* port-B for mic-in (rear panel) with vref */
15765 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
15766 /* port-C for line-in (rear panel) */
15767 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
15768 /* port-D for Front */
15769 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
15770 { 0x0b, AC_VERB_SET_CONNECT_SEL
, 0x00 },
15771 /* port-E for HP out (front panel) */
15772 /* this has to be set to VREF80 */
15773 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
15774 /* route front PCM to HP */
15775 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
15776 /* port-F for mic-in (front panel) with vref */
15777 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
15778 /* port-G for CLFE (rear panel) */
15779 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
15780 /* port-H for side (rear panel) */
15781 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
15783 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
15784 /* route front mic to ADC1*/
15785 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
15786 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15787 /* Unmute DAC0~3 & spdif out*/
15788 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15789 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15790 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15791 {0x06, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15792 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15793 /* Unmute Mixer 14 (mic) 1c (Line in)*/
15794 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15795 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15796 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15797 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15799 /* Unmute Stereo Mixer 15 */
15800 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15801 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15802 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
15803 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c}, /* Output 0~12 step */
15805 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15806 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15807 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15808 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15809 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15810 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15811 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15812 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15813 /* hp used DAC 3 (Front) */
15814 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
15815 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
15819 /* additional init verbs for ASUS laptops */
15820 static struct hda_verb alc861_asus_laptop_init_verbs
[] = {
15821 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x45 }, /* HP-out */
15822 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2) }, /* mute line-in */
15827 * generic initialization of ADC, input mixers and output mixers
15829 static struct hda_verb alc861_auto_init_verbs
[] = {
15831 * Unmute ADC0 and set the default input to mic-in
15833 /* {0x08, AC_VERB_SET_CONNECT_SEL, 0x00}, */
15834 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15836 /* Unmute DAC0~3 & spdif out*/
15837 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15838 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15839 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15840 {0x06, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15841 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15843 /* Unmute Mixer 14 (mic) 1c (Line in)*/
15844 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15845 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15846 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15847 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15849 /* Unmute Stereo Mixer 15 */
15850 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15851 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15852 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
15853 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c},
15855 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
15856 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
15857 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
15858 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
15859 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
15860 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
15861 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
15862 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
15864 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
15865 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
15866 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
15867 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
15868 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
15869 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
15870 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
15871 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
15873 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* set Mic 1 */
15878 static struct hda_verb alc861_toshiba_init_verbs
[] = {
15879 {0x0f, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
15884 /* toggle speaker-output according to the hp-jack state */
15885 static void alc861_toshiba_automute(struct hda_codec
*codec
)
15887 unsigned int present
= snd_hda_jack_detect(codec
, 0x0f);
15889 snd_hda_codec_amp_stereo(codec
, 0x16, HDA_INPUT
, 0,
15890 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
15891 snd_hda_codec_amp_stereo(codec
, 0x1a, HDA_INPUT
, 3,
15892 HDA_AMP_MUTE
, present
? 0 : HDA_AMP_MUTE
);
15895 static void alc861_toshiba_unsol_event(struct hda_codec
*codec
,
15898 if ((res
>> 26) == ALC880_HP_EVENT
)
15899 alc861_toshiba_automute(codec
);
15902 /* pcm configuration: identical with ALC880 */
15903 #define alc861_pcm_analog_playback alc880_pcm_analog_playback
15904 #define alc861_pcm_analog_capture alc880_pcm_analog_capture
15905 #define alc861_pcm_digital_playback alc880_pcm_digital_playback
15906 #define alc861_pcm_digital_capture alc880_pcm_digital_capture
15909 #define ALC861_DIGOUT_NID 0x07
15911 static struct hda_channel_mode alc861_8ch_modes
[1] = {
15915 static hda_nid_t alc861_dac_nids
[4] = {
15916 /* front, surround, clfe, side */
15917 0x03, 0x06, 0x05, 0x04
15920 static hda_nid_t alc660_dac_nids
[3] = {
15921 /* front, clfe, surround */
15925 static hda_nid_t alc861_adc_nids
[1] = {
15930 static struct hda_input_mux alc861_capture_source
= {
15934 { "Front Mic", 0x3 },
15941 static hda_nid_t
alc861_look_for_dac(struct hda_codec
*codec
, hda_nid_t pin
)
15943 struct alc_spec
*spec
= codec
->spec
;
15944 hda_nid_t mix
, srcs
[5];
15947 if (snd_hda_get_connections(codec
, pin
, &mix
, 1) != 1)
15949 num
= snd_hda_get_connections(codec
, mix
, srcs
, ARRAY_SIZE(srcs
));
15952 for (i
= 0; i
< num
; i
++) {
15954 type
= get_wcaps_type(get_wcaps(codec
, srcs
[i
]));
15955 if (type
!= AC_WID_AUD_OUT
)
15957 for (j
= 0; j
< spec
->multiout
.num_dacs
; j
++)
15958 if (spec
->multiout
.dac_nids
[j
] == srcs
[i
])
15960 if (j
>= spec
->multiout
.num_dacs
)
15966 /* fill in the dac_nids table from the parsed pin configuration */
15967 static int alc861_auto_fill_dac_nids(struct hda_codec
*codec
,
15968 const struct auto_pin_cfg
*cfg
)
15970 struct alc_spec
*spec
= codec
->spec
;
15972 hda_nid_t nid
, dac
;
15974 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
15975 for (i
= 0; i
< cfg
->line_outs
; i
++) {
15976 nid
= cfg
->line_out_pins
[i
];
15977 dac
= alc861_look_for_dac(codec
, nid
);
15980 spec
->multiout
.dac_nids
[spec
->multiout
.num_dacs
++] = dac
;
15985 static int __alc861_create_out_sw(struct hda_codec
*codec
, const char *pfx
,
15986 hda_nid_t nid
, int idx
, unsigned int chs
)
15988 return __add_pb_sw_ctrl(codec
->spec
, ALC_CTL_WIDGET_MUTE
, pfx
, idx
,
15989 HDA_COMPOSE_AMP_VAL(nid
, chs
, 0, HDA_OUTPUT
));
15992 #define alc861_create_out_sw(codec, pfx, nid, chs) \
15993 __alc861_create_out_sw(codec, pfx, nid, 0, chs)
15995 /* add playback controls from the parsed DAC table */
15996 static int alc861_auto_create_multi_out_ctls(struct hda_codec
*codec
,
15997 const struct auto_pin_cfg
*cfg
)
15999 struct alc_spec
*spec
= codec
->spec
;
16000 static const char * const chname
[4] = {
16001 "Front", "Surround", NULL
/*CLFE*/, "Side"
16003 const char *pfx
= alc_get_line_out_pfx(cfg
, true);
16007 for (i
= 0; i
< cfg
->line_outs
; i
++) {
16008 nid
= spec
->multiout
.dac_nids
[i
];
16011 if (!pfx
&& i
== 2) {
16013 err
= alc861_create_out_sw(codec
, "Center", nid
, 1);
16016 err
= alc861_create_out_sw(codec
, "LFE", nid
, 2);
16020 const char *name
= pfx
;
16026 err
= __alc861_create_out_sw(codec
, name
, nid
, index
, 3);
16034 static int alc861_auto_create_hp_ctls(struct hda_codec
*codec
, hda_nid_t pin
)
16036 struct alc_spec
*spec
= codec
->spec
;
16043 if ((pin
>= 0x0b && pin
<= 0x10) || pin
== 0x1f || pin
== 0x20) {
16044 nid
= alc861_look_for_dac(codec
, pin
);
16046 err
= alc861_create_out_sw(codec
, "Headphone", nid
, 3);
16049 spec
->multiout
.hp_nid
= nid
;
16055 /* create playback/capture controls for input pins */
16056 static int alc861_auto_create_input_ctls(struct hda_codec
*codec
,
16057 const struct auto_pin_cfg
*cfg
)
16059 return alc_auto_create_input_ctls(codec
, cfg
, 0x15, 0x08, 0);
16062 static void alc861_auto_set_output_and_unmute(struct hda_codec
*codec
,
16064 int pin_type
, hda_nid_t dac
)
16066 hda_nid_t mix
, srcs
[5];
16069 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
16071 snd_hda_codec_write(codec
, dac
, 0, AC_VERB_SET_AMP_GAIN_MUTE
,
16073 if (snd_hda_get_connections(codec
, nid
, &mix
, 1) != 1)
16075 num
= snd_hda_get_connections(codec
, mix
, srcs
, ARRAY_SIZE(srcs
));
16078 for (i
= 0; i
< num
; i
++) {
16080 if (srcs
[i
] == dac
|| srcs
[i
] == 0x15)
16081 mute
= AMP_IN_UNMUTE(i
);
16083 mute
= AMP_IN_MUTE(i
);
16084 snd_hda_codec_write(codec
, mix
, 0, AC_VERB_SET_AMP_GAIN_MUTE
,
16089 static void alc861_auto_init_multi_out(struct hda_codec
*codec
)
16091 struct alc_spec
*spec
= codec
->spec
;
16094 for (i
= 0; i
< spec
->autocfg
.line_outs
; i
++) {
16095 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
16096 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
16098 alc861_auto_set_output_and_unmute(codec
, nid
, pin_type
,
16099 spec
->multiout
.dac_nids
[i
]);
16103 static void alc861_auto_init_hp_out(struct hda_codec
*codec
)
16105 struct alc_spec
*spec
= codec
->spec
;
16107 if (spec
->autocfg
.hp_outs
)
16108 alc861_auto_set_output_and_unmute(codec
,
16109 spec
->autocfg
.hp_pins
[0],
16111 spec
->multiout
.hp_nid
);
16112 if (spec
->autocfg
.speaker_outs
)
16113 alc861_auto_set_output_and_unmute(codec
,
16114 spec
->autocfg
.speaker_pins
[0],
16116 spec
->multiout
.dac_nids
[0]);
16119 static void alc861_auto_init_analog_input(struct hda_codec
*codec
)
16121 struct alc_spec
*spec
= codec
->spec
;
16122 struct auto_pin_cfg
*cfg
= &spec
->autocfg
;
16125 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
16126 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
16127 if (nid
>= 0x0c && nid
<= 0x11)
16128 alc_set_input_pin(codec
, nid
, cfg
->inputs
[i
].type
);
16132 /* parse the BIOS configuration and set up the alc_spec */
16133 /* return 1 if successful, 0 if the proper config is not found,
16134 * or a negative error code
16136 static int alc861_parse_auto_config(struct hda_codec
*codec
)
16138 struct alc_spec
*spec
= codec
->spec
;
16140 static hda_nid_t alc861_ignore
[] = { 0x1d, 0 };
16142 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
16146 if (!spec
->autocfg
.line_outs
)
16147 return 0; /* can't find valid BIOS pin config */
16149 err
= alc861_auto_fill_dac_nids(codec
, &spec
->autocfg
);
16152 err
= alc861_auto_create_multi_out_ctls(codec
, &spec
->autocfg
);
16155 err
= alc861_auto_create_hp_ctls(codec
, spec
->autocfg
.hp_pins
[0]);
16158 err
= alc861_auto_create_input_ctls(codec
, &spec
->autocfg
);
16162 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
16164 alc_auto_parse_digital(codec
);
16166 if (spec
->kctls
.list
)
16167 add_mixer(spec
, spec
->kctls
.list
);
16169 add_verb(spec
, alc861_auto_init_verbs
);
16171 spec
->num_mux_defs
= 1;
16172 spec
->input_mux
= &spec
->private_imux
[0];
16174 spec
->adc_nids
= alc861_adc_nids
;
16175 spec
->num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
);
16176 set_capture_mixer(codec
);
16178 alc_ssid_check(codec
, 0x0e, 0x0f, 0x0b, 0);
16183 /* additional initialization for auto-configuration model */
16184 static void alc861_auto_init(struct hda_codec
*codec
)
16186 struct alc_spec
*spec
= codec
->spec
;
16187 alc861_auto_init_multi_out(codec
);
16188 alc861_auto_init_hp_out(codec
);
16189 alc861_auto_init_analog_input(codec
);
16190 alc_auto_init_digital(codec
);
16191 if (spec
->unsol_event
)
16192 alc_inithook(codec
);
16195 #ifdef CONFIG_SND_HDA_POWER_SAVE
16196 static struct hda_amp_list alc861_loopbacks
[] = {
16197 { 0x15, HDA_INPUT
, 0 },
16198 { 0x15, HDA_INPUT
, 1 },
16199 { 0x15, HDA_INPUT
, 2 },
16200 { 0x15, HDA_INPUT
, 3 },
16207 * configuration and preset
16209 static const char * const alc861_models
[ALC861_MODEL_LAST
] = {
16210 [ALC861_3ST
] = "3stack",
16211 [ALC660_3ST
] = "3stack-660",
16212 [ALC861_3ST_DIG
] = "3stack-dig",
16213 [ALC861_6ST_DIG
] = "6stack-dig",
16214 [ALC861_UNIWILL_M31
] = "uniwill-m31",
16215 [ALC861_TOSHIBA
] = "toshiba",
16216 [ALC861_ASUS
] = "asus",
16217 [ALC861_ASUS_LAPTOP
] = "asus-laptop",
16218 [ALC861_AUTO
] = "auto",
16221 static struct snd_pci_quirk alc861_cfg_tbl
[] = {
16222 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC861_3ST
),
16223 SND_PCI_QUIRK(0x1043, 0x1335, "ASUS F2/3", ALC861_ASUS_LAPTOP
),
16224 SND_PCI_QUIRK(0x1043, 0x1338, "ASUS F2/3", ALC861_ASUS_LAPTOP
),
16225 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS", ALC861_ASUS
),
16226 SND_PCI_QUIRK(0x1043, 0x13d7, "ASUS A9rp", ALC861_ASUS_LAPTOP
),
16227 SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS P1-AH2", ALC861_3ST_DIG
),
16228 SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba", ALC861_TOSHIBA
),
16229 /* FIXME: the entry below breaks Toshiba A100 (model=auto works!)
16230 * Any other models that need this preset?
16232 /* SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba", ALC861_TOSHIBA), */
16233 SND_PCI_QUIRK(0x1462, 0x7254, "HP dx2200 (MSI MS-7254)", ALC861_3ST
),
16234 SND_PCI_QUIRK(0x1462, 0x7297, "HP dx2250 (MSI MS-7297)", ALC861_3ST
),
16235 SND_PCI_QUIRK(0x1584, 0x2b01, "Uniwill X40AIx", ALC861_UNIWILL_M31
),
16236 SND_PCI_QUIRK(0x1584, 0x9072, "Uniwill m31", ALC861_UNIWILL_M31
),
16237 SND_PCI_QUIRK(0x1584, 0x9075, "Airis Praxis N1212", ALC861_ASUS_LAPTOP
),
16238 /* FIXME: the below seems conflict */
16239 /* SND_PCI_QUIRK(0x1584, 0x9075, "Uniwill", ALC861_UNIWILL_M31), */
16240 SND_PCI_QUIRK(0x1849, 0x0660, "Asrock 939SLI32", ALC660_3ST
),
16241 SND_PCI_QUIRK(0x8086, 0xd600, "Intel", ALC861_3ST
),
16245 static struct alc_config_preset alc861_presets
[] = {
16247 .mixers
= { alc861_3ST_mixer
},
16248 .init_verbs
= { alc861_threestack_init_verbs
},
16249 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
16250 .dac_nids
= alc861_dac_nids
,
16251 .num_channel_mode
= ARRAY_SIZE(alc861_threestack_modes
),
16252 .channel_mode
= alc861_threestack_modes
,
16254 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
16255 .adc_nids
= alc861_adc_nids
,
16256 .input_mux
= &alc861_capture_source
,
16258 [ALC861_3ST_DIG
] = {
16259 .mixers
= { alc861_base_mixer
},
16260 .init_verbs
= { alc861_threestack_init_verbs
},
16261 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
16262 .dac_nids
= alc861_dac_nids
,
16263 .dig_out_nid
= ALC861_DIGOUT_NID
,
16264 .num_channel_mode
= ARRAY_SIZE(alc861_threestack_modes
),
16265 .channel_mode
= alc861_threestack_modes
,
16267 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
16268 .adc_nids
= alc861_adc_nids
,
16269 .input_mux
= &alc861_capture_source
,
16271 [ALC861_6ST_DIG
] = {
16272 .mixers
= { alc861_base_mixer
},
16273 .init_verbs
= { alc861_base_init_verbs
},
16274 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
16275 .dac_nids
= alc861_dac_nids
,
16276 .dig_out_nid
= ALC861_DIGOUT_NID
,
16277 .num_channel_mode
= ARRAY_SIZE(alc861_8ch_modes
),
16278 .channel_mode
= alc861_8ch_modes
,
16279 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
16280 .adc_nids
= alc861_adc_nids
,
16281 .input_mux
= &alc861_capture_source
,
16284 .mixers
= { alc861_3ST_mixer
},
16285 .init_verbs
= { alc861_threestack_init_verbs
},
16286 .num_dacs
= ARRAY_SIZE(alc660_dac_nids
),
16287 .dac_nids
= alc660_dac_nids
,
16288 .num_channel_mode
= ARRAY_SIZE(alc861_threestack_modes
),
16289 .channel_mode
= alc861_threestack_modes
,
16291 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
16292 .adc_nids
= alc861_adc_nids
,
16293 .input_mux
= &alc861_capture_source
,
16295 [ALC861_UNIWILL_M31
] = {
16296 .mixers
= { alc861_uniwill_m31_mixer
},
16297 .init_verbs
= { alc861_uniwill_m31_init_verbs
},
16298 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
16299 .dac_nids
= alc861_dac_nids
,
16300 .dig_out_nid
= ALC861_DIGOUT_NID
,
16301 .num_channel_mode
= ARRAY_SIZE(alc861_uniwill_m31_modes
),
16302 .channel_mode
= alc861_uniwill_m31_modes
,
16304 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
16305 .adc_nids
= alc861_adc_nids
,
16306 .input_mux
= &alc861_capture_source
,
16308 [ALC861_TOSHIBA
] = {
16309 .mixers
= { alc861_toshiba_mixer
},
16310 .init_verbs
= { alc861_base_init_verbs
,
16311 alc861_toshiba_init_verbs
},
16312 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
16313 .dac_nids
= alc861_dac_nids
,
16314 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
16315 .channel_mode
= alc883_3ST_2ch_modes
,
16316 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
16317 .adc_nids
= alc861_adc_nids
,
16318 .input_mux
= &alc861_capture_source
,
16319 .unsol_event
= alc861_toshiba_unsol_event
,
16320 .init_hook
= alc861_toshiba_automute
,
16323 .mixers
= { alc861_asus_mixer
},
16324 .init_verbs
= { alc861_asus_init_verbs
},
16325 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
16326 .dac_nids
= alc861_dac_nids
,
16327 .dig_out_nid
= ALC861_DIGOUT_NID
,
16328 .num_channel_mode
= ARRAY_SIZE(alc861_asus_modes
),
16329 .channel_mode
= alc861_asus_modes
,
16332 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
16333 .adc_nids
= alc861_adc_nids
,
16334 .input_mux
= &alc861_capture_source
,
16336 [ALC861_ASUS_LAPTOP
] = {
16337 .mixers
= { alc861_toshiba_mixer
, alc861_asus_laptop_mixer
},
16338 .init_verbs
= { alc861_asus_init_verbs
,
16339 alc861_asus_laptop_init_verbs
},
16340 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
16341 .dac_nids
= alc861_dac_nids
,
16342 .dig_out_nid
= ALC861_DIGOUT_NID
,
16343 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
16344 .channel_mode
= alc883_3ST_2ch_modes
,
16346 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
16347 .adc_nids
= alc861_adc_nids
,
16348 .input_mux
= &alc861_capture_source
,
16352 /* Pin config fixes */
16354 PINFIX_FSC_AMILO_PI1505
,
16357 static const struct alc_fixup alc861_fixups
[] = {
16358 [PINFIX_FSC_AMILO_PI1505
] = {
16359 .type
= ALC_FIXUP_PINS
,
16360 .v
.pins
= (const struct alc_pincfg
[]) {
16361 { 0x0b, 0x0221101f }, /* HP */
16362 { 0x0f, 0x90170310 }, /* speaker */
16368 static struct snd_pci_quirk alc861_fixup_tbl
[] = {
16369 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", PINFIX_FSC_AMILO_PI1505
),
16373 static int patch_alc861(struct hda_codec
*codec
)
16375 struct alc_spec
*spec
;
16379 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
16383 codec
->spec
= spec
;
16385 board_config
= snd_hda_check_board_config(codec
, ALC861_MODEL_LAST
,
16389 if (board_config
< 0) {
16390 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
16392 board_config
= ALC861_AUTO
;
16395 if (board_config
== ALC861_AUTO
) {
16396 alc_pick_fixup(codec
, NULL
, alc861_fixup_tbl
, alc861_fixups
);
16397 alc_apply_fixup(codec
, ALC_FIXUP_ACT_PRE_PROBE
);
16400 if (board_config
== ALC861_AUTO
) {
16401 /* automatic parse from the BIOS config */
16402 err
= alc861_parse_auto_config(codec
);
16408 "hda_codec: Cannot set up configuration "
16409 "from BIOS. Using base mode...\n");
16410 board_config
= ALC861_3ST_DIG
;
16414 err
= snd_hda_attach_beep_device(codec
, 0x23);
16420 if (board_config
!= ALC861_AUTO
)
16421 setup_preset(codec
, &alc861_presets
[board_config
]);
16423 spec
->stream_analog_playback
= &alc861_pcm_analog_playback
;
16424 spec
->stream_analog_capture
= &alc861_pcm_analog_capture
;
16426 spec
->stream_digital_playback
= &alc861_pcm_digital_playback
;
16427 spec
->stream_digital_capture
= &alc861_pcm_digital_capture
;
16429 if (!spec
->cap_mixer
)
16430 set_capture_mixer(codec
);
16431 set_beep_amp(spec
, 0x23, 0, HDA_OUTPUT
);
16433 spec
->vmaster_nid
= 0x03;
16435 alc_apply_fixup(codec
, ALC_FIXUP_ACT_PROBE
);
16437 codec
->patch_ops
= alc_patch_ops
;
16438 if (board_config
== ALC861_AUTO
) {
16439 spec
->init_hook
= alc861_auto_init
;
16440 #ifdef CONFIG_SND_HDA_POWER_SAVE
16441 spec
->power_hook
= alc_power_eapd
;
16444 #ifdef CONFIG_SND_HDA_POWER_SAVE
16445 if (!spec
->loopback
.amplist
)
16446 spec
->loopback
.amplist
= alc861_loopbacks
;
16453 * ALC861-VD support
16457 * In addition, an independent DAC
16459 #define ALC861VD_DIGOUT_NID 0x06
16461 static hda_nid_t alc861vd_dac_nids
[4] = {
16462 /* front, surr, clfe, side surr */
16463 0x02, 0x03, 0x04, 0x05
16466 /* dac_nids for ALC660vd are in a different order - according to
16467 * Realtek's driver.
16468 * This should probably result in a different mixer for 6stack models
16469 * of ALC660vd codecs, but for now there is only 3stack mixer
16470 * - and it is the same as in 861vd.
16471 * adc_nids in ALC660vd are (is) the same as in 861vd
16473 static hda_nid_t alc660vd_dac_nids
[3] = {
16474 /* front, rear, clfe, rear_surr */
16478 static hda_nid_t alc861vd_adc_nids
[1] = {
16483 static hda_nid_t alc861vd_capsrc_nids
[1] = { 0x22 };
16486 /* FIXME: should be a matrix-type input source selection */
16487 static struct hda_input_mux alc861vd_capture_source
= {
16491 { "Front Mic", 0x1 },
16497 static struct hda_input_mux alc861vd_dallas_capture_source
= {
16501 { "Internal Mic", 0x1 },
16505 static struct hda_input_mux alc861vd_hp_capture_source
= {
16508 { "Front Mic", 0x0 },
16509 { "ATAPI Mic", 0x1 },
16516 static struct hda_channel_mode alc861vd_3stack_2ch_modes
[1] = {
16523 static struct hda_verb alc861vd_6stack_ch6_init
[] = {
16524 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
16525 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16526 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16527 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16534 static struct hda_verb alc861vd_6stack_ch8_init
[] = {
16535 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16536 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16537 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16538 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16542 static struct hda_channel_mode alc861vd_6stack_modes
[2] = {
16543 { 6, alc861vd_6stack_ch6_init
},
16544 { 8, alc861vd_6stack_ch8_init
},
16547 static struct snd_kcontrol_new alc861vd_chmode_mixer
[] = {
16549 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
16550 .name
= "Channel Mode",
16551 .info
= alc_ch_mode_info
,
16552 .get
= alc_ch_mode_get
,
16553 .put
= alc_ch_mode_put
,
16558 /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
16559 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
16561 static struct snd_kcontrol_new alc861vd_6st_mixer
[] = {
16562 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
16563 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
16565 HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
16566 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
16568 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0,
16570 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0,
16572 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
16573 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
16575 HDA_CODEC_VOLUME("Side Playback Volume", 0x05, 0x0, HDA_OUTPUT
),
16576 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
16578 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
16580 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
16581 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16582 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16584 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
16585 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
16586 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16588 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
16589 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
16591 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
16592 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
16597 static struct snd_kcontrol_new alc861vd_3st_mixer
[] = {
16598 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
16599 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
16601 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
16603 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
16604 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16605 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16607 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
16608 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
16609 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16611 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
16612 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
16614 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
16615 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
16620 static struct snd_kcontrol_new alc861vd_lenovo_mixer
[] = {
16621 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
16622 /*HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),*/
16623 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
16625 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
16627 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
16628 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16629 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16631 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT
),
16632 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
16633 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16635 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
16636 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
16641 /* Pin assignment: Speaker=0x14, HP = 0x15,
16642 * Mic=0x18, Internal Mic = 0x19, CD = 0x1c, PC Beep = 0x1d
16644 static struct snd_kcontrol_new alc861vd_dallas_mixer
[] = {
16645 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
16646 HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 2, HDA_INPUT
),
16647 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
16648 HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT
),
16649 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
16650 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16651 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16652 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
16653 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
16654 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16658 /* Pin assignment: Speaker=0x14, Line-out = 0x15,
16659 * Front Mic=0x18, ATAPI Mic = 0x19,
16661 static struct snd_kcontrol_new alc861vd_hp_mixer
[] = {
16662 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
16663 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
16664 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
16665 HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT
),
16666 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16667 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16668 HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
16669 HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16675 * generic initialization of ADC, input mixers and output mixers
16677 static struct hda_verb alc861vd_volume_init_verbs
[] = {
16679 * Unmute ADC0 and set the default input to mic-in
16681 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
16682 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16684 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of
16685 * the analog-loopback mixer widget
16687 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
16688 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16689 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
16690 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
16691 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
16692 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
16694 /* Capture mixer: unmute Mic, F-Mic, Line, CD inputs */
16695 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16696 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16697 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
16698 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(4)},
16701 * Set up output mixers (0x02 - 0x05)
16703 /* set vol=0 to output mixers */
16704 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
16705 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
16706 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
16707 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
16709 /* set up input amps for analog loopback */
16710 /* Amp Indices: DAC = 0, mixer = 1 */
16711 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16712 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
16713 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16714 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
16715 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16716 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
16717 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16718 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
16724 * 3-stack pin configuration:
16725 * front = 0x14, mic/clfe = 0x18, HP = 0x19, line/surr = 0x1a, f-mic = 0x1b
16727 static struct hda_verb alc861vd_3stack_init_verbs
[] = {
16729 * Set pin mode and muting
16731 /* set front pin widgets 0x14 for output */
16732 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16733 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16734 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
16736 /* Mic (rear) pin: input vref at 80% */
16737 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
16738 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
16739 /* Front Mic pin: input vref at 80% */
16740 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
16741 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
16742 /* Line In pin: input */
16743 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16744 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
16745 /* Line-2 In: Headphone output (output 0 - 0x0c) */
16746 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16747 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16748 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
16749 /* CD pin widget for input */
16750 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16756 * 6-stack pin configuration:
16758 static struct hda_verb alc861vd_6stack_init_verbs
[] = {
16760 * Set pin mode and muting
16762 /* set front pin widgets 0x14 for output */
16763 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16764 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16765 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
16767 /* Rear Pin: output 1 (0x0d) */
16768 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16769 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16770 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
16771 /* CLFE Pin: output 2 (0x0e) */
16772 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16773 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16774 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x02},
16775 /* Side Pin: output 3 (0x0f) */
16776 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16777 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16778 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
16780 /* Mic (rear) pin: input vref at 80% */
16781 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
16782 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
16783 /* Front Mic pin: input vref at 80% */
16784 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
16785 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
16786 /* Line In pin: input */
16787 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16788 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
16789 /* Line-2 In: Headphone output (output 0 - 0x0c) */
16790 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16791 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16792 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
16793 /* CD pin widget for input */
16794 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16799 static struct hda_verb alc861vd_eapd_verbs
[] = {
16800 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
16804 static struct hda_verb alc660vd_eapd_verbs
[] = {
16805 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
16806 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
16810 static struct hda_verb alc861vd_lenovo_unsol_verbs
[] = {
16811 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16812 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16813 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)},
16814 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16815 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16819 static void alc861vd_lenovo_setup(struct hda_codec
*codec
)
16821 struct alc_spec
*spec
= codec
->spec
;
16822 spec
->autocfg
.hp_pins
[0] = 0x1b;
16823 spec
->autocfg
.speaker_pins
[0] = 0x14;
16826 static void alc861vd_lenovo_init_hook(struct hda_codec
*codec
)
16828 alc_automute_amp(codec
);
16829 alc88x_simple_mic_automute(codec
);
16832 static void alc861vd_lenovo_unsol_event(struct hda_codec
*codec
,
16835 switch (res
>> 26) {
16836 case ALC880_MIC_EVENT
:
16837 alc88x_simple_mic_automute(codec
);
16840 alc_automute_amp_unsol_event(codec
, res
);
16845 static struct hda_verb alc861vd_dallas_verbs
[] = {
16846 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
16847 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
16848 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
16849 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
16851 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16852 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16853 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16854 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
16855 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16856 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
16857 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16858 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
16860 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16861 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16862 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16863 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16864 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16865 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16866 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16867 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16869 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
16870 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
16871 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
16872 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
16873 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16874 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16875 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16876 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16878 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16879 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
16880 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
16881 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
16883 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16884 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
16885 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16890 /* toggle speaker-output according to the hp-jack state */
16891 static void alc861vd_dallas_setup(struct hda_codec
*codec
)
16893 struct alc_spec
*spec
= codec
->spec
;
16895 spec
->autocfg
.hp_pins
[0] = 0x15;
16896 spec
->autocfg
.speaker_pins
[0] = 0x14;
16899 #ifdef CONFIG_SND_HDA_POWER_SAVE
16900 #define alc861vd_loopbacks alc880_loopbacks
16903 /* pcm configuration: identical with ALC880 */
16904 #define alc861vd_pcm_analog_playback alc880_pcm_analog_playback
16905 #define alc861vd_pcm_analog_capture alc880_pcm_analog_capture
16906 #define alc861vd_pcm_digital_playback alc880_pcm_digital_playback
16907 #define alc861vd_pcm_digital_capture alc880_pcm_digital_capture
16910 * configuration and preset
16912 static const char * const alc861vd_models
[ALC861VD_MODEL_LAST
] = {
16913 [ALC660VD_3ST
] = "3stack-660",
16914 [ALC660VD_3ST_DIG
] = "3stack-660-digout",
16915 [ALC660VD_ASUS_V1S
] = "asus-v1s",
16916 [ALC861VD_3ST
] = "3stack",
16917 [ALC861VD_3ST_DIG
] = "3stack-digout",
16918 [ALC861VD_6ST_DIG
] = "6stack-digout",
16919 [ALC861VD_LENOVO
] = "lenovo",
16920 [ALC861VD_DALLAS
] = "dallas",
16921 [ALC861VD_HP
] = "hp",
16922 [ALC861VD_AUTO
] = "auto",
16925 static struct snd_pci_quirk alc861vd_cfg_tbl
[] = {
16926 SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST
),
16927 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_HP
),
16928 SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST
),
16929 /*SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST),*/ /* auto */
16930 SND_PCI_QUIRK(0x1043, 0x1633, "Asus V1Sn", ALC660VD_ASUS_V1S
),
16931 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST_DIG
),
16932 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST
),
16933 SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO
),
16934 /*SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS),*/ /*lenovo*/
16935 SND_PCI_QUIRK(0x1179, 0xff01, "Toshiba A135", ALC861VD_LENOVO
),
16936 SND_PCI_QUIRK(0x1179, 0xff03, "Toshiba P205", ALC861VD_LENOVO
),
16937 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_DALLAS
),
16938 SND_PCI_QUIRK(0x1565, 0x820d, "Biostar NF61S SE", ALC861VD_6ST_DIG
),
16939 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", ALC861VD_LENOVO
),
16940 SND_PCI_QUIRK(0x1849, 0x0862, "ASRock K8NF6G-VSTA", ALC861VD_6ST_DIG
),
16944 static struct alc_config_preset alc861vd_presets
[] = {
16946 .mixers
= { alc861vd_3st_mixer
},
16947 .init_verbs
= { alc861vd_volume_init_verbs
,
16948 alc861vd_3stack_init_verbs
},
16949 .num_dacs
= ARRAY_SIZE(alc660vd_dac_nids
),
16950 .dac_nids
= alc660vd_dac_nids
,
16951 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
16952 .channel_mode
= alc861vd_3stack_2ch_modes
,
16953 .input_mux
= &alc861vd_capture_source
,
16955 [ALC660VD_3ST_DIG
] = {
16956 .mixers
= { alc861vd_3st_mixer
},
16957 .init_verbs
= { alc861vd_volume_init_verbs
,
16958 alc861vd_3stack_init_verbs
},
16959 .num_dacs
= ARRAY_SIZE(alc660vd_dac_nids
),
16960 .dac_nids
= alc660vd_dac_nids
,
16961 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
16962 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
16963 .channel_mode
= alc861vd_3stack_2ch_modes
,
16964 .input_mux
= &alc861vd_capture_source
,
16967 .mixers
= { alc861vd_3st_mixer
},
16968 .init_verbs
= { alc861vd_volume_init_verbs
,
16969 alc861vd_3stack_init_verbs
},
16970 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
16971 .dac_nids
= alc861vd_dac_nids
,
16972 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
16973 .channel_mode
= alc861vd_3stack_2ch_modes
,
16974 .input_mux
= &alc861vd_capture_source
,
16976 [ALC861VD_3ST_DIG
] = {
16977 .mixers
= { alc861vd_3st_mixer
},
16978 .init_verbs
= { alc861vd_volume_init_verbs
,
16979 alc861vd_3stack_init_verbs
},
16980 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
16981 .dac_nids
= alc861vd_dac_nids
,
16982 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
16983 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
16984 .channel_mode
= alc861vd_3stack_2ch_modes
,
16985 .input_mux
= &alc861vd_capture_source
,
16987 [ALC861VD_6ST_DIG
] = {
16988 .mixers
= { alc861vd_6st_mixer
, alc861vd_chmode_mixer
},
16989 .init_verbs
= { alc861vd_volume_init_verbs
,
16990 alc861vd_6stack_init_verbs
},
16991 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
16992 .dac_nids
= alc861vd_dac_nids
,
16993 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
16994 .num_channel_mode
= ARRAY_SIZE(alc861vd_6stack_modes
),
16995 .channel_mode
= alc861vd_6stack_modes
,
16996 .input_mux
= &alc861vd_capture_source
,
16998 [ALC861VD_LENOVO
] = {
16999 .mixers
= { alc861vd_lenovo_mixer
},
17000 .init_verbs
= { alc861vd_volume_init_verbs
,
17001 alc861vd_3stack_init_verbs
,
17002 alc861vd_eapd_verbs
,
17003 alc861vd_lenovo_unsol_verbs
},
17004 .num_dacs
= ARRAY_SIZE(alc660vd_dac_nids
),
17005 .dac_nids
= alc660vd_dac_nids
,
17006 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
17007 .channel_mode
= alc861vd_3stack_2ch_modes
,
17008 .input_mux
= &alc861vd_capture_source
,
17009 .unsol_event
= alc861vd_lenovo_unsol_event
,
17010 .setup
= alc861vd_lenovo_setup
,
17011 .init_hook
= alc861vd_lenovo_init_hook
,
17013 [ALC861VD_DALLAS
] = {
17014 .mixers
= { alc861vd_dallas_mixer
},
17015 .init_verbs
= { alc861vd_dallas_verbs
},
17016 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
17017 .dac_nids
= alc861vd_dac_nids
,
17018 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
17019 .channel_mode
= alc861vd_3stack_2ch_modes
,
17020 .input_mux
= &alc861vd_dallas_capture_source
,
17021 .unsol_event
= alc_automute_amp_unsol_event
,
17022 .setup
= alc861vd_dallas_setup
,
17023 .init_hook
= alc_automute_amp
,
17026 .mixers
= { alc861vd_hp_mixer
},
17027 .init_verbs
= { alc861vd_dallas_verbs
, alc861vd_eapd_verbs
},
17028 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
17029 .dac_nids
= alc861vd_dac_nids
,
17030 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
17031 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
17032 .channel_mode
= alc861vd_3stack_2ch_modes
,
17033 .input_mux
= &alc861vd_hp_capture_source
,
17034 .unsol_event
= alc_automute_amp_unsol_event
,
17035 .setup
= alc861vd_dallas_setup
,
17036 .init_hook
= alc_automute_amp
,
17038 [ALC660VD_ASUS_V1S
] = {
17039 .mixers
= { alc861vd_lenovo_mixer
},
17040 .init_verbs
= { alc861vd_volume_init_verbs
,
17041 alc861vd_3stack_init_verbs
,
17042 alc861vd_eapd_verbs
,
17043 alc861vd_lenovo_unsol_verbs
},
17044 .num_dacs
= ARRAY_SIZE(alc660vd_dac_nids
),
17045 .dac_nids
= alc660vd_dac_nids
,
17046 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
17047 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
17048 .channel_mode
= alc861vd_3stack_2ch_modes
,
17049 .input_mux
= &alc861vd_capture_source
,
17050 .unsol_event
= alc861vd_lenovo_unsol_event
,
17051 .setup
= alc861vd_lenovo_setup
,
17052 .init_hook
= alc861vd_lenovo_init_hook
,
17057 * BIOS auto configuration
17059 static int alc861vd_auto_create_input_ctls(struct hda_codec
*codec
,
17060 const struct auto_pin_cfg
*cfg
)
17062 return alc_auto_create_input_ctls(codec
, cfg
, 0x0b, 0x22, 0);
17066 static void alc861vd_auto_set_output_and_unmute(struct hda_codec
*codec
,
17067 hda_nid_t nid
, int pin_type
, int dac_idx
)
17069 alc_set_pin_output(codec
, nid
, pin_type
);
17072 static void alc861vd_auto_init_multi_out(struct hda_codec
*codec
)
17074 struct alc_spec
*spec
= codec
->spec
;
17077 for (i
= 0; i
<= HDA_SIDE
; i
++) {
17078 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
17079 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
17081 alc861vd_auto_set_output_and_unmute(codec
, nid
,
17087 static void alc861vd_auto_init_hp_out(struct hda_codec
*codec
)
17089 struct alc_spec
*spec
= codec
->spec
;
17092 pin
= spec
->autocfg
.hp_pins
[0];
17093 if (pin
) /* connect to front and use dac 0 */
17094 alc861vd_auto_set_output_and_unmute(codec
, pin
, PIN_HP
, 0);
17095 pin
= spec
->autocfg
.speaker_pins
[0];
17097 alc861vd_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
, 0);
17100 #define ALC861VD_PIN_CD_NID ALC880_PIN_CD_NID
17102 static void alc861vd_auto_init_analog_input(struct hda_codec
*codec
)
17104 struct alc_spec
*spec
= codec
->spec
;
17105 struct auto_pin_cfg
*cfg
= &spec
->autocfg
;
17108 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
17109 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
17110 if (alc_is_input_pin(codec
, nid
)) {
17111 alc_set_input_pin(codec
, nid
, cfg
->inputs
[i
].type
);
17112 if (nid
!= ALC861VD_PIN_CD_NID
&&
17113 (get_wcaps(codec
, nid
) & AC_WCAP_OUT_AMP
))
17114 snd_hda_codec_write(codec
, nid
, 0,
17115 AC_VERB_SET_AMP_GAIN_MUTE
,
17121 #define alc861vd_auto_init_input_src alc882_auto_init_input_src
17123 #define alc861vd_idx_to_mixer_vol(nid) ((nid) + 0x02)
17124 #define alc861vd_idx_to_mixer_switch(nid) ((nid) + 0x0c)
17126 /* add playback controls from the parsed DAC table */
17127 /* Based on ALC880 version. But ALC861VD has separate,
17128 * different NIDs for mute/unmute switch and volume control */
17129 static int alc861vd_auto_create_multi_out_ctls(struct alc_spec
*spec
,
17130 const struct auto_pin_cfg
*cfg
)
17132 static const char * const chname
[4] = {
17133 "Front", "Surround", "CLFE", "Side"
17135 const char *pfx
= alc_get_line_out_pfx(cfg
, true);
17136 hda_nid_t nid_v
, nid_s
;
17139 for (i
= 0; i
< cfg
->line_outs
; i
++) {
17140 if (!spec
->multiout
.dac_nids
[i
])
17142 nid_v
= alc861vd_idx_to_mixer_vol(
17144 spec
->multiout
.dac_nids
[i
]));
17145 nid_s
= alc861vd_idx_to_mixer_switch(
17147 spec
->multiout
.dac_nids
[i
]));
17149 if (!pfx
&& i
== 2) {
17151 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
,
17153 HDA_COMPOSE_AMP_VAL(nid_v
, 1, 0,
17157 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
,
17159 HDA_COMPOSE_AMP_VAL(nid_v
, 2, 0,
17163 err
= add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
,
17165 HDA_COMPOSE_AMP_VAL(nid_s
, 1, 2,
17169 err
= add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
,
17171 HDA_COMPOSE_AMP_VAL(nid_s
, 2, 2,
17176 const char *name
= pfx
;
17182 err
= __add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
,
17184 HDA_COMPOSE_AMP_VAL(nid_v
, 3, 0,
17188 err
= __add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
,
17190 HDA_COMPOSE_AMP_VAL(nid_s
, 3, 2,
17199 /* add playback controls for speaker and HP outputs */
17200 /* Based on ALC880 version. But ALC861VD has separate,
17201 * different NIDs for mute/unmute switch and volume control */
17202 static int alc861vd_auto_create_extra_out(struct alc_spec
*spec
,
17203 hda_nid_t pin
, const char *pfx
)
17205 hda_nid_t nid_v
, nid_s
;
17211 if (alc880_is_fixed_pin(pin
)) {
17212 nid_v
= alc880_idx_to_dac(alc880_fixed_pin_idx(pin
));
17213 /* specify the DAC as the extra output */
17214 if (!spec
->multiout
.hp_nid
)
17215 spec
->multiout
.hp_nid
= nid_v
;
17217 spec
->multiout
.extra_out_nid
[0] = nid_v
;
17218 /* control HP volume/switch on the output mixer amp */
17219 nid_v
= alc861vd_idx_to_mixer_vol(
17220 alc880_fixed_pin_idx(pin
));
17221 nid_s
= alc861vd_idx_to_mixer_switch(
17222 alc880_fixed_pin_idx(pin
));
17224 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, pfx
,
17225 HDA_COMPOSE_AMP_VAL(nid_v
, 3, 0, HDA_OUTPUT
));
17228 err
= add_pb_sw_ctrl(spec
, ALC_CTL_BIND_MUTE
, pfx
,
17229 HDA_COMPOSE_AMP_VAL(nid_s
, 3, 2, HDA_INPUT
));
17232 } else if (alc880_is_multi_pin(pin
)) {
17233 /* set manual connection */
17234 /* we have only a switch on HP-out PIN */
17235 err
= add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, pfx
,
17236 HDA_COMPOSE_AMP_VAL(pin
, 3, 0, HDA_OUTPUT
));
17243 /* parse the BIOS configuration and set up the alc_spec
17244 * return 1 if successful, 0 if the proper config is not found,
17245 * or a negative error code
17246 * Based on ALC880 version - had to change it to override
17247 * alc880_auto_create_extra_out and alc880_auto_create_multi_out_ctls */
17248 static int alc861vd_parse_auto_config(struct hda_codec
*codec
)
17250 struct alc_spec
*spec
= codec
->spec
;
17252 static hda_nid_t alc861vd_ignore
[] = { 0x1d, 0 };
17254 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
17258 if (!spec
->autocfg
.line_outs
)
17259 return 0; /* can't find valid BIOS pin config */
17261 err
= alc880_auto_fill_dac_nids(spec
, &spec
->autocfg
);
17264 err
= alc861vd_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
17267 err
= alc861vd_auto_create_extra_out(spec
,
17268 spec
->autocfg
.speaker_pins
[0],
17272 err
= alc861vd_auto_create_extra_out(spec
,
17273 spec
->autocfg
.hp_pins
[0],
17277 err
= alc861vd_auto_create_input_ctls(codec
, &spec
->autocfg
);
17281 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
17283 alc_auto_parse_digital(codec
);
17285 if (spec
->kctls
.list
)
17286 add_mixer(spec
, spec
->kctls
.list
);
17288 add_verb(spec
, alc861vd_volume_init_verbs
);
17290 spec
->num_mux_defs
= 1;
17291 spec
->input_mux
= &spec
->private_imux
[0];
17293 err
= alc_auto_add_mic_boost(codec
);
17297 alc_ssid_check(codec
, 0x15, 0x1b, 0x14, 0);
17302 /* additional initialization for auto-configuration model */
17303 static void alc861vd_auto_init(struct hda_codec
*codec
)
17305 struct alc_spec
*spec
= codec
->spec
;
17306 alc861vd_auto_init_multi_out(codec
);
17307 alc861vd_auto_init_hp_out(codec
);
17308 alc861vd_auto_init_analog_input(codec
);
17309 alc861vd_auto_init_input_src(codec
);
17310 alc_auto_init_digital(codec
);
17311 if (spec
->unsol_event
)
17312 alc_inithook(codec
);
17316 ALC660VD_FIX_ASUS_GPIO1
17320 static const struct alc_fixup alc861vd_fixups
[] = {
17321 [ALC660VD_FIX_ASUS_GPIO1
] = {
17322 .type
= ALC_FIXUP_VERBS
,
17323 .v
.verbs
= (const struct hda_verb
[]) {
17324 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
17325 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
17326 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
17332 static struct snd_pci_quirk alc861vd_fixup_tbl
[] = {
17333 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1
),
17337 static int patch_alc861vd(struct hda_codec
*codec
)
17339 struct alc_spec
*spec
;
17340 int err
, board_config
;
17342 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
17346 codec
->spec
= spec
;
17348 board_config
= snd_hda_check_board_config(codec
, ALC861VD_MODEL_LAST
,
17352 if (board_config
< 0 || board_config
>= ALC861VD_MODEL_LAST
) {
17353 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
17355 board_config
= ALC861VD_AUTO
;
17358 if (board_config
== ALC861VD_AUTO
) {
17359 alc_pick_fixup(codec
, NULL
, alc861vd_fixup_tbl
, alc861vd_fixups
);
17360 alc_apply_fixup(codec
, ALC_FIXUP_ACT_PRE_PROBE
);
17363 if (board_config
== ALC861VD_AUTO
) {
17364 /* automatic parse from the BIOS config */
17365 err
= alc861vd_parse_auto_config(codec
);
17371 "hda_codec: Cannot set up configuration "
17372 "from BIOS. Using base mode...\n");
17373 board_config
= ALC861VD_3ST
;
17377 err
= snd_hda_attach_beep_device(codec
, 0x23);
17383 if (board_config
!= ALC861VD_AUTO
)
17384 setup_preset(codec
, &alc861vd_presets
[board_config
]);
17386 if (codec
->vendor_id
== 0x10ec0660) {
17387 /* always turn on EAPD */
17388 add_verb(spec
, alc660vd_eapd_verbs
);
17391 spec
->stream_analog_playback
= &alc861vd_pcm_analog_playback
;
17392 spec
->stream_analog_capture
= &alc861vd_pcm_analog_capture
;
17394 spec
->stream_digital_playback
= &alc861vd_pcm_digital_playback
;
17395 spec
->stream_digital_capture
= &alc861vd_pcm_digital_capture
;
17397 if (!spec
->adc_nids
) {
17398 spec
->adc_nids
= alc861vd_adc_nids
;
17399 spec
->num_adc_nids
= ARRAY_SIZE(alc861vd_adc_nids
);
17401 if (!spec
->capsrc_nids
)
17402 spec
->capsrc_nids
= alc861vd_capsrc_nids
;
17404 set_capture_mixer(codec
);
17405 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
17407 spec
->vmaster_nid
= 0x02;
17409 alc_apply_fixup(codec
, ALC_FIXUP_ACT_PROBE
);
17411 codec
->patch_ops
= alc_patch_ops
;
17413 if (board_config
== ALC861VD_AUTO
)
17414 spec
->init_hook
= alc861vd_auto_init
;
17415 #ifdef CONFIG_SND_HDA_POWER_SAVE
17416 if (!spec
->loopback
.amplist
)
17417 spec
->loopback
.amplist
= alc861vd_loopbacks
;
17426 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
17427 * configuration. Each pin widget can choose any input DACs and a mixer.
17428 * Each ADC is connected from a mixer of all inputs. This makes possible
17429 * 6-channel independent captures.
17431 * In addition, an independent DAC for the multi-playback (not used in this
17434 #define ALC662_DIGOUT_NID 0x06
17435 #define ALC662_DIGIN_NID 0x0a
17437 static hda_nid_t alc662_dac_nids
[3] = {
17438 /* front, rear, clfe */
17442 static hda_nid_t alc272_dac_nids
[2] = {
17446 static hda_nid_t alc662_adc_nids
[2] = {
17451 static hda_nid_t alc272_adc_nids
[1] = {
17456 static hda_nid_t alc662_capsrc_nids
[2] = { 0x22, 0x23 };
17457 static hda_nid_t alc272_capsrc_nids
[1] = { 0x23 };
17461 /* FIXME: should be a matrix-type input source selection */
17462 static struct hda_input_mux alc662_capture_source
= {
17466 { "Front Mic", 0x1 },
17472 static struct hda_input_mux alc662_lenovo_101e_capture_source
= {
17480 static struct hda_input_mux alc663_capture_source
= {
17484 { "Front Mic", 0x1 },
17489 #if 0 /* set to 1 for testing other input sources below */
17490 static struct hda_input_mux alc272_nc10_capture_source
= {
17493 { "Autoselect Mic", 0x0 },
17494 { "Internal Mic", 0x1 },
17495 { "In-0x02", 0x2 },
17496 { "In-0x03", 0x3 },
17497 { "In-0x04", 0x4 },
17498 { "In-0x05", 0x5 },
17499 { "In-0x06", 0x6 },
17500 { "In-0x07", 0x7 },
17501 { "In-0x08", 0x8 },
17502 { "In-0x09", 0x9 },
17503 { "In-0x0a", 0x0a },
17504 { "In-0x0b", 0x0b },
17505 { "In-0x0c", 0x0c },
17506 { "In-0x0d", 0x0d },
17507 { "In-0x0e", 0x0e },
17508 { "In-0x0f", 0x0f },
17516 static struct hda_channel_mode alc662_3ST_2ch_modes
[1] = {
17523 static struct hda_verb alc662_3ST_ch2_init
[] = {
17524 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
17525 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
17526 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
17527 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
17534 static struct hda_verb alc662_3ST_ch6_init
[] = {
17535 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
17536 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
17537 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
17538 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
17539 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
17540 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
17544 static struct hda_channel_mode alc662_3ST_6ch_modes
[2] = {
17545 { 2, alc662_3ST_ch2_init
},
17546 { 6, alc662_3ST_ch6_init
},
17552 static struct hda_verb alc662_sixstack_ch6_init
[] = {
17553 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
17554 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
17555 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
17562 static struct hda_verb alc662_sixstack_ch8_init
[] = {
17563 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
17564 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
17565 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
17569 static struct hda_channel_mode alc662_5stack_modes
[2] = {
17570 { 2, alc662_sixstack_ch6_init
},
17571 { 6, alc662_sixstack_ch8_init
},
17574 /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
17575 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
17578 static struct snd_kcontrol_new alc662_base_mixer
[] = {
17579 /* output mixer control */
17580 HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT
),
17581 HDA_CODEC_MUTE("Front Playback Switch", 0x0c, 0x0, HDA_INPUT
),
17582 HDA_CODEC_VOLUME("Surround Playback Volume", 0x3, 0x0, HDA_OUTPUT
),
17583 HDA_CODEC_MUTE("Surround Playback Switch", 0x0d, 0x0, HDA_INPUT
),
17584 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0, HDA_OUTPUT
),
17585 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0, HDA_OUTPUT
),
17586 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x0, HDA_INPUT
),
17587 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x0, HDA_INPUT
),
17588 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
17590 /*Input mixer control */
17591 HDA_CODEC_VOLUME("CD Playback Volume", 0xb, 0x4, HDA_INPUT
),
17592 HDA_CODEC_MUTE("CD Playback Switch", 0xb, 0x4, HDA_INPUT
),
17593 HDA_CODEC_VOLUME("Line Playback Volume", 0xb, 0x02, HDA_INPUT
),
17594 HDA_CODEC_MUTE("Line Playback Switch", 0xb, 0x02, HDA_INPUT
),
17595 HDA_CODEC_VOLUME("Mic Playback Volume", 0xb, 0x0, HDA_INPUT
),
17596 HDA_CODEC_MUTE("Mic Playback Switch", 0xb, 0x0, HDA_INPUT
),
17597 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0xb, 0x01, HDA_INPUT
),
17598 HDA_CODEC_MUTE("Front Mic Playback Switch", 0xb, 0x01, HDA_INPUT
),
17602 static struct snd_kcontrol_new alc662_3ST_2ch_mixer
[] = {
17603 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
17604 HDA_CODEC_MUTE("Front Playback Switch", 0x0c, 0x0, HDA_INPUT
),
17605 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
17606 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
17607 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
17608 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
17609 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
17610 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
17611 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
17612 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
17613 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
17617 static struct snd_kcontrol_new alc662_3ST_6ch_mixer
[] = {
17618 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
17619 HDA_CODEC_MUTE("Front Playback Switch", 0x0c, 0x0, HDA_INPUT
),
17620 HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
17621 HDA_CODEC_MUTE("Surround Playback Switch", 0x0d, 0x0, HDA_INPUT
),
17622 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0, HDA_OUTPUT
),
17623 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0, HDA_OUTPUT
),
17624 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x0, HDA_INPUT
),
17625 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x0, HDA_INPUT
),
17626 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
17627 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
17628 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
17629 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
17630 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
17631 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
17632 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
17633 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
17634 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
17638 static struct snd_kcontrol_new alc662_lenovo_101e_mixer
[] = {
17639 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
17640 HDA_BIND_MUTE("Front Playback Switch", 0x02, 2, HDA_INPUT
),
17641 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
17642 HDA_BIND_MUTE("Speaker Playback Switch", 0x03, 2, HDA_INPUT
),
17643 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
17644 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
17645 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
17646 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
17647 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
17651 static struct snd_kcontrol_new alc662_eeepc_p701_mixer
[] = {
17652 HDA_CODEC_VOLUME("Master Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
17653 ALC262_HIPPO_MASTER_SWITCH
,
17655 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
17656 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
17657 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
17659 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
17660 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
17661 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
17665 static struct snd_kcontrol_new alc662_eeepc_ep20_mixer
[] = {
17666 ALC262_HIPPO_MASTER_SWITCH
,
17667 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
17668 HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
17669 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0, HDA_OUTPUT
),
17670 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0, HDA_OUTPUT
),
17671 HDA_BIND_MUTE("MuteCtrl Playback Switch", 0x0c, 2, HDA_INPUT
),
17672 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
17673 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
17674 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
17675 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
17679 static struct hda_bind_ctls alc663_asus_bind_master_vol
= {
17680 .ops
= &snd_hda_bind_vol
,
17682 HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT
),
17683 HDA_COMPOSE_AMP_VAL(0x03, 3, 0, HDA_OUTPUT
),
17688 static struct hda_bind_ctls alc663_asus_one_bind_switch
= {
17689 .ops
= &snd_hda_bind_sw
,
17691 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
17692 HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT
),
17697 static struct snd_kcontrol_new alc663_m51va_mixer
[] = {
17698 HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol
),
17699 HDA_BIND_SW("Master Playback Switch", &alc663_asus_one_bind_switch
),
17700 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
17701 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
17705 static struct hda_bind_ctls alc663_asus_tree_bind_switch
= {
17706 .ops
= &snd_hda_bind_sw
,
17708 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
17709 HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT
),
17710 HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT
),
17715 static struct snd_kcontrol_new alc663_two_hp_m1_mixer
[] = {
17716 HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol
),
17717 HDA_BIND_SW("Master Playback Switch", &alc663_asus_tree_bind_switch
),
17718 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
17719 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
17720 HDA_CODEC_VOLUME("F-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
17721 HDA_CODEC_MUTE("F-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
17726 static struct hda_bind_ctls alc663_asus_four_bind_switch
= {
17727 .ops
= &snd_hda_bind_sw
,
17729 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
17730 HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT
),
17731 HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_OUTPUT
),
17736 static struct snd_kcontrol_new alc663_two_hp_m2_mixer
[] = {
17737 HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol
),
17738 HDA_BIND_SW("Master Playback Switch", &alc663_asus_four_bind_switch
),
17739 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
17740 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
17741 HDA_CODEC_VOLUME("F-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
17742 HDA_CODEC_MUTE("F-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
17746 static struct snd_kcontrol_new alc662_1bjd_mixer
[] = {
17747 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
17748 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
17749 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
17750 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
17751 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
17752 HDA_CODEC_VOLUME("F-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
17753 HDA_CODEC_MUTE("F-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
17757 static struct hda_bind_ctls alc663_asus_two_bind_master_vol
= {
17758 .ops
= &snd_hda_bind_vol
,
17760 HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT
),
17761 HDA_COMPOSE_AMP_VAL(0x04, 3, 0, HDA_OUTPUT
),
17766 static struct hda_bind_ctls alc663_asus_two_bind_switch
= {
17767 .ops
= &snd_hda_bind_sw
,
17769 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
17770 HDA_COMPOSE_AMP_VAL(0x16, 3, 0, HDA_OUTPUT
),
17775 static struct snd_kcontrol_new alc663_asus_21jd_clfe_mixer
[] = {
17776 HDA_BIND_VOL("Master Playback Volume",
17777 &alc663_asus_two_bind_master_vol
),
17778 HDA_BIND_SW("Master Playback Switch", &alc663_asus_two_bind_switch
),
17779 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
17780 HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT
),
17781 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
17782 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
17786 static struct snd_kcontrol_new alc663_asus_15jd_clfe_mixer
[] = {
17787 HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol
),
17788 HDA_BIND_SW("Master Playback Switch", &alc663_asus_two_bind_switch
),
17789 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
17790 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
17791 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
17792 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
17796 static struct snd_kcontrol_new alc663_g71v_mixer
[] = {
17797 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
17798 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
17799 HDA_CODEC_VOLUME("Front Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
17800 HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
17801 HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT
),
17803 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
17804 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
17805 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
17806 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
17810 static struct snd_kcontrol_new alc663_g50v_mixer
[] = {
17811 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
17812 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
17813 HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT
),
17815 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
17816 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
17817 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
17818 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
17819 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
17820 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
17824 static struct hda_bind_ctls alc663_asus_mode7_8_all_bind_switch
= {
17825 .ops
= &snd_hda_bind_sw
,
17827 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
17828 HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT
),
17829 HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT
),
17830 HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_OUTPUT
),
17831 HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT
),
17836 static struct hda_bind_ctls alc663_asus_mode7_8_sp_bind_switch
= {
17837 .ops
= &snd_hda_bind_sw
,
17839 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
17840 HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT
),
17845 static struct snd_kcontrol_new alc663_mode7_mixer
[] = {
17846 HDA_BIND_SW("Master Playback Switch", &alc663_asus_mode7_8_all_bind_switch
),
17847 HDA_BIND_VOL("Speaker Playback Volume", &alc663_asus_bind_master_vol
),
17848 HDA_BIND_SW("Speaker Playback Switch", &alc663_asus_mode7_8_sp_bind_switch
),
17849 HDA_CODEC_MUTE("Headphone1 Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
17850 HDA_CODEC_MUTE("Headphone2 Playback Switch", 0x21, 0x0, HDA_OUTPUT
),
17851 HDA_CODEC_VOLUME("IntMic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
17852 HDA_CODEC_MUTE("IntMic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
17853 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
17854 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
17858 static struct snd_kcontrol_new alc663_mode8_mixer
[] = {
17859 HDA_BIND_SW("Master Playback Switch", &alc663_asus_mode7_8_all_bind_switch
),
17860 HDA_BIND_VOL("Speaker Playback Volume", &alc663_asus_bind_master_vol
),
17861 HDA_BIND_SW("Speaker Playback Switch", &alc663_asus_mode7_8_sp_bind_switch
),
17862 HDA_CODEC_MUTE("Headphone1 Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
17863 HDA_CODEC_MUTE("Headphone2 Playback Switch", 0x21, 0x0, HDA_OUTPUT
),
17864 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
17865 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
17870 static struct snd_kcontrol_new alc662_chmode_mixer
[] = {
17872 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
17873 .name
= "Channel Mode",
17874 .info
= alc_ch_mode_info
,
17875 .get
= alc_ch_mode_get
,
17876 .put
= alc_ch_mode_put
,
17881 static struct hda_verb alc662_init_verbs
[] = {
17882 /* ADC: mute amp left and right */
17883 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
17884 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
17886 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
17887 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
17888 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
17889 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
17890 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
17891 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
17893 /* Front Pin: output 0 (0x0c) */
17894 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
17895 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
17897 /* Rear Pin: output 1 (0x0d) */
17898 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
17899 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
17901 /* CLFE Pin: output 2 (0x0e) */
17902 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
17903 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
17905 /* Mic (rear) pin: input vref at 80% */
17906 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
17907 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
17908 /* Front Mic pin: input vref at 80% */
17909 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
17910 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
17911 /* Line In pin: input */
17912 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
17913 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
17914 /* Line-2 In: Headphone output (output 0 - 0x0c) */
17915 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
17916 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
17917 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
17918 /* CD pin widget for input */
17919 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
17921 /* FIXME: use matrix-type input source selection */
17922 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
17924 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
17925 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
17930 static struct hda_verb alc662_eapd_init_verbs
[] = {
17931 /* always trun on EAPD */
17932 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
17933 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
17937 static struct hda_verb alc663_init_verbs
[] = {
17938 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
17939 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
17940 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
17941 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
17942 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
17943 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
17947 static struct hda_verb alc272_init_verbs
[] = {
17948 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
17949 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
17950 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
17951 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
17952 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
17953 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
17954 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
17955 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
17959 static struct hda_verb alc662_sue_init_verbs
[] = {
17960 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_FRONT_EVENT
},
17961 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_HP_EVENT
},
17965 static struct hda_verb alc662_eeepc_sue_init_verbs
[] = {
17966 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
17967 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
17971 /* Set Unsolicited Event*/
17972 static struct hda_verb alc662_eeepc_ep20_sue_init_verbs
[] = {
17973 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
17974 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
17978 static struct hda_verb alc663_m51va_init_verbs
[] = {
17979 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
17980 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
17981 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
17982 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
17983 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
17984 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
17985 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(9)},
17986 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
17987 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
17991 static struct hda_verb alc663_21jd_amic_init_verbs
[] = {
17992 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
17993 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
17994 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
17995 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
17996 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
17997 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
17998 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
18002 static struct hda_verb alc662_1bjd_amic_init_verbs
[] = {
18003 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18004 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
18005 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18006 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Headphone */
18007 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
18008 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
18009 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
18010 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
18014 static struct hda_verb alc663_15jd_amic_init_verbs
[] = {
18015 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
18016 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18017 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
18018 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
18019 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
18020 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
18021 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
18025 static struct hda_verb alc663_two_hp_amic_m1_init_verbs
[] = {
18026 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18027 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
18028 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18029 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x0}, /* Headphone */
18030 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
18031 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18032 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x0}, /* Headphone */
18033 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
18034 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
18035 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
18036 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
18037 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
18041 static struct hda_verb alc663_two_hp_amic_m2_init_verbs
[] = {
18042 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18043 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
18044 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18045 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
18046 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
18047 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18048 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
18049 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
18050 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
18051 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
18052 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
18053 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
18057 static struct hda_verb alc663_g71v_init_verbs
[] = {
18058 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
18059 /* {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, */
18060 /* {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, */ /* Headphone */
18062 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
18063 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18064 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Headphone */
18066 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_FRONT_EVENT
},
18067 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_MIC_EVENT
},
18068 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_HP_EVENT
},
18072 static struct hda_verb alc663_g50v_init_verbs
[] = {
18073 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
18074 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18075 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Headphone */
18077 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
18078 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
18082 static struct hda_verb alc662_ecs_init_verbs
[] = {
18083 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, 0x701f},
18084 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
18085 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
18086 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
18090 static struct hda_verb alc272_dell_zm1_init_verbs
[] = {
18091 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18092 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18093 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18094 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18095 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
18096 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18097 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
18098 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
18099 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(9)},
18100 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
18101 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
18105 static struct hda_verb alc272_dell_init_verbs
[] = {
18106 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18107 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18108 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18109 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18110 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
18111 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18112 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
18113 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
18114 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(9)},
18115 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
18116 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
18120 static struct hda_verb alc663_mode7_init_verbs
[] = {
18121 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18122 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18123 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
18124 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18125 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
18126 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18127 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x01},
18128 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
18129 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18130 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
18131 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
18132 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(9)},
18133 {0x19, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
18134 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
18135 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
18139 static struct hda_verb alc663_mode8_init_verbs
[] = {
18140 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18141 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
18142 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18143 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
18144 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18145 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
18146 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18147 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
18148 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
18149 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
18150 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
18151 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
18152 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(9)},
18153 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
18154 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
18155 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
18159 static struct snd_kcontrol_new alc662_auto_capture_mixer
[] = {
18160 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT
),
18161 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT
),
18165 static struct snd_kcontrol_new alc272_auto_capture_mixer
[] = {
18166 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT
),
18167 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT
),
18171 static void alc662_lenovo_101e_ispeaker_automute(struct hda_codec
*codec
)
18173 unsigned int present
;
18174 unsigned char bits
;
18176 present
= snd_hda_jack_detect(codec
, 0x14);
18177 bits
= present
? HDA_AMP_MUTE
: 0;
18179 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
18180 HDA_AMP_MUTE
, bits
);
18183 static void alc662_lenovo_101e_all_automute(struct hda_codec
*codec
)
18185 unsigned int present
;
18186 unsigned char bits
;
18188 present
= snd_hda_jack_detect(codec
, 0x1b);
18189 bits
= present
? HDA_AMP_MUTE
: 0;
18191 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
18192 HDA_AMP_MUTE
, bits
);
18193 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
18194 HDA_AMP_MUTE
, bits
);
18197 static void alc662_lenovo_101e_unsol_event(struct hda_codec
*codec
,
18200 if ((res
>> 26) == ALC880_HP_EVENT
)
18201 alc662_lenovo_101e_all_automute(codec
);
18202 if ((res
>> 26) == ALC880_FRONT_EVENT
)
18203 alc662_lenovo_101e_ispeaker_automute(codec
);
18206 /* unsolicited event for HP jack sensing */
18207 static void alc662_eeepc_unsol_event(struct hda_codec
*codec
,
18210 if ((res
>> 26) == ALC880_MIC_EVENT
)
18211 alc_mic_automute(codec
);
18213 alc262_hippo_unsol_event(codec
, res
);
18216 static void alc662_eeepc_setup(struct hda_codec
*codec
)
18218 struct alc_spec
*spec
= codec
->spec
;
18220 alc262_hippo1_setup(codec
);
18221 spec
->ext_mic
.pin
= 0x18;
18222 spec
->ext_mic
.mux_idx
= 0;
18223 spec
->int_mic
.pin
= 0x19;
18224 spec
->int_mic
.mux_idx
= 1;
18225 spec
->auto_mic
= 1;
18228 static void alc662_eeepc_inithook(struct hda_codec
*codec
)
18230 alc262_hippo_automute(codec
);
18231 alc_mic_automute(codec
);
18234 static void alc662_eeepc_ep20_setup(struct hda_codec
*codec
)
18236 struct alc_spec
*spec
= codec
->spec
;
18238 spec
->autocfg
.hp_pins
[0] = 0x14;
18239 spec
->autocfg
.speaker_pins
[0] = 0x1b;
18242 #define alc662_eeepc_ep20_inithook alc262_hippo_master_update
18244 static void alc663_m51va_speaker_automute(struct hda_codec
*codec
)
18246 unsigned int present
;
18247 unsigned char bits
;
18249 present
= snd_hda_jack_detect(codec
, 0x21);
18250 bits
= present
? HDA_AMP_MUTE
: 0;
18251 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
18252 HDA_AMP_MUTE
, bits
);
18253 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
18254 HDA_AMP_MUTE
, bits
);
18257 static void alc663_21jd_two_speaker_automute(struct hda_codec
*codec
)
18259 unsigned int present
;
18260 unsigned char bits
;
18262 present
= snd_hda_jack_detect(codec
, 0x21);
18263 bits
= present
? HDA_AMP_MUTE
: 0;
18264 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
18265 HDA_AMP_MUTE
, bits
);
18266 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
18267 HDA_AMP_MUTE
, bits
);
18268 snd_hda_codec_amp_stereo(codec
, 0x0e, HDA_INPUT
, 0,
18269 HDA_AMP_MUTE
, bits
);
18270 snd_hda_codec_amp_stereo(codec
, 0x0e, HDA_INPUT
, 1,
18271 HDA_AMP_MUTE
, bits
);
18274 static void alc663_15jd_two_speaker_automute(struct hda_codec
*codec
)
18276 unsigned int present
;
18277 unsigned char bits
;
18279 present
= snd_hda_jack_detect(codec
, 0x15);
18280 bits
= present
? HDA_AMP_MUTE
: 0;
18281 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
18282 HDA_AMP_MUTE
, bits
);
18283 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
18284 HDA_AMP_MUTE
, bits
);
18285 snd_hda_codec_amp_stereo(codec
, 0x0e, HDA_INPUT
, 0,
18286 HDA_AMP_MUTE
, bits
);
18287 snd_hda_codec_amp_stereo(codec
, 0x0e, HDA_INPUT
, 1,
18288 HDA_AMP_MUTE
, bits
);
18291 static void alc662_f5z_speaker_automute(struct hda_codec
*codec
)
18293 unsigned int present
;
18294 unsigned char bits
;
18296 present
= snd_hda_jack_detect(codec
, 0x1b);
18297 bits
= present
? 0 : PIN_OUT
;
18298 snd_hda_codec_write(codec
, 0x14, 0,
18299 AC_VERB_SET_PIN_WIDGET_CONTROL
, bits
);
18302 static void alc663_two_hp_m1_speaker_automute(struct hda_codec
*codec
)
18304 unsigned int present1
, present2
;
18306 present1
= snd_hda_jack_detect(codec
, 0x21);
18307 present2
= snd_hda_jack_detect(codec
, 0x15);
18309 if (present1
|| present2
) {
18310 snd_hda_codec_write_cache(codec
, 0x14, 0,
18311 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0);
18313 snd_hda_codec_write_cache(codec
, 0x14, 0,
18314 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
18318 static void alc663_two_hp_m2_speaker_automute(struct hda_codec
*codec
)
18320 unsigned int present1
, present2
;
18322 present1
= snd_hda_jack_detect(codec
, 0x1b);
18323 present2
= snd_hda_jack_detect(codec
, 0x15);
18325 if (present1
|| present2
) {
18326 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
18327 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
18328 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
18329 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
18331 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
18333 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
18338 static void alc663_two_hp_m7_speaker_automute(struct hda_codec
*codec
)
18340 unsigned int present1
, present2
;
18342 present1
= snd_hda_codec_read(codec
, 0x1b, 0,
18343 AC_VERB_GET_PIN_SENSE
, 0)
18344 & AC_PINSENSE_PRESENCE
;
18345 present2
= snd_hda_codec_read(codec
, 0x21, 0,
18346 AC_VERB_GET_PIN_SENSE
, 0)
18347 & AC_PINSENSE_PRESENCE
;
18349 if (present1
|| present2
) {
18350 snd_hda_codec_write_cache(codec
, 0x14, 0,
18351 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0);
18352 snd_hda_codec_write_cache(codec
, 0x17, 0,
18353 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0);
18355 snd_hda_codec_write_cache(codec
, 0x14, 0,
18356 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
18357 snd_hda_codec_write_cache(codec
, 0x17, 0,
18358 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
18362 static void alc663_two_hp_m8_speaker_automute(struct hda_codec
*codec
)
18364 unsigned int present1
, present2
;
18366 present1
= snd_hda_codec_read(codec
, 0x21, 0,
18367 AC_VERB_GET_PIN_SENSE
, 0)
18368 & AC_PINSENSE_PRESENCE
;
18369 present2
= snd_hda_codec_read(codec
, 0x15, 0,
18370 AC_VERB_GET_PIN_SENSE
, 0)
18371 & AC_PINSENSE_PRESENCE
;
18373 if (present1
|| present2
) {
18374 snd_hda_codec_write_cache(codec
, 0x14, 0,
18375 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0);
18376 snd_hda_codec_write_cache(codec
, 0x17, 0,
18377 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0);
18379 snd_hda_codec_write_cache(codec
, 0x14, 0,
18380 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
18381 snd_hda_codec_write_cache(codec
, 0x17, 0,
18382 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
18386 static void alc663_m51va_unsol_event(struct hda_codec
*codec
,
18389 switch (res
>> 26) {
18390 case ALC880_HP_EVENT
:
18391 alc663_m51va_speaker_automute(codec
);
18393 case ALC880_MIC_EVENT
:
18394 alc_mic_automute(codec
);
18399 static void alc663_m51va_setup(struct hda_codec
*codec
)
18401 struct alc_spec
*spec
= codec
->spec
;
18402 spec
->ext_mic
.pin
= 0x18;
18403 spec
->ext_mic
.mux_idx
= 0;
18404 spec
->int_mic
.pin
= 0x12;
18405 spec
->int_mic
.mux_idx
= 9;
18406 spec
->auto_mic
= 1;
18409 static void alc663_m51va_inithook(struct hda_codec
*codec
)
18411 alc663_m51va_speaker_automute(codec
);
18412 alc_mic_automute(codec
);
18415 /* ***************** Mode1 ******************************/
18416 #define alc663_mode1_unsol_event alc663_m51va_unsol_event
18418 static void alc663_mode1_setup(struct hda_codec
*codec
)
18420 struct alc_spec
*spec
= codec
->spec
;
18421 spec
->ext_mic
.pin
= 0x18;
18422 spec
->ext_mic
.mux_idx
= 0;
18423 spec
->int_mic
.pin
= 0x19;
18424 spec
->int_mic
.mux_idx
= 1;
18425 spec
->auto_mic
= 1;
18428 #define alc663_mode1_inithook alc663_m51va_inithook
18430 /* ***************** Mode2 ******************************/
18431 static void alc662_mode2_unsol_event(struct hda_codec
*codec
,
18434 switch (res
>> 26) {
18435 case ALC880_HP_EVENT
:
18436 alc662_f5z_speaker_automute(codec
);
18438 case ALC880_MIC_EVENT
:
18439 alc_mic_automute(codec
);
18444 #define alc662_mode2_setup alc663_mode1_setup
18446 static void alc662_mode2_inithook(struct hda_codec
*codec
)
18448 alc662_f5z_speaker_automute(codec
);
18449 alc_mic_automute(codec
);
18451 /* ***************** Mode3 ******************************/
18452 static void alc663_mode3_unsol_event(struct hda_codec
*codec
,
18455 switch (res
>> 26) {
18456 case ALC880_HP_EVENT
:
18457 alc663_two_hp_m1_speaker_automute(codec
);
18459 case ALC880_MIC_EVENT
:
18460 alc_mic_automute(codec
);
18465 #define alc663_mode3_setup alc663_mode1_setup
18467 static void alc663_mode3_inithook(struct hda_codec
*codec
)
18469 alc663_two_hp_m1_speaker_automute(codec
);
18470 alc_mic_automute(codec
);
18472 /* ***************** Mode4 ******************************/
18473 static void alc663_mode4_unsol_event(struct hda_codec
*codec
,
18476 switch (res
>> 26) {
18477 case ALC880_HP_EVENT
:
18478 alc663_21jd_two_speaker_automute(codec
);
18480 case ALC880_MIC_EVENT
:
18481 alc_mic_automute(codec
);
18486 #define alc663_mode4_setup alc663_mode1_setup
18488 static void alc663_mode4_inithook(struct hda_codec
*codec
)
18490 alc663_21jd_two_speaker_automute(codec
);
18491 alc_mic_automute(codec
);
18493 /* ***************** Mode5 ******************************/
18494 static void alc663_mode5_unsol_event(struct hda_codec
*codec
,
18497 switch (res
>> 26) {
18498 case ALC880_HP_EVENT
:
18499 alc663_15jd_two_speaker_automute(codec
);
18501 case ALC880_MIC_EVENT
:
18502 alc_mic_automute(codec
);
18507 #define alc663_mode5_setup alc663_mode1_setup
18509 static void alc663_mode5_inithook(struct hda_codec
*codec
)
18511 alc663_15jd_two_speaker_automute(codec
);
18512 alc_mic_automute(codec
);
18514 /* ***************** Mode6 ******************************/
18515 static void alc663_mode6_unsol_event(struct hda_codec
*codec
,
18518 switch (res
>> 26) {
18519 case ALC880_HP_EVENT
:
18520 alc663_two_hp_m2_speaker_automute(codec
);
18522 case ALC880_MIC_EVENT
:
18523 alc_mic_automute(codec
);
18528 #define alc663_mode6_setup alc663_mode1_setup
18530 static void alc663_mode6_inithook(struct hda_codec
*codec
)
18532 alc663_two_hp_m2_speaker_automute(codec
);
18533 alc_mic_automute(codec
);
18536 /* ***************** Mode7 ******************************/
18537 static void alc663_mode7_unsol_event(struct hda_codec
*codec
,
18540 switch (res
>> 26) {
18541 case ALC880_HP_EVENT
:
18542 alc663_two_hp_m7_speaker_automute(codec
);
18544 case ALC880_MIC_EVENT
:
18545 alc_mic_automute(codec
);
18550 #define alc663_mode7_setup alc663_mode1_setup
18552 static void alc663_mode7_inithook(struct hda_codec
*codec
)
18554 alc663_two_hp_m7_speaker_automute(codec
);
18555 alc_mic_automute(codec
);
18558 /* ***************** Mode8 ******************************/
18559 static void alc663_mode8_unsol_event(struct hda_codec
*codec
,
18562 switch (res
>> 26) {
18563 case ALC880_HP_EVENT
:
18564 alc663_two_hp_m8_speaker_automute(codec
);
18566 case ALC880_MIC_EVENT
:
18567 alc_mic_automute(codec
);
18572 #define alc663_mode8_setup alc663_m51va_setup
18574 static void alc663_mode8_inithook(struct hda_codec
*codec
)
18576 alc663_two_hp_m8_speaker_automute(codec
);
18577 alc_mic_automute(codec
);
18580 static void alc663_g71v_hp_automute(struct hda_codec
*codec
)
18582 unsigned int present
;
18583 unsigned char bits
;
18585 present
= snd_hda_jack_detect(codec
, 0x21);
18586 bits
= present
? HDA_AMP_MUTE
: 0;
18587 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
18588 HDA_AMP_MUTE
, bits
);
18589 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
18590 HDA_AMP_MUTE
, bits
);
18593 static void alc663_g71v_front_automute(struct hda_codec
*codec
)
18595 unsigned int present
;
18596 unsigned char bits
;
18598 present
= snd_hda_jack_detect(codec
, 0x15);
18599 bits
= present
? HDA_AMP_MUTE
: 0;
18600 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
18601 HDA_AMP_MUTE
, bits
);
18604 static void alc663_g71v_unsol_event(struct hda_codec
*codec
,
18607 switch (res
>> 26) {
18608 case ALC880_HP_EVENT
:
18609 alc663_g71v_hp_automute(codec
);
18611 case ALC880_FRONT_EVENT
:
18612 alc663_g71v_front_automute(codec
);
18614 case ALC880_MIC_EVENT
:
18615 alc_mic_automute(codec
);
18620 #define alc663_g71v_setup alc663_m51va_setup
18622 static void alc663_g71v_inithook(struct hda_codec
*codec
)
18624 alc663_g71v_front_automute(codec
);
18625 alc663_g71v_hp_automute(codec
);
18626 alc_mic_automute(codec
);
18629 static void alc663_g50v_unsol_event(struct hda_codec
*codec
,
18632 switch (res
>> 26) {
18633 case ALC880_HP_EVENT
:
18634 alc663_m51va_speaker_automute(codec
);
18636 case ALC880_MIC_EVENT
:
18637 alc_mic_automute(codec
);
18642 #define alc663_g50v_setup alc663_m51va_setup
18644 static void alc663_g50v_inithook(struct hda_codec
*codec
)
18646 alc663_m51va_speaker_automute(codec
);
18647 alc_mic_automute(codec
);
18650 static struct snd_kcontrol_new alc662_ecs_mixer
[] = {
18651 HDA_CODEC_VOLUME("Master Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
18652 ALC262_HIPPO_MASTER_SWITCH
,
18654 HDA_CODEC_VOLUME("Mic/LineIn Boost Volume", 0x18, 0, HDA_INPUT
),
18655 HDA_CODEC_VOLUME("Mic/LineIn Playback Volume", 0x0b, 0x0, HDA_INPUT
),
18656 HDA_CODEC_MUTE("Mic/LineIn Playback Switch", 0x0b, 0x0, HDA_INPUT
),
18658 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
18659 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
18660 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
18664 static struct snd_kcontrol_new alc272_nc10_mixer
[] = {
18665 /* Master Playback automatically created from Speaker and Headphone */
18666 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
18667 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
18668 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
18669 HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT
),
18671 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
18672 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
18673 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
18675 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
18676 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
18677 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT
),
18681 #ifdef CONFIG_SND_HDA_POWER_SAVE
18682 #define alc662_loopbacks alc880_loopbacks
18686 /* pcm configuration: identical with ALC880 */
18687 #define alc662_pcm_analog_playback alc880_pcm_analog_playback
18688 #define alc662_pcm_analog_capture alc880_pcm_analog_capture
18689 #define alc662_pcm_digital_playback alc880_pcm_digital_playback
18690 #define alc662_pcm_digital_capture alc880_pcm_digital_capture
18693 * configuration and preset
18695 static const char * const alc662_models
[ALC662_MODEL_LAST
] = {
18696 [ALC662_3ST_2ch_DIG
] = "3stack-dig",
18697 [ALC662_3ST_6ch_DIG
] = "3stack-6ch-dig",
18698 [ALC662_3ST_6ch
] = "3stack-6ch",
18699 [ALC662_5ST_DIG
] = "5stack-dig",
18700 [ALC662_LENOVO_101E
] = "lenovo-101e",
18701 [ALC662_ASUS_EEEPC_P701
] = "eeepc-p701",
18702 [ALC662_ASUS_EEEPC_EP20
] = "eeepc-ep20",
18703 [ALC662_ECS
] = "ecs",
18704 [ALC663_ASUS_M51VA
] = "m51va",
18705 [ALC663_ASUS_G71V
] = "g71v",
18706 [ALC663_ASUS_H13
] = "h13",
18707 [ALC663_ASUS_G50V
] = "g50v",
18708 [ALC663_ASUS_MODE1
] = "asus-mode1",
18709 [ALC662_ASUS_MODE2
] = "asus-mode2",
18710 [ALC663_ASUS_MODE3
] = "asus-mode3",
18711 [ALC663_ASUS_MODE4
] = "asus-mode4",
18712 [ALC663_ASUS_MODE5
] = "asus-mode5",
18713 [ALC663_ASUS_MODE6
] = "asus-mode6",
18714 [ALC663_ASUS_MODE7
] = "asus-mode7",
18715 [ALC663_ASUS_MODE8
] = "asus-mode8",
18716 [ALC272_DELL
] = "dell",
18717 [ALC272_DELL_ZM1
] = "dell-zm1",
18718 [ALC272_SAMSUNG_NC10
] = "samsung-nc10",
18719 [ALC662_AUTO
] = "auto",
18722 static struct snd_pci_quirk alc662_cfg_tbl
[] = {
18723 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_ECS
),
18724 SND_PCI_QUIRK(0x1028, 0x02d6, "DELL", ALC272_DELL
),
18725 SND_PCI_QUIRK(0x1028, 0x02f4, "DELL ZM1", ALC272_DELL_ZM1
),
18726 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC663_ASUS_MODE1
),
18727 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC663_ASUS_MODE3
),
18728 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC663_ASUS_MODE1
),
18729 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC663_ASUS_MODE3
),
18730 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1
),
18731 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2
),
18732 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC663_ASUS_MODE1
),
18733 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC663_ASUS_MODE1
),
18734 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC663_ASUS_MODE1
),
18735 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_ASUS_MODE2
),
18736 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC663_ASUS_MODE7
),
18737 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC663_ASUS_MODE7
),
18738 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC663_ASUS_MODE8
),
18739 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC663_ASUS_MODE3
),
18740 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC663_ASUS_MODE1
),
18741 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_ASUS_MODE2
),
18742 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_ASUS_MODE2
),
18743 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC663_ASUS_MODE1
),
18744 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_ASUS_MODE2
),
18745 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC663_ASUS_MODE6
),
18746 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC663_ASUS_MODE6
),
18747 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_ASUS_MODE2
),
18748 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC663_ASUS_MODE1
),
18749 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC663_ASUS_MODE3
),
18750 SND_PCI_QUIRK(0x1043, 0x17c3, "ASUS UX20", ALC663_ASUS_M51VA
),
18751 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_ASUS_MODE2
),
18752 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_ASUS_MODE2
),
18753 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC663_ASUS_MODE5
),
18754 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC663_ASUS_MODE6
),
18755 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_ASUS_MODE2
),
18756 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC663_ASUS_MODE1
),
18757 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_ASUS_MODE2
),
18758 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_ASUS_MODE2
),
18759 SND_PCI_QUIRK(0x1043, 0x1878, "ASUS M51VA", ALC663_ASUS_M51VA
),
18760 /*SND_PCI_QUIRK(0x1043, 0x1878, "ASUS M50Vr", ALC663_ASUS_MODE1),*/
18761 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC663_ASUS_MODE3
),
18762 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC663_ASUS_MODE3
),
18763 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC663_ASUS_MODE1
),
18764 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC663_ASUS_MODE1
),
18765 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC663_ASUS_MODE1
),
18766 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC663_ASUS_MODE1
),
18767 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC663_ASUS_MODE1
),
18768 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_ASUS_MODE2
),
18769 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_ASUS_MODE2
),
18770 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC663_ASUS_MODE1
),
18771 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC663_ASUS_MODE1
),
18772 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC663_ASUS_MODE3
),
18773 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC663_ASUS_MODE1
),
18774 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC663_ASUS_MODE1
),
18775 SND_PCI_QUIRK(0x1043, 0x19a3, "ASUS G50V", ALC663_ASUS_G50V
),
18776 /*SND_PCI_QUIRK(0x1043, 0x19a3, "ASUS NB", ALC663_ASUS_MODE1),*/
18777 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC663_ASUS_MODE1
),
18778 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_ASUS_MODE2
),
18779 SND_PCI_QUIRK(0x1043, 0x19d3, "ASUS NB", ALC663_ASUS_M51VA
),
18780 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC663_ASUS_MODE1
),
18781 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC663_ASUS_MODE4
),
18782 SND_PCI_QUIRK(0x1043, 0x8290, "ASUS P5GC-MX", ALC662_3ST_6ch_DIG
),
18783 SND_PCI_QUIRK(0x1043, 0x82a1, "ASUS Eeepc", ALC662_ASUS_EEEPC_P701
),
18784 SND_PCI_QUIRK(0x1043, 0x82d1, "ASUS Eeepc EP20", ALC662_ASUS_EEEPC_EP20
),
18785 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_ECS
),
18786 SND_PCI_QUIRK(0x105b, 0x0d47, "Foxconn 45CMX/45GMX/45CMX-K",
18787 ALC662_3ST_6ch_DIG
),
18788 SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB20x", ALC662_AUTO
),
18789 SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10
),
18790 SND_PCI_QUIRK(0x152d, 0x2304, "Quanta WH1", ALC663_ASUS_H13
),
18791 SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG
),
18792 SND_PCI_QUIRK(0x1631, 0xc10c, "PB RS65", ALC663_ASUS_M51VA
),
18793 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo", ALC662_LENOVO_101E
),
18794 SND_PCI_QUIRK(0x1849, 0x3662, "ASROCK K10N78FullHD-hSLI R3.0",
18795 ALC662_3ST_6ch_DIG
),
18796 SND_PCI_QUIRK_MASK(0x1854, 0xf000, 0x2000, "ASUS H13-200x",
18798 SND_PCI_QUIRK(0x1991, 0x5628, "Ordissimo EVE", ALC662_LENOVO_101E
),
18802 static struct alc_config_preset alc662_presets
[] = {
18803 [ALC662_3ST_2ch_DIG
] = {
18804 .mixers
= { alc662_3ST_2ch_mixer
},
18805 .init_verbs
= { alc662_init_verbs
, alc662_eapd_init_verbs
},
18806 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
18807 .dac_nids
= alc662_dac_nids
,
18808 .dig_out_nid
= ALC662_DIGOUT_NID
,
18809 .dig_in_nid
= ALC662_DIGIN_NID
,
18810 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
18811 .channel_mode
= alc662_3ST_2ch_modes
,
18812 .input_mux
= &alc662_capture_source
,
18814 [ALC662_3ST_6ch_DIG
] = {
18815 .mixers
= { alc662_3ST_6ch_mixer
, alc662_chmode_mixer
},
18816 .init_verbs
= { alc662_init_verbs
, alc662_eapd_init_verbs
},
18817 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
18818 .dac_nids
= alc662_dac_nids
,
18819 .dig_out_nid
= ALC662_DIGOUT_NID
,
18820 .dig_in_nid
= ALC662_DIGIN_NID
,
18821 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_6ch_modes
),
18822 .channel_mode
= alc662_3ST_6ch_modes
,
18824 .input_mux
= &alc662_capture_source
,
18826 [ALC662_3ST_6ch
] = {
18827 .mixers
= { alc662_3ST_6ch_mixer
, alc662_chmode_mixer
},
18828 .init_verbs
= { alc662_init_verbs
, alc662_eapd_init_verbs
},
18829 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
18830 .dac_nids
= alc662_dac_nids
,
18831 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_6ch_modes
),
18832 .channel_mode
= alc662_3ST_6ch_modes
,
18834 .input_mux
= &alc662_capture_source
,
18836 [ALC662_5ST_DIG
] = {
18837 .mixers
= { alc662_base_mixer
, alc662_chmode_mixer
},
18838 .init_verbs
= { alc662_init_verbs
, alc662_eapd_init_verbs
},
18839 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
18840 .dac_nids
= alc662_dac_nids
,
18841 .dig_out_nid
= ALC662_DIGOUT_NID
,
18842 .dig_in_nid
= ALC662_DIGIN_NID
,
18843 .num_channel_mode
= ARRAY_SIZE(alc662_5stack_modes
),
18844 .channel_mode
= alc662_5stack_modes
,
18845 .input_mux
= &alc662_capture_source
,
18847 [ALC662_LENOVO_101E
] = {
18848 .mixers
= { alc662_lenovo_101e_mixer
},
18849 .init_verbs
= { alc662_init_verbs
,
18850 alc662_eapd_init_verbs
,
18851 alc662_sue_init_verbs
},
18852 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
18853 .dac_nids
= alc662_dac_nids
,
18854 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
18855 .channel_mode
= alc662_3ST_2ch_modes
,
18856 .input_mux
= &alc662_lenovo_101e_capture_source
,
18857 .unsol_event
= alc662_lenovo_101e_unsol_event
,
18858 .init_hook
= alc662_lenovo_101e_all_automute
,
18860 [ALC662_ASUS_EEEPC_P701
] = {
18861 .mixers
= { alc662_eeepc_p701_mixer
},
18862 .init_verbs
= { alc662_init_verbs
,
18863 alc662_eapd_init_verbs
,
18864 alc662_eeepc_sue_init_verbs
},
18865 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
18866 .dac_nids
= alc662_dac_nids
,
18867 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
18868 .channel_mode
= alc662_3ST_2ch_modes
,
18869 .unsol_event
= alc662_eeepc_unsol_event
,
18870 .setup
= alc662_eeepc_setup
,
18871 .init_hook
= alc662_eeepc_inithook
,
18873 [ALC662_ASUS_EEEPC_EP20
] = {
18874 .mixers
= { alc662_eeepc_ep20_mixer
,
18875 alc662_chmode_mixer
},
18876 .init_verbs
= { alc662_init_verbs
,
18877 alc662_eapd_init_verbs
,
18878 alc662_eeepc_ep20_sue_init_verbs
},
18879 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
18880 .dac_nids
= alc662_dac_nids
,
18881 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_6ch_modes
),
18882 .channel_mode
= alc662_3ST_6ch_modes
,
18883 .input_mux
= &alc662_lenovo_101e_capture_source
,
18884 .unsol_event
= alc662_eeepc_unsol_event
,
18885 .setup
= alc662_eeepc_ep20_setup
,
18886 .init_hook
= alc662_eeepc_ep20_inithook
,
18889 .mixers
= { alc662_ecs_mixer
},
18890 .init_verbs
= { alc662_init_verbs
,
18891 alc662_eapd_init_verbs
,
18892 alc662_ecs_init_verbs
},
18893 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
18894 .dac_nids
= alc662_dac_nids
,
18895 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
18896 .channel_mode
= alc662_3ST_2ch_modes
,
18897 .unsol_event
= alc662_eeepc_unsol_event
,
18898 .setup
= alc662_eeepc_setup
,
18899 .init_hook
= alc662_eeepc_inithook
,
18901 [ALC663_ASUS_M51VA
] = {
18902 .mixers
= { alc663_m51va_mixer
},
18903 .init_verbs
= { alc662_init_verbs
,
18904 alc662_eapd_init_verbs
,
18905 alc663_m51va_init_verbs
},
18906 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
18907 .dac_nids
= alc662_dac_nids
,
18908 .dig_out_nid
= ALC662_DIGOUT_NID
,
18909 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
18910 .channel_mode
= alc662_3ST_2ch_modes
,
18911 .unsol_event
= alc663_m51va_unsol_event
,
18912 .setup
= alc663_m51va_setup
,
18913 .init_hook
= alc663_m51va_inithook
,
18915 [ALC663_ASUS_G71V
] = {
18916 .mixers
= { alc663_g71v_mixer
},
18917 .init_verbs
= { alc662_init_verbs
,
18918 alc662_eapd_init_verbs
,
18919 alc663_g71v_init_verbs
},
18920 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
18921 .dac_nids
= alc662_dac_nids
,
18922 .dig_out_nid
= ALC662_DIGOUT_NID
,
18923 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
18924 .channel_mode
= alc662_3ST_2ch_modes
,
18925 .unsol_event
= alc663_g71v_unsol_event
,
18926 .setup
= alc663_g71v_setup
,
18927 .init_hook
= alc663_g71v_inithook
,
18929 [ALC663_ASUS_H13
] = {
18930 .mixers
= { alc663_m51va_mixer
},
18931 .init_verbs
= { alc662_init_verbs
,
18932 alc662_eapd_init_verbs
,
18933 alc663_m51va_init_verbs
},
18934 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
18935 .dac_nids
= alc662_dac_nids
,
18936 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
18937 .channel_mode
= alc662_3ST_2ch_modes
,
18938 .unsol_event
= alc663_m51va_unsol_event
,
18939 .init_hook
= alc663_m51va_inithook
,
18941 [ALC663_ASUS_G50V
] = {
18942 .mixers
= { alc663_g50v_mixer
},
18943 .init_verbs
= { alc662_init_verbs
,
18944 alc662_eapd_init_verbs
,
18945 alc663_g50v_init_verbs
},
18946 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
18947 .dac_nids
= alc662_dac_nids
,
18948 .dig_out_nid
= ALC662_DIGOUT_NID
,
18949 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_6ch_modes
),
18950 .channel_mode
= alc662_3ST_6ch_modes
,
18951 .input_mux
= &alc663_capture_source
,
18952 .unsol_event
= alc663_g50v_unsol_event
,
18953 .setup
= alc663_g50v_setup
,
18954 .init_hook
= alc663_g50v_inithook
,
18956 [ALC663_ASUS_MODE1
] = {
18957 .mixers
= { alc663_m51va_mixer
},
18958 .cap_mixer
= alc662_auto_capture_mixer
,
18959 .init_verbs
= { alc662_init_verbs
,
18960 alc662_eapd_init_verbs
,
18961 alc663_21jd_amic_init_verbs
},
18962 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
18964 .dac_nids
= alc662_dac_nids
,
18965 .dig_out_nid
= ALC662_DIGOUT_NID
,
18966 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
18967 .channel_mode
= alc662_3ST_2ch_modes
,
18968 .unsol_event
= alc663_mode1_unsol_event
,
18969 .setup
= alc663_mode1_setup
,
18970 .init_hook
= alc663_mode1_inithook
,
18972 [ALC662_ASUS_MODE2
] = {
18973 .mixers
= { alc662_1bjd_mixer
},
18974 .cap_mixer
= alc662_auto_capture_mixer
,
18975 .init_verbs
= { alc662_init_verbs
,
18976 alc662_eapd_init_verbs
,
18977 alc662_1bjd_amic_init_verbs
},
18978 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
18979 .dac_nids
= alc662_dac_nids
,
18980 .dig_out_nid
= ALC662_DIGOUT_NID
,
18981 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
18982 .channel_mode
= alc662_3ST_2ch_modes
,
18983 .unsol_event
= alc662_mode2_unsol_event
,
18984 .setup
= alc662_mode2_setup
,
18985 .init_hook
= alc662_mode2_inithook
,
18987 [ALC663_ASUS_MODE3
] = {
18988 .mixers
= { alc663_two_hp_m1_mixer
},
18989 .cap_mixer
= alc662_auto_capture_mixer
,
18990 .init_verbs
= { alc662_init_verbs
,
18991 alc662_eapd_init_verbs
,
18992 alc663_two_hp_amic_m1_init_verbs
},
18993 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
18995 .dac_nids
= alc662_dac_nids
,
18996 .dig_out_nid
= ALC662_DIGOUT_NID
,
18997 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
18998 .channel_mode
= alc662_3ST_2ch_modes
,
18999 .unsol_event
= alc663_mode3_unsol_event
,
19000 .setup
= alc663_mode3_setup
,
19001 .init_hook
= alc663_mode3_inithook
,
19003 [ALC663_ASUS_MODE4
] = {
19004 .mixers
= { alc663_asus_21jd_clfe_mixer
},
19005 .cap_mixer
= alc662_auto_capture_mixer
,
19006 .init_verbs
= { alc662_init_verbs
,
19007 alc662_eapd_init_verbs
,
19008 alc663_21jd_amic_init_verbs
},
19009 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
19011 .dac_nids
= alc662_dac_nids
,
19012 .dig_out_nid
= ALC662_DIGOUT_NID
,
19013 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
19014 .channel_mode
= alc662_3ST_2ch_modes
,
19015 .unsol_event
= alc663_mode4_unsol_event
,
19016 .setup
= alc663_mode4_setup
,
19017 .init_hook
= alc663_mode4_inithook
,
19019 [ALC663_ASUS_MODE5
] = {
19020 .mixers
= { alc663_asus_15jd_clfe_mixer
},
19021 .cap_mixer
= alc662_auto_capture_mixer
,
19022 .init_verbs
= { alc662_init_verbs
,
19023 alc662_eapd_init_verbs
,
19024 alc663_15jd_amic_init_verbs
},
19025 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
19027 .dac_nids
= alc662_dac_nids
,
19028 .dig_out_nid
= ALC662_DIGOUT_NID
,
19029 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
19030 .channel_mode
= alc662_3ST_2ch_modes
,
19031 .unsol_event
= alc663_mode5_unsol_event
,
19032 .setup
= alc663_mode5_setup
,
19033 .init_hook
= alc663_mode5_inithook
,
19035 [ALC663_ASUS_MODE6
] = {
19036 .mixers
= { alc663_two_hp_m2_mixer
},
19037 .cap_mixer
= alc662_auto_capture_mixer
,
19038 .init_verbs
= { alc662_init_verbs
,
19039 alc662_eapd_init_verbs
,
19040 alc663_two_hp_amic_m2_init_verbs
},
19041 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
19043 .dac_nids
= alc662_dac_nids
,
19044 .dig_out_nid
= ALC662_DIGOUT_NID
,
19045 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
19046 .channel_mode
= alc662_3ST_2ch_modes
,
19047 .unsol_event
= alc663_mode6_unsol_event
,
19048 .setup
= alc663_mode6_setup
,
19049 .init_hook
= alc663_mode6_inithook
,
19051 [ALC663_ASUS_MODE7
] = {
19052 .mixers
= { alc663_mode7_mixer
},
19053 .cap_mixer
= alc662_auto_capture_mixer
,
19054 .init_verbs
= { alc662_init_verbs
,
19055 alc662_eapd_init_verbs
,
19056 alc663_mode7_init_verbs
},
19057 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
19059 .dac_nids
= alc662_dac_nids
,
19060 .dig_out_nid
= ALC662_DIGOUT_NID
,
19061 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
19062 .channel_mode
= alc662_3ST_2ch_modes
,
19063 .unsol_event
= alc663_mode7_unsol_event
,
19064 .setup
= alc663_mode7_setup
,
19065 .init_hook
= alc663_mode7_inithook
,
19067 [ALC663_ASUS_MODE8
] = {
19068 .mixers
= { alc663_mode8_mixer
},
19069 .cap_mixer
= alc662_auto_capture_mixer
,
19070 .init_verbs
= { alc662_init_verbs
,
19071 alc662_eapd_init_verbs
,
19072 alc663_mode8_init_verbs
},
19073 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
19075 .dac_nids
= alc662_dac_nids
,
19076 .dig_out_nid
= ALC662_DIGOUT_NID
,
19077 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
19078 .channel_mode
= alc662_3ST_2ch_modes
,
19079 .unsol_event
= alc663_mode8_unsol_event
,
19080 .setup
= alc663_mode8_setup
,
19081 .init_hook
= alc663_mode8_inithook
,
19084 .mixers
= { alc663_m51va_mixer
},
19085 .cap_mixer
= alc272_auto_capture_mixer
,
19086 .init_verbs
= { alc662_init_verbs
,
19087 alc662_eapd_init_verbs
,
19088 alc272_dell_init_verbs
},
19089 .num_dacs
= ARRAY_SIZE(alc272_dac_nids
),
19090 .dac_nids
= alc272_dac_nids
,
19091 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
19092 .adc_nids
= alc272_adc_nids
,
19093 .num_adc_nids
= ARRAY_SIZE(alc272_adc_nids
),
19094 .capsrc_nids
= alc272_capsrc_nids
,
19095 .channel_mode
= alc662_3ST_2ch_modes
,
19096 .unsol_event
= alc663_m51va_unsol_event
,
19097 .setup
= alc663_m51va_setup
,
19098 .init_hook
= alc663_m51va_inithook
,
19100 [ALC272_DELL_ZM1
] = {
19101 .mixers
= { alc663_m51va_mixer
},
19102 .cap_mixer
= alc662_auto_capture_mixer
,
19103 .init_verbs
= { alc662_init_verbs
,
19104 alc662_eapd_init_verbs
,
19105 alc272_dell_zm1_init_verbs
},
19106 .num_dacs
= ARRAY_SIZE(alc272_dac_nids
),
19107 .dac_nids
= alc272_dac_nids
,
19108 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
19109 .adc_nids
= alc662_adc_nids
,
19111 .capsrc_nids
= alc662_capsrc_nids
,
19112 .channel_mode
= alc662_3ST_2ch_modes
,
19113 .unsol_event
= alc663_m51va_unsol_event
,
19114 .setup
= alc663_m51va_setup
,
19115 .init_hook
= alc663_m51va_inithook
,
19117 [ALC272_SAMSUNG_NC10
] = {
19118 .mixers
= { alc272_nc10_mixer
},
19119 .init_verbs
= { alc662_init_verbs
,
19120 alc662_eapd_init_verbs
,
19121 alc663_21jd_amic_init_verbs
},
19122 .num_dacs
= ARRAY_SIZE(alc272_dac_nids
),
19123 .dac_nids
= alc272_dac_nids
,
19124 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
19125 .channel_mode
= alc662_3ST_2ch_modes
,
19126 /*.input_mux = &alc272_nc10_capture_source,*/
19127 .unsol_event
= alc663_mode4_unsol_event
,
19128 .setup
= alc663_mode4_setup
,
19129 .init_hook
= alc663_mode4_inithook
,
19135 * BIOS auto configuration
19138 /* convert from MIX nid to DAC */
19139 static hda_nid_t
alc662_mix_to_dac(struct hda_codec
*codec
, hda_nid_t nid
)
19144 num
= snd_hda_get_connections(codec
, nid
, list
, ARRAY_SIZE(list
));
19145 for (i
= 0; i
< num
; i
++) {
19146 if (get_wcaps_type(get_wcaps(codec
, list
[i
])) == AC_WID_AUD_OUT
)
19152 /* get MIX nid connected to the given pin targeted to DAC */
19153 static hda_nid_t
alc662_dac_to_mix(struct hda_codec
*codec
, hda_nid_t pin
,
19159 num
= snd_hda_get_connections(codec
, pin
, mix
, ARRAY_SIZE(mix
));
19160 for (i
= 0; i
< num
; i
++) {
19161 if (alc662_mix_to_dac(codec
, mix
[i
]) == dac
)
19167 /* look for an empty DAC slot */
19168 static hda_nid_t
alc662_look_for_dac(struct hda_codec
*codec
, hda_nid_t pin
)
19170 struct alc_spec
*spec
= codec
->spec
;
19174 num
= snd_hda_get_connections(codec
, pin
, srcs
, ARRAY_SIZE(srcs
));
19177 for (i
= 0; i
< num
; i
++) {
19178 hda_nid_t nid
= alc662_mix_to_dac(codec
, srcs
[i
]);
19181 for (j
= 0; j
< spec
->multiout
.num_dacs
; j
++)
19182 if (spec
->multiout
.dac_nids
[j
] == nid
)
19184 if (j
>= spec
->multiout
.num_dacs
)
19190 /* fill in the dac_nids table from the parsed pin configuration */
19191 static int alc662_auto_fill_dac_nids(struct hda_codec
*codec
,
19192 const struct auto_pin_cfg
*cfg
)
19194 struct alc_spec
*spec
= codec
->spec
;
19198 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
19199 for (i
= 0; i
< cfg
->line_outs
; i
++) {
19200 dac
= alc662_look_for_dac(codec
, cfg
->line_out_pins
[i
]);
19203 spec
->multiout
.dac_nids
[spec
->multiout
.num_dacs
++] = dac
;
19208 static inline int __alc662_add_vol_ctl(struct alc_spec
*spec
, const char *pfx
,
19209 hda_nid_t nid
, int idx
, unsigned int chs
)
19211 return __add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, pfx
, idx
,
19212 HDA_COMPOSE_AMP_VAL(nid
, chs
, 0, HDA_OUTPUT
));
19215 static inline int __alc662_add_sw_ctl(struct alc_spec
*spec
, const char *pfx
,
19216 hda_nid_t nid
, int idx
, unsigned int chs
)
19218 return __add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, pfx
, idx
,
19219 HDA_COMPOSE_AMP_VAL(nid
, chs
, 0, HDA_INPUT
));
19222 #define alc662_add_vol_ctl(spec, pfx, nid, chs) \
19223 __alc662_add_vol_ctl(spec, pfx, nid, 0, chs)
19224 #define alc662_add_sw_ctl(spec, pfx, nid, chs) \
19225 __alc662_add_sw_ctl(spec, pfx, nid, 0, chs)
19226 #define alc662_add_stereo_vol(spec, pfx, nid) \
19227 alc662_add_vol_ctl(spec, pfx, nid, 3)
19228 #define alc662_add_stereo_sw(spec, pfx, nid) \
19229 alc662_add_sw_ctl(spec, pfx, nid, 3)
19231 /* add playback controls from the parsed DAC table */
19232 static int alc662_auto_create_multi_out_ctls(struct hda_codec
*codec
,
19233 const struct auto_pin_cfg
*cfg
)
19235 struct alc_spec
*spec
= codec
->spec
;
19236 static const char * const chname
[4] = {
19237 "Front", "Surround", NULL
/*CLFE*/, "Side"
19239 const char *pfx
= alc_get_line_out_pfx(cfg
, true);
19240 hda_nid_t nid
, mix
;
19243 for (i
= 0; i
< cfg
->line_outs
; i
++) {
19244 nid
= spec
->multiout
.dac_nids
[i
];
19247 mix
= alc662_dac_to_mix(codec
, cfg
->line_out_pins
[i
], nid
);
19250 if (!pfx
&& i
== 2) {
19252 err
= alc662_add_vol_ctl(spec
, "Center", nid
, 1);
19255 err
= alc662_add_vol_ctl(spec
, "LFE", nid
, 2);
19258 err
= alc662_add_sw_ctl(spec
, "Center", mix
, 1);
19261 err
= alc662_add_sw_ctl(spec
, "LFE", mix
, 2);
19265 const char *name
= pfx
;
19271 err
= __alc662_add_vol_ctl(spec
, name
, nid
, index
, 3);
19274 err
= __alc662_add_sw_ctl(spec
, name
, mix
, index
, 3);
19282 /* add playback controls for speaker and HP outputs */
19283 /* return DAC nid if any new DAC is assigned */
19284 static int alc662_auto_create_extra_out(struct hda_codec
*codec
, hda_nid_t pin
,
19287 struct alc_spec
*spec
= codec
->spec
;
19288 hda_nid_t nid
, mix
;
19293 nid
= alc662_look_for_dac(codec
, pin
);
19295 /* the corresponding DAC is already occupied */
19296 if (!(get_wcaps(codec
, pin
) & AC_WCAP_OUT_AMP
))
19297 return 0; /* no way */
19298 /* create a switch only */
19299 return add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, pfx
,
19300 HDA_COMPOSE_AMP_VAL(pin
, 3, 0, HDA_OUTPUT
));
19303 mix
= alc662_dac_to_mix(codec
, pin
, nid
);
19306 err
= alc662_add_vol_ctl(spec
, pfx
, nid
, 3);
19309 err
= alc662_add_sw_ctl(spec
, pfx
, mix
, 3);
19315 /* create playback/capture controls for input pins */
19316 #define alc662_auto_create_input_ctls \
19317 alc882_auto_create_input_ctls
19319 static void alc662_auto_set_output_and_unmute(struct hda_codec
*codec
,
19320 hda_nid_t nid
, int pin_type
,
19324 hda_nid_t srcs
[HDA_MAX_CONNECTIONS
];
19326 alc_set_pin_output(codec
, nid
, pin_type
);
19327 /* need the manual connection? */
19328 num
= snd_hda_get_connections(codec
, nid
, srcs
, ARRAY_SIZE(srcs
));
19331 for (i
= 0; i
< num
; i
++) {
19332 if (alc662_mix_to_dac(codec
, srcs
[i
]) != dac
)
19334 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_CONNECT_SEL
, i
);
19339 static void alc662_auto_init_multi_out(struct hda_codec
*codec
)
19341 struct alc_spec
*spec
= codec
->spec
;
19342 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
19345 for (i
= 0; i
<= HDA_SIDE
; i
++) {
19346 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
19348 alc662_auto_set_output_and_unmute(codec
, nid
, pin_type
,
19349 spec
->multiout
.dac_nids
[i
]);
19353 static void alc662_auto_init_hp_out(struct hda_codec
*codec
)
19355 struct alc_spec
*spec
= codec
->spec
;
19358 pin
= spec
->autocfg
.hp_pins
[0];
19360 alc662_auto_set_output_and_unmute(codec
, pin
, PIN_HP
,
19361 spec
->multiout
.hp_nid
);
19362 pin
= spec
->autocfg
.speaker_pins
[0];
19364 alc662_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
,
19365 spec
->multiout
.extra_out_nid
[0]);
19368 #define ALC662_PIN_CD_NID ALC880_PIN_CD_NID
19370 static void alc662_auto_init_analog_input(struct hda_codec
*codec
)
19372 struct alc_spec
*spec
= codec
->spec
;
19373 struct auto_pin_cfg
*cfg
= &spec
->autocfg
;
19376 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
19377 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
19378 if (alc_is_input_pin(codec
, nid
)) {
19379 alc_set_input_pin(codec
, nid
, cfg
->inputs
[i
].type
);
19380 if (nid
!= ALC662_PIN_CD_NID
&&
19381 (get_wcaps(codec
, nid
) & AC_WCAP_OUT_AMP
))
19382 snd_hda_codec_write(codec
, nid
, 0,
19383 AC_VERB_SET_AMP_GAIN_MUTE
,
19389 #define alc662_auto_init_input_src alc882_auto_init_input_src
19391 static int alc662_parse_auto_config(struct hda_codec
*codec
)
19393 struct alc_spec
*spec
= codec
->spec
;
19395 static hda_nid_t alc662_ignore
[] = { 0x1d, 0 };
19397 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
19401 if (!spec
->autocfg
.line_outs
)
19402 return 0; /* can't find valid BIOS pin config */
19404 err
= alc662_auto_fill_dac_nids(codec
, &spec
->autocfg
);
19407 err
= alc662_auto_create_multi_out_ctls(codec
, &spec
->autocfg
);
19410 err
= alc662_auto_create_extra_out(codec
,
19411 spec
->autocfg
.speaker_pins
[0],
19416 spec
->multiout
.extra_out_nid
[0] = err
;
19417 err
= alc662_auto_create_extra_out(codec
, spec
->autocfg
.hp_pins
[0],
19422 spec
->multiout
.hp_nid
= err
;
19423 err
= alc662_auto_create_input_ctls(codec
, &spec
->autocfg
);
19427 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
19429 alc_auto_parse_digital(codec
);
19431 if (spec
->kctls
.list
)
19432 add_mixer(spec
, spec
->kctls
.list
);
19434 spec
->num_mux_defs
= 1;
19435 spec
->input_mux
= &spec
->private_imux
[0];
19437 add_verb(spec
, alc662_init_verbs
);
19438 if (codec
->vendor_id
== 0x10ec0272 || codec
->vendor_id
== 0x10ec0663 ||
19439 codec
->vendor_id
== 0x10ec0665 || codec
->vendor_id
== 0x10ec0670)
19440 add_verb(spec
, alc663_init_verbs
);
19442 if (codec
->vendor_id
== 0x10ec0272)
19443 add_verb(spec
, alc272_init_verbs
);
19445 err
= alc_auto_add_mic_boost(codec
);
19449 if (codec
->vendor_id
== 0x10ec0272 || codec
->vendor_id
== 0x10ec0663 ||
19450 codec
->vendor_id
== 0x10ec0665 || codec
->vendor_id
== 0x10ec0670)
19451 alc_ssid_check(codec
, 0x15, 0x1b, 0x14, 0x21);
19453 alc_ssid_check(codec
, 0x15, 0x1b, 0x14, 0);
19458 /* additional initialization for auto-configuration model */
19459 static void alc662_auto_init(struct hda_codec
*codec
)
19461 struct alc_spec
*spec
= codec
->spec
;
19462 alc662_auto_init_multi_out(codec
);
19463 alc662_auto_init_hp_out(codec
);
19464 alc662_auto_init_analog_input(codec
);
19465 alc662_auto_init_input_src(codec
);
19466 alc_auto_init_digital(codec
);
19467 if (spec
->unsol_event
)
19468 alc_inithook(codec
);
19471 static void alc272_fixup_mario(struct hda_codec
*codec
,
19472 const struct alc_fixup
*fix
, int action
)
19474 if (action
!= ALC_FIXUP_ACT_PROBE
)
19476 if (snd_hda_override_amp_caps(codec
, 0x2, HDA_OUTPUT
,
19477 (0x3b << AC_AMPCAP_OFFSET_SHIFT
) |
19478 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT
) |
19479 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
19480 (0 << AC_AMPCAP_MUTE_SHIFT
)))
19481 printk(KERN_WARNING
19482 "hda_codec: failed to override amp caps for NID 0x2\n");
19486 ALC662_FIXUP_ASPIRE
,
19487 ALC662_FIXUP_IDEAPAD
,
19488 ALC272_FIXUP_MARIO
,
19489 ALC662_FIXUP_CZC_P10T
,
19490 ALC662_FIXUP_GIGABYTE
,
19493 static const struct alc_fixup alc662_fixups
[] = {
19494 [ALC662_FIXUP_ASPIRE
] = {
19495 .type
= ALC_FIXUP_PINS
,
19496 .v
.pins
= (const struct alc_pincfg
[]) {
19497 { 0x15, 0x99130112 }, /* subwoofer */
19501 [ALC662_FIXUP_IDEAPAD
] = {
19502 .type
= ALC_FIXUP_PINS
,
19503 .v
.pins
= (const struct alc_pincfg
[]) {
19504 { 0x17, 0x99130112 }, /* subwoofer */
19508 [ALC272_FIXUP_MARIO
] = {
19509 .type
= ALC_FIXUP_FUNC
,
19510 .v
.func
= alc272_fixup_mario
,
19512 [ALC662_FIXUP_CZC_P10T
] = {
19513 .type
= ALC_FIXUP_VERBS
,
19514 .v
.verbs
= (const struct hda_verb
[]) {
19515 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
19519 [ALC662_FIXUP_GIGABYTE
] = {
19520 .type
= ALC_FIXUP_PINS
,
19521 .v
.pins
= (const struct alc_pincfg
[]) {
19522 { 0x14, 0x1114410 }, /* set as speaker */
19528 static struct snd_pci_quirk alc662_fixup_tbl
[] = {
19529 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE
),
19530 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE
),
19531 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD
),
19532 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte", ALC662_FIXUP_GIGABYTE
),
19533 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD
),
19534 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD
),
19535 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T
),
19539 static const struct alc_model_fixup alc662_fixup_models
[] = {
19540 {.id
= ALC272_FIXUP_MARIO
, .name
= "mario"},
19545 static int patch_alc662(struct hda_codec
*codec
)
19547 struct alc_spec
*spec
;
19548 int err
, board_config
;
19551 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
19555 codec
->spec
= spec
;
19557 alc_auto_parse_customize_define(codec
);
19559 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
19561 coef
= alc_read_coef_idx(codec
, 0);
19562 if (coef
== 0x8020 || coef
== 0x8011)
19563 alc_codec_rename(codec
, "ALC661");
19564 else if (coef
& (1 << 14) &&
19565 codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
19566 spec
->cdefine
.platform_type
== 1)
19567 alc_codec_rename(codec
, "ALC272X");
19568 else if (coef
== 0x4011)
19569 alc_codec_rename(codec
, "ALC656");
19571 board_config
= snd_hda_check_board_config(codec
, ALC662_MODEL_LAST
,
19574 if (board_config
< 0) {
19575 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
19577 board_config
= ALC662_AUTO
;
19580 if (board_config
== ALC662_AUTO
) {
19581 alc_pick_fixup(codec
, alc662_fixup_models
,
19582 alc662_fixup_tbl
, alc662_fixups
);
19583 alc_apply_fixup(codec
, ALC_FIXUP_ACT_PRE_PROBE
);
19584 /* automatic parse from the BIOS config */
19585 err
= alc662_parse_auto_config(codec
);
19591 "hda_codec: Cannot set up configuration "
19592 "from BIOS. Using base mode...\n");
19593 board_config
= ALC662_3ST_2ch_DIG
;
19597 if (has_cdefine_beep(codec
)) {
19598 err
= snd_hda_attach_beep_device(codec
, 0x1);
19605 if (board_config
!= ALC662_AUTO
)
19606 setup_preset(codec
, &alc662_presets
[board_config
]);
19608 spec
->stream_analog_playback
= &alc662_pcm_analog_playback
;
19609 spec
->stream_analog_capture
= &alc662_pcm_analog_capture
;
19611 spec
->stream_digital_playback
= &alc662_pcm_digital_playback
;
19612 spec
->stream_digital_capture
= &alc662_pcm_digital_capture
;
19614 if (!spec
->adc_nids
) {
19615 spec
->adc_nids
= alc662_adc_nids
;
19616 spec
->num_adc_nids
= ARRAY_SIZE(alc662_adc_nids
);
19618 if (!spec
->capsrc_nids
)
19619 spec
->capsrc_nids
= alc662_capsrc_nids
;
19621 if (!spec
->cap_mixer
)
19622 set_capture_mixer(codec
);
19624 if (has_cdefine_beep(codec
)) {
19625 switch (codec
->vendor_id
) {
19627 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
19632 set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
19635 set_beep_amp(spec
, 0x0b, 0x03, HDA_INPUT
);
19639 spec
->vmaster_nid
= 0x02;
19641 alc_apply_fixup(codec
, ALC_FIXUP_ACT_PROBE
);
19643 codec
->patch_ops
= alc_patch_ops
;
19644 if (board_config
== ALC662_AUTO
)
19645 spec
->init_hook
= alc662_auto_init
;
19647 alc_init_jacks(codec
);
19649 #ifdef CONFIG_SND_HDA_POWER_SAVE
19650 if (!spec
->loopback
.amplist
)
19651 spec
->loopback
.amplist
= alc662_loopbacks
;
19657 static int patch_alc888(struct hda_codec
*codec
)
19659 if ((alc_read_coef_idx(codec
, 0) & 0x00f0)==0x0030){
19660 kfree(codec
->chip_name
);
19661 if (codec
->vendor_id
== 0x10ec0887)
19662 codec
->chip_name
= kstrdup("ALC887-VD", GFP_KERNEL
);
19664 codec
->chip_name
= kstrdup("ALC888-VD", GFP_KERNEL
);
19665 if (!codec
->chip_name
) {
19669 return patch_alc662(codec
);
19671 return patch_alc882(codec
);
19677 #define ALC680_DIGIN_NID ALC880_DIGIN_NID
19678 #define ALC680_DIGOUT_NID ALC880_DIGOUT_NID
19679 #define alc680_modes alc260_modes
19681 static hda_nid_t alc680_dac_nids
[3] = {
19682 /* Lout1, Lout2, hp */
19686 static hda_nid_t alc680_adc_nids
[3] = {
19688 /* DMIC, MIC, Line-in*/
19693 * Analog capture ADC cgange
19695 static void alc680_rec_autoswitch(struct hda_codec
*codec
)
19697 struct alc_spec
*spec
= codec
->spec
;
19698 struct auto_pin_cfg
*cfg
= &spec
->autocfg
;
19700 int type_found
= AUTO_PIN_LAST
;
19704 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
19705 nid
= cfg
->inputs
[i
].pin
;
19706 if (!(snd_hda_query_pin_caps(codec
, nid
) &
19707 AC_PINCAP_PRES_DETECT
))
19709 if (snd_hda_jack_detect(codec
, nid
)) {
19710 if (cfg
->inputs
[i
].type
< type_found
) {
19711 type_found
= cfg
->inputs
[i
].type
;
19719 snd_hda_get_connections(codec
, pin_found
, &nid
, 1);
19721 if (nid
!= spec
->cur_adc
)
19722 __snd_hda_codec_cleanup_stream(codec
, spec
->cur_adc
, 1);
19723 spec
->cur_adc
= nid
;
19724 snd_hda_codec_setup_stream(codec
, nid
, spec
->cur_adc_stream_tag
, 0,
19725 spec
->cur_adc_format
);
19728 static int alc680_capture_pcm_prepare(struct hda_pcm_stream
*hinfo
,
19729 struct hda_codec
*codec
,
19730 unsigned int stream_tag
,
19731 unsigned int format
,
19732 struct snd_pcm_substream
*substream
)
19734 struct alc_spec
*spec
= codec
->spec
;
19736 spec
->cur_adc
= 0x07;
19737 spec
->cur_adc_stream_tag
= stream_tag
;
19738 spec
->cur_adc_format
= format
;
19740 alc680_rec_autoswitch(codec
);
19744 static int alc680_capture_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
19745 struct hda_codec
*codec
,
19746 struct snd_pcm_substream
*substream
)
19748 snd_hda_codec_cleanup_stream(codec
, 0x07);
19749 snd_hda_codec_cleanup_stream(codec
, 0x08);
19750 snd_hda_codec_cleanup_stream(codec
, 0x09);
19754 static struct hda_pcm_stream alc680_pcm_analog_auto_capture
= {
19755 .substreams
= 1, /* can be overridden */
19758 /* NID is set in alc_build_pcms */
19760 .prepare
= alc680_capture_pcm_prepare
,
19761 .cleanup
= alc680_capture_pcm_cleanup
19765 static struct snd_kcontrol_new alc680_base_mixer
[] = {
19766 /* output mixer control */
19767 HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT
),
19768 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
19769 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x4, 0x0, HDA_OUTPUT
),
19770 HDA_CODEC_MUTE("Headphone Playback Switch", 0x16, 0x0, HDA_OUTPUT
),
19771 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x12, 0, HDA_INPUT
),
19772 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT
),
19773 HDA_CODEC_VOLUME("Line In Boost Volume", 0x19, 0, HDA_INPUT
),
19777 static struct hda_bind_ctls alc680_bind_cap_vol
= {
19778 .ops
= &snd_hda_bind_vol
,
19780 HDA_COMPOSE_AMP_VAL(0x07, 3, 0, HDA_INPUT
),
19781 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT
),
19782 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT
),
19787 static struct hda_bind_ctls alc680_bind_cap_switch
= {
19788 .ops
= &snd_hda_bind_sw
,
19790 HDA_COMPOSE_AMP_VAL(0x07, 3, 0, HDA_INPUT
),
19791 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT
),
19792 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT
),
19797 static struct snd_kcontrol_new alc680_master_capture_mixer
[] = {
19798 HDA_BIND_VOL("Capture Volume", &alc680_bind_cap_vol
),
19799 HDA_BIND_SW("Capture Switch", &alc680_bind_cap_switch
),
19804 * generic initialization of ADC, input mixers and output mixers
19806 static struct hda_verb alc680_init_verbs
[] = {
19807 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
19808 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
19809 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
19811 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
19812 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
19813 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
19814 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
19815 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
19816 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
19818 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
19819 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
19820 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
19821 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
19822 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
19824 {0x16, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
19825 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_MIC_EVENT
| AC_USRSP_EN
},
19826 {0x19, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_MIC_EVENT
| AC_USRSP_EN
},
19831 /* toggle speaker-output according to the hp-jack state */
19832 static void alc680_base_setup(struct hda_codec
*codec
)
19834 struct alc_spec
*spec
= codec
->spec
;
19836 spec
->autocfg
.hp_pins
[0] = 0x16;
19837 spec
->autocfg
.speaker_pins
[0] = 0x14;
19838 spec
->autocfg
.speaker_pins
[1] = 0x15;
19839 spec
->autocfg
.num_inputs
= 2;
19840 spec
->autocfg
.inputs
[0].pin
= 0x18;
19841 spec
->autocfg
.inputs
[0].type
= AUTO_PIN_MIC
;
19842 spec
->autocfg
.inputs
[1].pin
= 0x19;
19843 spec
->autocfg
.inputs
[1].type
= AUTO_PIN_LINE_IN
;
19846 static void alc680_unsol_event(struct hda_codec
*codec
,
19849 if ((res
>> 26) == ALC880_HP_EVENT
)
19850 alc_automute_amp(codec
);
19851 if ((res
>> 26) == ALC880_MIC_EVENT
)
19852 alc680_rec_autoswitch(codec
);
19855 static void alc680_inithook(struct hda_codec
*codec
)
19857 alc_automute_amp(codec
);
19858 alc680_rec_autoswitch(codec
);
19861 /* create input playback/capture controls for the given pin */
19862 static int alc680_new_analog_output(struct alc_spec
*spec
, hda_nid_t nid
,
19863 const char *ctlname
, int idx
)
19881 if (spec
->multiout
.dac_nids
[0] != dac
&&
19882 spec
->multiout
.dac_nids
[1] != dac
) {
19883 err
= add_pb_vol_ctrl(spec
, ALC_CTL_WIDGET_VOL
, ctlname
,
19884 HDA_COMPOSE_AMP_VAL(dac
, 3, idx
,
19889 err
= add_pb_sw_ctrl(spec
, ALC_CTL_WIDGET_MUTE
, ctlname
,
19890 HDA_COMPOSE_AMP_VAL(nid
, 3, idx
, HDA_OUTPUT
));
19894 spec
->multiout
.dac_nids
[spec
->multiout
.num_dacs
++] = dac
;
19900 /* add playback controls from the parsed DAC table */
19901 static int alc680_auto_create_multi_out_ctls(struct alc_spec
*spec
,
19902 const struct auto_pin_cfg
*cfg
)
19907 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
19909 nid
= cfg
->line_out_pins
[0];
19912 if (cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
19916 err
= alc680_new_analog_output(spec
, nid
, name
, 0);
19921 nid
= cfg
->speaker_pins
[0];
19923 err
= alc680_new_analog_output(spec
, nid
, "Speaker", 0);
19927 nid
= cfg
->hp_pins
[0];
19929 err
= alc680_new_analog_output(spec
, nid
, "Headphone", 0);
19937 static void alc680_auto_set_output_and_unmute(struct hda_codec
*codec
,
19938 hda_nid_t nid
, int pin_type
)
19940 alc_set_pin_output(codec
, nid
, pin_type
);
19943 static void alc680_auto_init_multi_out(struct hda_codec
*codec
)
19945 struct alc_spec
*spec
= codec
->spec
;
19946 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[0];
19948 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
19949 alc680_auto_set_output_and_unmute(codec
, nid
, pin_type
);
19953 static void alc680_auto_init_hp_out(struct hda_codec
*codec
)
19955 struct alc_spec
*spec
= codec
->spec
;
19958 pin
= spec
->autocfg
.hp_pins
[0];
19960 alc680_auto_set_output_and_unmute(codec
, pin
, PIN_HP
);
19961 pin
= spec
->autocfg
.speaker_pins
[0];
19963 alc680_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
);
19966 /* pcm configuration: identical with ALC880 */
19967 #define alc680_pcm_analog_playback alc880_pcm_analog_playback
19968 #define alc680_pcm_analog_capture alc880_pcm_analog_capture
19969 #define alc680_pcm_analog_alt_capture alc880_pcm_analog_alt_capture
19970 #define alc680_pcm_digital_playback alc880_pcm_digital_playback
19971 #define alc680_pcm_digital_capture alc880_pcm_digital_capture
19974 * BIOS auto configuration
19976 static int alc680_parse_auto_config(struct hda_codec
*codec
)
19978 struct alc_spec
*spec
= codec
->spec
;
19980 static hda_nid_t alc680_ignore
[] = { 0 };
19982 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
19987 if (!spec
->autocfg
.line_outs
) {
19988 if (spec
->autocfg
.dig_outs
|| spec
->autocfg
.dig_in_pin
) {
19989 spec
->multiout
.max_channels
= 2;
19990 spec
->no_analog
= 1;
19993 return 0; /* can't find valid BIOS pin config */
19995 err
= alc680_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
19999 spec
->multiout
.max_channels
= 2;
20002 /* digital only support output */
20003 alc_auto_parse_digital(codec
);
20004 if (spec
->kctls
.list
)
20005 add_mixer(spec
, spec
->kctls
.list
);
20007 add_verb(spec
, alc680_init_verbs
);
20009 err
= alc_auto_add_mic_boost(codec
);
20016 #define alc680_auto_init_analog_input alc882_auto_init_analog_input
20018 /* init callback for auto-configuration model -- overriding the default init */
20019 static void alc680_auto_init(struct hda_codec
*codec
)
20021 struct alc_spec
*spec
= codec
->spec
;
20022 alc680_auto_init_multi_out(codec
);
20023 alc680_auto_init_hp_out(codec
);
20024 alc680_auto_init_analog_input(codec
);
20025 alc_auto_init_digital(codec
);
20026 if (spec
->unsol_event
)
20027 alc_inithook(codec
);
20031 * configuration and preset
20033 static const char * const alc680_models
[ALC680_MODEL_LAST
] = {
20034 [ALC680_BASE
] = "base",
20035 [ALC680_AUTO
] = "auto",
20038 static struct snd_pci_quirk alc680_cfg_tbl
[] = {
20039 SND_PCI_QUIRK(0x1043, 0x12f3, "ASUS NX90", ALC680_BASE
),
20043 static struct alc_config_preset alc680_presets
[] = {
20045 .mixers
= { alc680_base_mixer
},
20046 .cap_mixer
= alc680_master_capture_mixer
,
20047 .init_verbs
= { alc680_init_verbs
},
20048 .num_dacs
= ARRAY_SIZE(alc680_dac_nids
),
20049 .dac_nids
= alc680_dac_nids
,
20050 .dig_out_nid
= ALC680_DIGOUT_NID
,
20051 .num_channel_mode
= ARRAY_SIZE(alc680_modes
),
20052 .channel_mode
= alc680_modes
,
20053 .unsol_event
= alc680_unsol_event
,
20054 .setup
= alc680_base_setup
,
20055 .init_hook
= alc680_inithook
,
20060 static int patch_alc680(struct hda_codec
*codec
)
20062 struct alc_spec
*spec
;
20066 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
20070 codec
->spec
= spec
;
20072 board_config
= snd_hda_check_board_config(codec
, ALC680_MODEL_LAST
,
20076 if (board_config
< 0 || board_config
>= ALC680_MODEL_LAST
) {
20077 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
20079 board_config
= ALC680_AUTO
;
20082 if (board_config
== ALC680_AUTO
) {
20083 /* automatic parse from the BIOS config */
20084 err
= alc680_parse_auto_config(codec
);
20090 "hda_codec: Cannot set up configuration "
20091 "from BIOS. Using base mode...\n");
20092 board_config
= ALC680_BASE
;
20096 if (board_config
!= ALC680_AUTO
)
20097 setup_preset(codec
, &alc680_presets
[board_config
]);
20099 spec
->stream_analog_playback
= &alc680_pcm_analog_playback
;
20100 spec
->stream_analog_capture
= &alc680_pcm_analog_auto_capture
;
20101 spec
->stream_digital_playback
= &alc680_pcm_digital_playback
;
20102 spec
->stream_digital_capture
= &alc680_pcm_digital_capture
;
20104 if (!spec
->adc_nids
) {
20105 spec
->adc_nids
= alc680_adc_nids
;
20106 spec
->num_adc_nids
= ARRAY_SIZE(alc680_adc_nids
);
20109 if (!spec
->cap_mixer
)
20110 set_capture_mixer(codec
);
20112 spec
->vmaster_nid
= 0x02;
20114 codec
->patch_ops
= alc_patch_ops
;
20115 if (board_config
== ALC680_AUTO
)
20116 spec
->init_hook
= alc680_auto_init
;
20124 static struct hda_codec_preset snd_hda_preset_realtek
[] = {
20125 { .id
= 0x10ec0260, .name
= "ALC260", .patch
= patch_alc260
},
20126 { .id
= 0x10ec0262, .name
= "ALC262", .patch
= patch_alc262
},
20127 { .id
= 0x10ec0267, .name
= "ALC267", .patch
= patch_alc268
},
20128 { .id
= 0x10ec0268, .name
= "ALC268", .patch
= patch_alc268
},
20129 { .id
= 0x10ec0269, .name
= "ALC269", .patch
= patch_alc269
},
20130 { .id
= 0x10ec0270, .name
= "ALC270", .patch
= patch_alc269
},
20131 { .id
= 0x10ec0272, .name
= "ALC272", .patch
= patch_alc662
},
20132 { .id
= 0x10ec0275, .name
= "ALC275", .patch
= patch_alc269
},
20133 { .id
= 0x10ec0861, .rev
= 0x100340, .name
= "ALC660",
20134 .patch
= patch_alc861
},
20135 { .id
= 0x10ec0660, .name
= "ALC660-VD", .patch
= patch_alc861vd
},
20136 { .id
= 0x10ec0861, .name
= "ALC861", .patch
= patch_alc861
},
20137 { .id
= 0x10ec0862, .name
= "ALC861-VD", .patch
= patch_alc861vd
},
20138 { .id
= 0x10ec0662, .rev
= 0x100002, .name
= "ALC662 rev2",
20139 .patch
= patch_alc882
},
20140 { .id
= 0x10ec0662, .rev
= 0x100101, .name
= "ALC662 rev1",
20141 .patch
= patch_alc662
},
20142 { .id
= 0x10ec0663, .name
= "ALC663", .patch
= patch_alc662
},
20143 { .id
= 0x10ec0665, .name
= "ALC665", .patch
= patch_alc662
},
20144 { .id
= 0x10ec0670, .name
= "ALC670", .patch
= patch_alc662
},
20145 { .id
= 0x10ec0680, .name
= "ALC680", .patch
= patch_alc680
},
20146 { .id
= 0x10ec0880, .name
= "ALC880", .patch
= patch_alc880
},
20147 { .id
= 0x10ec0882, .name
= "ALC882", .patch
= patch_alc882
},
20148 { .id
= 0x10ec0883, .name
= "ALC883", .patch
= patch_alc882
},
20149 { .id
= 0x10ec0885, .rev
= 0x100101, .name
= "ALC889A",
20150 .patch
= patch_alc882
},
20151 { .id
= 0x10ec0885, .rev
= 0x100103, .name
= "ALC889A",
20152 .patch
= patch_alc882
},
20153 { .id
= 0x10ec0885, .name
= "ALC885", .patch
= patch_alc882
},
20154 { .id
= 0x10ec0887, .name
= "ALC887", .patch
= patch_alc888
},
20155 { .id
= 0x10ec0888, .rev
= 0x100101, .name
= "ALC1200",
20156 .patch
= patch_alc882
},
20157 { .id
= 0x10ec0888, .name
= "ALC888", .patch
= patch_alc888
},
20158 { .id
= 0x10ec0889, .name
= "ALC889", .patch
= patch_alc882
},
20159 { .id
= 0x10ec0892, .name
= "ALC892", .patch
= patch_alc662
},
20160 {} /* terminator */
20163 MODULE_ALIAS("snd-hda-codec-id:10ec*");
20165 MODULE_LICENSE("GPL");
20166 MODULE_DESCRIPTION("Realtek HD-audio codec");
20168 static struct hda_codec_preset_list realtek_list
= {
20169 .preset
= snd_hda_preset_realtek
,
20170 .owner
= THIS_MODULE
,
20173 static int __init
patch_realtek_init(void)
20175 return snd_hda_add_codec_preset(&realtek_list
);
20178 static void __exit
patch_realtek_exit(void)
20180 snd_hda_delete_codec_preset(&realtek_list
);
20183 module_init(patch_realtek_init
)
20184 module_exit(patch_realtek_exit
)