2 * Universal Interface for Intel High Definition Audio Codec
4 * HD audio interface patch for ALC 260/880/882 codecs
6 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
7 * PeiSen Hou <pshou@realtek.com.tw>
8 * Takashi Iwai <tiwai@suse.de>
9 * Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
11 * This driver is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This driver is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include <linux/init.h>
27 #include <linux/delay.h>
28 #include <linux/slab.h>
29 #include <linux/pci.h>
30 #include <sound/core.h>
31 #include "hda_codec.h"
32 #include "hda_local.h"
35 #define ALC880_FRONT_EVENT 0x01
36 #define ALC880_DCVOL_EVENT 0x02
37 #define ALC880_HP_EVENT 0x04
38 #define ALC880_MIC_EVENT 0x08
40 /* ALC880 board config type */
64 #ifdef CONFIG_SND_DEBUG
68 ALC880_MODEL_LAST
/* last tag */
82 #ifdef CONFIG_SND_DEBUG
86 ALC260_MODEL_LAST
/* last tag */
96 ALC262_HP_BPC_D7000_WL
,
97 ALC262_HP_BPC_D7000_WF
,
110 ALC262_MODEL_LAST
/* last tag */
120 ALC268_ACER_ASPIRE_ONE
,
123 #ifdef CONFIG_SND_DEBUG
127 ALC268_MODEL_LAST
/* last tag */
134 ALC269_ASUS_EEEPC_P703
,
135 ALC269_ASUS_EEEPC_P901
,
139 ALC269_MODEL_LAST
/* last tag */
156 /* ALC861-VD models */
178 ALC662_ASUS_EEEPC_P701
,
179 ALC662_ASUS_EEEPC_EP20
,
216 ALC883_TARGA_2ch_DIG
,
217 ALC883_TARGA_8ch_DIG
,
220 ALC888_ACER_ASPIRE_4930G
,
221 ALC888_ACER_ASPIRE_6530G
,
222 ALC888_ACER_ASPIRE_8930G
,
223 ALC888_ACER_ASPIRE_7730G
,
227 ALC883_LENOVO_101E_2ch
,
228 ALC883_LENOVO_NB0763
,
229 ALC888_LENOVO_MS7195_DIG
,
237 ALC883_FUJITSU_PI2515
,
238 ALC888_FUJITSU_XA3530
,
239 ALC883_3ST_6ch_INTEL
,
252 #define GPIO_MASK 0x03
254 /* extra amp-initialization sequence types */
263 struct alc_mic_route
{
265 unsigned char mux_idx
;
266 unsigned char amix_idx
;
269 #define MUX_IDX_UNDEF ((unsigned char)-1)
272 /* codec parameterization */
273 struct snd_kcontrol_new
*mixers
[5]; /* mixer arrays */
274 unsigned int num_mixers
;
275 struct snd_kcontrol_new
*cap_mixer
; /* capture mixer */
276 unsigned int beep_amp
; /* beep amp value, set via set_beep_amp() */
278 const struct hda_verb
*init_verbs
[5]; /* initialization verbs
282 unsigned int num_init_verbs
;
284 char stream_name_analog
[32]; /* analog PCM stream */
285 struct hda_pcm_stream
*stream_analog_playback
;
286 struct hda_pcm_stream
*stream_analog_capture
;
287 struct hda_pcm_stream
*stream_analog_alt_playback
;
288 struct hda_pcm_stream
*stream_analog_alt_capture
;
290 char stream_name_digital
[32]; /* digital PCM stream */
291 struct hda_pcm_stream
*stream_digital_playback
;
292 struct hda_pcm_stream
*stream_digital_capture
;
295 struct hda_multi_out multiout
; /* playback set-up
296 * max_channels, dacs must be set
297 * dig_out_nid and hp_nid are optional
299 hda_nid_t alt_dac_nid
;
300 hda_nid_t slave_dig_outs
[3]; /* optional - for auto-parsing */
304 unsigned int num_adc_nids
;
306 hda_nid_t
*capsrc_nids
;
307 hda_nid_t dig_in_nid
; /* digital-in NID; optional */
310 unsigned int num_mux_defs
;
311 const struct hda_input_mux
*input_mux
;
312 unsigned int cur_mux
[3];
313 struct alc_mic_route ext_mic
;
314 struct alc_mic_route int_mic
;
317 const struct hda_channel_mode
*channel_mode
;
318 int num_channel_mode
;
320 int const_channel_count
;
321 int ext_channel_count
;
323 /* PCM information */
324 struct hda_pcm pcm_rec
[3]; /* used in alc_build_pcms() */
326 /* dynamic controls, init_verbs and input_mux */
327 struct auto_pin_cfg autocfg
;
328 struct snd_array kctls
;
329 struct hda_input_mux private_imux
[3];
330 hda_nid_t private_dac_nids
[AUTO_CFG_MAX_OUTS
];
331 hda_nid_t private_adc_nids
[AUTO_CFG_MAX_OUTS
];
332 hda_nid_t private_capsrc_nids
[AUTO_CFG_MAX_OUTS
];
335 void (*init_hook
)(struct hda_codec
*codec
);
336 void (*unsol_event
)(struct hda_codec
*codec
, unsigned int res
);
338 /* for pin sensing */
339 unsigned int sense_updated
: 1;
340 unsigned int jack_present
: 1;
341 unsigned int master_sw
: 1;
342 unsigned int auto_mic
:1;
345 unsigned int no_analog
:1; /* digital I/O only */
348 /* for virtual master */
349 hda_nid_t vmaster_nid
;
350 #ifdef CONFIG_SND_HDA_POWER_SAVE
351 struct hda_loopback_check loopback
;
356 unsigned int pll_coef_idx
, pll_coef_bit
;
360 * configuration template - to be copied to the spec instance
362 struct alc_config_preset
{
363 struct snd_kcontrol_new
*mixers
[5]; /* should be identical size
366 struct snd_kcontrol_new
*cap_mixer
; /* capture mixer */
367 const struct hda_verb
*init_verbs
[5];
368 unsigned int num_dacs
;
370 hda_nid_t dig_out_nid
; /* optional */
371 hda_nid_t hp_nid
; /* optional */
372 hda_nid_t
*slave_dig_outs
;
373 unsigned int num_adc_nids
;
375 hda_nid_t
*capsrc_nids
;
376 hda_nid_t dig_in_nid
;
377 unsigned int num_channel_mode
;
378 const struct hda_channel_mode
*channel_mode
;
380 int const_channel_count
;
381 unsigned int num_mux_defs
;
382 const struct hda_input_mux
*input_mux
;
383 void (*unsol_event
)(struct hda_codec
*, unsigned int);
384 void (*setup
)(struct hda_codec
*);
385 void (*init_hook
)(struct hda_codec
*);
386 #ifdef CONFIG_SND_HDA_POWER_SAVE
387 struct hda_amp_list
*loopbacks
;
395 static int alc_mux_enum_info(struct snd_kcontrol
*kcontrol
,
396 struct snd_ctl_elem_info
*uinfo
)
398 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
399 struct alc_spec
*spec
= codec
->spec
;
400 unsigned int mux_idx
= snd_ctl_get_ioffidx(kcontrol
, &uinfo
->id
);
401 if (mux_idx
>= spec
->num_mux_defs
)
403 return snd_hda_input_mux_info(&spec
->input_mux
[mux_idx
], uinfo
);
406 static int alc_mux_enum_get(struct snd_kcontrol
*kcontrol
,
407 struct snd_ctl_elem_value
*ucontrol
)
409 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
410 struct alc_spec
*spec
= codec
->spec
;
411 unsigned int adc_idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
413 ucontrol
->value
.enumerated
.item
[0] = spec
->cur_mux
[adc_idx
];
417 static int alc_mux_enum_put(struct snd_kcontrol
*kcontrol
,
418 struct snd_ctl_elem_value
*ucontrol
)
420 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
421 struct alc_spec
*spec
= codec
->spec
;
422 const struct hda_input_mux
*imux
;
423 unsigned int adc_idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
424 unsigned int mux_idx
;
425 hda_nid_t nid
= spec
->capsrc_nids
?
426 spec
->capsrc_nids
[adc_idx
] : spec
->adc_nids
[adc_idx
];
429 mux_idx
= adc_idx
>= spec
->num_mux_defs
? 0 : adc_idx
;
430 imux
= &spec
->input_mux
[mux_idx
];
432 type
= get_wcaps_type(get_wcaps(codec
, nid
));
433 if (type
== AC_WID_AUD_MIX
) {
434 /* Matrix-mixer style (e.g. ALC882) */
435 unsigned int *cur_val
= &spec
->cur_mux
[adc_idx
];
438 idx
= ucontrol
->value
.enumerated
.item
[0];
439 if (idx
>= imux
->num_items
)
440 idx
= imux
->num_items
- 1;
443 for (i
= 0; i
< imux
->num_items
; i
++) {
444 unsigned int v
= (i
== idx
) ? 0 : HDA_AMP_MUTE
;
445 snd_hda_codec_amp_stereo(codec
, nid
, HDA_INPUT
,
446 imux
->items
[i
].index
,
452 /* MUX style (e.g. ALC880) */
453 return snd_hda_input_mux_put(codec
, imux
, ucontrol
, nid
,
454 &spec
->cur_mux
[adc_idx
]);
459 * channel mode setting
461 static int alc_ch_mode_info(struct snd_kcontrol
*kcontrol
,
462 struct snd_ctl_elem_info
*uinfo
)
464 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
465 struct alc_spec
*spec
= codec
->spec
;
466 return snd_hda_ch_mode_info(codec
, uinfo
, spec
->channel_mode
,
467 spec
->num_channel_mode
);
470 static int alc_ch_mode_get(struct snd_kcontrol
*kcontrol
,
471 struct snd_ctl_elem_value
*ucontrol
)
473 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
474 struct alc_spec
*spec
= codec
->spec
;
475 return snd_hda_ch_mode_get(codec
, ucontrol
, spec
->channel_mode
,
476 spec
->num_channel_mode
,
477 spec
->ext_channel_count
);
480 static int alc_ch_mode_put(struct snd_kcontrol
*kcontrol
,
481 struct snd_ctl_elem_value
*ucontrol
)
483 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
484 struct alc_spec
*spec
= codec
->spec
;
485 int err
= snd_hda_ch_mode_put(codec
, ucontrol
, spec
->channel_mode
,
486 spec
->num_channel_mode
,
487 &spec
->ext_channel_count
);
488 if (err
>= 0 && !spec
->const_channel_count
) {
489 spec
->multiout
.max_channels
= spec
->ext_channel_count
;
490 if (spec
->need_dac_fix
)
491 spec
->multiout
.num_dacs
= spec
->multiout
.max_channels
/ 2;
497 * Control the mode of pin widget settings via the mixer. "pc" is used
498 * instead of "%" to avoid consequences of accidently treating the % as
499 * being part of a format specifier. Maximum allowed length of a value is
500 * 63 characters plus NULL terminator.
502 * Note: some retasking pin complexes seem to ignore requests for input
503 * states other than HiZ (eg: PIN_VREFxx) and revert to HiZ if any of these
504 * are requested. Therefore order this list so that this behaviour will not
505 * cause problems when mixer clients move through the enum sequentially.
506 * NIDs 0x0f and 0x10 have been observed to have this behaviour as of
509 static char *alc_pin_mode_names
[] = {
510 "Mic 50pc bias", "Mic 80pc bias",
511 "Line in", "Line out", "Headphone out",
513 static unsigned char alc_pin_mode_values
[] = {
514 PIN_VREF50
, PIN_VREF80
, PIN_IN
, PIN_OUT
, PIN_HP
,
516 /* The control can present all 5 options, or it can limit the options based
517 * in the pin being assumed to be exclusively an input or an output pin. In
518 * addition, "input" pins may or may not process the mic bias option
519 * depending on actual widget capability (NIDs 0x0f and 0x10 don't seem to
520 * accept requests for bias as of chip versions up to March 2006) and/or
521 * wiring in the computer.
523 #define ALC_PIN_DIR_IN 0x00
524 #define ALC_PIN_DIR_OUT 0x01
525 #define ALC_PIN_DIR_INOUT 0x02
526 #define ALC_PIN_DIR_IN_NOMICBIAS 0x03
527 #define ALC_PIN_DIR_INOUT_NOMICBIAS 0x04
529 /* Info about the pin modes supported by the different pin direction modes.
530 * For each direction the minimum and maximum values are given.
532 static signed char alc_pin_mode_dir_info
[5][2] = {
533 { 0, 2 }, /* ALC_PIN_DIR_IN */
534 { 3, 4 }, /* ALC_PIN_DIR_OUT */
535 { 0, 4 }, /* ALC_PIN_DIR_INOUT */
536 { 2, 2 }, /* ALC_PIN_DIR_IN_NOMICBIAS */
537 { 2, 4 }, /* ALC_PIN_DIR_INOUT_NOMICBIAS */
539 #define alc_pin_mode_min(_dir) (alc_pin_mode_dir_info[_dir][0])
540 #define alc_pin_mode_max(_dir) (alc_pin_mode_dir_info[_dir][1])
541 #define alc_pin_mode_n_items(_dir) \
542 (alc_pin_mode_max(_dir)-alc_pin_mode_min(_dir)+1)
544 static int alc_pin_mode_info(struct snd_kcontrol
*kcontrol
,
545 struct snd_ctl_elem_info
*uinfo
)
547 unsigned int item_num
= uinfo
->value
.enumerated
.item
;
548 unsigned char dir
= (kcontrol
->private_value
>> 16) & 0xff;
550 uinfo
->type
= SNDRV_CTL_ELEM_TYPE_ENUMERATED
;
552 uinfo
->value
.enumerated
.items
= alc_pin_mode_n_items(dir
);
554 if (item_num
<alc_pin_mode_min(dir
) || item_num
>alc_pin_mode_max(dir
))
555 item_num
= alc_pin_mode_min(dir
);
556 strcpy(uinfo
->value
.enumerated
.name
, alc_pin_mode_names
[item_num
]);
560 static int alc_pin_mode_get(struct snd_kcontrol
*kcontrol
,
561 struct snd_ctl_elem_value
*ucontrol
)
564 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
565 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
566 unsigned char dir
= (kcontrol
->private_value
>> 16) & 0xff;
567 long *valp
= ucontrol
->value
.integer
.value
;
568 unsigned int pinctl
= snd_hda_codec_read(codec
, nid
, 0,
569 AC_VERB_GET_PIN_WIDGET_CONTROL
,
572 /* Find enumerated value for current pinctl setting */
573 i
= alc_pin_mode_min(dir
);
574 while (i
<= alc_pin_mode_max(dir
) && alc_pin_mode_values
[i
] != pinctl
)
576 *valp
= i
<= alc_pin_mode_max(dir
) ? i
: alc_pin_mode_min(dir
);
580 static int alc_pin_mode_put(struct snd_kcontrol
*kcontrol
,
581 struct snd_ctl_elem_value
*ucontrol
)
584 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
585 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
586 unsigned char dir
= (kcontrol
->private_value
>> 16) & 0xff;
587 long val
= *ucontrol
->value
.integer
.value
;
588 unsigned int pinctl
= snd_hda_codec_read(codec
, nid
, 0,
589 AC_VERB_GET_PIN_WIDGET_CONTROL
,
592 if (val
< alc_pin_mode_min(dir
) || val
> alc_pin_mode_max(dir
))
593 val
= alc_pin_mode_min(dir
);
595 change
= pinctl
!= alc_pin_mode_values
[val
];
597 /* Set pin mode to that requested */
598 snd_hda_codec_write_cache(codec
, nid
, 0,
599 AC_VERB_SET_PIN_WIDGET_CONTROL
,
600 alc_pin_mode_values
[val
]);
602 /* Also enable the retasking pin's input/output as required
603 * for the requested pin mode. Enum values of 2 or less are
606 * Dynamically switching the input/output buffers probably
607 * reduces noise slightly (particularly on input) so we'll
608 * do it. However, having both input and output buffers
609 * enabled simultaneously doesn't seem to be problematic if
610 * this turns out to be necessary in the future.
613 snd_hda_codec_amp_stereo(codec
, nid
, HDA_OUTPUT
, 0,
614 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
615 snd_hda_codec_amp_stereo(codec
, nid
, HDA_INPUT
, 0,
618 snd_hda_codec_amp_stereo(codec
, nid
, HDA_INPUT
, 0,
619 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
620 snd_hda_codec_amp_stereo(codec
, nid
, HDA_OUTPUT
, 0,
627 #define ALC_PIN_MODE(xname, nid, dir) \
628 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
629 .info = alc_pin_mode_info, \
630 .get = alc_pin_mode_get, \
631 .put = alc_pin_mode_put, \
632 .private_value = nid | (dir<<16) }
634 /* A switch control for ALC260 GPIO pins. Multiple GPIOs can be ganged
635 * together using a mask with more than one bit set. This control is
636 * currently used only by the ALC260 test model. At this stage they are not
637 * needed for any "production" models.
639 #ifdef CONFIG_SND_DEBUG
640 #define alc_gpio_data_info snd_ctl_boolean_mono_info
642 static int alc_gpio_data_get(struct snd_kcontrol
*kcontrol
,
643 struct snd_ctl_elem_value
*ucontrol
)
645 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
646 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
647 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
648 long *valp
= ucontrol
->value
.integer
.value
;
649 unsigned int val
= snd_hda_codec_read(codec
, nid
, 0,
650 AC_VERB_GET_GPIO_DATA
, 0x00);
652 *valp
= (val
& mask
) != 0;
655 static int alc_gpio_data_put(struct snd_kcontrol
*kcontrol
,
656 struct snd_ctl_elem_value
*ucontrol
)
659 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
660 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
661 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
662 long val
= *ucontrol
->value
.integer
.value
;
663 unsigned int gpio_data
= snd_hda_codec_read(codec
, nid
, 0,
664 AC_VERB_GET_GPIO_DATA
,
667 /* Set/unset the masked GPIO bit(s) as needed */
668 change
= (val
== 0 ? 0 : mask
) != (gpio_data
& mask
);
673 snd_hda_codec_write_cache(codec
, nid
, 0,
674 AC_VERB_SET_GPIO_DATA
, gpio_data
);
678 #define ALC_GPIO_DATA_SWITCH(xname, nid, mask) \
679 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
680 .info = alc_gpio_data_info, \
681 .get = alc_gpio_data_get, \
682 .put = alc_gpio_data_put, \
683 .private_value = nid | (mask<<16) }
684 #endif /* CONFIG_SND_DEBUG */
686 /* A switch control to allow the enabling of the digital IO pins on the
687 * ALC260. This is incredibly simplistic; the intention of this control is
688 * to provide something in the test model allowing digital outputs to be
689 * identified if present. If models are found which can utilise these
690 * outputs a more complete mixer control can be devised for those models if
693 #ifdef CONFIG_SND_DEBUG
694 #define alc_spdif_ctrl_info snd_ctl_boolean_mono_info
696 static int alc_spdif_ctrl_get(struct snd_kcontrol
*kcontrol
,
697 struct snd_ctl_elem_value
*ucontrol
)
699 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
700 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
701 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
702 long *valp
= ucontrol
->value
.integer
.value
;
703 unsigned int val
= snd_hda_codec_read(codec
, nid
, 0,
704 AC_VERB_GET_DIGI_CONVERT_1
, 0x00);
706 *valp
= (val
& mask
) != 0;
709 static int alc_spdif_ctrl_put(struct snd_kcontrol
*kcontrol
,
710 struct snd_ctl_elem_value
*ucontrol
)
713 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
714 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
715 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
716 long val
= *ucontrol
->value
.integer
.value
;
717 unsigned int ctrl_data
= snd_hda_codec_read(codec
, nid
, 0,
718 AC_VERB_GET_DIGI_CONVERT_1
,
721 /* Set/unset the masked control bit(s) as needed */
722 change
= (val
== 0 ? 0 : mask
) != (ctrl_data
& mask
);
727 snd_hda_codec_write_cache(codec
, nid
, 0, AC_VERB_SET_DIGI_CONVERT_1
,
732 #define ALC_SPDIF_CTRL_SWITCH(xname, nid, mask) \
733 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
734 .info = alc_spdif_ctrl_info, \
735 .get = alc_spdif_ctrl_get, \
736 .put = alc_spdif_ctrl_put, \
737 .private_value = nid | (mask<<16) }
738 #endif /* CONFIG_SND_DEBUG */
740 /* A switch control to allow the enabling EAPD digital outputs on the ALC26x.
741 * Again, this is only used in the ALC26x test models to help identify when
742 * the EAPD line must be asserted for features to work.
744 #ifdef CONFIG_SND_DEBUG
745 #define alc_eapd_ctrl_info snd_ctl_boolean_mono_info
747 static int alc_eapd_ctrl_get(struct snd_kcontrol
*kcontrol
,
748 struct snd_ctl_elem_value
*ucontrol
)
750 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
751 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
752 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
753 long *valp
= ucontrol
->value
.integer
.value
;
754 unsigned int val
= snd_hda_codec_read(codec
, nid
, 0,
755 AC_VERB_GET_EAPD_BTLENABLE
, 0x00);
757 *valp
= (val
& mask
) != 0;
761 static int alc_eapd_ctrl_put(struct snd_kcontrol
*kcontrol
,
762 struct snd_ctl_elem_value
*ucontrol
)
765 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
766 hda_nid_t nid
= kcontrol
->private_value
& 0xffff;
767 unsigned char mask
= (kcontrol
->private_value
>> 16) & 0xff;
768 long val
= *ucontrol
->value
.integer
.value
;
769 unsigned int ctrl_data
= snd_hda_codec_read(codec
, nid
, 0,
770 AC_VERB_GET_EAPD_BTLENABLE
,
773 /* Set/unset the masked control bit(s) as needed */
774 change
= (!val
? 0 : mask
) != (ctrl_data
& mask
);
779 snd_hda_codec_write_cache(codec
, nid
, 0, AC_VERB_SET_EAPD_BTLENABLE
,
785 #define ALC_EAPD_CTRL_SWITCH(xname, nid, mask) \
786 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
787 .info = alc_eapd_ctrl_info, \
788 .get = alc_eapd_ctrl_get, \
789 .put = alc_eapd_ctrl_put, \
790 .private_value = nid | (mask<<16) }
791 #endif /* CONFIG_SND_DEBUG */
794 * set up the input pin config (depending on the given auto-pin type)
796 static void alc_set_input_pin(struct hda_codec
*codec
, hda_nid_t nid
,
799 unsigned int val
= PIN_IN
;
801 if (auto_pin_type
<= AUTO_PIN_FRONT_MIC
) {
803 pincap
= snd_hda_query_pin_caps(codec
, nid
);
804 pincap
= (pincap
& AC_PINCAP_VREF
) >> AC_PINCAP_VREF_SHIFT
;
805 if (pincap
& AC_PINCAP_VREF_80
)
807 else if (pincap
& AC_PINCAP_VREF_50
)
809 else if (pincap
& AC_PINCAP_VREF_100
)
811 else if (pincap
& AC_PINCAP_VREF_GRD
)
814 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
, val
);
819 static void add_mixer(struct alc_spec
*spec
, struct snd_kcontrol_new
*mix
)
821 if (snd_BUG_ON(spec
->num_mixers
>= ARRAY_SIZE(spec
->mixers
)))
823 spec
->mixers
[spec
->num_mixers
++] = mix
;
826 static void add_verb(struct alc_spec
*spec
, const struct hda_verb
*verb
)
828 if (snd_BUG_ON(spec
->num_init_verbs
>= ARRAY_SIZE(spec
->init_verbs
)))
830 spec
->init_verbs
[spec
->num_init_verbs
++] = verb
;
833 #ifdef CONFIG_PROC_FS
837 static void print_realtek_coef(struct snd_info_buffer
*buffer
,
838 struct hda_codec
*codec
, hda_nid_t nid
)
844 coeff
= snd_hda_codec_read(codec
, nid
, 0, AC_VERB_GET_PROC_COEF
, 0);
845 snd_iprintf(buffer
, " Processing Coefficient: 0x%02x\n", coeff
);
846 coeff
= snd_hda_codec_read(codec
, nid
, 0,
847 AC_VERB_GET_COEF_INDEX
, 0);
848 snd_iprintf(buffer
, " Coefficient Index: 0x%02x\n", coeff
);
851 #define print_realtek_coef NULL
855 * set up from the preset table
857 static void setup_preset(struct hda_codec
*codec
,
858 const struct alc_config_preset
*preset
)
860 struct alc_spec
*spec
= codec
->spec
;
863 for (i
= 0; i
< ARRAY_SIZE(preset
->mixers
) && preset
->mixers
[i
]; i
++)
864 add_mixer(spec
, preset
->mixers
[i
]);
865 spec
->cap_mixer
= preset
->cap_mixer
;
866 for (i
= 0; i
< ARRAY_SIZE(preset
->init_verbs
) && preset
->init_verbs
[i
];
868 add_verb(spec
, preset
->init_verbs
[i
]);
870 spec
->channel_mode
= preset
->channel_mode
;
871 spec
->num_channel_mode
= preset
->num_channel_mode
;
872 spec
->need_dac_fix
= preset
->need_dac_fix
;
873 spec
->const_channel_count
= preset
->const_channel_count
;
875 if (preset
->const_channel_count
)
876 spec
->multiout
.max_channels
= preset
->const_channel_count
;
878 spec
->multiout
.max_channels
= spec
->channel_mode
[0].channels
;
879 spec
->ext_channel_count
= spec
->channel_mode
[0].channels
;
881 spec
->multiout
.num_dacs
= preset
->num_dacs
;
882 spec
->multiout
.dac_nids
= preset
->dac_nids
;
883 spec
->multiout
.dig_out_nid
= preset
->dig_out_nid
;
884 spec
->multiout
.slave_dig_outs
= preset
->slave_dig_outs
;
885 spec
->multiout
.hp_nid
= preset
->hp_nid
;
887 spec
->num_mux_defs
= preset
->num_mux_defs
;
888 if (!spec
->num_mux_defs
)
889 spec
->num_mux_defs
= 1;
890 spec
->input_mux
= preset
->input_mux
;
892 spec
->num_adc_nids
= preset
->num_adc_nids
;
893 spec
->adc_nids
= preset
->adc_nids
;
894 spec
->capsrc_nids
= preset
->capsrc_nids
;
895 spec
->dig_in_nid
= preset
->dig_in_nid
;
897 spec
->unsol_event
= preset
->unsol_event
;
898 spec
->init_hook
= preset
->init_hook
;
899 #ifdef CONFIG_SND_HDA_POWER_SAVE
900 spec
->loopback
.amplist
= preset
->loopbacks
;
904 preset
->setup(codec
);
907 /* Enable GPIO mask and set output */
908 static struct hda_verb alc_gpio1_init_verbs
[] = {
909 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
910 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
911 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
915 static struct hda_verb alc_gpio2_init_verbs
[] = {
916 {0x01, AC_VERB_SET_GPIO_MASK
, 0x02},
917 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x02},
918 {0x01, AC_VERB_SET_GPIO_DATA
, 0x02},
922 static struct hda_verb alc_gpio3_init_verbs
[] = {
923 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
924 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x03},
925 {0x01, AC_VERB_SET_GPIO_DATA
, 0x03},
930 * Fix hardware PLL issue
931 * On some codecs, the analog PLL gating control must be off while
932 * the default value is 1.
934 static void alc_fix_pll(struct hda_codec
*codec
)
936 struct alc_spec
*spec
= codec
->spec
;
941 snd_hda_codec_write(codec
, spec
->pll_nid
, 0, AC_VERB_SET_COEF_INDEX
,
943 val
= snd_hda_codec_read(codec
, spec
->pll_nid
, 0,
944 AC_VERB_GET_PROC_COEF
, 0);
945 snd_hda_codec_write(codec
, spec
->pll_nid
, 0, AC_VERB_SET_COEF_INDEX
,
947 snd_hda_codec_write(codec
, spec
->pll_nid
, 0, AC_VERB_SET_PROC_COEF
,
948 val
& ~(1 << spec
->pll_coef_bit
));
951 static void alc_fix_pll_init(struct hda_codec
*codec
, hda_nid_t nid
,
952 unsigned int coef_idx
, unsigned int coef_bit
)
954 struct alc_spec
*spec
= codec
->spec
;
956 spec
->pll_coef_idx
= coef_idx
;
957 spec
->pll_coef_bit
= coef_bit
;
961 static void alc_automute_pin(struct hda_codec
*codec
)
963 struct alc_spec
*spec
= codec
->spec
;
964 unsigned int present
, pincap
;
965 unsigned int nid
= spec
->autocfg
.hp_pins
[0];
968 pincap
= snd_hda_query_pin_caps(codec
, nid
);
969 if (pincap
& AC_PINCAP_TRIG_REQ
) /* need trigger? */
970 snd_hda_codec_read(codec
, nid
, 0, AC_VERB_SET_PIN_SENSE
, 0);
971 present
= snd_hda_codec_read(codec
, nid
, 0,
972 AC_VERB_GET_PIN_SENSE
, 0);
973 spec
->jack_present
= (present
& AC_PINSENSE_PRESENCE
) != 0;
974 for (i
= 0; i
< ARRAY_SIZE(spec
->autocfg
.speaker_pins
); i
++) {
975 nid
= spec
->autocfg
.speaker_pins
[i
];
978 snd_hda_codec_write(codec
, nid
, 0,
979 AC_VERB_SET_PIN_WIDGET_CONTROL
,
980 spec
->jack_present
? 0 : PIN_OUT
);
984 static int get_connection_index(struct hda_codec
*codec
, hda_nid_t mux
,
987 hda_nid_t conn
[HDA_MAX_NUM_INPUTS
];
990 nums
= snd_hda_get_connections(codec
, mux
, conn
, ARRAY_SIZE(conn
));
991 for (i
= 0; i
< nums
; i
++)
997 static void alc_mic_automute(struct hda_codec
*codec
)
999 struct alc_spec
*spec
= codec
->spec
;
1000 struct alc_mic_route
*dead
, *alive
;
1001 unsigned int present
, type
;
1004 if (!spec
->auto_mic
)
1006 if (!spec
->int_mic
.pin
|| !spec
->ext_mic
.pin
)
1008 if (snd_BUG_ON(!spec
->adc_nids
))
1011 cap_nid
= spec
->capsrc_nids
? spec
->capsrc_nids
[0] : spec
->adc_nids
[0];
1013 present
= snd_hda_codec_read(codec
, spec
->ext_mic
.pin
, 0,
1014 AC_VERB_GET_PIN_SENSE
, 0);
1015 present
&= AC_PINSENSE_PRESENCE
;
1017 alive
= &spec
->ext_mic
;
1018 dead
= &spec
->int_mic
;
1020 alive
= &spec
->int_mic
;
1021 dead
= &spec
->ext_mic
;
1024 type
= get_wcaps_type(get_wcaps(codec
, cap_nid
));
1025 if (type
== AC_WID_AUD_MIX
) {
1026 /* Matrix-mixer style (e.g. ALC882) */
1027 snd_hda_codec_amp_stereo(codec
, cap_nid
, HDA_INPUT
,
1030 snd_hda_codec_amp_stereo(codec
, cap_nid
, HDA_INPUT
,
1032 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
1034 /* MUX style (e.g. ALC880) */
1035 snd_hda_codec_write_cache(codec
, cap_nid
, 0,
1036 AC_VERB_SET_CONNECT_SEL
,
1040 /* FIXME: analog mixer */
1043 /* unsolicited event for HP jack sensing */
1044 static void alc_sku_unsol_event(struct hda_codec
*codec
, unsigned int res
)
1046 if (codec
->vendor_id
== 0x10ec0880)
1051 case ALC880_HP_EVENT
:
1052 alc_automute_pin(codec
);
1054 case ALC880_MIC_EVENT
:
1055 alc_mic_automute(codec
);
1060 static void alc_inithook(struct hda_codec
*codec
)
1062 alc_automute_pin(codec
);
1063 alc_mic_automute(codec
);
1066 /* additional initialization for ALC888 variants */
1067 static void alc888_coef_init(struct hda_codec
*codec
)
1071 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 0);
1072 tmp
= snd_hda_codec_read(codec
, 0x20, 0, AC_VERB_GET_PROC_COEF
, 0);
1073 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 7);
1074 if ((tmp
& 0xf0) == 0x20)
1076 snd_hda_codec_read(codec
, 0x20, 0,
1077 AC_VERB_SET_PROC_COEF
, 0x830);
1080 snd_hda_codec_read(codec
, 0x20, 0,
1081 AC_VERB_SET_PROC_COEF
, 0x3030);
1084 static void alc889_coef_init(struct hda_codec
*codec
)
1088 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 7);
1089 tmp
= snd_hda_codec_read(codec
, 0x20, 0, AC_VERB_GET_PROC_COEF
, 0);
1090 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 7);
1091 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_PROC_COEF
, tmp
|0x2010);
1094 static void alc_auto_init_amp(struct hda_codec
*codec
, int type
)
1099 case ALC_INIT_GPIO1
:
1100 snd_hda_sequence_write(codec
, alc_gpio1_init_verbs
);
1102 case ALC_INIT_GPIO2
:
1103 snd_hda_sequence_write(codec
, alc_gpio2_init_verbs
);
1105 case ALC_INIT_GPIO3
:
1106 snd_hda_sequence_write(codec
, alc_gpio3_init_verbs
);
1108 case ALC_INIT_DEFAULT
:
1109 switch (codec
->vendor_id
) {
1111 snd_hda_codec_write(codec
, 0x0f, 0,
1112 AC_VERB_SET_EAPD_BTLENABLE
, 2);
1113 snd_hda_codec_write(codec
, 0x10, 0,
1114 AC_VERB_SET_EAPD_BTLENABLE
, 2);
1126 snd_hda_codec_write(codec
, 0x14, 0,
1127 AC_VERB_SET_EAPD_BTLENABLE
, 2);
1128 snd_hda_codec_write(codec
, 0x15, 0,
1129 AC_VERB_SET_EAPD_BTLENABLE
, 2);
1132 switch (codec
->vendor_id
) {
1134 snd_hda_codec_write(codec
, 0x1a, 0,
1135 AC_VERB_SET_COEF_INDEX
, 7);
1136 tmp
= snd_hda_codec_read(codec
, 0x1a, 0,
1137 AC_VERB_GET_PROC_COEF
, 0);
1138 snd_hda_codec_write(codec
, 0x1a, 0,
1139 AC_VERB_SET_COEF_INDEX
, 7);
1140 snd_hda_codec_write(codec
, 0x1a, 0,
1141 AC_VERB_SET_PROC_COEF
,
1151 alc889_coef_init(codec
);
1154 alc888_coef_init(codec
);
1158 snd_hda_codec_write(codec
, 0x20, 0,
1159 AC_VERB_SET_COEF_INDEX
, 7);
1160 tmp
= snd_hda_codec_read(codec
, 0x20, 0,
1161 AC_VERB_GET_PROC_COEF
, 0);
1162 snd_hda_codec_write(codec
, 0x20, 0,
1163 AC_VERB_SET_COEF_INDEX
, 7);
1164 snd_hda_codec_write(codec
, 0x20, 0,
1165 AC_VERB_SET_PROC_COEF
,
1173 static void alc_init_auto_hp(struct hda_codec
*codec
)
1175 struct alc_spec
*spec
= codec
->spec
;
1177 if (!spec
->autocfg
.hp_pins
[0])
1180 if (!spec
->autocfg
.speaker_pins
[0]) {
1181 if (spec
->autocfg
.line_out_pins
[0] &&
1182 spec
->autocfg
.line_out_type
== AUTO_PIN_SPEAKER_OUT
)
1183 spec
->autocfg
.speaker_pins
[0] =
1184 spec
->autocfg
.line_out_pins
[0];
1189 snd_printdd("realtek: Enable HP auto-muting on NID 0x%x\n",
1190 spec
->autocfg
.hp_pins
[0]);
1191 snd_hda_codec_write_cache(codec
, spec
->autocfg
.hp_pins
[0], 0,
1192 AC_VERB_SET_UNSOLICITED_ENABLE
,
1193 AC_USRSP_EN
| ALC880_HP_EVENT
);
1194 spec
->unsol_event
= alc_sku_unsol_event
;
1197 static void alc_init_auto_mic(struct hda_codec
*codec
)
1199 struct alc_spec
*spec
= codec
->spec
;
1200 struct auto_pin_cfg
*cfg
= &spec
->autocfg
;
1201 hda_nid_t fixed
, ext
;
1204 /* there must be only two mic inputs exclusively */
1205 for (i
= AUTO_PIN_LINE
; i
< AUTO_PIN_LAST
; i
++)
1206 if (cfg
->input_pins
[i
])
1210 for (i
= AUTO_PIN_MIC
; i
<= AUTO_PIN_FRONT_MIC
; i
++) {
1211 hda_nid_t nid
= cfg
->input_pins
[i
];
1212 unsigned int defcfg
;
1215 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
1216 switch (get_defcfg_connect(defcfg
)) {
1217 case AC_JACK_PORT_FIXED
:
1219 return; /* already occupied */
1222 case AC_JACK_PORT_COMPLEX
:
1224 return; /* already occupied */
1228 return; /* invalid entry */
1231 if (!(get_wcaps(codec
, ext
) & AC_WCAP_UNSOL_CAP
))
1232 return; /* no unsol support */
1233 snd_printdd("realtek: Enable auto-mic switch on NID 0x%x/0x%x\n",
1235 spec
->ext_mic
.pin
= ext
;
1236 spec
->int_mic
.pin
= fixed
;
1237 spec
->ext_mic
.mux_idx
= MUX_IDX_UNDEF
; /* set later */
1238 spec
->int_mic
.mux_idx
= MUX_IDX_UNDEF
; /* set later */
1240 snd_hda_codec_write_cache(codec
, spec
->ext_mic
.pin
, 0,
1241 AC_VERB_SET_UNSOLICITED_ENABLE
,
1242 AC_USRSP_EN
| ALC880_MIC_EVENT
);
1243 spec
->unsol_event
= alc_sku_unsol_event
;
1246 /* check subsystem ID and set up device-specific initialization;
1247 * return 1 if initialized, 0 if invalid SSID
1249 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
1250 * 31 ~ 16 : Manufacture ID
1252 * 7 ~ 0 : Assembly ID
1253 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
1255 static int alc_subsystem_id(struct hda_codec
*codec
,
1256 hda_nid_t porta
, hda_nid_t porte
,
1259 unsigned int ass
, tmp
, i
;
1261 struct alc_spec
*spec
= codec
->spec
;
1263 ass
= codec
->subsystem_id
& 0xffff;
1264 if ((ass
!= codec
->bus
->pci
->subsystem_device
) && (ass
& 1))
1267 /* invalid SSID, check the special NID pin defcfg instead */
1269 * 31~30 : port connectivity
1272 * 19~16 : Check sum (15:1)
1277 if (codec
->vendor_id
== 0x10ec0260)
1279 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
1280 snd_printd("realtek: No valid SSID, "
1281 "checking pincfg 0x%08x for NID 0x%x\n",
1283 if (!(ass
& 1) && !(ass
& 0x100000))
1285 if ((ass
>> 30) != 1) /* no physical connection */
1290 for (i
= 1; i
< 16; i
++) {
1294 if (((ass
>> 16) & 0xf) != tmp
)
1297 snd_printd("realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
1298 ass
& 0xffff, codec
->vendor_id
);
1302 * 2 : 0 --> Desktop, 1 --> Laptop
1303 * 3~5 : External Amplifier control
1306 tmp
= (ass
& 0x38) >> 3; /* external Amp control */
1309 spec
->init_amp
= ALC_INIT_GPIO1
;
1312 spec
->init_amp
= ALC_INIT_GPIO2
;
1315 spec
->init_amp
= ALC_INIT_GPIO3
;
1318 spec
->init_amp
= ALC_INIT_DEFAULT
;
1322 /* is laptop or Desktop and enable the function "Mute internal speaker
1323 * when the external headphone out jack is plugged"
1325 if (!(ass
& 0x8000))
1328 * 10~8 : Jack location
1329 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
1331 * 15 : 1 --> enable the function "Mute internal speaker
1332 * when the external headphone out jack is plugged"
1334 if (!spec
->autocfg
.hp_pins
[0]) {
1336 tmp
= (ass
>> 11) & 0x3; /* HP to chassis */
1345 for (i
= 0; i
< spec
->autocfg
.line_outs
; i
++)
1346 if (spec
->autocfg
.line_out_pins
[i
] == nid
)
1348 spec
->autocfg
.hp_pins
[0] = nid
;
1351 alc_init_auto_hp(codec
);
1352 alc_init_auto_mic(codec
);
1356 static void alc_ssid_check(struct hda_codec
*codec
,
1357 hda_nid_t porta
, hda_nid_t porte
, hda_nid_t portd
)
1359 if (!alc_subsystem_id(codec
, porta
, porte
, portd
)) {
1360 struct alc_spec
*spec
= codec
->spec
;
1361 snd_printd("realtek: "
1362 "Enable default setup for auto mode as fallback\n");
1363 spec
->init_amp
= ALC_INIT_DEFAULT
;
1364 alc_init_auto_hp(codec
);
1365 alc_init_auto_mic(codec
);
1370 * Fix-up pin default configurations and add default verbs
1379 const struct alc_pincfg
*pins
;
1380 const struct hda_verb
*verbs
;
1383 static void alc_pick_fixup(struct hda_codec
*codec
,
1384 const struct snd_pci_quirk
*quirk
,
1385 const struct alc_fixup
*fix
)
1387 const struct alc_pincfg
*cfg
;
1389 quirk
= snd_pci_quirk_lookup(codec
->bus
->pci
, quirk
);
1393 fix
+= quirk
->value
;
1396 for (; cfg
->nid
; cfg
++)
1397 snd_hda_codec_set_pincfg(codec
, cfg
->nid
, cfg
->val
);
1400 add_verb(codec
->spec
, fix
->verbs
);
1410 static struct hda_verb alc888_4ST_ch2_intel_init
[] = {
1411 /* Mic-in jack as mic in */
1412 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
1413 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
1414 /* Line-in jack as Line in */
1415 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
1416 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
1417 /* Line-Out as Front */
1418 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x00},
1425 static struct hda_verb alc888_4ST_ch4_intel_init
[] = {
1426 /* Mic-in jack as mic in */
1427 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
1428 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
1429 /* Line-in jack as Surround */
1430 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1431 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1432 /* Line-Out as Front */
1433 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x00},
1440 static struct hda_verb alc888_4ST_ch6_intel_init
[] = {
1441 /* Mic-in jack as CLFE */
1442 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1443 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1444 /* Line-in jack as Surround */
1445 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1446 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1447 /* Line-Out as CLFE (workaround because Mic-in is not loud enough) */
1448 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
1455 static struct hda_verb alc888_4ST_ch8_intel_init
[] = {
1456 /* Mic-in jack as CLFE */
1457 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1458 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1459 /* Line-in jack as Surround */
1460 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1461 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1462 /* Line-Out as Side */
1463 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
1467 static struct hda_channel_mode alc888_4ST_8ch_intel_modes
[4] = {
1468 { 2, alc888_4ST_ch2_intel_init
},
1469 { 4, alc888_4ST_ch4_intel_init
},
1470 { 6, alc888_4ST_ch6_intel_init
},
1471 { 8, alc888_4ST_ch8_intel_init
},
1475 * ALC888 Fujitsu Siemens Amillo xa3530
1478 static struct hda_verb alc888_fujitsu_xa3530_verbs
[] = {
1479 /* Front Mic: set to PIN_IN (empty by default) */
1480 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
1481 /* Connect Internal HP to Front */
1482 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1483 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1484 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
1485 /* Connect Bass HP to Front */
1486 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1487 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1488 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
1489 /* Connect Line-Out side jack (SPDIF) to Side */
1490 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1491 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1492 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
1493 /* Connect Mic jack to CLFE */
1494 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1495 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1496 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02},
1497 /* Connect Line-in jack to Surround */
1498 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1499 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1500 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01},
1501 /* Connect HP out jack to Front */
1502 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1503 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1504 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
1505 /* Enable unsolicited event for HP jack and Line-out jack */
1506 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
1507 {0x17, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
1511 static void alc_automute_amp(struct hda_codec
*codec
)
1513 struct alc_spec
*spec
= codec
->spec
;
1514 unsigned int val
, mute
, pincap
;
1518 spec
->jack_present
= 0;
1519 for (i
= 0; i
< ARRAY_SIZE(spec
->autocfg
.hp_pins
); i
++) {
1520 nid
= spec
->autocfg
.hp_pins
[i
];
1523 pincap
= snd_hda_query_pin_caps(codec
, nid
);
1524 if (pincap
& AC_PINCAP_TRIG_REQ
) /* need trigger? */
1525 snd_hda_codec_read(codec
, nid
, 0,
1526 AC_VERB_SET_PIN_SENSE
, 0);
1527 val
= snd_hda_codec_read(codec
, nid
, 0,
1528 AC_VERB_GET_PIN_SENSE
, 0);
1529 if (val
& AC_PINSENSE_PRESENCE
) {
1530 spec
->jack_present
= 1;
1535 mute
= spec
->jack_present
? HDA_AMP_MUTE
: 0;
1536 /* Toggle internal speakers muting */
1537 for (i
= 0; i
< ARRAY_SIZE(spec
->autocfg
.speaker_pins
); i
++) {
1538 nid
= spec
->autocfg
.speaker_pins
[i
];
1541 snd_hda_codec_amp_stereo(codec
, nid
, HDA_OUTPUT
, 0,
1542 HDA_AMP_MUTE
, mute
);
1546 static void alc_automute_amp_unsol_event(struct hda_codec
*codec
,
1549 if (codec
->vendor_id
== 0x10ec0880)
1553 if (res
== ALC880_HP_EVENT
)
1554 alc_automute_amp(codec
);
1557 static void alc889_automute_setup(struct hda_codec
*codec
)
1559 struct alc_spec
*spec
= codec
->spec
;
1561 spec
->autocfg
.hp_pins
[0] = 0x15;
1562 spec
->autocfg
.speaker_pins
[0] = 0x14;
1563 spec
->autocfg
.speaker_pins
[1] = 0x16;
1564 spec
->autocfg
.speaker_pins
[2] = 0x17;
1565 spec
->autocfg
.speaker_pins
[3] = 0x19;
1566 spec
->autocfg
.speaker_pins
[4] = 0x1a;
1569 static void alc889_intel_init_hook(struct hda_codec
*codec
)
1571 alc889_coef_init(codec
);
1572 alc_automute_amp(codec
);
1575 static void alc888_fujitsu_xa3530_setup(struct hda_codec
*codec
)
1577 struct alc_spec
*spec
= codec
->spec
;
1579 spec
->autocfg
.hp_pins
[0] = 0x17; /* line-out */
1580 spec
->autocfg
.hp_pins
[1] = 0x1b; /* hp */
1581 spec
->autocfg
.speaker_pins
[0] = 0x14; /* speaker */
1582 spec
->autocfg
.speaker_pins
[1] = 0x15; /* bass */
1586 * ALC888 Acer Aspire 4930G model
1589 static struct hda_verb alc888_acer_aspire_4930g_verbs
[] = {
1590 /* Front Mic: set to PIN_IN (empty by default) */
1591 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
1592 /* Unselect Front Mic by default in input mixer 3 */
1593 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0xb)},
1594 /* Enable unsolicited event for HP jack */
1595 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
1596 /* Connect Internal HP to front */
1597 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1598 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1599 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
1600 /* Connect HP out to front */
1601 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1602 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1603 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
1608 * ALC888 Acer Aspire 6530G model
1611 static struct hda_verb alc888_acer_aspire_6530g_verbs
[] = {
1612 /* Bias voltage on for external mic port */
1613 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
| PIN_VREF80
},
1614 /* Front Mic: set to PIN_IN (empty by default) */
1615 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
1616 /* Unselect Front Mic by default in input mixer 3 */
1617 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0xb)},
1618 /* Enable unsolicited event for HP jack */
1619 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
1620 /* Enable speaker output */
1621 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1622 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1623 /* Enable headphone output */
1624 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
| PIN_HP
},
1625 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1626 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
1631 * ALC889 Acer Aspire 8930G model
1634 static struct hda_verb alc889_acer_aspire_8930g_verbs
[] = {
1635 /* Front Mic: set to PIN_IN (empty by default) */
1636 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
1637 /* Unselect Front Mic by default in input mixer 3 */
1638 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0xb)},
1639 /* Enable unsolicited event for HP jack */
1640 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
1641 /* Connect Internal Front to Front */
1642 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1643 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1644 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
1645 /* Connect Internal Rear to Rear */
1646 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1647 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1648 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x01},
1649 /* Connect Internal CLFE to CLFE */
1650 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1651 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1652 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x02},
1653 /* Connect HP out to Front */
1654 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
| PIN_HP
},
1655 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1656 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
1657 /* Enable all DACs */
1658 /* DAC DISABLE/MUTE 1? */
1659 /* setting bits 1-5 disables DAC nids 0x02-0x06 apparently. Init=0x38 */
1660 {0x20, AC_VERB_SET_COEF_INDEX
, 0x03},
1661 {0x20, AC_VERB_SET_PROC_COEF
, 0x0000},
1662 /* DAC DISABLE/MUTE 2? */
1663 /* some bit here disables the other DACs. Init=0x4900 */
1664 {0x20, AC_VERB_SET_COEF_INDEX
, 0x08},
1665 {0x20, AC_VERB_SET_PROC_COEF
, 0x0000},
1666 /* Enable amplifiers */
1667 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0x02},
1668 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 0x02},
1670 * This laptop has a stereo digital microphone. The mics are only 1cm apart
1671 * which makes the stereo useless. However, either the mic or the ALC889
1672 * makes the signal become a difference/sum signal instead of standard
1673 * stereo, which is annoying. So instead we flip this bit which makes the
1674 * codec replicate the sum signal to both channels, turning it into a
1677 /* DMIC_CONTROL? Init value = 0x0001 */
1678 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0b},
1679 {0x20, AC_VERB_SET_PROC_COEF
, 0x0003},
1683 static struct hda_input_mux alc888_2_capture_sources
[2] = {
1684 /* Front mic only available on one ADC */
1691 { "Front Mic", 0xb },
1704 static struct hda_input_mux alc888_acer_aspire_6530_sources
[2] = {
1705 /* Interal mic only available on one ADC */
1712 { "Input Mix", 0xa },
1722 { "Input Mix", 0xa },
1727 static struct hda_input_mux alc889_capture_sources
[3] = {
1728 /* Digital mic only available on first "ADC" */
1735 { "Front Mic", 0xb },
1736 { "Input Mix", 0xa },
1745 { "Input Mix", 0xa },
1754 { "Input Mix", 0xa },
1759 static struct snd_kcontrol_new alc888_base_mixer
[] = {
1760 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
1761 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
1762 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
1763 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
1764 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
1766 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
1767 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
1768 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
1769 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
1770 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
1771 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
1772 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
1773 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
1774 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
1775 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
1776 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
1777 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
1781 static void alc888_acer_aspire_4930g_setup(struct hda_codec
*codec
)
1783 struct alc_spec
*spec
= codec
->spec
;
1785 spec
->autocfg
.hp_pins
[0] = 0x15;
1786 spec
->autocfg
.speaker_pins
[0] = 0x14;
1789 static void alc888_acer_aspire_6530g_setup(struct hda_codec
*codec
)
1791 struct alc_spec
*spec
= codec
->spec
;
1793 spec
->autocfg
.hp_pins
[0] = 0x15;
1794 spec
->autocfg
.speaker_pins
[0] = 0x14;
1795 spec
->autocfg
.speaker_pins
[1] = 0x16;
1796 spec
->autocfg
.speaker_pins
[2] = 0x17;
1799 static void alc889_acer_aspire_8930g_setup(struct hda_codec
*codec
)
1801 struct alc_spec
*spec
= codec
->spec
;
1803 spec
->autocfg
.hp_pins
[0] = 0x15;
1804 spec
->autocfg
.speaker_pins
[0] = 0x14;
1805 spec
->autocfg
.speaker_pins
[1] = 0x16;
1806 spec
->autocfg
.speaker_pins
[2] = 0x1b;
1810 * ALC880 3-stack model
1812 * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0e)
1813 * Pin assignment: Front = 0x14, Line-In/Surr = 0x1a, Mic/CLFE = 0x18,
1814 * F-Mic = 0x1b, HP = 0x19
1817 static hda_nid_t alc880_dac_nids
[4] = {
1818 /* front, rear, clfe, rear_surr */
1819 0x02, 0x05, 0x04, 0x03
1822 static hda_nid_t alc880_adc_nids
[3] = {
1827 /* The datasheet says the node 0x07 is connected from inputs,
1828 * but it shows zero connection in the real implementation on some devices.
1829 * Note: this is a 915GAV bug, fixed on 915GLV
1831 static hda_nid_t alc880_adc_nids_alt
[2] = {
1836 #define ALC880_DIGOUT_NID 0x06
1837 #define ALC880_DIGIN_NID 0x0a
1839 static struct hda_input_mux alc880_capture_source
= {
1843 { "Front Mic", 0x3 },
1849 /* channel source setting (2/6 channel selection for 3-stack) */
1851 static struct hda_verb alc880_threestack_ch2_init
[] = {
1852 /* set line-in to input, mute it */
1853 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
1854 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
1855 /* set mic-in to input vref 80%, mute it */
1856 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
1857 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
1862 static struct hda_verb alc880_threestack_ch6_init
[] = {
1863 /* set line-in to output, unmute it */
1864 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1865 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1866 /* set mic-in to output, unmute it */
1867 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
1868 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
1872 static struct hda_channel_mode alc880_threestack_modes
[2] = {
1873 { 2, alc880_threestack_ch2_init
},
1874 { 6, alc880_threestack_ch6_init
},
1877 static struct snd_kcontrol_new alc880_three_stack_mixer
[] = {
1878 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
1879 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
1880 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
1881 HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT
),
1882 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
1883 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
1884 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
1885 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
1886 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
1887 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
1888 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
1889 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
1890 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
1891 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
1892 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x3, HDA_INPUT
),
1893 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x3, HDA_INPUT
),
1894 HDA_CODEC_MUTE("Headphone Playback Switch", 0x19, 0x0, HDA_OUTPUT
),
1896 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
1897 .name
= "Channel Mode",
1898 .info
= alc_ch_mode_info
,
1899 .get
= alc_ch_mode_get
,
1900 .put
= alc_ch_mode_put
,
1905 /* capture mixer elements */
1906 static int alc_cap_vol_info(struct snd_kcontrol
*kcontrol
,
1907 struct snd_ctl_elem_info
*uinfo
)
1909 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
1910 struct alc_spec
*spec
= codec
->spec
;
1913 mutex_lock(&codec
->control_mutex
);
1914 kcontrol
->private_value
= HDA_COMPOSE_AMP_VAL(spec
->adc_nids
[0], 3, 0,
1916 err
= snd_hda_mixer_amp_volume_info(kcontrol
, uinfo
);
1917 mutex_unlock(&codec
->control_mutex
);
1921 static int alc_cap_vol_tlv(struct snd_kcontrol
*kcontrol
, int op_flag
,
1922 unsigned int size
, unsigned int __user
*tlv
)
1924 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
1925 struct alc_spec
*spec
= codec
->spec
;
1928 mutex_lock(&codec
->control_mutex
);
1929 kcontrol
->private_value
= HDA_COMPOSE_AMP_VAL(spec
->adc_nids
[0], 3, 0,
1931 err
= snd_hda_mixer_amp_tlv(kcontrol
, op_flag
, size
, tlv
);
1932 mutex_unlock(&codec
->control_mutex
);
1936 typedef int (*getput_call_t
)(struct snd_kcontrol
*kcontrol
,
1937 struct snd_ctl_elem_value
*ucontrol
);
1939 static int alc_cap_getput_caller(struct snd_kcontrol
*kcontrol
,
1940 struct snd_ctl_elem_value
*ucontrol
,
1943 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
1944 struct alc_spec
*spec
= codec
->spec
;
1945 unsigned int adc_idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
);
1948 mutex_lock(&codec
->control_mutex
);
1949 kcontrol
->private_value
= HDA_COMPOSE_AMP_VAL(spec
->adc_nids
[adc_idx
],
1951 err
= func(kcontrol
, ucontrol
);
1952 mutex_unlock(&codec
->control_mutex
);
1956 static int alc_cap_vol_get(struct snd_kcontrol
*kcontrol
,
1957 struct snd_ctl_elem_value
*ucontrol
)
1959 return alc_cap_getput_caller(kcontrol
, ucontrol
,
1960 snd_hda_mixer_amp_volume_get
);
1963 static int alc_cap_vol_put(struct snd_kcontrol
*kcontrol
,
1964 struct snd_ctl_elem_value
*ucontrol
)
1966 return alc_cap_getput_caller(kcontrol
, ucontrol
,
1967 snd_hda_mixer_amp_volume_put
);
1970 /* capture mixer elements */
1971 #define alc_cap_sw_info snd_ctl_boolean_stereo_info
1973 static int alc_cap_sw_get(struct snd_kcontrol
*kcontrol
,
1974 struct snd_ctl_elem_value
*ucontrol
)
1976 return alc_cap_getput_caller(kcontrol
, ucontrol
,
1977 snd_hda_mixer_amp_switch_get
);
1980 static int alc_cap_sw_put(struct snd_kcontrol
*kcontrol
,
1981 struct snd_ctl_elem_value
*ucontrol
)
1983 return alc_cap_getput_caller(kcontrol
, ucontrol
,
1984 snd_hda_mixer_amp_switch_put
);
1987 #define _DEFINE_CAPMIX(num) \
1989 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
1990 .name = "Capture Switch", \
1991 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
1993 .info = alc_cap_sw_info, \
1994 .get = alc_cap_sw_get, \
1995 .put = alc_cap_sw_put, \
1998 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
1999 .name = "Capture Volume", \
2000 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | \
2001 SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
2002 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK), \
2004 .info = alc_cap_vol_info, \
2005 .get = alc_cap_vol_get, \
2006 .put = alc_cap_vol_put, \
2007 .tlv = { .c = alc_cap_vol_tlv }, \
2010 #define _DEFINE_CAPSRC(num) \
2012 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
2013 /* .name = "Capture Source", */ \
2014 .name = "Input Source", \
2016 .info = alc_mux_enum_info, \
2017 .get = alc_mux_enum_get, \
2018 .put = alc_mux_enum_put, \
2021 #define DEFINE_CAPMIX(num) \
2022 static struct snd_kcontrol_new alc_capture_mixer ## num[] = { \
2023 _DEFINE_CAPMIX(num), \
2024 _DEFINE_CAPSRC(num), \
2028 #define DEFINE_CAPMIX_NOSRC(num) \
2029 static struct snd_kcontrol_new alc_capture_mixer_nosrc ## num[] = { \
2030 _DEFINE_CAPMIX(num), \
2034 /* up to three ADCs */
2038 DEFINE_CAPMIX_NOSRC(1);
2039 DEFINE_CAPMIX_NOSRC(2);
2040 DEFINE_CAPMIX_NOSRC(3);
2043 * ALC880 5-stack model
2045 * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0d),
2047 * Pin assignment: Front = 0x14, Surr = 0x17, CLFE = 0x16
2048 * Line-In/Side = 0x1a, Mic = 0x18, F-Mic = 0x1b, HP = 0x19
2051 /* additional mixers to alc880_three_stack_mixer */
2052 static struct snd_kcontrol_new alc880_five_stack_mixer
[] = {
2053 HDA_CODEC_VOLUME("Side Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2054 HDA_BIND_MUTE("Side Playback Switch", 0x0d, 2, HDA_INPUT
),
2058 /* channel source setting (6/8 channel selection for 5-stack) */
2060 static struct hda_verb alc880_fivestack_ch6_init
[] = {
2061 /* set line-in to input, mute it */
2062 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2063 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2068 static struct hda_verb alc880_fivestack_ch8_init
[] = {
2069 /* set line-in to output, unmute it */
2070 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2071 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2075 static struct hda_channel_mode alc880_fivestack_modes
[2] = {
2076 { 6, alc880_fivestack_ch6_init
},
2077 { 8, alc880_fivestack_ch8_init
},
2082 * ALC880 6-stack model
2084 * DAC: Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e),
2085 * Side = 0x05 (0x0f)
2086 * Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, Side = 0x17,
2087 * Mic = 0x18, F-Mic = 0x19, Line = 0x1a, HP = 0x1b
2090 static hda_nid_t alc880_6st_dac_nids
[4] = {
2091 /* front, rear, clfe, rear_surr */
2092 0x02, 0x03, 0x04, 0x05
2095 static struct hda_input_mux alc880_6stack_capture_source
= {
2099 { "Front Mic", 0x1 },
2105 /* fixed 8-channels */
2106 static struct hda_channel_mode alc880_sixstack_modes
[1] = {
2110 static struct snd_kcontrol_new alc880_six_stack_mixer
[] = {
2111 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2112 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2113 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2114 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
2115 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
2116 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2117 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2118 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2119 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
2120 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
2121 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2122 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2123 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
2124 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
2125 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2126 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2127 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
2128 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
2130 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2131 .name
= "Channel Mode",
2132 .info
= alc_ch_mode_info
,
2133 .get
= alc_ch_mode_get
,
2134 .put
= alc_ch_mode_put
,
2143 * W810 has rear IO for:
2146 * Center/LFE (DAC 04)
2149 * The system also has a pair of internal speakers, and a headphone jack.
2150 * These are both connected to Line2 on the codec, hence to DAC 02.
2152 * There is a variable resistor to control the speaker or headphone
2153 * volume. This is a hardware-only device without a software API.
2155 * Plugging headphones in will disable the internal speakers. This is
2156 * implemented in hardware, not via the driver using jack sense. In
2157 * a similar fashion, plugging into the rear socket marked "front" will
2158 * disable both the speakers and headphones.
2160 * For input, there's a microphone jack, and an "audio in" jack.
2161 * These may not do anything useful with this driver yet, because I
2162 * haven't setup any initialization verbs for these yet...
2165 static hda_nid_t alc880_w810_dac_nids
[3] = {
2166 /* front, rear/surround, clfe */
2170 /* fixed 6 channels */
2171 static struct hda_channel_mode alc880_w810_modes
[1] = {
2175 /* Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, HP = 0x1b */
2176 static struct snd_kcontrol_new alc880_w810_base_mixer
[] = {
2177 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2178 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2179 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2180 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
2181 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
2182 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2183 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2184 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2185 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
2193 * DAC: Front = 0x02 (0x0c), HP = 0x03 (0x0d)
2194 * Pin assignment: Front = 0x14, HP = 0x15, Mic = 0x18, Mic2 = 0x19(?),
2198 static hda_nid_t alc880_z71v_dac_nids
[1] = {
2201 #define ALC880_Z71V_HP_DAC 0x03
2203 /* fixed 2 channels */
2204 static struct hda_channel_mode alc880_2_jack_modes
[1] = {
2208 static struct snd_kcontrol_new alc880_z71v_mixer
[] = {
2209 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2210 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2211 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2212 HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT
),
2213 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2214 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2215 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2216 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2222 * ALC880 F1734 model
2224 * DAC: HP = 0x02 (0x0c), Front = 0x03 (0x0d)
2225 * Pin assignment: HP = 0x14, Front = 0x15, Mic = 0x18
2228 static hda_nid_t alc880_f1734_dac_nids
[1] = {
2231 #define ALC880_F1734_HP_DAC 0x02
2233 static struct snd_kcontrol_new alc880_f1734_mixer
[] = {
2234 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2235 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
2236 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2237 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
2238 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2239 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2240 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
2241 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
2245 static struct hda_input_mux alc880_f1734_capture_source
= {
2257 * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
2258 * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
2259 * Mic = 0x18, Line = 0x1a
2262 #define alc880_asus_dac_nids alc880_w810_dac_nids /* identical with w810 */
2263 #define alc880_asus_modes alc880_threestack_modes /* 2/6 channel mode */
2265 static struct snd_kcontrol_new alc880_asus_mixer
[] = {
2266 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2267 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
2268 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2269 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
2270 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
2271 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2272 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2273 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2274 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2275 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2276 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
2277 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
2278 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2279 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2281 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2282 .name
= "Channel Mode",
2283 .info
= alc_ch_mode_info
,
2284 .get
= alc_ch_mode_get
,
2285 .put
= alc_ch_mode_put
,
2291 * ALC880 ASUS W1V model
2293 * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
2294 * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
2295 * Mic = 0x18, Line = 0x1a, Line2 = 0x1b
2298 /* additional mixers to alc880_asus_mixer */
2299 static struct snd_kcontrol_new alc880_asus_w1v_mixer
[] = {
2300 HDA_CODEC_VOLUME("Line2 Playback Volume", 0x0b, 0x03, HDA_INPUT
),
2301 HDA_CODEC_MUTE("Line2 Playback Switch", 0x0b, 0x03, HDA_INPUT
),
2306 static struct snd_kcontrol_new alc880_tcl_s700_mixer
[] = {
2307 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2308 HDA_CODEC_MUTE("Front Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
2309 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
2310 HDA_CODEC_VOLUME("CD Playback Volume", 0x0B, 0x04, HDA_INPUT
),
2311 HDA_CODEC_MUTE("CD Playback Switch", 0x0B, 0x04, HDA_INPUT
),
2312 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0B, 0x0, HDA_INPUT
),
2313 HDA_CODEC_MUTE("Mic Playback Switch", 0x0B, 0x0, HDA_INPUT
),
2314 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT
),
2315 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT
),
2320 static struct snd_kcontrol_new alc880_uniwill_mixer
[] = {
2321 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2322 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
2323 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2324 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
2325 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
2326 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
2327 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
2328 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
2329 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2330 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2331 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
2332 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
2333 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2334 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2335 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
2336 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
2338 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2339 .name
= "Channel Mode",
2340 .info
= alc_ch_mode_info
,
2341 .get
= alc_ch_mode_get
,
2342 .put
= alc_ch_mode_put
,
2347 static struct snd_kcontrol_new alc880_fujitsu_mixer
[] = {
2348 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2349 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
2350 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2351 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
2352 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
2353 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
2354 HDA_CODEC_VOLUME("Ext Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2355 HDA_CODEC_MUTE("Ext Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2356 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
2357 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
2361 static struct snd_kcontrol_new alc880_uniwill_p53_mixer
[] = {
2362 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
2363 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
2364 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
2365 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
2366 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
2367 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
2372 * virtual master controls
2376 * slave controls for virtual master
2378 static const char *alc_slave_vols
[] = {
2379 "Front Playback Volume",
2380 "Surround Playback Volume",
2381 "Center Playback Volume",
2382 "LFE Playback Volume",
2383 "Side Playback Volume",
2384 "Headphone Playback Volume",
2385 "Speaker Playback Volume",
2386 "Mono Playback Volume",
2387 "Line-Out Playback Volume",
2388 "PCM Playback Volume",
2392 static const char *alc_slave_sws
[] = {
2393 "Front Playback Switch",
2394 "Surround Playback Switch",
2395 "Center Playback Switch",
2396 "LFE Playback Switch",
2397 "Side Playback Switch",
2398 "Headphone Playback Switch",
2399 "Speaker Playback Switch",
2400 "Mono Playback Switch",
2401 "IEC958 Playback Switch",
2406 * build control elements
2409 static void alc_free_kctls(struct hda_codec
*codec
);
2411 /* additional beep mixers; the actual parameters are overwritten at build */
2412 static struct snd_kcontrol_new alc_beep_mixer
[] = {
2413 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT
),
2414 HDA_CODEC_MUTE("Beep Playback Switch", 0, 0, HDA_INPUT
),
2418 static int alc_build_controls(struct hda_codec
*codec
)
2420 struct alc_spec
*spec
= codec
->spec
;
2424 for (i
= 0; i
< spec
->num_mixers
; i
++) {
2425 err
= snd_hda_add_new_ctls(codec
, spec
->mixers
[i
]);
2429 if (spec
->cap_mixer
) {
2430 err
= snd_hda_add_new_ctls(codec
, spec
->cap_mixer
);
2434 if (spec
->multiout
.dig_out_nid
) {
2435 err
= snd_hda_create_spdif_out_ctls(codec
,
2436 spec
->multiout
.dig_out_nid
);
2439 if (!spec
->no_analog
) {
2440 err
= snd_hda_create_spdif_share_sw(codec
,
2444 spec
->multiout
.share_spdif
= 1;
2447 if (spec
->dig_in_nid
) {
2448 err
= snd_hda_create_spdif_in_ctls(codec
, spec
->dig_in_nid
);
2453 /* create beep controls if needed */
2454 if (spec
->beep_amp
) {
2455 struct snd_kcontrol_new
*knew
;
2456 for (knew
= alc_beep_mixer
; knew
->name
; knew
++) {
2457 struct snd_kcontrol
*kctl
;
2458 kctl
= snd_ctl_new1(knew
, codec
);
2461 kctl
->private_value
= spec
->beep_amp
;
2462 err
= snd_hda_ctl_add(codec
, kctl
);
2468 /* if we have no master control, let's create it */
2469 if (!spec
->no_analog
&&
2470 !snd_hda_find_mixer_ctl(codec
, "Master Playback Volume")) {
2471 unsigned int vmaster_tlv
[4];
2472 snd_hda_set_vmaster_tlv(codec
, spec
->vmaster_nid
,
2473 HDA_OUTPUT
, vmaster_tlv
);
2474 err
= snd_hda_add_vmaster(codec
, "Master Playback Volume",
2475 vmaster_tlv
, alc_slave_vols
);
2479 if (!spec
->no_analog
&&
2480 !snd_hda_find_mixer_ctl(codec
, "Master Playback Switch")) {
2481 err
= snd_hda_add_vmaster(codec
, "Master Playback Switch",
2482 NULL
, alc_slave_sws
);
2487 alc_free_kctls(codec
); /* no longer needed */
2493 * initialize the codec volumes, etc
2497 * generic initialization of ADC, input mixers and output mixers
2499 static struct hda_verb alc880_volume_init_verbs
[] = {
2501 * Unmute ADC0-2 and set the default input to mic-in
2503 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
2504 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2505 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
2506 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2507 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
2508 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2510 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
2512 * Note: PASD motherboards uses the Line In 2 as the input for front
2515 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
2516 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
2517 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2518 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
2519 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
2520 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
2521 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)},
2522 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)},
2525 * Set up output mixers (0x0c - 0x0f)
2527 /* set vol=0 to output mixers */
2528 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
2529 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
2530 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
2531 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
2532 /* set up input amps for analog loopback */
2533 /* Amp Indices: DAC = 0, mixer = 1 */
2534 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
2535 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2536 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
2537 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2538 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
2539 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2540 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
2541 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2547 * 3-stack pin configuration:
2548 * front = 0x14, mic/clfe = 0x18, HP = 0x19, line/surr = 0x1a, f-mic = 0x1b
2550 static struct hda_verb alc880_pin_3stack_init_verbs
[] = {
2552 * preset connection lists of input pins
2553 * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
2555 {0x10, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* mic/clfe */
2556 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
2557 {0x12, AC_VERB_SET_CONNECT_SEL
, 0x03}, /* line/surround */
2560 * Set pin mode and muting
2562 /* set front pin widgets 0x14 for output */
2563 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2564 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2565 /* Mic1 (rear panel) pin widget for input and vref at 80% */
2566 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2567 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2568 /* Mic2 (as headphone out) for HP output */
2569 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2570 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2571 /* Line In pin widget for input */
2572 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2573 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2574 /* Line2 (as front mic) pin widget for input and vref at 80% */
2575 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2576 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2577 /* CD pin widget for input */
2578 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2584 * 5-stack pin configuration:
2585 * front = 0x14, surround = 0x17, clfe = 0x16, mic = 0x18, HP = 0x19,
2586 * line-in/side = 0x1a, f-mic = 0x1b
2588 static struct hda_verb alc880_pin_5stack_init_verbs
[] = {
2590 * preset connection lists of input pins
2591 * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
2593 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
2594 {0x12, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* line/side */
2597 * Set pin mode and muting
2599 /* set pin widgets 0x14-0x17 for output */
2600 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2601 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2602 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2603 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2604 /* unmute pins for output (no gain on this amp) */
2605 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2606 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2607 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2608 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2610 /* Mic1 (rear panel) pin widget for input and vref at 80% */
2611 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2612 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2613 /* Mic2 (as headphone out) for HP output */
2614 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2615 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2616 /* Line In pin widget for input */
2617 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2618 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2619 /* Line2 (as front mic) pin widget for input and vref at 80% */
2620 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2621 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2622 /* CD pin widget for input */
2623 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2629 * W810 pin configuration:
2630 * front = 0x14, surround = 0x15, clfe = 0x16, HP = 0x1b
2632 static struct hda_verb alc880_pin_w810_init_verbs
[] = {
2633 /* hphone/speaker input selector: front DAC */
2634 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x0},
2636 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2637 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2638 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2639 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2640 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2641 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2643 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2644 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2650 * Z71V pin configuration:
2651 * Speaker-out = 0x14, HP = 0x15, Mic = 0x18, Line-in = 0x1a, Mic2 = 0x1b (?)
2653 static struct hda_verb alc880_pin_z71v_init_verbs
[] = {
2654 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2655 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2656 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2657 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2659 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2660 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2661 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2662 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2668 * 6-stack pin configuration:
2669 * front = 0x14, surr = 0x15, clfe = 0x16, side = 0x17, mic = 0x18,
2670 * f-mic = 0x19, line = 0x1a, HP = 0x1b
2672 static struct hda_verb alc880_pin_6stack_init_verbs
[] = {
2673 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
2675 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2676 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2677 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2678 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2679 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2680 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2681 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2682 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2684 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2685 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2686 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2687 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2688 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2689 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2690 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2691 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2692 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2698 * Uniwill pin configuration:
2699 * HP = 0x14, InternalSpeaker = 0x15, mic = 0x18, internal mic = 0x19,
2702 static struct hda_verb alc880_uniwill_init_verbs
[] = {
2703 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
2705 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2706 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2707 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2708 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2709 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2710 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2711 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2712 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2713 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
2714 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
2715 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
2716 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
2717 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
2718 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
2720 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2721 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2722 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2723 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2724 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2725 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2726 /* {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, */
2727 /* {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, */
2728 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2730 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
2731 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
2738 * HP = 0x14, InternalSpeaker = 0x15, mic = 0x19,
2740 static struct hda_verb alc880_uniwill_p53_init_verbs
[] = {
2741 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
2743 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2744 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2745 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2746 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2747 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2748 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2749 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
2750 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
2751 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
2752 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
2753 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
2754 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
2756 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2757 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2758 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2759 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2760 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2761 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2763 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
2764 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_DCVOL_EVENT
},
2769 static struct hda_verb alc880_beep_init_verbs
[] = {
2770 { 0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(5) },
2774 /* auto-toggle front mic */
2775 static void alc880_uniwill_mic_automute(struct hda_codec
*codec
)
2777 unsigned int present
;
2780 present
= snd_hda_codec_read(codec
, 0x18, 0,
2781 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
2782 bits
= present
? HDA_AMP_MUTE
: 0;
2783 snd_hda_codec_amp_stereo(codec
, 0x0b, HDA_INPUT
, 1, HDA_AMP_MUTE
, bits
);
2786 static void alc880_uniwill_setup(struct hda_codec
*codec
)
2788 struct alc_spec
*spec
= codec
->spec
;
2790 spec
->autocfg
.hp_pins
[0] = 0x14;
2791 spec
->autocfg
.speaker_pins
[0] = 0x15;
2792 spec
->autocfg
.speaker_pins
[0] = 0x16;
2795 static void alc880_uniwill_init_hook(struct hda_codec
*codec
)
2797 alc_automute_amp(codec
);
2798 alc880_uniwill_mic_automute(codec
);
2801 static void alc880_uniwill_unsol_event(struct hda_codec
*codec
,
2804 /* Looks like the unsol event is incompatible with the standard
2805 * definition. 4bit tag is placed at 28 bit!
2807 switch (res
>> 28) {
2808 case ALC880_MIC_EVENT
:
2809 alc880_uniwill_mic_automute(codec
);
2812 alc_automute_amp_unsol_event(codec
, res
);
2817 static void alc880_uniwill_p53_setup(struct hda_codec
*codec
)
2819 struct alc_spec
*spec
= codec
->spec
;
2821 spec
->autocfg
.hp_pins
[0] = 0x14;
2822 spec
->autocfg
.speaker_pins
[0] = 0x15;
2825 static void alc880_uniwill_p53_dcvol_automute(struct hda_codec
*codec
)
2827 unsigned int present
;
2829 present
= snd_hda_codec_read(codec
, 0x21, 0,
2830 AC_VERB_GET_VOLUME_KNOB_CONTROL
, 0);
2831 present
&= HDA_AMP_VOLMASK
;
2832 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_OUTPUT
, 0,
2833 HDA_AMP_VOLMASK
, present
);
2834 snd_hda_codec_amp_stereo(codec
, 0x0d, HDA_OUTPUT
, 0,
2835 HDA_AMP_VOLMASK
, present
);
2838 static void alc880_uniwill_p53_unsol_event(struct hda_codec
*codec
,
2841 /* Looks like the unsol event is incompatible with the standard
2842 * definition. 4bit tag is placed at 28 bit!
2844 if ((res
>> 28) == ALC880_DCVOL_EVENT
)
2845 alc880_uniwill_p53_dcvol_automute(codec
);
2847 alc_automute_amp_unsol_event(codec
, res
);
2851 * F1734 pin configuration:
2852 * HP = 0x14, speaker-out = 0x15, mic = 0x18
2854 static struct hda_verb alc880_pin_f1734_init_verbs
[] = {
2855 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x01},
2856 {0x10, AC_VERB_SET_CONNECT_SEL
, 0x02},
2857 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x00},
2858 {0x12, AC_VERB_SET_CONNECT_SEL
, 0x01},
2859 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00},
2861 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2862 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2863 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2864 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2866 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2867 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2868 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
2869 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2870 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2871 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2872 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2873 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2874 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2876 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_HP_EVENT
},
2877 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_DCVOL_EVENT
},
2883 * ASUS pin configuration:
2884 * HP/front = 0x14, surr = 0x15, clfe = 0x16, mic = 0x18, line = 0x1a
2886 static struct hda_verb alc880_pin_asus_init_verbs
[] = {
2887 {0x10, AC_VERB_SET_CONNECT_SEL
, 0x02},
2888 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x00},
2889 {0x12, AC_VERB_SET_CONNECT_SEL
, 0x01},
2890 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00},
2892 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2893 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2894 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2895 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2896 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2897 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2898 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2899 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2901 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2902 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2903 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2904 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2905 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2906 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
2907 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2908 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2909 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2914 /* Enable GPIO mask and set output */
2915 #define alc880_gpio1_init_verbs alc_gpio1_init_verbs
2916 #define alc880_gpio2_init_verbs alc_gpio2_init_verbs
2917 #define alc880_gpio3_init_verbs alc_gpio3_init_verbs
2919 /* Clevo m520g init */
2920 static struct hda_verb alc880_pin_clevo_init_verbs
[] = {
2921 /* headphone output */
2922 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x01},
2924 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2925 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2927 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2928 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2930 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2931 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2932 /* Mic1 (rear panel) */
2933 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2934 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2935 /* Mic2 (front panel) */
2936 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2937 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2939 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2940 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
2941 /* change to EAPD mode */
2942 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
2943 {0x20, AC_VERB_SET_PROC_COEF
, 0x3060},
2948 static struct hda_verb alc880_pin_tcl_S700_init_verbs
[] = {
2949 /* change to EAPD mode */
2950 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
2951 {0x20, AC_VERB_SET_PROC_COEF
, 0x3060},
2953 /* Headphone output */
2954 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
2956 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
2957 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
2959 /* Line In pin widget for input */
2960 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2961 /* CD pin widget for input */
2962 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
2963 /* Mic1 (rear panel) pin widget for input and vref at 80% */
2964 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
2966 /* change to EAPD mode */
2967 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
2968 {0x20, AC_VERB_SET_PROC_COEF
, 0x3070},
2974 * LG m1 express dual
2977 * Rear Line-In/Out (blue): 0x14
2978 * Build-in Mic-In: 0x15
2980 * HP-Out (green): 0x1b
2981 * Mic-In/Out (red): 0x19
2985 /* To make 5.1 output working (green=Front, blue=Surr, red=CLFE) */
2986 static hda_nid_t alc880_lg_dac_nids
[3] = {
2990 /* seems analog CD is not working */
2991 static struct hda_input_mux alc880_lg_capture_source
= {
2996 { "Internal Mic", 0x6 },
3000 /* 2,4,6 channel modes */
3001 static struct hda_verb alc880_lg_ch2_init
[] = {
3002 /* set line-in and mic-in to input */
3003 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3004 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3008 static struct hda_verb alc880_lg_ch4_init
[] = {
3009 /* set line-in to out and mic-in to input */
3010 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3011 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3015 static struct hda_verb alc880_lg_ch6_init
[] = {
3016 /* set line-in and mic-in to output */
3017 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3018 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3022 static struct hda_channel_mode alc880_lg_ch_modes
[3] = {
3023 { 2, alc880_lg_ch2_init
},
3024 { 4, alc880_lg_ch4_init
},
3025 { 6, alc880_lg_ch6_init
},
3028 static struct snd_kcontrol_new alc880_lg_mixer
[] = {
3029 HDA_CODEC_VOLUME("Front Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
3030 HDA_BIND_MUTE("Front Playback Switch", 0x0f, 2, HDA_INPUT
),
3031 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
3032 HDA_BIND_MUTE("Surround Playback Switch", 0x0c, 2, HDA_INPUT
),
3033 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0d, 1, 0x0, HDA_OUTPUT
),
3034 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT
),
3035 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT
),
3036 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT
),
3037 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
3038 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
3039 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x06, HDA_INPUT
),
3040 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x06, HDA_INPUT
),
3041 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x07, HDA_INPUT
),
3042 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x07, HDA_INPUT
),
3044 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
3045 .name
= "Channel Mode",
3046 .info
= alc_ch_mode_info
,
3047 .get
= alc_ch_mode_get
,
3048 .put
= alc_ch_mode_put
,
3053 static struct hda_verb alc880_lg_init_verbs
[] = {
3054 /* set capture source to mic-in */
3055 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3056 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3057 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3058 /* mute all amp mixer inputs */
3059 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(5)},
3060 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)},
3061 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)},
3062 /* line-in to input */
3063 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3064 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3066 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3067 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3069 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3070 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3071 /* mic-in to input */
3072 {0x11, AC_VERB_SET_CONNECT_SEL
, 0x01},
3073 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3074 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3076 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x03},
3077 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3078 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3080 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
3084 /* toggle speaker-output according to the hp-jack state */
3085 static void alc880_lg_setup(struct hda_codec
*codec
)
3087 struct alc_spec
*spec
= codec
->spec
;
3089 spec
->autocfg
.hp_pins
[0] = 0x1b;
3090 spec
->autocfg
.speaker_pins
[0] = 0x17;
3099 * Built-in Mic-In: 0x19
3105 static struct hda_input_mux alc880_lg_lw_capture_source
= {
3109 { "Internal Mic", 0x1 },
3114 #define alc880_lg_lw_modes alc880_threestack_modes
3116 static struct snd_kcontrol_new alc880_lg_lw_mixer
[] = {
3117 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
3118 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
3119 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
3120 HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT
),
3121 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
3122 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
3123 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
3124 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
3125 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
3126 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
3127 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
3128 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
3129 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
3130 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
3132 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
3133 .name
= "Channel Mode",
3134 .info
= alc_ch_mode_info
,
3135 .get
= alc_ch_mode_get
,
3136 .put
= alc_ch_mode_put
,
3141 static struct hda_verb alc880_lg_lw_init_verbs
[] = {
3142 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
3143 {0x10, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* mic/clfe */
3144 {0x12, AC_VERB_SET_CONNECT_SEL
, 0x03}, /* line/surround */
3146 /* set capture source to mic-in */
3147 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3148 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3149 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3150 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)},
3152 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3153 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3155 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3156 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3157 /* mic-in to input */
3158 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3159 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3161 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3162 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3164 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
3168 /* toggle speaker-output according to the hp-jack state */
3169 static void alc880_lg_lw_setup(struct hda_codec
*codec
)
3171 struct alc_spec
*spec
= codec
->spec
;
3173 spec
->autocfg
.hp_pins
[0] = 0x1b;
3174 spec
->autocfg
.speaker_pins
[0] = 0x14;
3177 static struct snd_kcontrol_new alc880_medion_rim_mixer
[] = {
3178 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
3179 HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT
),
3180 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
3181 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
3182 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
3183 HDA_CODEC_MUTE("Internal Playback Switch", 0x0b, 0x1, HDA_INPUT
),
3187 static struct hda_input_mux alc880_medion_rim_capture_source
= {
3191 { "Internal Mic", 0x1 },
3195 static struct hda_verb alc880_medion_rim_init_verbs
[] = {
3196 {0x13, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
3198 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3199 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3201 /* Mic1 (rear panel) pin widget for input and vref at 80% */
3202 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3203 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3204 /* Mic2 (as headphone out) for HP output */
3205 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
3206 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3207 /* Internal Speaker */
3208 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3209 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3211 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
3212 {0x20, AC_VERB_SET_PROC_COEF
, 0x3060},
3214 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
3218 /* toggle speaker-output according to the hp-jack state */
3219 static void alc880_medion_rim_automute(struct hda_codec
*codec
)
3221 struct alc_spec
*spec
= codec
->spec
;
3222 alc_automute_amp(codec
);
3224 if (spec
->jack_present
)
3225 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
, 0);
3227 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
, 2);
3230 static void alc880_medion_rim_unsol_event(struct hda_codec
*codec
,
3233 /* Looks like the unsol event is incompatible with the standard
3234 * definition. 4bit tag is placed at 28 bit!
3236 if ((res
>> 28) == ALC880_HP_EVENT
)
3237 alc880_medion_rim_automute(codec
);
3240 static void alc880_medion_rim_setup(struct hda_codec
*codec
)
3242 struct alc_spec
*spec
= codec
->spec
;
3244 spec
->autocfg
.hp_pins
[0] = 0x14;
3245 spec
->autocfg
.speaker_pins
[0] = 0x1b;
3248 #ifdef CONFIG_SND_HDA_POWER_SAVE
3249 static struct hda_amp_list alc880_loopbacks
[] = {
3250 { 0x0b, HDA_INPUT
, 0 },
3251 { 0x0b, HDA_INPUT
, 1 },
3252 { 0x0b, HDA_INPUT
, 2 },
3253 { 0x0b, HDA_INPUT
, 3 },
3254 { 0x0b, HDA_INPUT
, 4 },
3258 static struct hda_amp_list alc880_lg_loopbacks
[] = {
3259 { 0x0b, HDA_INPUT
, 1 },
3260 { 0x0b, HDA_INPUT
, 6 },
3261 { 0x0b, HDA_INPUT
, 7 },
3270 static int alc_init(struct hda_codec
*codec
)
3272 struct alc_spec
*spec
= codec
->spec
;
3276 alc_auto_init_amp(codec
, spec
->init_amp
);
3278 for (i
= 0; i
< spec
->num_init_verbs
; i
++)
3279 snd_hda_sequence_write(codec
, spec
->init_verbs
[i
]);
3281 if (spec
->init_hook
)
3282 spec
->init_hook(codec
);
3287 static void alc_unsol_event(struct hda_codec
*codec
, unsigned int res
)
3289 struct alc_spec
*spec
= codec
->spec
;
3291 if (spec
->unsol_event
)
3292 spec
->unsol_event(codec
, res
);
3295 #ifdef CONFIG_SND_HDA_POWER_SAVE
3296 static int alc_check_power_status(struct hda_codec
*codec
, hda_nid_t nid
)
3298 struct alc_spec
*spec
= codec
->spec
;
3299 return snd_hda_check_amp_list_power(codec
, &spec
->loopback
, nid
);
3304 * Analog playback callbacks
3306 static int alc880_playback_pcm_open(struct hda_pcm_stream
*hinfo
,
3307 struct hda_codec
*codec
,
3308 struct snd_pcm_substream
*substream
)
3310 struct alc_spec
*spec
= codec
->spec
;
3311 return snd_hda_multi_out_analog_open(codec
, &spec
->multiout
, substream
,
3315 static int alc880_playback_pcm_prepare(struct hda_pcm_stream
*hinfo
,
3316 struct hda_codec
*codec
,
3317 unsigned int stream_tag
,
3318 unsigned int format
,
3319 struct snd_pcm_substream
*substream
)
3321 struct alc_spec
*spec
= codec
->spec
;
3322 return snd_hda_multi_out_analog_prepare(codec
, &spec
->multiout
,
3323 stream_tag
, format
, substream
);
3326 static int alc880_playback_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
3327 struct hda_codec
*codec
,
3328 struct snd_pcm_substream
*substream
)
3330 struct alc_spec
*spec
= codec
->spec
;
3331 return snd_hda_multi_out_analog_cleanup(codec
, &spec
->multiout
);
3337 static int alc880_dig_playback_pcm_open(struct hda_pcm_stream
*hinfo
,
3338 struct hda_codec
*codec
,
3339 struct snd_pcm_substream
*substream
)
3341 struct alc_spec
*spec
= codec
->spec
;
3342 return snd_hda_multi_out_dig_open(codec
, &spec
->multiout
);
3345 static int alc880_dig_playback_pcm_prepare(struct hda_pcm_stream
*hinfo
,
3346 struct hda_codec
*codec
,
3347 unsigned int stream_tag
,
3348 unsigned int format
,
3349 struct snd_pcm_substream
*substream
)
3351 struct alc_spec
*spec
= codec
->spec
;
3352 return snd_hda_multi_out_dig_prepare(codec
, &spec
->multiout
,
3353 stream_tag
, format
, substream
);
3356 static int alc880_dig_playback_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
3357 struct hda_codec
*codec
,
3358 struct snd_pcm_substream
*substream
)
3360 struct alc_spec
*spec
= codec
->spec
;
3361 return snd_hda_multi_out_dig_cleanup(codec
, &spec
->multiout
);
3364 static int alc880_dig_playback_pcm_close(struct hda_pcm_stream
*hinfo
,
3365 struct hda_codec
*codec
,
3366 struct snd_pcm_substream
*substream
)
3368 struct alc_spec
*spec
= codec
->spec
;
3369 return snd_hda_multi_out_dig_close(codec
, &spec
->multiout
);
3375 static int alc880_alt_capture_pcm_prepare(struct hda_pcm_stream
*hinfo
,
3376 struct hda_codec
*codec
,
3377 unsigned int stream_tag
,
3378 unsigned int format
,
3379 struct snd_pcm_substream
*substream
)
3381 struct alc_spec
*spec
= codec
->spec
;
3383 snd_hda_codec_setup_stream(codec
, spec
->adc_nids
[substream
->number
+ 1],
3384 stream_tag
, 0, format
);
3388 static int alc880_alt_capture_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
3389 struct hda_codec
*codec
,
3390 struct snd_pcm_substream
*substream
)
3392 struct alc_spec
*spec
= codec
->spec
;
3394 snd_hda_codec_cleanup_stream(codec
,
3395 spec
->adc_nids
[substream
->number
+ 1]);
3402 static struct hda_pcm_stream alc880_pcm_analog_playback
= {
3406 /* NID is set in alc_build_pcms */
3408 .open
= alc880_playback_pcm_open
,
3409 .prepare
= alc880_playback_pcm_prepare
,
3410 .cleanup
= alc880_playback_pcm_cleanup
3414 static struct hda_pcm_stream alc880_pcm_analog_capture
= {
3418 /* NID is set in alc_build_pcms */
3421 static struct hda_pcm_stream alc880_pcm_analog_alt_playback
= {
3425 /* NID is set in alc_build_pcms */
3428 static struct hda_pcm_stream alc880_pcm_analog_alt_capture
= {
3429 .substreams
= 2, /* can be overridden */
3432 /* NID is set in alc_build_pcms */
3434 .prepare
= alc880_alt_capture_pcm_prepare
,
3435 .cleanup
= alc880_alt_capture_pcm_cleanup
3439 static struct hda_pcm_stream alc880_pcm_digital_playback
= {
3443 /* NID is set in alc_build_pcms */
3445 .open
= alc880_dig_playback_pcm_open
,
3446 .close
= alc880_dig_playback_pcm_close
,
3447 .prepare
= alc880_dig_playback_pcm_prepare
,
3448 .cleanup
= alc880_dig_playback_pcm_cleanup
3452 static struct hda_pcm_stream alc880_pcm_digital_capture
= {
3456 /* NID is set in alc_build_pcms */
3459 /* Used by alc_build_pcms to flag that a PCM has no playback stream */
3460 static struct hda_pcm_stream alc_pcm_null_stream
= {
3466 static int alc_build_pcms(struct hda_codec
*codec
)
3468 struct alc_spec
*spec
= codec
->spec
;
3469 struct hda_pcm
*info
= spec
->pcm_rec
;
3472 codec
->num_pcms
= 1;
3473 codec
->pcm_info
= info
;
3475 if (spec
->no_analog
)
3478 snprintf(spec
->stream_name_analog
, sizeof(spec
->stream_name_analog
),
3479 "%s Analog", codec
->chip_name
);
3480 info
->name
= spec
->stream_name_analog
;
3482 if (spec
->stream_analog_playback
) {
3483 if (snd_BUG_ON(!spec
->multiout
.dac_nids
))
3485 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] = *(spec
->stream_analog_playback
);
3486 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].nid
= spec
->multiout
.dac_nids
[0];
3488 if (spec
->stream_analog_capture
) {
3489 if (snd_BUG_ON(!spec
->adc_nids
))
3491 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] = *(spec
->stream_analog_capture
);
3492 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].nid
= spec
->adc_nids
[0];
3495 if (spec
->channel_mode
) {
3496 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].channels_max
= 0;
3497 for (i
= 0; i
< spec
->num_channel_mode
; i
++) {
3498 if (spec
->channel_mode
[i
].channels
> info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].channels_max
) {
3499 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].channels_max
= spec
->channel_mode
[i
].channels
;
3505 /* SPDIF for stream index #1 */
3506 if (spec
->multiout
.dig_out_nid
|| spec
->dig_in_nid
) {
3507 snprintf(spec
->stream_name_digital
,
3508 sizeof(spec
->stream_name_digital
),
3509 "%s Digital", codec
->chip_name
);
3510 codec
->num_pcms
= 2;
3511 codec
->slave_dig_outs
= spec
->multiout
.slave_dig_outs
;
3512 info
= spec
->pcm_rec
+ 1;
3513 info
->name
= spec
->stream_name_digital
;
3514 if (spec
->dig_out_type
)
3515 info
->pcm_type
= spec
->dig_out_type
;
3517 info
->pcm_type
= HDA_PCM_TYPE_SPDIF
;
3518 if (spec
->multiout
.dig_out_nid
&&
3519 spec
->stream_digital_playback
) {
3520 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] = *(spec
->stream_digital_playback
);
3521 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].nid
= spec
->multiout
.dig_out_nid
;
3523 if (spec
->dig_in_nid
&&
3524 spec
->stream_digital_capture
) {
3525 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] = *(spec
->stream_digital_capture
);
3526 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].nid
= spec
->dig_in_nid
;
3528 /* FIXME: do we need this for all Realtek codec models? */
3529 codec
->spdif_status_reset
= 1;
3532 if (spec
->no_analog
)
3535 /* If the use of more than one ADC is requested for the current
3536 * model, configure a second analog capture-only PCM.
3538 /* Additional Analaog capture for index #2 */
3539 if ((spec
->alt_dac_nid
&& spec
->stream_analog_alt_playback
) ||
3540 (spec
->num_adc_nids
> 1 && spec
->stream_analog_alt_capture
)) {
3541 codec
->num_pcms
= 3;
3542 info
= spec
->pcm_rec
+ 2;
3543 info
->name
= spec
->stream_name_analog
;
3544 if (spec
->alt_dac_nid
) {
3545 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] =
3546 *spec
->stream_analog_alt_playback
;
3547 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].nid
=
3550 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
] =
3551 alc_pcm_null_stream
;
3552 info
->stream
[SNDRV_PCM_STREAM_PLAYBACK
].nid
= 0;
3554 if (spec
->num_adc_nids
> 1) {
3555 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] =
3556 *spec
->stream_analog_alt_capture
;
3557 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].nid
=
3559 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].substreams
=
3560 spec
->num_adc_nids
- 1;
3562 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
] =
3563 alc_pcm_null_stream
;
3564 info
->stream
[SNDRV_PCM_STREAM_CAPTURE
].nid
= 0;
3571 static void alc_free_kctls(struct hda_codec
*codec
)
3573 struct alc_spec
*spec
= codec
->spec
;
3575 if (spec
->kctls
.list
) {
3576 struct snd_kcontrol_new
*kctl
= spec
->kctls
.list
;
3578 for (i
= 0; i
< spec
->kctls
.used
; i
++)
3579 kfree(kctl
[i
].name
);
3581 snd_array_free(&spec
->kctls
);
3584 static void alc_free(struct hda_codec
*codec
)
3586 struct alc_spec
*spec
= codec
->spec
;
3591 alc_free_kctls(codec
);
3593 snd_hda_detach_beep_device(codec
);
3596 #ifdef SND_HDA_NEEDS_RESUME
3597 static int alc_resume(struct hda_codec
*codec
)
3599 codec
->patch_ops
.init(codec
);
3600 snd_hda_codec_resume_amp(codec
);
3601 snd_hda_codec_resume_cache(codec
);
3608 static struct hda_codec_ops alc_patch_ops
= {
3609 .build_controls
= alc_build_controls
,
3610 .build_pcms
= alc_build_pcms
,
3613 .unsol_event
= alc_unsol_event
,
3614 #ifdef SND_HDA_NEEDS_RESUME
3615 .resume
= alc_resume
,
3617 #ifdef CONFIG_SND_HDA_POWER_SAVE
3618 .check_power_status
= alc_check_power_status
,
3624 * Test configuration for debugging
3626 * Almost all inputs/outputs are enabled. I/O pins can be configured via
3629 #ifdef CONFIG_SND_DEBUG
3630 static hda_nid_t alc880_test_dac_nids
[4] = {
3631 0x02, 0x03, 0x04, 0x05
3634 static struct hda_input_mux alc880_test_capture_source
= {
3643 { "Surround", 0x6 },
3647 static struct hda_channel_mode alc880_test_modes
[4] = {
3654 static int alc_test_pin_ctl_info(struct snd_kcontrol
*kcontrol
,
3655 struct snd_ctl_elem_info
*uinfo
)
3657 static char *texts
[] = {
3658 "N/A", "Line Out", "HP Out",
3659 "In Hi-Z", "In 50%", "In Grd", "In 80%", "In 100%"
3661 uinfo
->type
= SNDRV_CTL_ELEM_TYPE_ENUMERATED
;
3663 uinfo
->value
.enumerated
.items
= 8;
3664 if (uinfo
->value
.enumerated
.item
>= 8)
3665 uinfo
->value
.enumerated
.item
= 7;
3666 strcpy(uinfo
->value
.enumerated
.name
, texts
[uinfo
->value
.enumerated
.item
]);
3670 static int alc_test_pin_ctl_get(struct snd_kcontrol
*kcontrol
,
3671 struct snd_ctl_elem_value
*ucontrol
)
3673 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
3674 hda_nid_t nid
= (hda_nid_t
)kcontrol
->private_value
;
3675 unsigned int pin_ctl
, item
= 0;
3677 pin_ctl
= snd_hda_codec_read(codec
, nid
, 0,
3678 AC_VERB_GET_PIN_WIDGET_CONTROL
, 0);
3679 if (pin_ctl
& AC_PINCTL_OUT_EN
) {
3680 if (pin_ctl
& AC_PINCTL_HP_EN
)
3684 } else if (pin_ctl
& AC_PINCTL_IN_EN
) {
3685 switch (pin_ctl
& AC_PINCTL_VREFEN
) {
3686 case AC_PINCTL_VREF_HIZ
: item
= 3; break;
3687 case AC_PINCTL_VREF_50
: item
= 4; break;
3688 case AC_PINCTL_VREF_GRD
: item
= 5; break;
3689 case AC_PINCTL_VREF_80
: item
= 6; break;
3690 case AC_PINCTL_VREF_100
: item
= 7; break;
3693 ucontrol
->value
.enumerated
.item
[0] = item
;
3697 static int alc_test_pin_ctl_put(struct snd_kcontrol
*kcontrol
,
3698 struct snd_ctl_elem_value
*ucontrol
)
3700 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
3701 hda_nid_t nid
= (hda_nid_t
)kcontrol
->private_value
;
3702 static unsigned int ctls
[] = {
3703 0, AC_PINCTL_OUT_EN
, AC_PINCTL_OUT_EN
| AC_PINCTL_HP_EN
,
3704 AC_PINCTL_IN_EN
| AC_PINCTL_VREF_HIZ
,
3705 AC_PINCTL_IN_EN
| AC_PINCTL_VREF_50
,
3706 AC_PINCTL_IN_EN
| AC_PINCTL_VREF_GRD
,
3707 AC_PINCTL_IN_EN
| AC_PINCTL_VREF_80
,
3708 AC_PINCTL_IN_EN
| AC_PINCTL_VREF_100
,
3710 unsigned int old_ctl
, new_ctl
;
3712 old_ctl
= snd_hda_codec_read(codec
, nid
, 0,
3713 AC_VERB_GET_PIN_WIDGET_CONTROL
, 0);
3714 new_ctl
= ctls
[ucontrol
->value
.enumerated
.item
[0]];
3715 if (old_ctl
!= new_ctl
) {
3717 snd_hda_codec_write_cache(codec
, nid
, 0,
3718 AC_VERB_SET_PIN_WIDGET_CONTROL
,
3720 val
= ucontrol
->value
.enumerated
.item
[0] >= 3 ?
3722 snd_hda_codec_amp_stereo(codec
, nid
, HDA_OUTPUT
, 0,
3729 static int alc_test_pin_src_info(struct snd_kcontrol
*kcontrol
,
3730 struct snd_ctl_elem_info
*uinfo
)
3732 static char *texts
[] = {
3733 "Front", "Surround", "CLFE", "Side"
3735 uinfo
->type
= SNDRV_CTL_ELEM_TYPE_ENUMERATED
;
3737 uinfo
->value
.enumerated
.items
= 4;
3738 if (uinfo
->value
.enumerated
.item
>= 4)
3739 uinfo
->value
.enumerated
.item
= 3;
3740 strcpy(uinfo
->value
.enumerated
.name
, texts
[uinfo
->value
.enumerated
.item
]);
3744 static int alc_test_pin_src_get(struct snd_kcontrol
*kcontrol
,
3745 struct snd_ctl_elem_value
*ucontrol
)
3747 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
3748 hda_nid_t nid
= (hda_nid_t
)kcontrol
->private_value
;
3751 sel
= snd_hda_codec_read(codec
, nid
, 0, AC_VERB_GET_CONNECT_SEL
, 0);
3752 ucontrol
->value
.enumerated
.item
[0] = sel
& 3;
3756 static int alc_test_pin_src_put(struct snd_kcontrol
*kcontrol
,
3757 struct snd_ctl_elem_value
*ucontrol
)
3759 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
3760 hda_nid_t nid
= (hda_nid_t
)kcontrol
->private_value
;
3763 sel
= snd_hda_codec_read(codec
, nid
, 0, AC_VERB_GET_CONNECT_SEL
, 0) & 3;
3764 if (ucontrol
->value
.enumerated
.item
[0] != sel
) {
3765 sel
= ucontrol
->value
.enumerated
.item
[0] & 3;
3766 snd_hda_codec_write_cache(codec
, nid
, 0,
3767 AC_VERB_SET_CONNECT_SEL
, sel
);
3773 #define PIN_CTL_TEST(xname,nid) { \
3774 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
3776 .info = alc_test_pin_ctl_info, \
3777 .get = alc_test_pin_ctl_get, \
3778 .put = alc_test_pin_ctl_put, \
3779 .private_value = nid \
3782 #define PIN_SRC_TEST(xname,nid) { \
3783 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
3785 .info = alc_test_pin_src_info, \
3786 .get = alc_test_pin_src_get, \
3787 .put = alc_test_pin_src_put, \
3788 .private_value = nid \
3791 static struct snd_kcontrol_new alc880_test_mixer
[] = {
3792 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
3793 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
3794 HDA_CODEC_VOLUME("CLFE Playback Volume", 0x0e, 0x0, HDA_OUTPUT
),
3795 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
3796 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
3797 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
3798 HDA_BIND_MUTE("CLFE Playback Switch", 0x0e, 2, HDA_INPUT
),
3799 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
3800 PIN_CTL_TEST("Front Pin Mode", 0x14),
3801 PIN_CTL_TEST("Surround Pin Mode", 0x15),
3802 PIN_CTL_TEST("CLFE Pin Mode", 0x16),
3803 PIN_CTL_TEST("Side Pin Mode", 0x17),
3804 PIN_CTL_TEST("In-1 Pin Mode", 0x18),
3805 PIN_CTL_TEST("In-2 Pin Mode", 0x19),
3806 PIN_CTL_TEST("In-3 Pin Mode", 0x1a),
3807 PIN_CTL_TEST("In-4 Pin Mode", 0x1b),
3808 PIN_SRC_TEST("In-1 Pin Source", 0x18),
3809 PIN_SRC_TEST("In-2 Pin Source", 0x19),
3810 PIN_SRC_TEST("In-3 Pin Source", 0x1a),
3811 PIN_SRC_TEST("In-4 Pin Source", 0x1b),
3812 HDA_CODEC_VOLUME("In-1 Playback Volume", 0x0b, 0x0, HDA_INPUT
),
3813 HDA_CODEC_MUTE("In-1 Playback Switch", 0x0b, 0x0, HDA_INPUT
),
3814 HDA_CODEC_VOLUME("In-2 Playback Volume", 0x0b, 0x1, HDA_INPUT
),
3815 HDA_CODEC_MUTE("In-2 Playback Switch", 0x0b, 0x1, HDA_INPUT
),
3816 HDA_CODEC_VOLUME("In-3 Playback Volume", 0x0b, 0x2, HDA_INPUT
),
3817 HDA_CODEC_MUTE("In-3 Playback Switch", 0x0b, 0x2, HDA_INPUT
),
3818 HDA_CODEC_VOLUME("In-4 Playback Volume", 0x0b, 0x3, HDA_INPUT
),
3819 HDA_CODEC_MUTE("In-4 Playback Switch", 0x0b, 0x3, HDA_INPUT
),
3820 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x4, HDA_INPUT
),
3821 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x4, HDA_INPUT
),
3823 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
3824 .name
= "Channel Mode",
3825 .info
= alc_ch_mode_info
,
3826 .get
= alc_ch_mode_get
,
3827 .put
= alc_ch_mode_put
,
3832 static struct hda_verb alc880_test_init_verbs
[] = {
3833 /* Unmute inputs of 0x0c - 0x0f */
3834 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3835 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3836 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3837 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3838 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3839 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3840 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
3841 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
3842 /* Vol output for 0x0c-0x0f */
3843 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
3844 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
3845 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
3846 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
3847 /* Set output pins 0x14-0x17 */
3848 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3849 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3850 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3851 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
3852 /* Unmute output pins 0x14-0x17 */
3853 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3854 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3855 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3856 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
3857 /* Set input pins 0x18-0x1c */
3858 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3859 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
3860 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3861 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3862 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
3863 /* Mute input pins 0x18-0x1b */
3864 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3865 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3866 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3867 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
3869 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
3870 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
3871 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
3872 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
3873 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
3874 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
3875 /* Analog input/passthru */
3876 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
3877 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
3878 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
3879 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
3880 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
3888 static const char *alc880_models
[ALC880_MODEL_LAST
] = {
3889 [ALC880_3ST
] = "3stack",
3890 [ALC880_TCL_S700
] = "tcl",
3891 [ALC880_3ST_DIG
] = "3stack-digout",
3892 [ALC880_CLEVO
] = "clevo",
3893 [ALC880_5ST
] = "5stack",
3894 [ALC880_5ST_DIG
] = "5stack-digout",
3895 [ALC880_W810
] = "w810",
3896 [ALC880_Z71V
] = "z71v",
3897 [ALC880_6ST
] = "6stack",
3898 [ALC880_6ST_DIG
] = "6stack-digout",
3899 [ALC880_ASUS
] = "asus",
3900 [ALC880_ASUS_W1V
] = "asus-w1v",
3901 [ALC880_ASUS_DIG
] = "asus-dig",
3902 [ALC880_ASUS_DIG2
] = "asus-dig2",
3903 [ALC880_UNIWILL_DIG
] = "uniwill",
3904 [ALC880_UNIWILL_P53
] = "uniwill-p53",
3905 [ALC880_FUJITSU
] = "fujitsu",
3906 [ALC880_F1734
] = "F1734",
3908 [ALC880_LG_LW
] = "lg-lw",
3909 [ALC880_MEDION_RIM
] = "medion",
3910 #ifdef CONFIG_SND_DEBUG
3911 [ALC880_TEST
] = "test",
3913 [ALC880_AUTO
] = "auto",
3916 static struct snd_pci_quirk alc880_cfg_tbl
[] = {
3917 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_W810
),
3918 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_5ST_DIG
),
3919 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_6ST
),
3920 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_3ST_DIG
),
3921 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_6ST_DIG
),
3922 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_6ST_DIG
),
3923 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_6ST_DIG
),
3924 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG
),
3925 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST
),
3926 SND_PCI_QUIRK(0x1039, 0x1234, NULL
, ALC880_6ST_DIG
),
3927 SND_PCI_QUIRK(0x103c, 0x2a09, "HP", ALC880_5ST
),
3928 SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V
),
3929 SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG
),
3930 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG
),
3931 SND_PCI_QUIRK(0x1043, 0x1113, "ASUS", ALC880_ASUS_DIG
),
3932 SND_PCI_QUIRK(0x1043, 0x1123, "ASUS", ALC880_ASUS_DIG
),
3933 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS", ALC880_ASUS_DIG
),
3934 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_Z71V
),
3935 /* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */
3936 SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG
),
3937 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG
),
3938 SND_PCI_QUIRK(0x1043, 0x814e, "ASUS P5GD1 w/SPDIF", ALC880_6ST_DIG
),
3939 SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG
),
3940 SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST
),
3941 SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST
),
3942 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_ASUS
), /* default ASUS */
3943 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_3ST
),
3944 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_3ST
),
3945 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_5ST
),
3946 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_5ST
),
3947 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_5ST
),
3948 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_6ST_DIG
),
3949 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_6ST_DIG
),
3950 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_6ST_DIG
),
3951 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_6ST_DIG
),
3952 SND_PCI_QUIRK(0x1558, 0x0520, "Clevo m520G", ALC880_CLEVO
),
3953 SND_PCI_QUIRK(0x1558, 0x0660, "Clevo m655n", ALC880_CLEVO
),
3954 SND_PCI_QUIRK(0x1558, 0x5401, "ASUS", ALC880_ASUS_DIG2
),
3955 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_5ST_DIG
),
3956 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_UNIWILL_DIG
),
3957 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwlll", ALC880_F1734
),
3958 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_UNIWILL
),
3959 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_UNIWILL_P53
),
3960 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_W810
),
3961 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_MEDION_RIM
),
3962 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_5ST_DIG
),
3963 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG
),
3964 SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_F1734
),
3965 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FUJITSU
),
3966 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC", ALC880_UNIWILL
),
3967 SND_PCI_QUIRK(0x1734, 0x10b0, "Fujitsu", ALC880_FUJITSU
),
3968 SND_PCI_QUIRK(0x1854, 0x0018, "LG LW20", ALC880_LG_LW
),
3969 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG
),
3970 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_LG
),
3971 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_LG_LW
),
3972 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_TCL_S700
),
3973 SND_PCI_QUIRK(0x2668, 0x8086, NULL
, ALC880_6ST_DIG
), /* broken BIOS */
3974 SND_PCI_QUIRK(0x8086, 0x2668, NULL
, ALC880_6ST_DIG
),
3975 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_5ST_DIG
),
3976 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_5ST_DIG
),
3977 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_5ST_DIG
),
3978 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_3ST_DIG
),
3979 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_5ST_DIG
),
3980 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_3ST_DIG
),
3981 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_3ST_DIG
),
3982 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_5ST_DIG
),
3983 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_5ST_DIG
),
3984 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_5ST_DIG
),
3986 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_3ST
),
3987 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_5ST_DIG
),
3988 SND_PCI_QUIRK(0xe803, 0x1019, NULL
, ALC880_6ST_DIG
),
3993 * ALC880 codec presets
3995 static struct alc_config_preset alc880_presets
[] = {
3997 .mixers
= { alc880_three_stack_mixer
},
3998 .init_verbs
= { alc880_volume_init_verbs
,
3999 alc880_pin_3stack_init_verbs
},
4000 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4001 .dac_nids
= alc880_dac_nids
,
4002 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
4003 .channel_mode
= alc880_threestack_modes
,
4005 .input_mux
= &alc880_capture_source
,
4007 [ALC880_3ST_DIG
] = {
4008 .mixers
= { alc880_three_stack_mixer
},
4009 .init_verbs
= { alc880_volume_init_verbs
,
4010 alc880_pin_3stack_init_verbs
},
4011 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4012 .dac_nids
= alc880_dac_nids
,
4013 .dig_out_nid
= ALC880_DIGOUT_NID
,
4014 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
4015 .channel_mode
= alc880_threestack_modes
,
4017 .input_mux
= &alc880_capture_source
,
4019 [ALC880_TCL_S700
] = {
4020 .mixers
= { alc880_tcl_s700_mixer
},
4021 .init_verbs
= { alc880_volume_init_verbs
,
4022 alc880_pin_tcl_S700_init_verbs
,
4023 alc880_gpio2_init_verbs
},
4024 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4025 .dac_nids
= alc880_dac_nids
,
4026 .adc_nids
= alc880_adc_nids_alt
, /* FIXME: correct? */
4027 .num_adc_nids
= 1, /* single ADC */
4029 .num_channel_mode
= ARRAY_SIZE(alc880_2_jack_modes
),
4030 .channel_mode
= alc880_2_jack_modes
,
4031 .input_mux
= &alc880_capture_source
,
4034 .mixers
= { alc880_three_stack_mixer
,
4035 alc880_five_stack_mixer
},
4036 .init_verbs
= { alc880_volume_init_verbs
,
4037 alc880_pin_5stack_init_verbs
},
4038 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4039 .dac_nids
= alc880_dac_nids
,
4040 .num_channel_mode
= ARRAY_SIZE(alc880_fivestack_modes
),
4041 .channel_mode
= alc880_fivestack_modes
,
4042 .input_mux
= &alc880_capture_source
,
4044 [ALC880_5ST_DIG
] = {
4045 .mixers
= { alc880_three_stack_mixer
,
4046 alc880_five_stack_mixer
},
4047 .init_verbs
= { alc880_volume_init_verbs
,
4048 alc880_pin_5stack_init_verbs
},
4049 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4050 .dac_nids
= alc880_dac_nids
,
4051 .dig_out_nid
= ALC880_DIGOUT_NID
,
4052 .num_channel_mode
= ARRAY_SIZE(alc880_fivestack_modes
),
4053 .channel_mode
= alc880_fivestack_modes
,
4054 .input_mux
= &alc880_capture_source
,
4057 .mixers
= { alc880_six_stack_mixer
},
4058 .init_verbs
= { alc880_volume_init_verbs
,
4059 alc880_pin_6stack_init_verbs
},
4060 .num_dacs
= ARRAY_SIZE(alc880_6st_dac_nids
),
4061 .dac_nids
= alc880_6st_dac_nids
,
4062 .num_channel_mode
= ARRAY_SIZE(alc880_sixstack_modes
),
4063 .channel_mode
= alc880_sixstack_modes
,
4064 .input_mux
= &alc880_6stack_capture_source
,
4066 [ALC880_6ST_DIG
] = {
4067 .mixers
= { alc880_six_stack_mixer
},
4068 .init_verbs
= { alc880_volume_init_verbs
,
4069 alc880_pin_6stack_init_verbs
},
4070 .num_dacs
= ARRAY_SIZE(alc880_6st_dac_nids
),
4071 .dac_nids
= alc880_6st_dac_nids
,
4072 .dig_out_nid
= ALC880_DIGOUT_NID
,
4073 .num_channel_mode
= ARRAY_SIZE(alc880_sixstack_modes
),
4074 .channel_mode
= alc880_sixstack_modes
,
4075 .input_mux
= &alc880_6stack_capture_source
,
4078 .mixers
= { alc880_w810_base_mixer
},
4079 .init_verbs
= { alc880_volume_init_verbs
,
4080 alc880_pin_w810_init_verbs
,
4081 alc880_gpio2_init_verbs
},
4082 .num_dacs
= ARRAY_SIZE(alc880_w810_dac_nids
),
4083 .dac_nids
= alc880_w810_dac_nids
,
4084 .dig_out_nid
= ALC880_DIGOUT_NID
,
4085 .num_channel_mode
= ARRAY_SIZE(alc880_w810_modes
),
4086 .channel_mode
= alc880_w810_modes
,
4087 .input_mux
= &alc880_capture_source
,
4090 .mixers
= { alc880_z71v_mixer
},
4091 .init_verbs
= { alc880_volume_init_verbs
,
4092 alc880_pin_z71v_init_verbs
},
4093 .num_dacs
= ARRAY_SIZE(alc880_z71v_dac_nids
),
4094 .dac_nids
= alc880_z71v_dac_nids
,
4095 .dig_out_nid
= ALC880_DIGOUT_NID
,
4097 .num_channel_mode
= ARRAY_SIZE(alc880_2_jack_modes
),
4098 .channel_mode
= alc880_2_jack_modes
,
4099 .input_mux
= &alc880_capture_source
,
4102 .mixers
= { alc880_f1734_mixer
},
4103 .init_verbs
= { alc880_volume_init_verbs
,
4104 alc880_pin_f1734_init_verbs
},
4105 .num_dacs
= ARRAY_SIZE(alc880_f1734_dac_nids
),
4106 .dac_nids
= alc880_f1734_dac_nids
,
4108 .num_channel_mode
= ARRAY_SIZE(alc880_2_jack_modes
),
4109 .channel_mode
= alc880_2_jack_modes
,
4110 .input_mux
= &alc880_f1734_capture_source
,
4111 .unsol_event
= alc880_uniwill_p53_unsol_event
,
4112 .setup
= alc880_uniwill_p53_setup
,
4113 .init_hook
= alc_automute_amp
,
4116 .mixers
= { alc880_asus_mixer
},
4117 .init_verbs
= { alc880_volume_init_verbs
,
4118 alc880_pin_asus_init_verbs
,
4119 alc880_gpio1_init_verbs
},
4120 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4121 .dac_nids
= alc880_asus_dac_nids
,
4122 .num_channel_mode
= ARRAY_SIZE(alc880_asus_modes
),
4123 .channel_mode
= alc880_asus_modes
,
4125 .input_mux
= &alc880_capture_source
,
4127 [ALC880_ASUS_DIG
] = {
4128 .mixers
= { alc880_asus_mixer
},
4129 .init_verbs
= { alc880_volume_init_verbs
,
4130 alc880_pin_asus_init_verbs
,
4131 alc880_gpio1_init_verbs
},
4132 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4133 .dac_nids
= alc880_asus_dac_nids
,
4134 .dig_out_nid
= ALC880_DIGOUT_NID
,
4135 .num_channel_mode
= ARRAY_SIZE(alc880_asus_modes
),
4136 .channel_mode
= alc880_asus_modes
,
4138 .input_mux
= &alc880_capture_source
,
4140 [ALC880_ASUS_DIG2
] = {
4141 .mixers
= { alc880_asus_mixer
},
4142 .init_verbs
= { alc880_volume_init_verbs
,
4143 alc880_pin_asus_init_verbs
,
4144 alc880_gpio2_init_verbs
}, /* use GPIO2 */
4145 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4146 .dac_nids
= alc880_asus_dac_nids
,
4147 .dig_out_nid
= ALC880_DIGOUT_NID
,
4148 .num_channel_mode
= ARRAY_SIZE(alc880_asus_modes
),
4149 .channel_mode
= alc880_asus_modes
,
4151 .input_mux
= &alc880_capture_source
,
4153 [ALC880_ASUS_W1V
] = {
4154 .mixers
= { alc880_asus_mixer
, alc880_asus_w1v_mixer
},
4155 .init_verbs
= { alc880_volume_init_verbs
,
4156 alc880_pin_asus_init_verbs
,
4157 alc880_gpio1_init_verbs
},
4158 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4159 .dac_nids
= alc880_asus_dac_nids
,
4160 .dig_out_nid
= ALC880_DIGOUT_NID
,
4161 .num_channel_mode
= ARRAY_SIZE(alc880_asus_modes
),
4162 .channel_mode
= alc880_asus_modes
,
4164 .input_mux
= &alc880_capture_source
,
4166 [ALC880_UNIWILL_DIG
] = {
4167 .mixers
= { alc880_asus_mixer
},
4168 .init_verbs
= { alc880_volume_init_verbs
,
4169 alc880_pin_asus_init_verbs
},
4170 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4171 .dac_nids
= alc880_asus_dac_nids
,
4172 .dig_out_nid
= ALC880_DIGOUT_NID
,
4173 .num_channel_mode
= ARRAY_SIZE(alc880_asus_modes
),
4174 .channel_mode
= alc880_asus_modes
,
4176 .input_mux
= &alc880_capture_source
,
4178 [ALC880_UNIWILL
] = {
4179 .mixers
= { alc880_uniwill_mixer
},
4180 .init_verbs
= { alc880_volume_init_verbs
,
4181 alc880_uniwill_init_verbs
},
4182 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4183 .dac_nids
= alc880_asus_dac_nids
,
4184 .dig_out_nid
= ALC880_DIGOUT_NID
,
4185 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
4186 .channel_mode
= alc880_threestack_modes
,
4188 .input_mux
= &alc880_capture_source
,
4189 .unsol_event
= alc880_uniwill_unsol_event
,
4190 .setup
= alc880_uniwill_setup
,
4191 .init_hook
= alc880_uniwill_init_hook
,
4193 [ALC880_UNIWILL_P53
] = {
4194 .mixers
= { alc880_uniwill_p53_mixer
},
4195 .init_verbs
= { alc880_volume_init_verbs
,
4196 alc880_uniwill_p53_init_verbs
},
4197 .num_dacs
= ARRAY_SIZE(alc880_asus_dac_nids
),
4198 .dac_nids
= alc880_asus_dac_nids
,
4199 .num_channel_mode
= ARRAY_SIZE(alc880_w810_modes
),
4200 .channel_mode
= alc880_threestack_modes
,
4201 .input_mux
= &alc880_capture_source
,
4202 .unsol_event
= alc880_uniwill_p53_unsol_event
,
4203 .setup
= alc880_uniwill_p53_setup
,
4204 .init_hook
= alc_automute_amp
,
4206 [ALC880_FUJITSU
] = {
4207 .mixers
= { alc880_fujitsu_mixer
},
4208 .init_verbs
= { alc880_volume_init_verbs
,
4209 alc880_uniwill_p53_init_verbs
,
4210 alc880_beep_init_verbs
},
4211 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4212 .dac_nids
= alc880_dac_nids
,
4213 .dig_out_nid
= ALC880_DIGOUT_NID
,
4214 .num_channel_mode
= ARRAY_SIZE(alc880_2_jack_modes
),
4215 .channel_mode
= alc880_2_jack_modes
,
4216 .input_mux
= &alc880_capture_source
,
4217 .unsol_event
= alc880_uniwill_p53_unsol_event
,
4218 .setup
= alc880_uniwill_p53_setup
,
4219 .init_hook
= alc_automute_amp
,
4222 .mixers
= { alc880_three_stack_mixer
},
4223 .init_verbs
= { alc880_volume_init_verbs
,
4224 alc880_pin_clevo_init_verbs
},
4225 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4226 .dac_nids
= alc880_dac_nids
,
4228 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
4229 .channel_mode
= alc880_threestack_modes
,
4231 .input_mux
= &alc880_capture_source
,
4234 .mixers
= { alc880_lg_mixer
},
4235 .init_verbs
= { alc880_volume_init_verbs
,
4236 alc880_lg_init_verbs
},
4237 .num_dacs
= ARRAY_SIZE(alc880_lg_dac_nids
),
4238 .dac_nids
= alc880_lg_dac_nids
,
4239 .dig_out_nid
= ALC880_DIGOUT_NID
,
4240 .num_channel_mode
= ARRAY_SIZE(alc880_lg_ch_modes
),
4241 .channel_mode
= alc880_lg_ch_modes
,
4243 .input_mux
= &alc880_lg_capture_source
,
4244 .unsol_event
= alc_automute_amp_unsol_event
,
4245 .setup
= alc880_lg_setup
,
4246 .init_hook
= alc_automute_amp
,
4247 #ifdef CONFIG_SND_HDA_POWER_SAVE
4248 .loopbacks
= alc880_lg_loopbacks
,
4252 .mixers
= { alc880_lg_lw_mixer
},
4253 .init_verbs
= { alc880_volume_init_verbs
,
4254 alc880_lg_lw_init_verbs
},
4255 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4256 .dac_nids
= alc880_dac_nids
,
4257 .dig_out_nid
= ALC880_DIGOUT_NID
,
4258 .num_channel_mode
= ARRAY_SIZE(alc880_lg_lw_modes
),
4259 .channel_mode
= alc880_lg_lw_modes
,
4260 .input_mux
= &alc880_lg_lw_capture_source
,
4261 .unsol_event
= alc_automute_amp_unsol_event
,
4262 .setup
= alc880_lg_lw_setup
,
4263 .init_hook
= alc_automute_amp
,
4265 [ALC880_MEDION_RIM
] = {
4266 .mixers
= { alc880_medion_rim_mixer
},
4267 .init_verbs
= { alc880_volume_init_verbs
,
4268 alc880_medion_rim_init_verbs
,
4269 alc_gpio2_init_verbs
},
4270 .num_dacs
= ARRAY_SIZE(alc880_dac_nids
),
4271 .dac_nids
= alc880_dac_nids
,
4272 .dig_out_nid
= ALC880_DIGOUT_NID
,
4273 .num_channel_mode
= ARRAY_SIZE(alc880_2_jack_modes
),
4274 .channel_mode
= alc880_2_jack_modes
,
4275 .input_mux
= &alc880_medion_rim_capture_source
,
4276 .unsol_event
= alc880_medion_rim_unsol_event
,
4277 .setup
= alc880_medion_rim_setup
,
4278 .init_hook
= alc880_medion_rim_automute
,
4280 #ifdef CONFIG_SND_DEBUG
4282 .mixers
= { alc880_test_mixer
},
4283 .init_verbs
= { alc880_test_init_verbs
},
4284 .num_dacs
= ARRAY_SIZE(alc880_test_dac_nids
),
4285 .dac_nids
= alc880_test_dac_nids
,
4286 .dig_out_nid
= ALC880_DIGOUT_NID
,
4287 .num_channel_mode
= ARRAY_SIZE(alc880_test_modes
),
4288 .channel_mode
= alc880_test_modes
,
4289 .input_mux
= &alc880_test_capture_source
,
4295 * Automatic parse of I/O pins from the BIOS configuration
4300 ALC_CTL_WIDGET_MUTE
,
4303 static struct snd_kcontrol_new alc880_control_templates
[] = {
4304 HDA_CODEC_VOLUME(NULL
, 0, 0, 0),
4305 HDA_CODEC_MUTE(NULL
, 0, 0, 0),
4306 HDA_BIND_MUTE(NULL
, 0, 0, 0),
4309 /* add dynamic controls */
4310 static int add_control(struct alc_spec
*spec
, int type
, const char *name
,
4313 struct snd_kcontrol_new
*knew
;
4315 snd_array_init(&spec
->kctls
, sizeof(*knew
), 32);
4316 knew
= snd_array_new(&spec
->kctls
);
4319 *knew
= alc880_control_templates
[type
];
4320 knew
->name
= kstrdup(name
, GFP_KERNEL
);
4323 knew
->private_value
= val
;
4327 #define alc880_is_fixed_pin(nid) ((nid) >= 0x14 && (nid) <= 0x17)
4328 #define alc880_fixed_pin_idx(nid) ((nid) - 0x14)
4329 #define alc880_is_multi_pin(nid) ((nid) >= 0x18)
4330 #define alc880_multi_pin_idx(nid) ((nid) - 0x18)
4331 #define alc880_idx_to_dac(nid) ((nid) + 0x02)
4332 #define alc880_dac_to_idx(nid) ((nid) - 0x02)
4333 #define alc880_idx_to_mixer(nid) ((nid) + 0x0c)
4334 #define alc880_idx_to_selector(nid) ((nid) + 0x10)
4335 #define ALC880_PIN_CD_NID 0x1c
4337 /* fill in the dac_nids table from the parsed pin configuration */
4338 static int alc880_auto_fill_dac_nids(struct alc_spec
*spec
,
4339 const struct auto_pin_cfg
*cfg
)
4345 memset(assigned
, 0, sizeof(assigned
));
4346 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
4348 /* check the pins hardwired to audio widget */
4349 for (i
= 0; i
< cfg
->line_outs
; i
++) {
4350 nid
= cfg
->line_out_pins
[i
];
4351 if (alc880_is_fixed_pin(nid
)) {
4352 int idx
= alc880_fixed_pin_idx(nid
);
4353 spec
->multiout
.dac_nids
[i
] = alc880_idx_to_dac(idx
);
4357 /* left pins can be connect to any audio widget */
4358 for (i
= 0; i
< cfg
->line_outs
; i
++) {
4359 nid
= cfg
->line_out_pins
[i
];
4360 if (alc880_is_fixed_pin(nid
))
4362 /* search for an empty channel */
4363 for (j
= 0; j
< cfg
->line_outs
; j
++) {
4365 spec
->multiout
.dac_nids
[i
] =
4366 alc880_idx_to_dac(j
);
4372 spec
->multiout
.num_dacs
= cfg
->line_outs
;
4376 /* add playback controls from the parsed DAC table */
4377 static int alc880_auto_create_multi_out_ctls(struct alc_spec
*spec
,
4378 const struct auto_pin_cfg
*cfg
)
4381 static const char *chname
[4] = {
4382 "Front", "Surround", NULL
/*CLFE*/, "Side"
4387 for (i
= 0; i
< cfg
->line_outs
; i
++) {
4388 if (!spec
->multiout
.dac_nids
[i
])
4390 nid
= alc880_idx_to_mixer(alc880_dac_to_idx(spec
->multiout
.dac_nids
[i
]));
4393 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
,
4394 "Center Playback Volume",
4395 HDA_COMPOSE_AMP_VAL(nid
, 1, 0,
4399 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
,
4400 "LFE Playback Volume",
4401 HDA_COMPOSE_AMP_VAL(nid
, 2, 0,
4405 err
= add_control(spec
, ALC_CTL_BIND_MUTE
,
4406 "Center Playback Switch",
4407 HDA_COMPOSE_AMP_VAL(nid
, 1, 2,
4411 err
= add_control(spec
, ALC_CTL_BIND_MUTE
,
4412 "LFE Playback Switch",
4413 HDA_COMPOSE_AMP_VAL(nid
, 2, 2,
4419 if (cfg
->line_outs
== 1 &&
4420 cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
4424 sprintf(name
, "%s Playback Volume", pfx
);
4425 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
, name
,
4426 HDA_COMPOSE_AMP_VAL(nid
, 3, 0,
4430 sprintf(name
, "%s Playback Switch", pfx
);
4431 err
= add_control(spec
, ALC_CTL_BIND_MUTE
, name
,
4432 HDA_COMPOSE_AMP_VAL(nid
, 3, 2,
4441 /* add playback controls for speaker and HP outputs */
4442 static int alc880_auto_create_extra_out(struct alc_spec
*spec
, hda_nid_t pin
,
4452 if (alc880_is_fixed_pin(pin
)) {
4453 nid
= alc880_idx_to_dac(alc880_fixed_pin_idx(pin
));
4454 /* specify the DAC as the extra output */
4455 if (!spec
->multiout
.hp_nid
)
4456 spec
->multiout
.hp_nid
= nid
;
4458 spec
->multiout
.extra_out_nid
[0] = nid
;
4459 /* control HP volume/switch on the output mixer amp */
4460 nid
= alc880_idx_to_mixer(alc880_fixed_pin_idx(pin
));
4461 sprintf(name
, "%s Playback Volume", pfx
);
4462 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
, name
,
4463 HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_OUTPUT
));
4466 sprintf(name
, "%s Playback Switch", pfx
);
4467 err
= add_control(spec
, ALC_CTL_BIND_MUTE
, name
,
4468 HDA_COMPOSE_AMP_VAL(nid
, 3, 2, HDA_INPUT
));
4471 } else if (alc880_is_multi_pin(pin
)) {
4472 /* set manual connection */
4473 /* we have only a switch on HP-out PIN */
4474 sprintf(name
, "%s Playback Switch", pfx
);
4475 err
= add_control(spec
, ALC_CTL_WIDGET_MUTE
, name
,
4476 HDA_COMPOSE_AMP_VAL(pin
, 3, 0, HDA_OUTPUT
));
4483 /* create input playback/capture controls for the given pin */
4484 static int new_analog_input(struct alc_spec
*spec
, hda_nid_t pin
,
4485 const char *ctlname
,
4486 int idx
, hda_nid_t mix_nid
)
4491 sprintf(name
, "%s Playback Volume", ctlname
);
4492 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
, name
,
4493 HDA_COMPOSE_AMP_VAL(mix_nid
, 3, idx
, HDA_INPUT
));
4496 sprintf(name
, "%s Playback Switch", ctlname
);
4497 err
= add_control(spec
, ALC_CTL_WIDGET_MUTE
, name
,
4498 HDA_COMPOSE_AMP_VAL(mix_nid
, 3, idx
, HDA_INPUT
));
4504 static int alc_is_input_pin(struct hda_codec
*codec
, hda_nid_t nid
)
4506 unsigned int pincap
= snd_hda_query_pin_caps(codec
, nid
);
4507 return (pincap
& AC_PINCAP_IN
) != 0;
4510 /* create playback/capture controls for input pins */
4511 static int alc_auto_create_input_ctls(struct hda_codec
*codec
,
4512 const struct auto_pin_cfg
*cfg
,
4514 hda_nid_t cap1
, hda_nid_t cap2
)
4516 struct alc_spec
*spec
= codec
->spec
;
4517 struct hda_input_mux
*imux
= &spec
->private_imux
[0];
4520 for (i
= 0; i
< AUTO_PIN_LAST
; i
++) {
4523 pin
= cfg
->input_pins
[i
];
4524 if (!alc_is_input_pin(codec
, pin
))
4528 idx
= get_connection_index(codec
, mixer
, pin
);
4530 err
= new_analog_input(spec
, pin
,
4531 auto_pin_cfg_labels
[i
],
4540 idx
= get_connection_index(codec
, cap1
, pin
);
4541 if (idx
< 0 && cap2
)
4542 idx
= get_connection_index(codec
, cap2
, pin
);
4544 imux
->items
[imux
->num_items
].label
=
4545 auto_pin_cfg_labels
[i
];
4546 imux
->items
[imux
->num_items
].index
= idx
;
4553 static int alc880_auto_create_input_ctls(struct hda_codec
*codec
,
4554 const struct auto_pin_cfg
*cfg
)
4556 return alc_auto_create_input_ctls(codec
, cfg
, 0x0b, 0x08, 0x09);
4559 static void alc_set_pin_output(struct hda_codec
*codec
, hda_nid_t nid
,
4560 unsigned int pin_type
)
4562 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
4565 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_AMP_GAIN_MUTE
,
4569 static void alc880_auto_set_output_and_unmute(struct hda_codec
*codec
,
4570 hda_nid_t nid
, int pin_type
,
4573 alc_set_pin_output(codec
, nid
, pin_type
);
4574 /* need the manual connection? */
4575 if (alc880_is_multi_pin(nid
)) {
4576 struct alc_spec
*spec
= codec
->spec
;
4577 int idx
= alc880_multi_pin_idx(nid
);
4578 snd_hda_codec_write(codec
, alc880_idx_to_selector(idx
), 0,
4579 AC_VERB_SET_CONNECT_SEL
,
4580 alc880_dac_to_idx(spec
->multiout
.dac_nids
[dac_idx
]));
4584 static int get_pin_type(int line_out_type
)
4586 if (line_out_type
== AUTO_PIN_HP_OUT
)
4592 static void alc880_auto_init_multi_out(struct hda_codec
*codec
)
4594 struct alc_spec
*spec
= codec
->spec
;
4597 for (i
= 0; i
< spec
->autocfg
.line_outs
; i
++) {
4598 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
4599 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
4600 alc880_auto_set_output_and_unmute(codec
, nid
, pin_type
, i
);
4604 static void alc880_auto_init_extra_out(struct hda_codec
*codec
)
4606 struct alc_spec
*spec
= codec
->spec
;
4609 pin
= spec
->autocfg
.speaker_pins
[0];
4610 if (pin
) /* connect to front */
4611 alc880_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
, 0);
4612 pin
= spec
->autocfg
.hp_pins
[0];
4613 if (pin
) /* connect to front */
4614 alc880_auto_set_output_and_unmute(codec
, pin
, PIN_HP
, 0);
4617 static void alc880_auto_init_analog_input(struct hda_codec
*codec
)
4619 struct alc_spec
*spec
= codec
->spec
;
4622 for (i
= 0; i
< AUTO_PIN_LAST
; i
++) {
4623 hda_nid_t nid
= spec
->autocfg
.input_pins
[i
];
4624 if (alc_is_input_pin(codec
, nid
)) {
4625 alc_set_input_pin(codec
, nid
, i
);
4626 if (nid
!= ALC880_PIN_CD_NID
&&
4627 (get_wcaps(codec
, nid
) & AC_WCAP_OUT_AMP
))
4628 snd_hda_codec_write(codec
, nid
, 0,
4629 AC_VERB_SET_AMP_GAIN_MUTE
,
4635 /* parse the BIOS configuration and set up the alc_spec */
4636 /* return 1 if successful, 0 if the proper config is not found,
4637 * or a negative error code
4639 static int alc880_parse_auto_config(struct hda_codec
*codec
)
4641 struct alc_spec
*spec
= codec
->spec
;
4643 static hda_nid_t alc880_ignore
[] = { 0x1d, 0 };
4645 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
4649 if (!spec
->autocfg
.line_outs
)
4650 return 0; /* can't find valid BIOS pin config */
4652 err
= alc880_auto_fill_dac_nids(spec
, &spec
->autocfg
);
4655 err
= alc880_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
4658 err
= alc880_auto_create_extra_out(spec
,
4659 spec
->autocfg
.speaker_pins
[0],
4663 err
= alc880_auto_create_extra_out(spec
, spec
->autocfg
.hp_pins
[0],
4667 err
= alc880_auto_create_input_ctls(codec
, &spec
->autocfg
);
4671 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
4673 /* check multiple SPDIF-out (for recent codecs) */
4674 for (i
= 0; i
< spec
->autocfg
.dig_outs
; i
++) {
4676 err
= snd_hda_get_connections(codec
,
4677 spec
->autocfg
.dig_out_pins
[i
],
4682 spec
->multiout
.dig_out_nid
= dig_nid
;
4684 spec
->multiout
.slave_dig_outs
= spec
->slave_dig_outs
;
4685 spec
->slave_dig_outs
[i
- 1] = dig_nid
;
4686 if (i
== ARRAY_SIZE(spec
->slave_dig_outs
) - 1)
4690 if (spec
->autocfg
.dig_in_pin
)
4691 spec
->dig_in_nid
= ALC880_DIGIN_NID
;
4693 if (spec
->kctls
.list
)
4694 add_mixer(spec
, spec
->kctls
.list
);
4696 add_verb(spec
, alc880_volume_init_verbs
);
4698 spec
->num_mux_defs
= 1;
4699 spec
->input_mux
= &spec
->private_imux
[0];
4701 alc_ssid_check(codec
, 0x15, 0x1b, 0x14);
4706 /* additional initialization for auto-configuration model */
4707 static void alc880_auto_init(struct hda_codec
*codec
)
4709 struct alc_spec
*spec
= codec
->spec
;
4710 alc880_auto_init_multi_out(codec
);
4711 alc880_auto_init_extra_out(codec
);
4712 alc880_auto_init_analog_input(codec
);
4713 if (spec
->unsol_event
)
4714 alc_inithook(codec
);
4717 /* check the ADC/MUX contains all input pins; some ADC/MUX contains only
4718 * one of two digital mic pins, e.g. on ALC272
4720 static void fixup_automic_adc(struct hda_codec
*codec
)
4722 struct alc_spec
*spec
= codec
->spec
;
4725 for (i
= 0; i
< spec
->num_adc_nids
; i
++) {
4726 hda_nid_t cap
= spec
->capsrc_nids
?
4727 spec
->capsrc_nids
[i
] : spec
->adc_nids
[i
];
4730 iidx
= get_connection_index(codec
, cap
, spec
->int_mic
.pin
);
4733 eidx
= get_connection_index(codec
, cap
, spec
->ext_mic
.pin
);
4736 spec
->int_mic
.mux_idx
= iidx
;
4737 spec
->ext_mic
.mux_idx
= eidx
;
4738 if (spec
->capsrc_nids
)
4739 spec
->capsrc_nids
+= i
;
4740 spec
->adc_nids
+= i
;
4741 spec
->num_adc_nids
= 1;
4744 snd_printd(KERN_INFO
"hda_codec: %s: "
4745 "No ADC/MUX containing both 0x%x and 0x%x pins\n",
4746 codec
->chip_name
, spec
->int_mic
.pin
, spec
->ext_mic
.pin
);
4747 spec
->auto_mic
= 0; /* disable auto-mic to be sure */
4750 static void set_capture_mixer(struct hda_codec
*codec
)
4752 struct alc_spec
*spec
= codec
->spec
;
4753 static struct snd_kcontrol_new
*caps
[2][3] = {
4754 { alc_capture_mixer_nosrc1
,
4755 alc_capture_mixer_nosrc2
,
4756 alc_capture_mixer_nosrc3
},
4757 { alc_capture_mixer1
,
4759 alc_capture_mixer3
},
4761 if (spec
->num_adc_nids
> 0 && spec
->num_adc_nids
<= 3) {
4763 if (spec
->auto_mic
) {
4765 fixup_automic_adc(codec
);
4766 } else if (spec
->input_mux
&& spec
->input_mux
->num_items
> 1)
4770 spec
->cap_mixer
= caps
[mux
][spec
->num_adc_nids
- 1];
4774 #define set_beep_amp(spec, nid, idx, dir) \
4775 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
4778 * OK, here we have finally the patch for ALC880
4781 static int patch_alc880(struct hda_codec
*codec
)
4783 struct alc_spec
*spec
;
4787 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
4793 board_config
= snd_hda_check_board_config(codec
, ALC880_MODEL_LAST
,
4796 if (board_config
< 0) {
4797 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
4799 board_config
= ALC880_AUTO
;
4802 if (board_config
== ALC880_AUTO
) {
4803 /* automatic parse from the BIOS config */
4804 err
= alc880_parse_auto_config(codec
);
4810 "hda_codec: Cannot set up configuration "
4811 "from BIOS. Using 3-stack mode...\n");
4812 board_config
= ALC880_3ST
;
4816 err
= snd_hda_attach_beep_device(codec
, 0x1);
4822 if (board_config
!= ALC880_AUTO
)
4823 setup_preset(codec
, &alc880_presets
[board_config
]);
4825 spec
->stream_analog_playback
= &alc880_pcm_analog_playback
;
4826 spec
->stream_analog_capture
= &alc880_pcm_analog_capture
;
4827 spec
->stream_analog_alt_capture
= &alc880_pcm_analog_alt_capture
;
4829 spec
->stream_digital_playback
= &alc880_pcm_digital_playback
;
4830 spec
->stream_digital_capture
= &alc880_pcm_digital_capture
;
4832 if (!spec
->adc_nids
&& spec
->input_mux
) {
4833 /* check whether NID 0x07 is valid */
4834 unsigned int wcap
= get_wcaps(codec
, alc880_adc_nids
[0]);
4836 wcap
= get_wcaps_type(wcap
);
4837 if (wcap
!= AC_WID_AUD_IN
) {
4838 spec
->adc_nids
= alc880_adc_nids_alt
;
4839 spec
->num_adc_nids
= ARRAY_SIZE(alc880_adc_nids_alt
);
4841 spec
->adc_nids
= alc880_adc_nids
;
4842 spec
->num_adc_nids
= ARRAY_SIZE(alc880_adc_nids
);
4845 set_capture_mixer(codec
);
4846 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
4848 spec
->vmaster_nid
= 0x0c;
4850 codec
->patch_ops
= alc_patch_ops
;
4851 if (board_config
== ALC880_AUTO
)
4852 spec
->init_hook
= alc880_auto_init
;
4853 #ifdef CONFIG_SND_HDA_POWER_SAVE
4854 if (!spec
->loopback
.amplist
)
4855 spec
->loopback
.amplist
= alc880_loopbacks
;
4857 codec
->proc_widget_hook
= print_realtek_coef
;
4867 static hda_nid_t alc260_dac_nids
[1] = {
4872 static hda_nid_t alc260_adc_nids
[1] = {
4877 static hda_nid_t alc260_adc_nids_alt
[1] = {
4882 /* NIDs used when simultaneous access to both ADCs makes sense. Note that
4883 * alc260_capture_mixer assumes ADC0 (nid 0x04) is the first ADC.
4885 static hda_nid_t alc260_dual_adc_nids
[2] = {
4890 #define ALC260_DIGOUT_NID 0x03
4891 #define ALC260_DIGIN_NID 0x06
4893 static struct hda_input_mux alc260_capture_source
= {
4897 { "Front Mic", 0x1 },
4903 /* On Fujitsu S702x laptops capture only makes sense from Mic/LineIn jack,
4904 * headphone jack and the internal CD lines since these are the only pins at
4905 * which audio can appear. For flexibility, also allow the option of
4906 * recording the mixer output on the second ADC (ADC0 doesn't have a
4907 * connection to the mixer output).
4909 static struct hda_input_mux alc260_fujitsu_capture_sources
[2] = {
4913 { "Mic/Line", 0x0 },
4915 { "Headphone", 0x2 },
4921 { "Mic/Line", 0x0 },
4923 { "Headphone", 0x2 },
4930 /* Acer TravelMate(/Extensa/Aspire) notebooks have similar configuration to
4931 * the Fujitsu S702x, but jacks are marked differently.
4933 static struct hda_input_mux alc260_acer_capture_sources
[2] = {
4940 { "Headphone", 0x5 },
4949 { "Headphone", 0x6 },
4955 /* Maxdata Favorit 100XS */
4956 static struct hda_input_mux alc260_favorit100_capture_sources
[2] = {
4960 { "Line/Mic", 0x0 },
4967 { "Line/Mic", 0x0 },
4975 * This is just place-holder, so there's something for alc_build_pcms to look
4976 * at when it calculates the maximum number of channels. ALC260 has no mixer
4977 * element which allows changing the channel mode, so the verb list is
4980 static struct hda_channel_mode alc260_modes
[1] = {
4985 /* Mixer combinations
4987 * basic: base_output + input + pc_beep + capture
4988 * HP: base_output + input + capture_alt
4989 * HP_3013: hp_3013 + input + capture
4990 * fujitsu: fujitsu + capture
4991 * acer: acer + capture
4994 static struct snd_kcontrol_new alc260_base_output_mixer
[] = {
4995 HDA_CODEC_VOLUME("Front Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
4996 HDA_BIND_MUTE("Front Playback Switch", 0x08, 2, HDA_INPUT
),
4997 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x09, 0x0, HDA_OUTPUT
),
4998 HDA_BIND_MUTE("Headphone Playback Switch", 0x09, 2, HDA_INPUT
),
4999 HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT
),
5000 HDA_BIND_MUTE_MONO("Mono Playback Switch", 0x0a, 1, 2, HDA_INPUT
),
5004 static struct snd_kcontrol_new alc260_input_mixer
[] = {
5005 HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT
),
5006 HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT
),
5007 HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT
),
5008 HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT
),
5009 HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT
),
5010 HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT
),
5011 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x07, 0x01, HDA_INPUT
),
5012 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x07, 0x01, HDA_INPUT
),
5016 /* update HP, line and mono out pins according to the master switch */
5017 static void alc260_hp_master_update(struct hda_codec
*codec
,
5018 hda_nid_t hp
, hda_nid_t line
,
5021 struct alc_spec
*spec
= codec
->spec
;
5022 unsigned int val
= spec
->master_sw
? PIN_HP
: 0;
5023 /* change HP and line-out pins */
5024 snd_hda_codec_write(codec
, hp
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5026 snd_hda_codec_write(codec
, line
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5028 /* mono (speaker) depending on the HP jack sense */
5029 val
= (val
&& !spec
->jack_present
) ? PIN_OUT
: 0;
5030 snd_hda_codec_write(codec
, mono
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5034 static int alc260_hp_master_sw_get(struct snd_kcontrol
*kcontrol
,
5035 struct snd_ctl_elem_value
*ucontrol
)
5037 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
5038 struct alc_spec
*spec
= codec
->spec
;
5039 *ucontrol
->value
.integer
.value
= spec
->master_sw
;
5043 static int alc260_hp_master_sw_put(struct snd_kcontrol
*kcontrol
,
5044 struct snd_ctl_elem_value
*ucontrol
)
5046 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
5047 struct alc_spec
*spec
= codec
->spec
;
5048 int val
= !!*ucontrol
->value
.integer
.value
;
5049 hda_nid_t hp
, line
, mono
;
5051 if (val
== spec
->master_sw
)
5053 spec
->master_sw
= val
;
5054 hp
= (kcontrol
->private_value
>> 16) & 0xff;
5055 line
= (kcontrol
->private_value
>> 8) & 0xff;
5056 mono
= kcontrol
->private_value
& 0xff;
5057 alc260_hp_master_update(codec
, hp
, line
, mono
);
5061 static struct snd_kcontrol_new alc260_hp_output_mixer
[] = {
5063 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
5064 .name
= "Master Playback Switch",
5065 .info
= snd_ctl_boolean_mono_info
,
5066 .get
= alc260_hp_master_sw_get
,
5067 .put
= alc260_hp_master_sw_put
,
5068 .private_value
= (0x0f << 16) | (0x10 << 8) | 0x11
5070 HDA_CODEC_VOLUME("Front Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5071 HDA_BIND_MUTE("Front Playback Switch", 0x08, 2, HDA_INPUT
),
5072 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x09, 0x0, HDA_OUTPUT
),
5073 HDA_BIND_MUTE("Headphone Playback Switch", 0x09, 2, HDA_INPUT
),
5074 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0a, 1, 0x0,
5076 HDA_BIND_MUTE_MONO("Speaker Playback Switch", 0x0a, 1, 2, HDA_INPUT
),
5080 static struct hda_verb alc260_hp_unsol_verbs
[] = {
5081 {0x10, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
5085 static void alc260_hp_automute(struct hda_codec
*codec
)
5087 struct alc_spec
*spec
= codec
->spec
;
5088 unsigned int present
;
5090 present
= snd_hda_codec_read(codec
, 0x10, 0,
5091 AC_VERB_GET_PIN_SENSE
, 0);
5092 spec
->jack_present
= (present
& AC_PINSENSE_PRESENCE
) != 0;
5093 alc260_hp_master_update(codec
, 0x0f, 0x10, 0x11);
5096 static void alc260_hp_unsol_event(struct hda_codec
*codec
, unsigned int res
)
5098 if ((res
>> 26) == ALC880_HP_EVENT
)
5099 alc260_hp_automute(codec
);
5102 static struct snd_kcontrol_new alc260_hp_3013_mixer
[] = {
5104 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
5105 .name
= "Master Playback Switch",
5106 .info
= snd_ctl_boolean_mono_info
,
5107 .get
= alc260_hp_master_sw_get
,
5108 .put
= alc260_hp_master_sw_put
,
5109 .private_value
= (0x15 << 16) | (0x10 << 8) | 0x11
5111 HDA_CODEC_VOLUME("Front Playback Volume", 0x09, 0x0, HDA_OUTPUT
),
5112 HDA_CODEC_MUTE("Front Playback Switch", 0x10, 0x0, HDA_OUTPUT
),
5113 HDA_CODEC_VOLUME("Aux-In Playback Volume", 0x07, 0x06, HDA_INPUT
),
5114 HDA_CODEC_MUTE("Aux-In Playback Switch", 0x07, 0x06, HDA_INPUT
),
5115 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5116 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
5117 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT
),
5118 HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x11, 1, 0x0, HDA_OUTPUT
),
5122 static struct hda_bind_ctls alc260_dc7600_bind_master_vol
= {
5123 .ops
= &snd_hda_bind_vol
,
5125 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_OUTPUT
),
5126 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_OUTPUT
),
5127 HDA_COMPOSE_AMP_VAL(0x0a, 3, 0, HDA_OUTPUT
),
5132 static struct hda_bind_ctls alc260_dc7600_bind_switch
= {
5133 .ops
= &snd_hda_bind_sw
,
5135 HDA_COMPOSE_AMP_VAL(0x11, 3, 0, HDA_OUTPUT
),
5136 HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT
),
5141 static struct snd_kcontrol_new alc260_hp_dc7600_mixer
[] = {
5142 HDA_BIND_VOL("Master Playback Volume", &alc260_dc7600_bind_master_vol
),
5143 HDA_BIND_SW("LineOut Playback Switch", &alc260_dc7600_bind_switch
),
5144 HDA_CODEC_MUTE("Speaker Playback Switch", 0x0f, 0x0, HDA_OUTPUT
),
5145 HDA_CODEC_MUTE("Headphone Playback Switch", 0x10, 0x0, HDA_OUTPUT
),
5149 static struct hda_verb alc260_hp_3013_unsol_verbs
[] = {
5150 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
5154 static void alc260_hp_3013_automute(struct hda_codec
*codec
)
5156 struct alc_spec
*spec
= codec
->spec
;
5157 unsigned int present
;
5159 present
= snd_hda_codec_read(codec
, 0x15, 0,
5160 AC_VERB_GET_PIN_SENSE
, 0);
5161 spec
->jack_present
= (present
& AC_PINSENSE_PRESENCE
) != 0;
5162 alc260_hp_master_update(codec
, 0x15, 0x10, 0x11);
5165 static void alc260_hp_3013_unsol_event(struct hda_codec
*codec
,
5168 if ((res
>> 26) == ALC880_HP_EVENT
)
5169 alc260_hp_3013_automute(codec
);
5172 static void alc260_hp_3012_automute(struct hda_codec
*codec
)
5174 unsigned int present
, bits
;
5176 present
= snd_hda_codec_read(codec
, 0x10, 0,
5177 AC_VERB_GET_PIN_SENSE
, 0) & AC_PINSENSE_PRESENCE
;
5179 bits
= present
? 0 : PIN_OUT
;
5180 snd_hda_codec_write(codec
, 0x0f, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5182 snd_hda_codec_write(codec
, 0x11, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5184 snd_hda_codec_write(codec
, 0x15, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5188 static void alc260_hp_3012_unsol_event(struct hda_codec
*codec
,
5191 if ((res
>> 26) == ALC880_HP_EVENT
)
5192 alc260_hp_3012_automute(codec
);
5195 /* Fujitsu S702x series laptops. ALC260 pin usage: Mic/Line jack = 0x12,
5196 * HP jack = 0x14, CD audio = 0x16, internal speaker = 0x10.
5198 static struct snd_kcontrol_new alc260_fujitsu_mixer
[] = {
5199 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5200 HDA_BIND_MUTE("Headphone Playback Switch", 0x08, 2, HDA_INPUT
),
5201 ALC_PIN_MODE("Headphone Jack Mode", 0x14, ALC_PIN_DIR_INOUT
),
5202 HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT
),
5203 HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT
),
5204 HDA_CODEC_VOLUME("Mic/Line Playback Volume", 0x07, 0x0, HDA_INPUT
),
5205 HDA_CODEC_MUTE("Mic/Line Playback Switch", 0x07, 0x0, HDA_INPUT
),
5206 ALC_PIN_MODE("Mic/Line Jack Mode", 0x12, ALC_PIN_DIR_IN
),
5207 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x09, 0x0, HDA_OUTPUT
),
5208 HDA_BIND_MUTE("Speaker Playback Switch", 0x09, 2, HDA_INPUT
),
5212 /* Mixer for Acer TravelMate(/Extensa/Aspire) notebooks. Note that current
5213 * versions of the ALC260 don't act on requests to enable mic bias from NID
5214 * 0x0f (used to drive the headphone jack in these laptops). The ALC260
5215 * datasheet doesn't mention this restriction. At this stage it's not clear
5216 * whether this behaviour is intentional or is a hardware bug in chip
5217 * revisions available in early 2006. Therefore for now allow the
5218 * "Headphone Jack Mode" control to span all choices, but if it turns out
5219 * that the lack of mic bias for this NID is intentional we could change the
5220 * mode from ALC_PIN_DIR_INOUT to ALC_PIN_DIR_INOUT_NOMICBIAS.
5222 * In addition, Acer TravelMate(/Extensa/Aspire) notebooks in early 2006
5223 * don't appear to make the mic bias available from the "line" jack, even
5224 * though the NID used for this jack (0x14) can supply it. The theory is
5225 * that perhaps Acer have included blocking capacitors between the ALC260
5226 * and the output jack. If this turns out to be the case for all such
5227 * models the "Line Jack Mode" mode could be changed from ALC_PIN_DIR_INOUT
5228 * to ALC_PIN_DIR_INOUT_NOMICBIAS.
5230 * The C20x Tablet series have a mono internal speaker which is controlled
5231 * via the chip's Mono sum widget and pin complex, so include the necessary
5232 * controls for such models. On models without a "mono speaker" the control
5233 * won't do anything.
5235 static struct snd_kcontrol_new alc260_acer_mixer
[] = {
5236 HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5237 HDA_BIND_MUTE("Master Playback Switch", 0x08, 2, HDA_INPUT
),
5238 ALC_PIN_MODE("Headphone Jack Mode", 0x0f, ALC_PIN_DIR_INOUT
),
5239 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0a, 1, 0x0,
5241 HDA_BIND_MUTE_MONO("Speaker Playback Switch", 0x0a, 1, 2,
5243 HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT
),
5244 HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT
),
5245 HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT
),
5246 HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT
),
5247 ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN
),
5248 HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT
),
5249 HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT
),
5250 ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT
),
5254 /* Maxdata Favorit 100XS: one output and one input (0x12) jack
5256 static struct snd_kcontrol_new alc260_favorit100_mixer
[] = {
5257 HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5258 HDA_BIND_MUTE("Master Playback Switch", 0x08, 2, HDA_INPUT
),
5259 ALC_PIN_MODE("Output Jack Mode", 0x0f, ALC_PIN_DIR_INOUT
),
5260 HDA_CODEC_VOLUME("Line/Mic Playback Volume", 0x07, 0x0, HDA_INPUT
),
5261 HDA_CODEC_MUTE("Line/Mic Playback Switch", 0x07, 0x0, HDA_INPUT
),
5262 ALC_PIN_MODE("Line/Mic Jack Mode", 0x12, ALC_PIN_DIR_IN
),
5266 /* Packard bell V7900 ALC260 pin usage: HP = 0x0f, Mic jack = 0x12,
5267 * Line In jack = 0x14, CD audio = 0x16, pc beep = 0x17.
5269 static struct snd_kcontrol_new alc260_will_mixer
[] = {
5270 HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5271 HDA_BIND_MUTE("Master Playback Switch", 0x08, 0x2, HDA_INPUT
),
5272 HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT
),
5273 HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT
),
5274 ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN
),
5275 HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT
),
5276 HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT
),
5277 ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT
),
5278 HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT
),
5279 HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT
),
5283 /* Replacer 672V ALC260 pin usage: Mic jack = 0x12,
5284 * Line In jack = 0x14, ATAPI Mic = 0x13, speaker = 0x0f.
5286 static struct snd_kcontrol_new alc260_replacer_672v_mixer
[] = {
5287 HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5288 HDA_BIND_MUTE("Master Playback Switch", 0x08, 0x2, HDA_INPUT
),
5289 HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT
),
5290 HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT
),
5291 ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN
),
5292 HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x07, 0x1, HDA_INPUT
),
5293 HDA_CODEC_MUTE("ATATI Mic Playback Switch", 0x07, 0x1, HDA_INPUT
),
5294 HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT
),
5295 HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT
),
5296 ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT
),
5301 * initialization verbs
5303 static struct hda_verb alc260_init_verbs
[] = {
5304 /* Line In pin widget for input */
5305 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
5306 /* CD pin widget for input */
5307 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
5308 /* Mic1 (rear panel) pin widget for input and vref at 80% */
5309 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
5310 /* Mic2 (front panel) pin widget for input and vref at 80% */
5311 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
5312 /* LINE-2 is used for line-out in rear */
5313 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5314 /* select line-out */
5315 {0x0e, AC_VERB_SET_CONNECT_SEL
, 0x00},
5317 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5319 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
5321 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5322 /* mute capture amp left and right */
5323 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
5324 /* set connection select to line in (default select for this ADC) */
5325 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x02},
5326 /* mute capture amp left and right */
5327 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
5328 /* set connection select to line in (default select for this ADC) */
5329 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x02},
5330 /* set vol=0 Line-Out mixer amp left and right */
5331 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5332 /* unmute pin widget amp left and right (no gain on this amp) */
5333 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5334 /* set vol=0 HP mixer amp left and right */
5335 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5336 /* unmute pin widget amp left and right (no gain on this amp) */
5337 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5338 /* set vol=0 Mono mixer amp left and right */
5339 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5340 /* unmute pin widget amp left and right (no gain on this amp) */
5341 {0x11, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5342 /* unmute LINE-2 out pin */
5343 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5344 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
5347 /* mute analog inputs */
5348 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5349 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5350 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
5351 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
5352 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
5353 /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
5354 /* mute Front out path */
5355 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5356 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5357 /* mute Headphone out path */
5358 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5359 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5360 /* mute Mono out path */
5361 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5362 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5366 #if 0 /* should be identical with alc260_init_verbs? */
5367 static struct hda_verb alc260_hp_init_verbs
[] = {
5368 /* Headphone and output */
5369 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
5371 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
5372 /* Mic1 (rear panel) pin widget for input and vref at 80% */
5373 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
5374 /* Mic2 (front panel) pin widget for input and vref at 80% */
5375 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
5376 /* Line In pin widget for input */
5377 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
5378 /* Line-2 pin widget for output */
5379 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
5380 /* CD pin widget for input */
5381 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
5382 /* unmute amp left and right */
5383 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000},
5384 /* set connection select to line in (default select for this ADC) */
5385 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x02},
5386 /* unmute Line-Out mixer amp left and right (volume = 0) */
5387 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb000},
5388 /* mute pin widget amp left and right (no gain on this amp) */
5389 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
5390 /* unmute HP mixer amp left and right (volume = 0) */
5391 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb000},
5392 /* mute pin widget amp left and right (no gain on this amp) */
5393 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
5394 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
5397 /* mute analog inputs */
5398 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5399 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5400 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
5401 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
5402 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
5403 /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
5404 /* Unmute Front out path */
5405 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
5406 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
5407 /* Unmute Headphone out path */
5408 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
5409 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
5410 /* Unmute Mono out path */
5411 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
5412 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
5417 static struct hda_verb alc260_hp_3013_init_verbs
[] = {
5418 /* Line out and output */
5419 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
5421 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
5422 /* Mic1 (rear panel) pin widget for input and vref at 80% */
5423 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
5424 /* Mic2 (front panel) pin widget for input and vref at 80% */
5425 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
5426 /* Line In pin widget for input */
5427 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
5428 /* Headphone pin widget for output */
5429 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
5430 /* CD pin widget for input */
5431 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
5432 /* unmute amp left and right */
5433 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000},
5434 /* set connection select to line in (default select for this ADC) */
5435 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x02},
5436 /* unmute Line-Out mixer amp left and right (volume = 0) */
5437 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb000},
5438 /* mute pin widget amp left and right (no gain on this amp) */
5439 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
5440 /* unmute HP mixer amp left and right (volume = 0) */
5441 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb000},
5442 /* mute pin widget amp left and right (no gain on this amp) */
5443 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
5444 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
5447 /* mute analog inputs */
5448 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5449 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5450 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
5451 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
5452 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
5453 /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
5454 /* Unmute Front out path */
5455 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
5456 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
5457 /* Unmute Headphone out path */
5458 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
5459 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
5460 /* Unmute Mono out path */
5461 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
5462 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
5466 /* Initialisation sequence for ALC260 as configured in Fujitsu S702x
5467 * laptops. ALC260 pin usage: Mic/Line jack = 0x12, HP jack = 0x14, CD
5468 * audio = 0x16, internal speaker = 0x10.
5470 static struct hda_verb alc260_fujitsu_init_verbs
[] = {
5471 /* Disable all GPIOs */
5472 {0x01, AC_VERB_SET_GPIO_MASK
, 0},
5473 /* Internal speaker is connected to headphone pin */
5474 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
5475 /* Headphone/Line-out jack connects to Line1 pin; make it an output */
5476 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5477 /* Mic/Line-in jack is connected to mic1 pin, so make it an input */
5478 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
5479 /* Ensure all other unused pins are disabled and muted. */
5480 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5481 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5482 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5483 {0x11, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5484 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5485 {0x13, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5486 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5487 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5489 /* Disable digital (SPDIF) pins */
5490 {0x03, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5491 {0x06, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5493 /* Ensure Line1 pin widget takes its input from the OUT1 sum bus
5494 * when acting as an output.
5496 {0x0d, AC_VERB_SET_CONNECT_SEL
, 0},
5498 /* Start with output sum widgets muted and their output gains at min */
5499 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5500 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5501 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5502 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5503 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5504 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5505 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5506 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5507 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5509 /* Unmute HP pin widget amp left and right (no equiv mixer ctrl) */
5510 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5511 /* Unmute Line1 pin widget output buffer since it starts as an output.
5512 * If the pin mode is changed by the user the pin mode control will
5513 * take care of enabling the pin's input/output buffers as needed.
5514 * Therefore there's no need to enable the input buffer at this
5517 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5518 /* Unmute input buffer of pin widget used for Line-in (no equiv
5521 {0x12, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
5523 /* Mute capture amp left and right */
5524 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5525 /* Set ADC connection select to match default mixer setting - line
5528 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x00},
5530 /* Do the same for the second ADC: mute capture input amp and
5531 * set ADC connection to line in (on mic1 pin)
5533 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5534 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x00},
5536 /* Mute all inputs to mixer widget (even unconnected ones) */
5537 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)}, /* mic1 pin */
5538 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)}, /* mic2 pin */
5539 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)}, /* line1 pin */
5540 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)}, /* line2 pin */
5541 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)}, /* CD pin */
5542 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)}, /* Beep-gen pin */
5543 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)}, /* Line-out pin */
5544 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)}, /* HP-pin pin */
5549 /* Initialisation sequence for ALC260 as configured in Acer TravelMate and
5550 * similar laptops (adapted from Fujitsu init verbs).
5552 static struct hda_verb alc260_acer_init_verbs
[] = {
5553 /* On TravelMate laptops, GPIO 0 enables the internal speaker and
5554 * the headphone jack. Turn this on and rely on the standard mute
5555 * methods whenever the user wants to turn these outputs off.
5557 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
5558 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
5559 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
5560 /* Internal speaker/Headphone jack is connected to Line-out pin */
5561 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
5562 /* Internal microphone/Mic jack is connected to Mic1 pin */
5563 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
5564 /* Line In jack is connected to Line1 pin */
5565 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
5566 /* Some Acers (eg: C20x Tablets) use Mono pin for internal speaker */
5567 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
5568 /* Ensure all other unused pins are disabled and muted. */
5569 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5570 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5571 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5572 {0x13, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5573 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5574 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5575 /* Disable digital (SPDIF) pins */
5576 {0x03, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5577 {0x06, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5579 /* Ensure Mic1 and Line1 pin widgets take input from the OUT1 sum
5580 * bus when acting as outputs.
5582 {0x0b, AC_VERB_SET_CONNECT_SEL
, 0},
5583 {0x0d, AC_VERB_SET_CONNECT_SEL
, 0},
5585 /* Start with output sum widgets muted and their output gains at min */
5586 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5587 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5588 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5589 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5590 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5591 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5592 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5593 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5594 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5596 /* Unmute Line-out pin widget amp left and right
5597 * (no equiv mixer ctrl)
5599 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5600 /* Unmute mono pin widget amp output (no equiv mixer ctrl) */
5601 {0x11, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5602 /* Unmute Mic1 and Line1 pin widget input buffers since they start as
5603 * inputs. If the pin mode is changed by the user the pin mode control
5604 * will take care of enabling the pin's input/output buffers as needed.
5605 * Therefore there's no need to enable the input buffer at this
5608 {0x12, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
5609 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
5611 /* Mute capture amp left and right */
5612 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5613 /* Set ADC connection select to match default mixer setting - mic
5616 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x00},
5618 /* Do similar with the second ADC: mute capture input amp and
5619 * set ADC connection to mic to match ALSA's default state.
5621 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5622 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x00},
5624 /* Mute all inputs to mixer widget (even unconnected ones) */
5625 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)}, /* mic1 pin */
5626 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)}, /* mic2 pin */
5627 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)}, /* line1 pin */
5628 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)}, /* line2 pin */
5629 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)}, /* CD pin */
5630 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)}, /* Beep-gen pin */
5631 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)}, /* Line-out pin */
5632 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)}, /* HP-pin pin */
5637 /* Initialisation sequence for Maxdata Favorit 100XS
5638 * (adapted from Acer init verbs).
5640 static struct hda_verb alc260_favorit100_init_verbs
[] = {
5641 /* GPIO 0 enables the output jack.
5642 * Turn this on and rely on the standard mute
5643 * methods whenever the user wants to turn these outputs off.
5645 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
5646 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
5647 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
5648 /* Line/Mic input jack is connected to Mic1 pin */
5649 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
5650 /* Ensure all other unused pins are disabled and muted. */
5651 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5652 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5653 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5654 {0x11, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5655 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5656 {0x13, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5657 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5658 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5659 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5660 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5661 /* Disable digital (SPDIF) pins */
5662 {0x03, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5663 {0x06, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5665 /* Ensure Mic1 and Line1 pin widgets take input from the OUT1 sum
5666 * bus when acting as outputs.
5668 {0x0b, AC_VERB_SET_CONNECT_SEL
, 0},
5669 {0x0d, AC_VERB_SET_CONNECT_SEL
, 0},
5671 /* Start with output sum widgets muted and their output gains at min */
5672 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5673 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5674 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5675 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5676 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5677 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5678 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5679 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5680 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5682 /* Unmute Line-out pin widget amp left and right
5683 * (no equiv mixer ctrl)
5685 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5686 /* Unmute Mic1 and Line1 pin widget input buffers since they start as
5687 * inputs. If the pin mode is changed by the user the pin mode control
5688 * will take care of enabling the pin's input/output buffers as needed.
5689 * Therefore there's no need to enable the input buffer at this
5692 {0x12, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
5694 /* Mute capture amp left and right */
5695 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5696 /* Set ADC connection select to match default mixer setting - mic
5699 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x00},
5701 /* Do similar with the second ADC: mute capture input amp and
5702 * set ADC connection to mic to match ALSA's default state.
5704 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5705 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x00},
5707 /* Mute all inputs to mixer widget (even unconnected ones) */
5708 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)}, /* mic1 pin */
5709 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)}, /* mic2 pin */
5710 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)}, /* line1 pin */
5711 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)}, /* line2 pin */
5712 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)}, /* CD pin */
5713 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)}, /* Beep-gen pin */
5714 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)}, /* Line-out pin */
5715 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)}, /* HP-pin pin */
5720 static struct hda_verb alc260_will_verbs
[] = {
5721 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
5722 {0x0b, AC_VERB_SET_CONNECT_SEL
, 0x00},
5723 {0x0d, AC_VERB_SET_CONNECT_SEL
, 0x00},
5724 {0x0f, AC_VERB_SET_EAPD_BTLENABLE
, 0x02},
5725 {0x1a, AC_VERB_SET_COEF_INDEX
, 0x07},
5726 {0x1a, AC_VERB_SET_PROC_COEF
, 0x3040},
5730 static struct hda_verb alc260_replacer_672v_verbs
[] = {
5731 {0x0f, AC_VERB_SET_EAPD_BTLENABLE
, 0x02},
5732 {0x1a, AC_VERB_SET_COEF_INDEX
, 0x07},
5733 {0x1a, AC_VERB_SET_PROC_COEF
, 0x3050},
5735 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
5736 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
5737 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
5739 {0x0f, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
5743 /* toggle speaker-output according to the hp-jack state */
5744 static void alc260_replacer_672v_automute(struct hda_codec
*codec
)
5746 unsigned int present
;
5748 /* speaker --> GPIO Data 0, hp or spdif --> GPIO data 1 */
5749 present
= snd_hda_codec_read(codec
, 0x0f, 0,
5750 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
5752 snd_hda_codec_write_cache(codec
, 0x01, 0,
5753 AC_VERB_SET_GPIO_DATA
, 1);
5754 snd_hda_codec_write_cache(codec
, 0x0f, 0,
5755 AC_VERB_SET_PIN_WIDGET_CONTROL
,
5758 snd_hda_codec_write_cache(codec
, 0x01, 0,
5759 AC_VERB_SET_GPIO_DATA
, 0);
5760 snd_hda_codec_write_cache(codec
, 0x0f, 0,
5761 AC_VERB_SET_PIN_WIDGET_CONTROL
,
5766 static void alc260_replacer_672v_unsol_event(struct hda_codec
*codec
,
5769 if ((res
>> 26) == ALC880_HP_EVENT
)
5770 alc260_replacer_672v_automute(codec
);
5773 static struct hda_verb alc260_hp_dc7600_verbs
[] = {
5774 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x01},
5775 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
5776 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5777 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
5778 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5779 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5780 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
5781 {0x10, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
5782 {0x11, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
5783 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
5787 /* Test configuration for debugging, modelled after the ALC880 test
5790 #ifdef CONFIG_SND_DEBUG
5791 static hda_nid_t alc260_test_dac_nids
[1] = {
5794 static hda_nid_t alc260_test_adc_nids
[2] = {
5797 /* For testing the ALC260, each input MUX needs its own definition since
5798 * the signal assignments are different. This assumes that the first ADC
5801 static struct hda_input_mux alc260_test_capture_sources
[2] = {
5805 { "MIC1 pin", 0x0 },
5806 { "MIC2 pin", 0x1 },
5807 { "LINE1 pin", 0x2 },
5808 { "LINE2 pin", 0x3 },
5810 { "LINE-OUT pin", 0x5 },
5811 { "HP-OUT pin", 0x6 },
5817 { "MIC1 pin", 0x0 },
5818 { "MIC2 pin", 0x1 },
5819 { "LINE1 pin", 0x2 },
5820 { "LINE2 pin", 0x3 },
5823 { "LINE-OUT pin", 0x6 },
5824 { "HP-OUT pin", 0x7 },
5828 static struct snd_kcontrol_new alc260_test_mixer
[] = {
5829 /* Output driver widgets */
5830 HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT
),
5831 HDA_BIND_MUTE_MONO("Mono Playback Switch", 0x0a, 1, 2, HDA_INPUT
),
5832 HDA_CODEC_VOLUME("LOUT2 Playback Volume", 0x09, 0x0, HDA_OUTPUT
),
5833 HDA_BIND_MUTE("LOUT2 Playback Switch", 0x09, 2, HDA_INPUT
),
5834 HDA_CODEC_VOLUME("LOUT1 Playback Volume", 0x08, 0x0, HDA_OUTPUT
),
5835 HDA_BIND_MUTE("LOUT1 Playback Switch", 0x08, 2, HDA_INPUT
),
5837 /* Modes for retasking pin widgets
5838 * Note: the ALC260 doesn't seem to act on requests to enable mic
5839 * bias from NIDs 0x0f and 0x10. The ALC260 datasheet doesn't
5840 * mention this restriction. At this stage it's not clear whether
5841 * this behaviour is intentional or is a hardware bug in chip
5842 * revisions available at least up until early 2006. Therefore for
5843 * now allow the "HP-OUT" and "LINE-OUT" Mode controls to span all
5844 * choices, but if it turns out that the lack of mic bias for these
5845 * NIDs is intentional we could change their modes from
5846 * ALC_PIN_DIR_INOUT to ALC_PIN_DIR_INOUT_NOMICBIAS.
5848 ALC_PIN_MODE("HP-OUT pin mode", 0x10, ALC_PIN_DIR_INOUT
),
5849 ALC_PIN_MODE("LINE-OUT pin mode", 0x0f, ALC_PIN_DIR_INOUT
),
5850 ALC_PIN_MODE("LINE2 pin mode", 0x15, ALC_PIN_DIR_INOUT
),
5851 ALC_PIN_MODE("LINE1 pin mode", 0x14, ALC_PIN_DIR_INOUT
),
5852 ALC_PIN_MODE("MIC2 pin mode", 0x13, ALC_PIN_DIR_INOUT
),
5853 ALC_PIN_MODE("MIC1 pin mode", 0x12, ALC_PIN_DIR_INOUT
),
5855 /* Loopback mixer controls */
5856 HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x07, 0x00, HDA_INPUT
),
5857 HDA_CODEC_MUTE("MIC1 Playback Switch", 0x07, 0x00, HDA_INPUT
),
5858 HDA_CODEC_VOLUME("MIC2 Playback Volume", 0x07, 0x01, HDA_INPUT
),
5859 HDA_CODEC_MUTE("MIC2 Playback Switch", 0x07, 0x01, HDA_INPUT
),
5860 HDA_CODEC_VOLUME("LINE1 Playback Volume", 0x07, 0x02, HDA_INPUT
),
5861 HDA_CODEC_MUTE("LINE1 Playback Switch", 0x07, 0x02, HDA_INPUT
),
5862 HDA_CODEC_VOLUME("LINE2 Playback Volume", 0x07, 0x03, HDA_INPUT
),
5863 HDA_CODEC_MUTE("LINE2 Playback Switch", 0x07, 0x03, HDA_INPUT
),
5864 HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT
),
5865 HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT
),
5866 HDA_CODEC_VOLUME("LINE-OUT loopback Playback Volume", 0x07, 0x06, HDA_INPUT
),
5867 HDA_CODEC_MUTE("LINE-OUT loopback Playback Switch", 0x07, 0x06, HDA_INPUT
),
5868 HDA_CODEC_VOLUME("HP-OUT loopback Playback Volume", 0x07, 0x7, HDA_INPUT
),
5869 HDA_CODEC_MUTE("HP-OUT loopback Playback Switch", 0x07, 0x7, HDA_INPUT
),
5871 /* Controls for GPIO pins, assuming they are configured as outputs */
5872 ALC_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
5873 ALC_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
5874 ALC_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
5875 ALC_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
5877 /* Switches to allow the digital IO pins to be enabled. The datasheet
5878 * is ambigious as to which NID is which; testing on laptops which
5879 * make this output available should provide clarification.
5881 ALC_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x03, 0x01),
5882 ALC_SPDIF_CTRL_SWITCH("SPDIF Capture Switch", 0x06, 0x01),
5884 /* A switch allowing EAPD to be enabled. Some laptops seem to use
5885 * this output to turn on an external amplifier.
5887 ALC_EAPD_CTRL_SWITCH("LINE-OUT EAPD Enable Switch", 0x0f, 0x02),
5888 ALC_EAPD_CTRL_SWITCH("HP-OUT EAPD Enable Switch", 0x10, 0x02),
5892 static struct hda_verb alc260_test_init_verbs
[] = {
5893 /* Enable all GPIOs as outputs with an initial value of 0 */
5894 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x0f},
5895 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
5896 {0x01, AC_VERB_SET_GPIO_MASK
, 0x0f},
5898 /* Enable retasking pins as output, initially without power amp */
5899 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5900 {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5901 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5902 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5903 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5904 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
5906 /* Disable digital (SPDIF) pins initially, but users can enable
5907 * them via a mixer switch. In the case of SPDIF-out, this initverb
5908 * payload also sets the generation to 0, output to be in "consumer"
5909 * PCM format, copyright asserted, no pre-emphasis and no validity
5912 {0x03, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5913 {0x06, AC_VERB_SET_DIGI_CONVERT_1
, 0},
5915 /* Ensure mic1, mic2, line1 and line2 pin widgets take input from the
5916 * OUT1 sum bus when acting as an output.
5918 {0x0b, AC_VERB_SET_CONNECT_SEL
, 0},
5919 {0x0c, AC_VERB_SET_CONNECT_SEL
, 0},
5920 {0x0d, AC_VERB_SET_CONNECT_SEL
, 0},
5921 {0x0e, AC_VERB_SET_CONNECT_SEL
, 0},
5923 /* Start with output sum widgets muted and their output gains at min */
5924 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5925 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5926 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5927 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5928 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5929 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5930 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5931 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
5932 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
5934 /* Unmute retasking pin widget output buffers since the default
5935 * state appears to be output. As the pin mode is changed by the
5936 * user the pin mode control will take care of enabling the pin's
5937 * input/output buffers as needed.
5939 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5940 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5941 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5942 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5943 {0x13, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5944 {0x12, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5945 /* Also unmute the mono-out pin widget */
5946 {0x11, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
5948 /* Mute capture amp left and right */
5949 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5950 /* Set ADC connection select to match default mixer setting (mic1
5953 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x00},
5955 /* Do the same for the second ADC: mute capture input amp and
5956 * set ADC connection to mic1 pin
5958 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
5959 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x00},
5961 /* Mute all inputs to mixer widget (even unconnected ones) */
5962 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)}, /* mic1 pin */
5963 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)}, /* mic2 pin */
5964 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)}, /* line1 pin */
5965 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)}, /* line2 pin */
5966 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)}, /* CD pin */
5967 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)}, /* Beep-gen pin */
5968 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)}, /* Line-out pin */
5969 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)}, /* HP-pin pin */
5975 #define alc260_pcm_analog_playback alc880_pcm_analog_alt_playback
5976 #define alc260_pcm_analog_capture alc880_pcm_analog_capture
5978 #define alc260_pcm_digital_playback alc880_pcm_digital_playback
5979 #define alc260_pcm_digital_capture alc880_pcm_digital_capture
5982 * for BIOS auto-configuration
5985 static int alc260_add_playback_controls(struct alc_spec
*spec
, hda_nid_t nid
,
5986 const char *pfx
, int *vol_bits
)
5989 unsigned long vol_val
, sw_val
;
5993 if (nid
>= 0x0f && nid
< 0x11) {
5994 nid_vol
= nid
- 0x7;
5995 vol_val
= HDA_COMPOSE_AMP_VAL(nid_vol
, 3, 0, HDA_OUTPUT
);
5996 sw_val
= HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_OUTPUT
);
5997 } else if (nid
== 0x11) {
5998 nid_vol
= nid
- 0x7;
5999 vol_val
= HDA_COMPOSE_AMP_VAL(nid_vol
, 2, 0, HDA_OUTPUT
);
6000 sw_val
= HDA_COMPOSE_AMP_VAL(nid
, 2, 0, HDA_OUTPUT
);
6001 } else if (nid
>= 0x12 && nid
<= 0x15) {
6003 vol_val
= HDA_COMPOSE_AMP_VAL(nid_vol
, 3, 0, HDA_OUTPUT
);
6004 sw_val
= HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_OUTPUT
);
6008 if (!(*vol_bits
& (1 << nid_vol
))) {
6009 /* first control for the volume widget */
6010 snprintf(name
, sizeof(name
), "%s Playback Volume", pfx
);
6011 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
, name
, vol_val
);
6014 *vol_bits
|= (1 << nid_vol
);
6016 snprintf(name
, sizeof(name
), "%s Playback Switch", pfx
);
6017 err
= add_control(spec
, ALC_CTL_WIDGET_MUTE
, name
, sw_val
);
6023 /* add playback controls from the parsed DAC table */
6024 static int alc260_auto_create_multi_out_ctls(struct alc_spec
*spec
,
6025 const struct auto_pin_cfg
*cfg
)
6031 spec
->multiout
.num_dacs
= 1;
6032 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
6033 spec
->multiout
.dac_nids
[0] = 0x02;
6035 nid
= cfg
->line_out_pins
[0];
6038 if (!cfg
->speaker_pins
[0] && !cfg
->hp_pins
[0])
6040 else if (cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
6044 err
= alc260_add_playback_controls(spec
, nid
, pfx
, &vols
);
6049 nid
= cfg
->speaker_pins
[0];
6051 err
= alc260_add_playback_controls(spec
, nid
, "Speaker", &vols
);
6056 nid
= cfg
->hp_pins
[0];
6058 err
= alc260_add_playback_controls(spec
, nid
, "Headphone",
6066 /* create playback/capture controls for input pins */
6067 static int alc260_auto_create_input_ctls(struct hda_codec
*codec
,
6068 const struct auto_pin_cfg
*cfg
)
6070 return alc_auto_create_input_ctls(codec
, cfg
, 0x07, 0x04, 0x05);
6073 static void alc260_auto_set_output_and_unmute(struct hda_codec
*codec
,
6074 hda_nid_t nid
, int pin_type
,
6077 alc_set_pin_output(codec
, nid
, pin_type
);
6078 /* need the manual connection? */
6080 int idx
= nid
- 0x12;
6081 snd_hda_codec_write(codec
, idx
+ 0x0b, 0,
6082 AC_VERB_SET_CONNECT_SEL
, sel_idx
);
6086 static void alc260_auto_init_multi_out(struct hda_codec
*codec
)
6088 struct alc_spec
*spec
= codec
->spec
;
6091 nid
= spec
->autocfg
.line_out_pins
[0];
6093 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
6094 alc260_auto_set_output_and_unmute(codec
, nid
, pin_type
, 0);
6097 nid
= spec
->autocfg
.speaker_pins
[0];
6099 alc260_auto_set_output_and_unmute(codec
, nid
, PIN_OUT
, 0);
6101 nid
= spec
->autocfg
.hp_pins
[0];
6103 alc260_auto_set_output_and_unmute(codec
, nid
, PIN_HP
, 0);
6106 #define ALC260_PIN_CD_NID 0x16
6107 static void alc260_auto_init_analog_input(struct hda_codec
*codec
)
6109 struct alc_spec
*spec
= codec
->spec
;
6112 for (i
= 0; i
< AUTO_PIN_LAST
; i
++) {
6113 hda_nid_t nid
= spec
->autocfg
.input_pins
[i
];
6115 alc_set_input_pin(codec
, nid
, i
);
6116 if (nid
!= ALC260_PIN_CD_NID
&&
6117 (get_wcaps(codec
, nid
) & AC_WCAP_OUT_AMP
))
6118 snd_hda_codec_write(codec
, nid
, 0,
6119 AC_VERB_SET_AMP_GAIN_MUTE
,
6126 * generic initialization of ADC, input mixers and output mixers
6128 static struct hda_verb alc260_volume_init_verbs
[] = {
6130 * Unmute ADC0-1 and set the default input to mic-in
6132 {0x04, AC_VERB_SET_CONNECT_SEL
, 0x00},
6133 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6134 {0x05, AC_VERB_SET_CONNECT_SEL
, 0x00},
6135 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6137 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
6139 * Note: PASD motherboards uses the Line In 2 as the input for
6140 * front panel mic (mic 2)
6142 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
6143 /* mute analog inputs */
6144 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6145 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6146 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
6147 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
6148 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
6151 * Set up output mixers (0x08 - 0x0a)
6153 /* set vol=0 to output mixers */
6154 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6155 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6156 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
6157 /* set up input amps for analog loopback */
6158 /* Amp Indices: DAC = 0, mixer = 1 */
6159 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6160 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
6161 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6162 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
6163 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6164 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
6169 static int alc260_parse_auto_config(struct hda_codec
*codec
)
6171 struct alc_spec
*spec
= codec
->spec
;
6173 static hda_nid_t alc260_ignore
[] = { 0x17, 0 };
6175 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
6179 err
= alc260_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
6182 if (!spec
->kctls
.list
)
6183 return 0; /* can't find valid BIOS pin config */
6184 err
= alc260_auto_create_input_ctls(codec
, &spec
->autocfg
);
6188 spec
->multiout
.max_channels
= 2;
6190 if (spec
->autocfg
.dig_outs
)
6191 spec
->multiout
.dig_out_nid
= ALC260_DIGOUT_NID
;
6192 if (spec
->kctls
.list
)
6193 add_mixer(spec
, spec
->kctls
.list
);
6195 add_verb(spec
, alc260_volume_init_verbs
);
6197 spec
->num_mux_defs
= 1;
6198 spec
->input_mux
= &spec
->private_imux
[0];
6200 alc_ssid_check(codec
, 0x10, 0x15, 0x0f);
6205 /* additional initialization for auto-configuration model */
6206 static void alc260_auto_init(struct hda_codec
*codec
)
6208 struct alc_spec
*spec
= codec
->spec
;
6209 alc260_auto_init_multi_out(codec
);
6210 alc260_auto_init_analog_input(codec
);
6211 if (spec
->unsol_event
)
6212 alc_inithook(codec
);
6215 #ifdef CONFIG_SND_HDA_POWER_SAVE
6216 static struct hda_amp_list alc260_loopbacks
[] = {
6217 { 0x07, HDA_INPUT
, 0 },
6218 { 0x07, HDA_INPUT
, 1 },
6219 { 0x07, HDA_INPUT
, 2 },
6220 { 0x07, HDA_INPUT
, 3 },
6221 { 0x07, HDA_INPUT
, 4 },
6227 * ALC260 configurations
6229 static const char *alc260_models
[ALC260_MODEL_LAST
] = {
6230 [ALC260_BASIC
] = "basic",
6232 [ALC260_HP_3013
] = "hp-3013",
6233 [ALC260_HP_DC7600
] = "hp-dc7600",
6234 [ALC260_FUJITSU_S702X
] = "fujitsu",
6235 [ALC260_ACER
] = "acer",
6236 [ALC260_WILL
] = "will",
6237 [ALC260_REPLACER_672V
] = "replacer",
6238 [ALC260_FAVORIT100
] = "favorit100",
6239 #ifdef CONFIG_SND_DEBUG
6240 [ALC260_TEST
] = "test",
6242 [ALC260_AUTO
] = "auto",
6245 static struct snd_pci_quirk alc260_cfg_tbl
[] = {
6246 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_ACER
),
6247 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER
),
6248 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FAVORIT100
),
6249 SND_PCI_QUIRK(0x103c, 0x2808, "HP d5700", ALC260_HP_3013
),
6250 SND_PCI_QUIRK(0x103c, 0x280a, "HP d5750", ALC260_HP_3013
),
6251 SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013
),
6252 SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP_3013
),
6253 SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_DC7600
),
6254 SND_PCI_QUIRK(0x103c, 0x3013, "HP", ALC260_HP_3013
),
6255 SND_PCI_QUIRK(0x103c, 0x3014, "HP", ALC260_HP
),
6256 SND_PCI_QUIRK(0x103c, 0x3015, "HP", ALC260_HP
),
6257 SND_PCI_QUIRK(0x103c, 0x3016, "HP", ALC260_HP
),
6258 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_BASIC
),
6259 SND_PCI_QUIRK(0x104d, 0x81cc, "Sony VAIO", ALC260_BASIC
),
6260 SND_PCI_QUIRK(0x104d, 0x81cd, "Sony VAIO", ALC260_BASIC
),
6261 SND_PCI_QUIRK(0x10cf, 0x1326, "Fujitsu S702X", ALC260_FUJITSU_S702X
),
6262 SND_PCI_QUIRK(0x152d, 0x0729, "CTL U553W", ALC260_BASIC
),
6263 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_REPLACER_672V
),
6264 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_WILL
),
6268 static struct alc_config_preset alc260_presets
[] = {
6270 .mixers
= { alc260_base_output_mixer
,
6271 alc260_input_mixer
},
6272 .init_verbs
= { alc260_init_verbs
},
6273 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6274 .dac_nids
= alc260_dac_nids
,
6275 .num_adc_nids
= ARRAY_SIZE(alc260_dual_adc_nids
),
6276 .adc_nids
= alc260_adc_nids
,
6277 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6278 .channel_mode
= alc260_modes
,
6279 .input_mux
= &alc260_capture_source
,
6282 .mixers
= { alc260_hp_output_mixer
,
6283 alc260_input_mixer
},
6284 .init_verbs
= { alc260_init_verbs
,
6285 alc260_hp_unsol_verbs
},
6286 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6287 .dac_nids
= alc260_dac_nids
,
6288 .num_adc_nids
= ARRAY_SIZE(alc260_adc_nids_alt
),
6289 .adc_nids
= alc260_adc_nids_alt
,
6290 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6291 .channel_mode
= alc260_modes
,
6292 .input_mux
= &alc260_capture_source
,
6293 .unsol_event
= alc260_hp_unsol_event
,
6294 .init_hook
= alc260_hp_automute
,
6296 [ALC260_HP_DC7600
] = {
6297 .mixers
= { alc260_hp_dc7600_mixer
,
6298 alc260_input_mixer
},
6299 .init_verbs
= { alc260_init_verbs
,
6300 alc260_hp_dc7600_verbs
},
6301 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6302 .dac_nids
= alc260_dac_nids
,
6303 .num_adc_nids
= ARRAY_SIZE(alc260_adc_nids_alt
),
6304 .adc_nids
= alc260_adc_nids_alt
,
6305 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6306 .channel_mode
= alc260_modes
,
6307 .input_mux
= &alc260_capture_source
,
6308 .unsol_event
= alc260_hp_3012_unsol_event
,
6309 .init_hook
= alc260_hp_3012_automute
,
6311 [ALC260_HP_3013
] = {
6312 .mixers
= { alc260_hp_3013_mixer
,
6313 alc260_input_mixer
},
6314 .init_verbs
= { alc260_hp_3013_init_verbs
,
6315 alc260_hp_3013_unsol_verbs
},
6316 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6317 .dac_nids
= alc260_dac_nids
,
6318 .num_adc_nids
= ARRAY_SIZE(alc260_adc_nids_alt
),
6319 .adc_nids
= alc260_adc_nids_alt
,
6320 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6321 .channel_mode
= alc260_modes
,
6322 .input_mux
= &alc260_capture_source
,
6323 .unsol_event
= alc260_hp_3013_unsol_event
,
6324 .init_hook
= alc260_hp_3013_automute
,
6326 [ALC260_FUJITSU_S702X
] = {
6327 .mixers
= { alc260_fujitsu_mixer
},
6328 .init_verbs
= { alc260_fujitsu_init_verbs
},
6329 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6330 .dac_nids
= alc260_dac_nids
,
6331 .num_adc_nids
= ARRAY_SIZE(alc260_dual_adc_nids
),
6332 .adc_nids
= alc260_dual_adc_nids
,
6333 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6334 .channel_mode
= alc260_modes
,
6335 .num_mux_defs
= ARRAY_SIZE(alc260_fujitsu_capture_sources
),
6336 .input_mux
= alc260_fujitsu_capture_sources
,
6339 .mixers
= { alc260_acer_mixer
},
6340 .init_verbs
= { alc260_acer_init_verbs
},
6341 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6342 .dac_nids
= alc260_dac_nids
,
6343 .num_adc_nids
= ARRAY_SIZE(alc260_dual_adc_nids
),
6344 .adc_nids
= alc260_dual_adc_nids
,
6345 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6346 .channel_mode
= alc260_modes
,
6347 .num_mux_defs
= ARRAY_SIZE(alc260_acer_capture_sources
),
6348 .input_mux
= alc260_acer_capture_sources
,
6350 [ALC260_FAVORIT100
] = {
6351 .mixers
= { alc260_favorit100_mixer
},
6352 .init_verbs
= { alc260_favorit100_init_verbs
},
6353 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6354 .dac_nids
= alc260_dac_nids
,
6355 .num_adc_nids
= ARRAY_SIZE(alc260_dual_adc_nids
),
6356 .adc_nids
= alc260_dual_adc_nids
,
6357 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6358 .channel_mode
= alc260_modes
,
6359 .num_mux_defs
= ARRAY_SIZE(alc260_favorit100_capture_sources
),
6360 .input_mux
= alc260_favorit100_capture_sources
,
6363 .mixers
= { alc260_will_mixer
},
6364 .init_verbs
= { alc260_init_verbs
, alc260_will_verbs
},
6365 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6366 .dac_nids
= alc260_dac_nids
,
6367 .num_adc_nids
= ARRAY_SIZE(alc260_adc_nids
),
6368 .adc_nids
= alc260_adc_nids
,
6369 .dig_out_nid
= ALC260_DIGOUT_NID
,
6370 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6371 .channel_mode
= alc260_modes
,
6372 .input_mux
= &alc260_capture_source
,
6374 [ALC260_REPLACER_672V
] = {
6375 .mixers
= { alc260_replacer_672v_mixer
},
6376 .init_verbs
= { alc260_init_verbs
, alc260_replacer_672v_verbs
},
6377 .num_dacs
= ARRAY_SIZE(alc260_dac_nids
),
6378 .dac_nids
= alc260_dac_nids
,
6379 .num_adc_nids
= ARRAY_SIZE(alc260_adc_nids
),
6380 .adc_nids
= alc260_adc_nids
,
6381 .dig_out_nid
= ALC260_DIGOUT_NID
,
6382 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6383 .channel_mode
= alc260_modes
,
6384 .input_mux
= &alc260_capture_source
,
6385 .unsol_event
= alc260_replacer_672v_unsol_event
,
6386 .init_hook
= alc260_replacer_672v_automute
,
6388 #ifdef CONFIG_SND_DEBUG
6390 .mixers
= { alc260_test_mixer
},
6391 .init_verbs
= { alc260_test_init_verbs
},
6392 .num_dacs
= ARRAY_SIZE(alc260_test_dac_nids
),
6393 .dac_nids
= alc260_test_dac_nids
,
6394 .num_adc_nids
= ARRAY_SIZE(alc260_test_adc_nids
),
6395 .adc_nids
= alc260_test_adc_nids
,
6396 .num_channel_mode
= ARRAY_SIZE(alc260_modes
),
6397 .channel_mode
= alc260_modes
,
6398 .num_mux_defs
= ARRAY_SIZE(alc260_test_capture_sources
),
6399 .input_mux
= alc260_test_capture_sources
,
6404 static int patch_alc260(struct hda_codec
*codec
)
6406 struct alc_spec
*spec
;
6407 int err
, board_config
;
6409 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
6415 board_config
= snd_hda_check_board_config(codec
, ALC260_MODEL_LAST
,
6418 if (board_config
< 0) {
6419 snd_printd(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
6421 board_config
= ALC260_AUTO
;
6424 if (board_config
== ALC260_AUTO
) {
6425 /* automatic parse from the BIOS config */
6426 err
= alc260_parse_auto_config(codec
);
6432 "hda_codec: Cannot set up configuration "
6433 "from BIOS. Using base mode...\n");
6434 board_config
= ALC260_BASIC
;
6438 err
= snd_hda_attach_beep_device(codec
, 0x1);
6444 if (board_config
!= ALC260_AUTO
)
6445 setup_preset(codec
, &alc260_presets
[board_config
]);
6447 spec
->stream_analog_playback
= &alc260_pcm_analog_playback
;
6448 spec
->stream_analog_capture
= &alc260_pcm_analog_capture
;
6450 spec
->stream_digital_playback
= &alc260_pcm_digital_playback
;
6451 spec
->stream_digital_capture
= &alc260_pcm_digital_capture
;
6453 if (!spec
->adc_nids
&& spec
->input_mux
) {
6454 /* check whether NID 0x04 is valid */
6455 unsigned int wcap
= get_wcaps(codec
, 0x04);
6456 wcap
= get_wcaps_type(wcap
);
6458 if (wcap
!= AC_WID_AUD_IN
|| spec
->input_mux
->num_items
== 1) {
6459 spec
->adc_nids
= alc260_adc_nids_alt
;
6460 spec
->num_adc_nids
= ARRAY_SIZE(alc260_adc_nids_alt
);
6462 spec
->adc_nids
= alc260_adc_nids
;
6463 spec
->num_adc_nids
= ARRAY_SIZE(alc260_adc_nids
);
6466 set_capture_mixer(codec
);
6467 set_beep_amp(spec
, 0x07, 0x05, HDA_INPUT
);
6469 spec
->vmaster_nid
= 0x08;
6471 codec
->patch_ops
= alc_patch_ops
;
6472 if (board_config
== ALC260_AUTO
)
6473 spec
->init_hook
= alc260_auto_init
;
6474 #ifdef CONFIG_SND_HDA_POWER_SAVE
6475 if (!spec
->loopback
.amplist
)
6476 spec
->loopback
.amplist
= alc260_loopbacks
;
6478 codec
->proc_widget_hook
= print_realtek_coef
;
6485 * ALC882/883/885/888/889 support
6487 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
6488 * configuration. Each pin widget can choose any input DACs and a mixer.
6489 * Each ADC is connected from a mixer of all inputs. This makes possible
6490 * 6-channel independent captures.
6492 * In addition, an independent DAC for the multi-playback (not used in this
6495 #define ALC882_DIGOUT_NID 0x06
6496 #define ALC882_DIGIN_NID 0x0a
6497 #define ALC883_DIGOUT_NID ALC882_DIGOUT_NID
6498 #define ALC883_DIGIN_NID ALC882_DIGIN_NID
6499 #define ALC1200_DIGOUT_NID 0x10
6502 static struct hda_channel_mode alc882_ch_modes
[1] = {
6507 static hda_nid_t alc882_dac_nids
[4] = {
6508 /* front, rear, clfe, rear_surr */
6509 0x02, 0x03, 0x04, 0x05
6511 #define alc883_dac_nids alc882_dac_nids
6514 #define alc882_adc_nids alc880_adc_nids
6515 #define alc882_adc_nids_alt alc880_adc_nids_alt
6516 #define alc883_adc_nids alc882_adc_nids_alt
6517 static hda_nid_t alc883_adc_nids_alt
[1] = { 0x08 };
6518 static hda_nid_t alc883_adc_nids_rev
[2] = { 0x09, 0x08 };
6519 #define alc889_adc_nids alc880_adc_nids
6521 static hda_nid_t alc882_capsrc_nids
[3] = { 0x24, 0x23, 0x22 };
6522 static hda_nid_t alc882_capsrc_nids_alt
[2] = { 0x23, 0x22 };
6523 #define alc883_capsrc_nids alc882_capsrc_nids_alt
6524 static hda_nid_t alc883_capsrc_nids_rev
[2] = { 0x22, 0x23 };
6525 #define alc889_capsrc_nids alc882_capsrc_nids
6528 /* FIXME: should be a matrix-type input source selection */
6530 static struct hda_input_mux alc882_capture_source
= {
6534 { "Front Mic", 0x1 },
6540 #define alc883_capture_source alc882_capture_source
6542 static struct hda_input_mux alc889_capture_source
= {
6545 { "Front Mic", 0x0 },
6551 static struct hda_input_mux mb5_capture_source
= {
6560 static struct hda_input_mux alc883_3stack_6ch_intel
= {
6564 { "Front Mic", 0x0 },
6570 static struct hda_input_mux alc883_lenovo_101e_capture_source
= {
6578 static struct hda_input_mux alc883_lenovo_nb0763_capture_source
= {
6588 static struct hda_input_mux alc883_fujitsu_pi2515_capture_source
= {
6596 static struct hda_input_mux alc883_lenovo_sky_capture_source
= {
6600 { "Front Mic", 0x1 },
6605 static struct hda_input_mux alc883_asus_eee1601_capture_source
= {
6613 static struct hda_input_mux alc889A_mb31_capture_source
= {
6617 /* Front Mic (0x01) unused */
6619 /* Line 2 (0x03) unused */
6620 /* CD (0x04) unsused? */
6627 static struct hda_channel_mode alc883_3ST_2ch_modes
[1] = {
6634 static struct hda_verb alc882_3ST_ch2_init
[] = {
6635 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6636 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6637 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6638 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6645 static struct hda_verb alc882_3ST_ch4_init
[] = {
6646 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6647 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6648 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6649 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6650 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6657 static struct hda_verb alc882_3ST_ch6_init
[] = {
6658 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6659 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6660 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
6661 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6662 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6663 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6667 static struct hda_channel_mode alc882_3ST_6ch_modes
[3] = {
6668 { 2, alc882_3ST_ch2_init
},
6669 { 4, alc882_3ST_ch4_init
},
6670 { 6, alc882_3ST_ch6_init
},
6673 #define alc883_3ST_6ch_modes alc882_3ST_6ch_modes
6678 static struct hda_verb alc883_3ST_ch2_clevo_init
[] = {
6679 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
6680 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6681 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6682 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6683 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6690 static struct hda_verb alc883_3ST_ch4_clevo_init
[] = {
6691 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6692 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6693 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6694 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6695 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6696 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6703 static struct hda_verb alc883_3ST_ch6_clevo_init
[] = {
6704 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6705 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6706 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6707 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
6708 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6709 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6710 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6714 static struct hda_channel_mode alc883_3ST_6ch_clevo_modes
[3] = {
6715 { 2, alc883_3ST_ch2_clevo_init
},
6716 { 4, alc883_3ST_ch4_clevo_init
},
6717 { 6, alc883_3ST_ch6_clevo_init
},
6724 static struct hda_verb alc882_sixstack_ch6_init
[] = {
6725 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
6726 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6727 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6728 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6735 static struct hda_verb alc882_sixstack_ch8_init
[] = {
6736 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6737 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6738 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6739 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6743 static struct hda_channel_mode alc882_sixstack_modes
[2] = {
6744 { 6, alc882_sixstack_ch6_init
},
6745 { 8, alc882_sixstack_ch8_init
},
6749 * macbook pro ALC885 can switch LineIn to LineOut without losing Mic
6755 static struct hda_verb alc885_mbp_ch2_init
[] = {
6756 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6757 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
6758 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
6765 static struct hda_verb alc885_mbp_ch4_init
[] = {
6766 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6767 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6768 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6769 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
6770 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
6774 static struct hda_channel_mode alc885_mbp_4ch_modes
[2] = {
6775 { 2, alc885_mbp_ch2_init
},
6776 { 4, alc885_mbp_ch4_init
},
6781 * Speakers/Woofer/HP = Front
6784 static struct hda_verb alc885_mb5_ch2_init
[] = {
6785 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6786 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6792 * Speakers/HP = Front
6796 static struct hda_verb alc885_mb5_ch6_init
[] = {
6797 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6798 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6799 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
6803 static struct hda_channel_mode alc885_mb5_6ch_modes
[2] = {
6804 { 2, alc885_mb5_ch2_init
},
6805 { 6, alc885_mb5_ch6_init
},
6812 static struct hda_verb alc883_4ST_ch2_init
[] = {
6813 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6814 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6815 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6816 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6817 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6818 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6825 static struct hda_verb alc883_4ST_ch4_init
[] = {
6826 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6827 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6828 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6829 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6830 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6831 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6832 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6839 static struct hda_verb alc883_4ST_ch6_init
[] = {
6840 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6841 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6842 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6843 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6844 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
6845 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6846 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6847 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6854 static struct hda_verb alc883_4ST_ch8_init
[] = {
6855 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6856 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6857 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x03 },
6858 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6859 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6860 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
6861 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6862 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6863 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6867 static struct hda_channel_mode alc883_4ST_8ch_modes
[4] = {
6868 { 2, alc883_4ST_ch2_init
},
6869 { 4, alc883_4ST_ch4_init
},
6870 { 6, alc883_4ST_ch6_init
},
6871 { 8, alc883_4ST_ch8_init
},
6878 static struct hda_verb alc883_3ST_ch2_intel_init
[] = {
6879 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6880 { 0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6881 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6882 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6889 static struct hda_verb alc883_3ST_ch4_intel_init
[] = {
6890 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
6891 { 0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6892 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6893 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6894 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6901 static struct hda_verb alc883_3ST_ch6_intel_init
[] = {
6902 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6903 { 0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6904 { 0x19, AC_VERB_SET_CONNECT_SEL
, 0x02 },
6905 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6906 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6907 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6911 static struct hda_channel_mode alc883_3ST_6ch_intel_modes
[3] = {
6912 { 2, alc883_3ST_ch2_intel_init
},
6913 { 4, alc883_3ST_ch4_intel_init
},
6914 { 6, alc883_3ST_ch6_intel_init
},
6920 static struct hda_verb alc889_ch2_intel_init
[] = {
6921 { 0x14, AC_VERB_SET_CONNECT_SEL
, 0x00 },
6922 { 0x19, AC_VERB_SET_CONNECT_SEL
, 0x00 },
6923 { 0x16, AC_VERB_SET_CONNECT_SEL
, 0x00 },
6924 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x00 },
6925 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6926 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6933 static struct hda_verb alc889_ch6_intel_init
[] = {
6934 { 0x14, AC_VERB_SET_CONNECT_SEL
, 0x00 },
6935 { 0x19, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6936 { 0x16, AC_VERB_SET_CONNECT_SEL
, 0x02 },
6937 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x03 },
6938 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
6939 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
6946 static struct hda_verb alc889_ch8_intel_init
[] = {
6947 { 0x14, AC_VERB_SET_CONNECT_SEL
, 0x00 },
6948 { 0x19, AC_VERB_SET_CONNECT_SEL
, 0x01 },
6949 { 0x16, AC_VERB_SET_CONNECT_SEL
, 0x02 },
6950 { 0x17, AC_VERB_SET_CONNECT_SEL
, 0x03 },
6951 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x03 },
6952 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6953 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
6957 static struct hda_channel_mode alc889_8ch_intel_modes
[3] = {
6958 { 2, alc889_ch2_intel_init
},
6959 { 6, alc889_ch6_intel_init
},
6960 { 8, alc889_ch8_intel_init
},
6966 static struct hda_verb alc883_sixstack_ch6_init
[] = {
6967 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
6968 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6969 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6970 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6977 static struct hda_verb alc883_sixstack_ch8_init
[] = {
6978 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6979 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6980 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6981 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
6985 static struct hda_channel_mode alc883_sixstack_modes
[2] = {
6986 { 6, alc883_sixstack_ch6_init
},
6987 { 8, alc883_sixstack_ch8_init
},
6991 /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
6992 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
6994 static struct snd_kcontrol_new alc882_base_mixer
[] = {
6995 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
6996 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
6997 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
6998 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
6999 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
7000 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
7001 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
7002 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
7003 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
7004 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
7005 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7006 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7007 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7008 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7009 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7010 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7011 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7012 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7013 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7014 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
7015 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7019 static struct snd_kcontrol_new alc885_mbp3_mixer
[] = {
7020 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT
),
7021 HDA_BIND_MUTE ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT
),
7022 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0e, 0x00, HDA_OUTPUT
),
7023 HDA_BIND_MUTE ("Headphone Playback Switch", 0x0e, 0x02, HDA_INPUT
),
7024 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT
),
7025 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7026 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7027 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT
),
7028 HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT
),
7029 HDA_CODEC_VOLUME("Line Boost", 0x1a, 0x00, HDA_INPUT
),
7030 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0x00, HDA_INPUT
),
7034 static struct snd_kcontrol_new alc885_mb5_mixer
[] = {
7035 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT
),
7036 HDA_BIND_MUTE ("Front Playback Switch", 0x0c, 0x02, HDA_INPUT
),
7037 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT
),
7038 HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT
),
7039 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT
),
7040 HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT
),
7041 HDA_CODEC_VOLUME("HP Playback Volume", 0x0f, 0x00, HDA_OUTPUT
),
7042 HDA_BIND_MUTE ("HP Playback Switch", 0x0f, 0x02, HDA_INPUT
),
7043 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7044 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7045 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
7046 HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
7047 HDA_CODEC_VOLUME("Line Boost", 0x15, 0x00, HDA_INPUT
),
7048 HDA_CODEC_VOLUME("Mic Boost", 0x19, 0x00, HDA_INPUT
),
7052 static struct snd_kcontrol_new alc882_w2jc_mixer
[] = {
7053 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7054 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7055 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7056 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7057 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7058 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7059 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7060 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7061 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7065 static struct snd_kcontrol_new alc882_targa_mixer
[] = {
7066 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7067 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7068 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7069 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7070 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7071 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7072 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7073 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7074 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7075 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7076 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7077 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7078 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
7082 /* Pin assignment: Front=0x14, HP = 0x15, Front = 0x16, ???
7083 * Front Mic=0x18, Line In = 0x1a, Line In = 0x1b, CD = 0x1c
7085 static struct snd_kcontrol_new alc882_asus_a7j_mixer
[] = {
7086 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7087 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
7088 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
7089 HDA_CODEC_MUTE("Mobile Front Playback Switch", 0x16, 0x0, HDA_OUTPUT
),
7090 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7091 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7092 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7093 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7094 HDA_CODEC_VOLUME("Mobile Line Playback Volume", 0x0b, 0x03, HDA_INPUT
),
7095 HDA_CODEC_MUTE("Mobile Line Playback Switch", 0x0b, 0x03, HDA_INPUT
),
7096 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7097 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7098 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7102 static struct snd_kcontrol_new alc882_asus_a7m_mixer
[] = {
7103 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7104 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7105 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
7106 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7107 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7108 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7109 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7110 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7111 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7112 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7116 static struct snd_kcontrol_new alc882_chmode_mixer
[] = {
7118 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
7119 .name
= "Channel Mode",
7120 .info
= alc_ch_mode_info
,
7121 .get
= alc_ch_mode_get
,
7122 .put
= alc_ch_mode_put
,
7127 static struct hda_verb alc882_base_init_verbs
[] = {
7128 /* Front mixer: unmute input/output amp left and right (volume = 0) */
7129 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7130 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7131 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7133 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7134 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7135 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7137 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7138 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7139 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7141 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7142 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7143 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7145 /* mute analog input loopbacks */
7146 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7147 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7148 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7149 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7150 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7152 /* Front Pin: output 0 (0x0c) */
7153 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7154 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7155 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
7156 /* Rear Pin: output 1 (0x0d) */
7157 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7158 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7159 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
7160 /* CLFE Pin: output 2 (0x0e) */
7161 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7162 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7163 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x02},
7164 /* Side Pin: output 3 (0x0f) */
7165 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7166 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7167 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
7168 /* Mic (rear) pin: input vref at 80% */
7169 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7170 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7171 /* Front Mic pin: input vref at 80% */
7172 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7173 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7174 /* Line In pin: input */
7175 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7176 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7177 /* Line-2 In: Headphone output (output 0 - 0x0c) */
7178 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7179 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7180 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
7181 /* CD pin widget for input */
7182 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7184 /* FIXME: use matrix-type input source selection */
7185 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
7187 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7188 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7189 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7190 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7192 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7193 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7194 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7195 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7196 /* ADC2: mute amp left and right */
7197 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7198 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
7199 /* ADC3: mute amp left and right */
7200 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7201 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
7206 static struct hda_verb alc882_adc1_init_verbs
[] = {
7207 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
7208 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7209 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7210 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7211 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7212 /* ADC1: mute amp left and right */
7213 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7214 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
7218 static struct hda_verb alc882_eapd_verbs
[] = {
7219 /* change to EAPD mode */
7220 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
7221 {0x20, AC_VERB_SET_PROC_COEF
, 0x3060},
7225 static struct hda_verb alc889_eapd_verbs
[] = {
7226 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
7227 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
7231 static struct hda_verb alc_hp15_unsol_verbs
[] = {
7232 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
7233 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7237 static struct hda_verb alc885_init_verbs
[] = {
7238 /* Front mixer: unmute input/output amp left and right (volume = 0) */
7239 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7240 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7241 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7243 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7244 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7245 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7247 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7248 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7249 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7251 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7252 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7253 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7255 /* mute analog input loopbacks */
7256 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7257 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7258 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7260 /* Front HP Pin: output 0 (0x0c) */
7261 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7262 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7263 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
7264 /* Front Pin: output 0 (0x0c) */
7265 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7266 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7267 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
7268 /* Rear Pin: output 1 (0x0d) */
7269 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7270 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7271 {0x19, AC_VERB_SET_CONNECT_SEL
, 0x01},
7272 /* CLFE Pin: output 2 (0x0e) */
7273 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7274 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7275 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x02},
7276 /* Side Pin: output 3 (0x0f) */
7277 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7278 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7279 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
7280 /* Mic (rear) pin: input vref at 80% */
7281 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7282 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7283 /* Front Mic pin: input vref at 80% */
7284 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7285 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7286 /* Line In pin: input */
7287 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7288 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7290 /* Mixer elements: 0x18, , 0x1a, 0x1b */
7292 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
7293 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7294 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7296 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7297 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7298 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7300 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
7301 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7302 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7303 /* ADC2: mute amp left and right */
7304 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7305 /* ADC3: mute amp left and right */
7306 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7311 static struct hda_verb alc885_init_input_verbs
[] = {
7312 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7313 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
7314 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
7319 /* Unmute Selector 24h and set the default input to front mic */
7320 static struct hda_verb alc889_init_input_verbs
[] = {
7321 {0x24, AC_VERB_SET_CONNECT_SEL
, 0x00},
7322 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7327 #define alc883_init_verbs alc882_base_init_verbs
7330 static struct snd_kcontrol_new alc882_macpro_mixer
[] = {
7331 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7332 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7333 HDA_CODEC_MUTE("Headphone Playback Switch", 0x18, 0x0, HDA_OUTPUT
),
7334 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT
),
7335 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT
),
7336 /* FIXME: this looks suspicious...
7337 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x02, HDA_INPUT),
7338 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x02, HDA_INPUT),
7343 static struct hda_verb alc882_macpro_init_verbs
[] = {
7344 /* Front mixer: unmute input/output amp left and right (volume = 0) */
7345 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7346 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7347 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7348 /* Front Pin: output 0 (0x0c) */
7349 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7350 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7351 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
7352 /* Front Mic pin: input vref at 80% */
7353 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7354 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7355 /* Speaker: output */
7356 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7357 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7358 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x04},
7359 /* Headphone output (output 0 - 0x0c) */
7360 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7361 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7362 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x00},
7364 /* FIXME: use matrix-type input source selection */
7365 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
7366 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
7367 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7368 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7369 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7370 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7372 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7373 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7374 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7375 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7377 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7378 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7379 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7380 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7381 /* ADC1: mute amp left and right */
7382 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7383 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
7384 /* ADC2: mute amp left and right */
7385 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7386 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
7387 /* ADC3: mute amp left and right */
7388 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7389 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
7395 static struct hda_verb alc885_mb5_init_verbs
[] = {
7397 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7398 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7399 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7400 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7402 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7403 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7404 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7405 /* Surround mixer */
7406 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7407 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7408 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7410 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7411 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7412 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7414 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7415 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7416 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7417 /* Front Pin (0x0c) */
7418 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
| 0x01},
7419 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7420 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x00},
7421 /* LFE Pin (0x0e) */
7422 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
| 0x01},
7423 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7424 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x02},
7426 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7427 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7428 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x03},
7429 /* Front Mic pin: input vref at 80% */
7430 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7431 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7433 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7434 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7436 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7437 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7438 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7439 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7443 /* Macbook Pro rev3 */
7444 static struct hda_verb alc885_mbp3_init_verbs
[] = {
7445 /* Front mixer: unmute input/output amp left and right (volume = 0) */
7446 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7447 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7448 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7450 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7451 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7452 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7454 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7455 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7456 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7457 /* Front Pin: output 0 (0x0c) */
7458 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7459 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7460 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
7461 /* HP Pin: output 0 (0x0e) */
7462 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc4},
7463 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7464 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x02},
7465 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
7466 /* Mic (rear) pin: input vref at 80% */
7467 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7468 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7469 /* Front Mic pin: input vref at 80% */
7470 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7471 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7472 /* Line In pin: use output 1 when in LineOut mode */
7473 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
7474 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7475 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01},
7477 /* FIXME: use matrix-type input source selection */
7478 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
7479 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
7480 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7481 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7482 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7483 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7485 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7486 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7487 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7488 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7490 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7491 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7492 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7493 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7494 /* ADC1: mute amp left and right */
7495 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7496 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
7497 /* ADC2: mute amp left and right */
7498 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7499 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
7500 /* ADC3: mute amp left and right */
7501 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7502 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
7507 /* iMac 24 mixer. */
7508 static struct snd_kcontrol_new alc885_imac24_mixer
[] = {
7509 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x00, HDA_OUTPUT
),
7510 HDA_CODEC_MUTE("Master Playback Switch", 0x0c, 0x00, HDA_INPUT
),
7514 /* iMac 24 init verbs. */
7515 static struct hda_verb alc885_imac24_init_verbs
[] = {
7516 /* Internal speakers: output 0 (0x0c) */
7517 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7518 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7519 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x00},
7520 /* Internal speakers: output 0 (0x0c) */
7521 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7522 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7523 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x00},
7524 /* Headphone: output 0 (0x0c) */
7525 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7526 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
7527 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
7528 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
7529 /* Front Mic: input vref at 80% */
7530 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
7531 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
7535 /* Toggle speaker-output according to the hp-jack state */
7536 static void alc885_imac24_setup(struct hda_codec
*codec
)
7538 struct alc_spec
*spec
= codec
->spec
;
7540 spec
->autocfg
.hp_pins
[0] = 0x14;
7541 spec
->autocfg
.speaker_pins
[0] = 0x18;
7542 spec
->autocfg
.speaker_pins
[1] = 0x1a;
7545 static void alc885_mbp3_setup(struct hda_codec
*codec
)
7547 struct alc_spec
*spec
= codec
->spec
;
7549 spec
->autocfg
.hp_pins
[0] = 0x15;
7550 spec
->autocfg
.speaker_pins
[0] = 0x14;
7554 static struct hda_verb alc882_targa_verbs
[] = {
7555 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7556 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7558 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7559 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7561 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* mic/clfe */
7562 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* line/surround */
7563 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
7565 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
7569 /* toggle speaker-output according to the hp-jack state */
7570 static void alc882_targa_automute(struct hda_codec
*codec
)
7572 struct alc_spec
*spec
= codec
->spec
;
7573 alc_automute_amp(codec
);
7574 snd_hda_codec_write_cache(codec
, 1, 0, AC_VERB_SET_GPIO_DATA
,
7575 spec
->jack_present
? 1 : 3);
7578 static void alc882_targa_setup(struct hda_codec
*codec
)
7580 struct alc_spec
*spec
= codec
->spec
;
7582 spec
->autocfg
.hp_pins
[0] = 0x14;
7583 spec
->autocfg
.speaker_pins
[0] = 0x1b;
7586 static void alc882_targa_unsol_event(struct hda_codec
*codec
, unsigned int res
)
7588 if ((res
>> 26) == ALC880_HP_EVENT
)
7589 alc882_targa_automute(codec
);
7592 static struct hda_verb alc882_asus_a7j_verbs
[] = {
7593 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7594 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7596 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7597 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7598 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7600 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Front */
7601 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
7602 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Front */
7604 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* mic/clfe */
7605 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* line/surround */
7606 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
7610 static struct hda_verb alc882_asus_a7m_verbs
[] = {
7611 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7612 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7614 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
7615 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7616 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
7618 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Front */
7619 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
7620 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Front */
7622 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* mic/clfe */
7623 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* line/surround */
7624 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP */
7628 static void alc882_gpio_mute(struct hda_codec
*codec
, int pin
, int muted
)
7630 unsigned int gpiostate
, gpiomask
, gpiodir
;
7632 gpiostate
= snd_hda_codec_read(codec
, codec
->afg
, 0,
7633 AC_VERB_GET_GPIO_DATA
, 0);
7636 gpiostate
|= (1 << pin
);
7638 gpiostate
&= ~(1 << pin
);
7640 gpiomask
= snd_hda_codec_read(codec
, codec
->afg
, 0,
7641 AC_VERB_GET_GPIO_MASK
, 0);
7642 gpiomask
|= (1 << pin
);
7644 gpiodir
= snd_hda_codec_read(codec
, codec
->afg
, 0,
7645 AC_VERB_GET_GPIO_DIRECTION
, 0);
7646 gpiodir
|= (1 << pin
);
7649 snd_hda_codec_write(codec
, codec
->afg
, 0,
7650 AC_VERB_SET_GPIO_MASK
, gpiomask
);
7651 snd_hda_codec_write(codec
, codec
->afg
, 0,
7652 AC_VERB_SET_GPIO_DIRECTION
, gpiodir
);
7656 snd_hda_codec_write(codec
, codec
->afg
, 0,
7657 AC_VERB_SET_GPIO_DATA
, gpiostate
);
7660 /* set up GPIO at initialization */
7661 static void alc885_macpro_init_hook(struct hda_codec
*codec
)
7663 alc882_gpio_mute(codec
, 0, 0);
7664 alc882_gpio_mute(codec
, 1, 0);
7667 /* set up GPIO and update auto-muting at initialization */
7668 static void alc885_imac24_init_hook(struct hda_codec
*codec
)
7670 alc885_macpro_init_hook(codec
);
7671 alc_automute_amp(codec
);
7675 * generic initialization of ADC, input mixers and output mixers
7677 static struct hda_verb alc883_auto_init_verbs
[] = {
7679 * Unmute ADC0-2 and set the default input to mic-in
7681 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
7682 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7683 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
7684 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7686 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
7688 * Note: PASD motherboards uses the Line In 2 as the input for
7689 * front panel mic (mic 2)
7691 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
7692 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
7693 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
7694 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
7695 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
7696 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
7699 * Set up output mixers (0x0c - 0x0f)
7701 /* set vol=0 to output mixers */
7702 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7703 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7704 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7705 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
7706 /* set up input amps for analog loopback */
7707 /* Amp Indices: DAC = 0, mixer = 1 */
7708 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7709 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7710 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7711 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7712 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7713 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7714 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7715 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7716 {0x26, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
7717 {0x26, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
7719 /* FIXME: use matrix-type input source selection */
7720 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
7722 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
7723 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
7724 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
7725 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
7727 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
7728 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
7729 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
7730 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
7735 /* 2ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:front) */
7736 static struct hda_verb alc889A_mb31_ch2_init
[] = {
7737 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP as front */
7738 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Subwoofer on */
7739 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* Line as input */
7740 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
}, /* Line off */
7744 /* 4ch mode (Speaker:front, Subwoofer:CLFE, Line:CLFE, Headphones:front) */
7745 static struct hda_verb alc889A_mb31_ch4_init
[] = {
7746 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* HP as front */
7747 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Subwoofer on */
7748 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
}, /* Line as output */
7749 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Line on */
7753 /* 5ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:rear) */
7754 static struct hda_verb alc889A_mb31_ch5_init
[] = {
7755 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* HP as rear */
7756 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Subwoofer on */
7757 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* Line as input */
7758 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
}, /* Line off */
7762 /* 6ch mode (Speaker:front, Subwoofer:off, Line:CLFE, Headphones:Rear) */
7763 static struct hda_verb alc889A_mb31_ch6_init
[] = {
7764 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* HP as front */
7765 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
}, /* Subwoofer off */
7766 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
}, /* Line as output */
7767 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
}, /* Line on */
7771 static struct hda_channel_mode alc889A_mb31_6ch_modes
[4] = {
7772 { 2, alc889A_mb31_ch2_init
},
7773 { 4, alc889A_mb31_ch4_init
},
7774 { 5, alc889A_mb31_ch5_init
},
7775 { 6, alc889A_mb31_ch6_init
},
7778 static struct hda_verb alc883_medion_eapd_verbs
[] = {
7779 /* eanable EAPD on medion laptop */
7780 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
7781 {0x20, AC_VERB_SET_PROC_COEF
, 0x3070},
7785 #define alc883_base_mixer alc882_base_mixer
7787 static struct snd_kcontrol_new alc883_mitac_mixer
[] = {
7788 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7789 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7790 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
7791 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
7792 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
7793 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
7794 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
7795 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7796 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7797 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7798 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7799 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
7800 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7804 static struct snd_kcontrol_new alc883_clevo_m720_mixer
[] = {
7805 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7806 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
7807 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7808 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
7809 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7810 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7811 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7812 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7813 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
7814 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7818 static struct snd_kcontrol_new alc883_2ch_fujitsu_pi2515_mixer
[] = {
7819 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7820 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT
),
7821 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7822 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
7823 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7824 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7825 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7826 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7827 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
7828 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7832 static struct snd_kcontrol_new alc883_3ST_2ch_mixer
[] = {
7833 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7834 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7835 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7836 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7837 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7838 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7839 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7840 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7841 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7842 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7843 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7844 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
7845 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7849 static struct snd_kcontrol_new alc883_3ST_6ch_mixer
[] = {
7850 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7851 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7852 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7853 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
7854 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
7855 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
7856 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
7857 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
7858 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7859 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7860 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7861 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7862 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7863 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7864 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7865 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7866 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7867 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
7868 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7872 static struct snd_kcontrol_new alc883_3ST_6ch_intel_mixer
[] = {
7873 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7874 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7875 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7876 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
7877 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
7879 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
7880 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
7881 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
7882 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
7883 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7884 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7885 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7886 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7887 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7888 HDA_CODEC_VOLUME("Mic Boost", 0x19, 0, HDA_INPUT
),
7889 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7890 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7891 HDA_CODEC_VOLUME("Front Mic Boost", 0x18, 0, HDA_INPUT
),
7892 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7896 static struct snd_kcontrol_new alc885_8ch_intel_mixer
[] = {
7897 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7898 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7899 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7900 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
7901 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
7903 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
7904 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
7905 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
7906 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
7907 HDA_BIND_MUTE("Speaker Playback Switch", 0x0f, 2, HDA_INPUT
),
7908 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
7909 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7910 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7911 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x3, HDA_INPUT
),
7912 HDA_CODEC_VOLUME("Mic Boost", 0x1b, 0, HDA_INPUT
),
7913 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x3, HDA_INPUT
),
7914 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7915 HDA_CODEC_VOLUME("Front Mic Boost", 0x18, 0, HDA_INPUT
),
7916 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7920 static struct snd_kcontrol_new alc883_fivestack_mixer
[] = {
7921 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7922 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7923 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7924 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
7925 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
7926 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
7927 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
7928 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
7929 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7930 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7931 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7932 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7933 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7934 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7935 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7936 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7937 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7938 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
7939 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7943 static struct snd_kcontrol_new alc883_targa_mixer
[] = {
7944 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7945 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7946 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
7947 HDA_CODEC_MUTE("Speaker Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7948 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7949 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
7950 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
7951 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
7952 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
7953 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
7954 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7955 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7956 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
7957 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
7958 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7959 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7960 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7964 static struct snd_kcontrol_new alc883_targa_2ch_mixer
[] = {
7965 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7966 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7967 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
7968 HDA_CODEC_MUTE("Speaker Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7969 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
7970 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
7971 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
7972 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7973 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
7974 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7975 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
7976 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7980 static struct snd_kcontrol_new alc883_targa_8ch_mixer
[] = {
7981 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
7982 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
7983 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7984 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
7985 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
7989 static struct snd_kcontrol_new alc883_lenovo_101e_2ch_mixer
[] = {
7990 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
7991 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
7992 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
7993 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT
),
7994 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
7995 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
7996 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
7997 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
8001 static struct snd_kcontrol_new alc883_lenovo_nb0763_mixer
[] = {
8002 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8003 HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 2, HDA_INPUT
),
8004 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
8005 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8006 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8007 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8008 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8009 HDA_CODEC_VOLUME("iMic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
8010 HDA_CODEC_MUTE("iMic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
8014 static struct snd_kcontrol_new alc883_medion_md2_mixer
[] = {
8015 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8016 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
8017 HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
8018 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8019 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8020 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8021 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8022 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8023 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8027 static struct snd_kcontrol_new alc883_acer_aspire_mixer
[] = {
8028 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8029 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8030 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
8031 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8032 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8033 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8034 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
8035 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8039 static struct snd_kcontrol_new alc888_acer_aspire_6530_mixer
[] = {
8040 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8041 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8042 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
8043 HDA_BIND_MUTE("LFE Playback Switch", 0x0f, 2, HDA_INPUT
),
8044 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8045 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8046 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8047 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8048 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8049 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
8050 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8054 static struct snd_kcontrol_new alc888_lenovo_sky_mixer
[] = {
8055 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8056 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8057 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0e, 0x0, HDA_OUTPUT
),
8058 HDA_BIND_MUTE("Surround Playback Switch", 0x0e, 2, HDA_INPUT
),
8059 HDA_CODEC_VOLUME_MONO("Center Playback Volume",
8060 0x0d, 1, 0x0, HDA_OUTPUT
),
8061 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT
),
8062 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT
),
8063 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT
),
8064 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT
),
8065 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
8066 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
8067 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
8068 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8069 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8070 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8071 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
8072 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8073 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
8074 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
8075 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
8079 static struct snd_kcontrol_new alc889A_mb31_mixer
[] = {
8081 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT
),
8082 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 0x02, HDA_INPUT
),
8083 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT
),
8084 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT
),
8085 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x00,
8087 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x02, HDA_INPUT
),
8088 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x00, HDA_OUTPUT
),
8089 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x02, HDA_INPUT
),
8090 /* Output switches */
8091 HDA_CODEC_MUTE("Enable Speaker", 0x14, 0x00, HDA_OUTPUT
),
8092 HDA_CODEC_MUTE("Enable Headphones", 0x15, 0x00, HDA_OUTPUT
),
8093 HDA_CODEC_MUTE_MONO("Enable LFE", 0x16, 2, 0x00, HDA_OUTPUT
),
8095 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0x00, HDA_INPUT
),
8096 HDA_CODEC_VOLUME("Line Boost", 0x1a, 0x00, HDA_INPUT
),
8098 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT
),
8099 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT
),
8100 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8101 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8105 static struct snd_kcontrol_new alc883_vaiott_mixer
[] = {
8106 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8107 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8108 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
8109 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
8110 HDA_CODEC_VOLUME("Mic Boost", 0x19, 0, HDA_INPUT
),
8111 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
8115 static struct hda_bind_ctls alc883_bind_cap_vol
= {
8116 .ops
= &snd_hda_bind_vol
,
8118 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT
),
8119 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT
),
8124 static struct hda_bind_ctls alc883_bind_cap_switch
= {
8125 .ops
= &snd_hda_bind_sw
,
8127 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT
),
8128 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT
),
8133 static struct snd_kcontrol_new alc883_asus_eee1601_mixer
[] = {
8134 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
8135 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
8136 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
8137 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
8138 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
8139 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
8140 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
8141 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
8145 static struct snd_kcontrol_new alc883_asus_eee1601_cap_mixer
[] = {
8146 HDA_BIND_VOL("Capture Volume", &alc883_bind_cap_vol
),
8147 HDA_BIND_SW("Capture Switch", &alc883_bind_cap_switch
),
8149 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
8150 /* .name = "Capture Source", */
8151 .name
= "Input Source",
8153 .info
= alc_mux_enum_info
,
8154 .get
= alc_mux_enum_get
,
8155 .put
= alc_mux_enum_put
,
8160 static struct snd_kcontrol_new alc883_chmode_mixer
[] = {
8162 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
8163 .name
= "Channel Mode",
8164 .info
= alc_ch_mode_info
,
8165 .get
= alc_ch_mode_get
,
8166 .put
= alc_ch_mode_put
,
8171 /* toggle speaker-output according to the hp-jack state */
8172 static void alc883_mitac_setup(struct hda_codec
*codec
)
8174 struct alc_spec
*spec
= codec
->spec
;
8176 spec
->autocfg
.hp_pins
[0] = 0x15;
8177 spec
->autocfg
.speaker_pins
[0] = 0x14;
8178 spec
->autocfg
.speaker_pins
[1] = 0x17;
8181 /* auto-toggle front mic */
8183 static void alc883_mitac_mic_automute(struct hda_codec *codec)
8185 unsigned int present;
8188 present = snd_hda_codec_read(codec, 0x18, 0,
8189 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
8190 bits = present ? HDA_AMP_MUTE : 0;
8191 snd_hda_codec_amp_stereo(codec, 0x0b, HDA_INPUT, 1, HDA_AMP_MUTE, bits);
8195 static struct hda_verb alc883_mitac_verbs
[] = {
8197 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8198 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8200 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x02},
8201 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8203 /* enable unsolicited event */
8204 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8205 /* {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_MIC_EVENT | AC_USRSP_EN}, */
8210 static struct hda_verb alc883_clevo_m540r_verbs
[] = {
8212 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8213 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8215 /*{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},*/
8217 /* enable unsolicited event */
8219 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8220 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_MIC_EVENT | AC_USRSP_EN},
8226 static struct hda_verb alc883_clevo_m720_verbs
[] = {
8228 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8229 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8231 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x01},
8232 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8234 /* enable unsolicited event */
8235 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8236 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_MIC_EVENT
| AC_USRSP_EN
},
8241 static struct hda_verb alc883_2ch_fujitsu_pi2515_verbs
[] = {
8243 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
8244 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8246 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
8247 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8249 /* enable unsolicited event */
8250 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8255 static struct hda_verb alc883_targa_verbs
[] = {
8256 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8257 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8259 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8260 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8262 /* Connect Line-Out side jack (SPDIF) to Side */
8263 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8264 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8265 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
8266 /* Connect Mic jack to CLFE */
8267 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8268 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8269 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02},
8270 /* Connect Line-in jack to Surround */
8271 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8272 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8273 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01},
8274 /* Connect HP out jack to Front */
8275 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8276 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8277 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
8279 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8284 static struct hda_verb alc883_lenovo_101e_verbs
[] = {
8285 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8286 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_FRONT_EVENT
|AC_USRSP_EN
},
8287 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
|AC_USRSP_EN
},
8291 static struct hda_verb alc883_lenovo_nb0763_verbs
[] = {
8292 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8293 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8294 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8295 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8299 static struct hda_verb alc888_lenovo_ms7195_verbs
[] = {
8300 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8301 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8302 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8303 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_FRONT_EVENT
| AC_USRSP_EN
},
8304 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8308 static struct hda_verb alc883_haier_w66_verbs
[] = {
8309 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8310 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8312 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8314 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
8315 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8316 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8317 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8321 static struct hda_verb alc888_lenovo_sky_verbs
[] = {
8322 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8323 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8324 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8325 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8326 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8327 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8328 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x00},
8329 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8333 static struct hda_verb alc888_6st_dell_verbs
[] = {
8334 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8338 static struct hda_verb alc883_vaiott_verbs
[] = {
8340 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8341 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8343 /* enable unsolicited event */
8344 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8349 static void alc888_3st_hp_setup(struct hda_codec
*codec
)
8351 struct alc_spec
*spec
= codec
->spec
;
8353 spec
->autocfg
.hp_pins
[0] = 0x1b;
8354 spec
->autocfg
.speaker_pins
[0] = 0x14;
8355 spec
->autocfg
.speaker_pins
[1] = 0x16;
8356 spec
->autocfg
.speaker_pins
[2] = 0x18;
8359 static struct hda_verb alc888_3st_hp_verbs
[] = {
8360 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Front: output 0 (0x0c) */
8361 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Rear : output 1 (0x0d) */
8362 {0x18, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* CLFE : output 2 (0x0e) */
8363 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8370 static struct hda_verb alc888_3st_hp_2ch_init
[] = {
8371 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
8372 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8373 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
8374 { 0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8381 static struct hda_verb alc888_3st_hp_4ch_init
[] = {
8382 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
8383 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
8384 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8385 { 0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8386 { 0x16, AC_VERB_SET_CONNECT_SEL
, 0x01 },
8393 static struct hda_verb alc888_3st_hp_6ch_init
[] = {
8394 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8395 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8396 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
8397 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8398 { 0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8399 { 0x16, AC_VERB_SET_CONNECT_SEL
, 0x01 },
8403 static struct hda_channel_mode alc888_3st_hp_modes
[3] = {
8404 { 2, alc888_3st_hp_2ch_init
},
8405 { 4, alc888_3st_hp_4ch_init
},
8406 { 6, alc888_3st_hp_6ch_init
},
8409 /* toggle front-jack and RCA according to the hp-jack state */
8410 static void alc888_lenovo_ms7195_front_automute(struct hda_codec
*codec
)
8412 unsigned int present
;
8414 present
= snd_hda_codec_read(codec
, 0x1b, 0,
8415 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
8416 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
8417 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
8418 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
8419 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
8422 /* toggle RCA according to the front-jack state */
8423 static void alc888_lenovo_ms7195_rca_automute(struct hda_codec
*codec
)
8425 unsigned int present
;
8427 present
= snd_hda_codec_read(codec
, 0x14, 0,
8428 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
8429 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
8430 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
8433 static void alc883_lenovo_ms7195_unsol_event(struct hda_codec
*codec
,
8436 if ((res
>> 26) == ALC880_HP_EVENT
)
8437 alc888_lenovo_ms7195_front_automute(codec
);
8438 if ((res
>> 26) == ALC880_FRONT_EVENT
)
8439 alc888_lenovo_ms7195_rca_automute(codec
);
8442 static struct hda_verb alc883_medion_md2_verbs
[] = {
8443 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8444 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8446 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8448 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8452 /* toggle speaker-output according to the hp-jack state */
8453 static void alc883_medion_md2_setup(struct hda_codec
*codec
)
8455 struct alc_spec
*spec
= codec
->spec
;
8457 spec
->autocfg
.hp_pins
[0] = 0x14;
8458 spec
->autocfg
.speaker_pins
[0] = 0x15;
8461 /* toggle speaker-output according to the hp-jack state */
8462 #define alc883_targa_init_hook alc882_targa_init_hook
8463 #define alc883_targa_unsol_event alc882_targa_unsol_event
8465 static void alc883_clevo_m720_mic_automute(struct hda_codec
*codec
)
8467 unsigned int present
;
8469 present
= snd_hda_codec_read(codec
, 0x18, 0,
8470 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
8471 snd_hda_codec_amp_stereo(codec
, 0x0b, HDA_INPUT
, 1,
8472 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
8475 static void alc883_clevo_m720_setup(struct hda_codec
*codec
)
8477 struct alc_spec
*spec
= codec
->spec
;
8479 spec
->autocfg
.hp_pins
[0] = 0x15;
8480 spec
->autocfg
.speaker_pins
[0] = 0x14;
8483 static void alc883_clevo_m720_init_hook(struct hda_codec
*codec
)
8485 alc_automute_amp(codec
);
8486 alc883_clevo_m720_mic_automute(codec
);
8489 static void alc883_clevo_m720_unsol_event(struct hda_codec
*codec
,
8492 switch (res
>> 26) {
8493 case ALC880_MIC_EVENT
:
8494 alc883_clevo_m720_mic_automute(codec
);
8497 alc_automute_amp_unsol_event(codec
, res
);
8502 /* toggle speaker-output according to the hp-jack state */
8503 static void alc883_2ch_fujitsu_pi2515_setup(struct hda_codec
*codec
)
8505 struct alc_spec
*spec
= codec
->spec
;
8507 spec
->autocfg
.hp_pins
[0] = 0x14;
8508 spec
->autocfg
.speaker_pins
[0] = 0x15;
8511 static void alc883_haier_w66_setup(struct hda_codec
*codec
)
8513 struct alc_spec
*spec
= codec
->spec
;
8515 spec
->autocfg
.hp_pins
[0] = 0x1b;
8516 spec
->autocfg
.speaker_pins
[0] = 0x14;
8519 static void alc883_lenovo_101e_ispeaker_automute(struct hda_codec
*codec
)
8521 unsigned int present
;
8524 present
= snd_hda_codec_read(codec
, 0x14, 0, AC_VERB_GET_PIN_SENSE
, 0)
8525 & AC_PINSENSE_PRESENCE
;
8526 bits
= present
? HDA_AMP_MUTE
: 0;
8527 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
8528 HDA_AMP_MUTE
, bits
);
8531 static void alc883_lenovo_101e_all_automute(struct hda_codec
*codec
)
8533 unsigned int present
;
8536 present
= snd_hda_codec_read(codec
, 0x1b, 0,
8537 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
8538 bits
= present
? HDA_AMP_MUTE
: 0;
8539 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
8540 HDA_AMP_MUTE
, bits
);
8541 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
8542 HDA_AMP_MUTE
, bits
);
8545 static void alc883_lenovo_101e_unsol_event(struct hda_codec
*codec
,
8548 if ((res
>> 26) == ALC880_HP_EVENT
)
8549 alc883_lenovo_101e_all_automute(codec
);
8550 if ((res
>> 26) == ALC880_FRONT_EVENT
)
8551 alc883_lenovo_101e_ispeaker_automute(codec
);
8554 /* toggle speaker-output according to the hp-jack state */
8555 static void alc883_acer_aspire_setup(struct hda_codec
*codec
)
8557 struct alc_spec
*spec
= codec
->spec
;
8559 spec
->autocfg
.hp_pins
[0] = 0x14;
8560 spec
->autocfg
.speaker_pins
[0] = 0x15;
8561 spec
->autocfg
.speaker_pins
[1] = 0x16;
8564 static struct hda_verb alc883_acer_eapd_verbs
[] = {
8565 /* HP Pin: output 0 (0x0c) */
8566 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8567 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
8568 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
8569 /* Front Pin: output 0 (0x0c) */
8570 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8571 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8572 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8573 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x00},
8574 /* eanable EAPD on medion laptop */
8575 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
8576 {0x20, AC_VERB_SET_PROC_COEF
, 0x3050},
8577 /* enable unsolicited event */
8578 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8582 static struct hda_verb alc888_acer_aspire_7730G_verbs
[] = {
8583 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
8584 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x02},
8585 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8589 static void alc888_6st_dell_setup(struct hda_codec
*codec
)
8591 struct alc_spec
*spec
= codec
->spec
;
8593 spec
->autocfg
.hp_pins
[0] = 0x1b;
8594 spec
->autocfg
.speaker_pins
[0] = 0x14;
8595 spec
->autocfg
.speaker_pins
[1] = 0x15;
8596 spec
->autocfg
.speaker_pins
[2] = 0x16;
8597 spec
->autocfg
.speaker_pins
[3] = 0x17;
8600 static void alc888_lenovo_sky_setup(struct hda_codec
*codec
)
8602 struct alc_spec
*spec
= codec
->spec
;
8604 spec
->autocfg
.hp_pins
[0] = 0x1b;
8605 spec
->autocfg
.speaker_pins
[0] = 0x14;
8606 spec
->autocfg
.speaker_pins
[1] = 0x15;
8607 spec
->autocfg
.speaker_pins
[2] = 0x16;
8608 spec
->autocfg
.speaker_pins
[3] = 0x17;
8609 spec
->autocfg
.speaker_pins
[4] = 0x1a;
8612 static void alc883_vaiott_setup(struct hda_codec
*codec
)
8614 struct alc_spec
*spec
= codec
->spec
;
8616 spec
->autocfg
.hp_pins
[0] = 0x15;
8617 spec
->autocfg
.speaker_pins
[0] = 0x14;
8618 spec
->autocfg
.speaker_pins
[1] = 0x17;
8621 static struct hda_verb alc888_asus_m90v_verbs
[] = {
8622 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8623 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8624 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
8625 /* enable unsolicited event */
8626 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8627 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_MIC_EVENT
| AC_USRSP_EN
},
8631 static void alc883_mode2_setup(struct hda_codec
*codec
)
8633 struct alc_spec
*spec
= codec
->spec
;
8635 spec
->autocfg
.hp_pins
[0] = 0x1b;
8636 spec
->autocfg
.speaker_pins
[0] = 0x14;
8637 spec
->autocfg
.speaker_pins
[1] = 0x15;
8638 spec
->autocfg
.speaker_pins
[2] = 0x16;
8639 spec
->ext_mic
.pin
= 0x18;
8640 spec
->int_mic
.pin
= 0x19;
8641 spec
->ext_mic
.mux_idx
= 0;
8642 spec
->int_mic
.mux_idx
= 1;
8646 static struct hda_verb alc888_asus_eee1601_verbs
[] = {
8647 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
8648 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
8649 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
8650 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
8651 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
8652 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0b},
8653 {0x20, AC_VERB_SET_PROC_COEF
, 0x0838},
8654 /* enable unsolicited event */
8655 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8659 static void alc883_eee1601_inithook(struct hda_codec
*codec
)
8661 struct alc_spec
*spec
= codec
->spec
;
8663 spec
->autocfg
.hp_pins
[0] = 0x14;
8664 spec
->autocfg
.speaker_pins
[0] = 0x1b;
8665 alc_automute_pin(codec
);
8668 static struct hda_verb alc889A_mb31_verbs
[] = {
8669 /* Init rear pin (used as headphone output) */
8670 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc4}, /* Apple Headphones */
8671 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Connect to front */
8672 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
8673 /* Init line pin (used as output in 4ch and 6ch mode) */
8674 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x02}, /* Connect to CLFE */
8675 /* Init line 2 pin (used as headphone out by default) */
8676 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* Use as input */
8677 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
}, /* Mute output */
8681 /* Mute speakers according to the headphone jack state */
8682 static void alc889A_mb31_automute(struct hda_codec
*codec
)
8684 unsigned int present
;
8686 /* Mute only in 2ch or 4ch mode */
8687 if (snd_hda_codec_read(codec
, 0x15, 0, AC_VERB_GET_CONNECT_SEL
, 0)
8689 present
= snd_hda_codec_read(codec
, 0x15, 0,
8690 AC_VERB_GET_PIN_SENSE
, 0) & AC_PINSENSE_PRESENCE
;
8691 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
8692 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
8693 snd_hda_codec_amp_stereo(codec
, 0x16, HDA_OUTPUT
, 0,
8694 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
8698 static void alc889A_mb31_unsol_event(struct hda_codec
*codec
, unsigned int res
)
8700 if ((res
>> 26) == ALC880_HP_EVENT
)
8701 alc889A_mb31_automute(codec
);
8705 #ifdef CONFIG_SND_HDA_POWER_SAVE
8706 #define alc882_loopbacks alc880_loopbacks
8709 /* pcm configuration: identical with ALC880 */
8710 #define alc882_pcm_analog_playback alc880_pcm_analog_playback
8711 #define alc882_pcm_analog_capture alc880_pcm_analog_capture
8712 #define alc882_pcm_digital_playback alc880_pcm_digital_playback
8713 #define alc882_pcm_digital_capture alc880_pcm_digital_capture
8715 static hda_nid_t alc883_slave_dig_outs
[] = {
8716 ALC1200_DIGOUT_NID
, 0,
8719 static hda_nid_t alc1200_slave_dig_outs
[] = {
8720 ALC883_DIGOUT_NID
, 0,
8724 * configuration and preset
8726 static const char *alc882_models
[ALC882_MODEL_LAST
] = {
8727 [ALC882_3ST_DIG
] = "3stack-dig",
8728 [ALC882_6ST_DIG
] = "6stack-dig",
8729 [ALC882_ARIMA
] = "arima",
8730 [ALC882_W2JC
] = "w2jc",
8731 [ALC882_TARGA
] = "targa",
8732 [ALC882_ASUS_A7J
] = "asus-a7j",
8733 [ALC882_ASUS_A7M
] = "asus-a7m",
8734 [ALC885_MACPRO
] = "macpro",
8735 [ALC885_MB5
] = "mb5",
8736 [ALC885_MBP3
] = "mbp3",
8737 [ALC885_IMAC24
] = "imac24",
8738 [ALC883_3ST_2ch_DIG
] = "3stack-2ch-dig",
8739 [ALC883_3ST_6ch_DIG
] = "3stack-6ch-dig",
8740 [ALC883_3ST_6ch
] = "3stack-6ch",
8741 [ALC883_6ST_DIG
] = "alc883-6stack-dig",
8742 [ALC883_TARGA_DIG
] = "targa-dig",
8743 [ALC883_TARGA_2ch_DIG
] = "targa-2ch-dig",
8744 [ALC883_TARGA_8ch_DIG
] = "targa-8ch-dig",
8745 [ALC883_ACER
] = "acer",
8746 [ALC883_ACER_ASPIRE
] = "acer-aspire",
8747 [ALC888_ACER_ASPIRE_4930G
] = "acer-aspire-4930g",
8748 [ALC888_ACER_ASPIRE_6530G
] = "acer-aspire-6530g",
8749 [ALC888_ACER_ASPIRE_8930G
] = "acer-aspire-8930g",
8750 [ALC888_ACER_ASPIRE_7730G
] = "acer-aspire-7730g",
8751 [ALC883_MEDION
] = "medion",
8752 [ALC883_MEDION_MD2
] = "medion-md2",
8753 [ALC883_LAPTOP_EAPD
] = "laptop-eapd",
8754 [ALC883_LENOVO_101E_2ch
] = "lenovo-101e",
8755 [ALC883_LENOVO_NB0763
] = "lenovo-nb0763",
8756 [ALC888_LENOVO_MS7195_DIG
] = "lenovo-ms7195-dig",
8757 [ALC888_LENOVO_SKY
] = "lenovo-sky",
8758 [ALC883_HAIER_W66
] = "haier-w66",
8759 [ALC888_3ST_HP
] = "3stack-hp",
8760 [ALC888_6ST_DELL
] = "6stack-dell",
8761 [ALC883_MITAC
] = "mitac",
8762 [ALC883_CLEVO_M540R
] = "clevo-m540r",
8763 [ALC883_CLEVO_M720
] = "clevo-m720",
8764 [ALC883_FUJITSU_PI2515
] = "fujitsu-pi2515",
8765 [ALC888_FUJITSU_XA3530
] = "fujitsu-xa3530",
8766 [ALC883_3ST_6ch_INTEL
] = "3stack-6ch-intel",
8767 [ALC889A_INTEL
] = "intel-alc889a",
8768 [ALC889_INTEL
] = "intel-x58",
8769 [ALC1200_ASUS_P5Q
] = "asus-p5q",
8770 [ALC889A_MB31
] = "mb31",
8771 [ALC883_SONY_VAIO_TT
] = "sony-vaio-tt",
8772 [ALC882_AUTO
] = "auto",
8775 static struct snd_pci_quirk alc882_cfg_tbl
[] = {
8776 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG
),
8778 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE
),
8779 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_ACER_ASPIRE
),
8780 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_ACER_ASPIRE
),
8781 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE
),
8782 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE
),
8783 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE
),
8784 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
8785 ALC888_ACER_ASPIRE_4930G
),
8786 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
8787 ALC888_ACER_ASPIRE_4930G
),
8788 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
8789 ALC888_ACER_ASPIRE_8930G
),
8790 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
8791 ALC888_ACER_ASPIRE_8930G
),
8792 SND_PCI_QUIRK(0x1025, 0x0157, "Acer X3200", ALC882_AUTO
),
8793 SND_PCI_QUIRK(0x1025, 0x0158, "Acer AX1700-U3700A", ALC882_AUTO
),
8794 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
8795 ALC888_ACER_ASPIRE_6530G
),
8796 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
8797 ALC888_ACER_ASPIRE_6530G
),
8798 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
8799 ALC888_ACER_ASPIRE_7730G
),
8800 /* default Acer -- disabled as it causes more problems.
8801 * model=auto should work fine now
8803 /* SND_PCI_QUIRK_VENDOR(0x1025, "Acer laptop", ALC883_ACER), */
8805 SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL
),
8807 SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG
),
8808 SND_PCI_QUIRK(0x103c, 0x2a4f, "HP Samba", ALC888_3ST_HP
),
8809 SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP
),
8810 SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG
),
8811 SND_PCI_QUIRK(0x103c, 0x2a66, "HP Acacia", ALC888_3ST_HP
),
8812 SND_PCI_QUIRK(0x103c, 0x2a72, "HP Educ.ar", ALC888_3ST_HP
),
8814 SND_PCI_QUIRK(0x1043, 0x060d, "Asus A7J", ALC882_ASUS_A7J
),
8815 SND_PCI_QUIRK(0x1043, 0x1243, "Asus A7J", ALC882_ASUS_A7J
),
8816 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_ASUS_A7M
),
8817 SND_PCI_QUIRK(0x1043, 0x1873, "Asus M90V", ALC888_ASUS_M90V
),
8818 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC
),
8819 SND_PCI_QUIRK(0x1043, 0x817f, "Asus P5LD2", ALC882_6ST_DIG
),
8820 SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG
),
8821 SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG
),
8822 SND_PCI_QUIRK(0x1043, 0x8284, "Asus Z37E", ALC883_6ST_DIG
),
8823 SND_PCI_QUIRK(0x1043, 0x82fe, "Asus P5Q-EM HDMI", ALC1200_ASUS_P5Q
),
8824 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_ASUS_EEE1601
),
8826 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC883_SONY_VAIO_TT
),
8827 SND_PCI_QUIRK(0x105b, 0x0ce8, "Foxconn P35AX-S", ALC883_6ST_DIG
),
8828 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG
),
8829 SND_PCI_QUIRK(0x1071, 0x8227, "Mitac 82801H", ALC883_MITAC
),
8830 SND_PCI_QUIRK(0x1071, 0x8253, "Mitac 8252d", ALC883_MITAC
),
8831 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD
),
8832 SND_PCI_QUIRK(0x10f1, 0x2350, "TYAN-S2350", ALC888_6ST_DELL
),
8833 SND_PCI_QUIRK(0x108e, 0x534d, NULL
, ALC883_3ST_6ch
),
8834 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte P35 DS3R", ALC882_6ST_DIG
),
8836 SND_PCI_QUIRK(0x1462, 0x0349, "MSI", ALC883_TARGA_2ch_DIG
),
8837 SND_PCI_QUIRK(0x1462, 0x040d, "MSI", ALC883_TARGA_2ch_DIG
),
8838 SND_PCI_QUIRK(0x1462, 0x0579, "MSI", ALC883_TARGA_2ch_DIG
),
8839 SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA
), /* MSI-1049 T8 */
8840 SND_PCI_QUIRK(0x1462, 0x2fb3, "MSI", ALC883_TARGA_2ch_DIG
),
8841 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG
),
8842 SND_PCI_QUIRK(0x1462, 0x3729, "MSI S420", ALC883_TARGA_DIG
),
8843 SND_PCI_QUIRK(0x1462, 0x3783, "NEC S970", ALC883_TARGA_DIG
),
8844 SND_PCI_QUIRK(0x1462, 0x3b7f, "MSI", ALC883_TARGA_2ch_DIG
),
8845 SND_PCI_QUIRK(0x1462, 0x3ef9, "MSI", ALC883_TARGA_DIG
),
8846 SND_PCI_QUIRK(0x1462, 0x3fc1, "MSI", ALC883_TARGA_DIG
),
8847 SND_PCI_QUIRK(0x1462, 0x3fc3, "MSI", ALC883_TARGA_DIG
),
8848 SND_PCI_QUIRK(0x1462, 0x3fcc, "MSI", ALC883_TARGA_DIG
),
8849 SND_PCI_QUIRK(0x1462, 0x3fdf, "MSI", ALC883_TARGA_DIG
),
8850 SND_PCI_QUIRK(0x1462, 0x42cd, "MSI", ALC883_TARGA_DIG
),
8851 SND_PCI_QUIRK(0x1462, 0x4314, "MSI", ALC883_TARGA_DIG
),
8852 SND_PCI_QUIRK(0x1462, 0x4319, "MSI", ALC883_TARGA_DIG
),
8853 SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG
),
8854 SND_PCI_QUIRK(0x1462, 0x6510, "MSI GX620", ALC883_TARGA_8ch_DIG
),
8855 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC883_6ST_DIG
),
8856 SND_PCI_QUIRK(0x1462, 0x7187, "MSI", ALC883_6ST_DIG
),
8857 SND_PCI_QUIRK(0x1462, 0x7250, "MSI", ALC883_6ST_DIG
),
8858 SND_PCI_QUIRK(0x1462, 0x7260, "MSI 7260", ALC883_TARGA_DIG
),
8859 SND_PCI_QUIRK(0x1462, 0x7267, "MSI", ALC883_3ST_6ch_DIG
),
8860 SND_PCI_QUIRK(0x1462, 0x7280, "MSI", ALC883_6ST_DIG
),
8861 SND_PCI_QUIRK(0x1462, 0x7327, "MSI", ALC883_6ST_DIG
),
8862 SND_PCI_QUIRK(0x1462, 0x7350, "MSI", ALC883_6ST_DIG
),
8863 SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG
),
8864 SND_PCI_QUIRK(0x1462, 0xaa08, "MSI", ALC883_TARGA_2ch_DIG
),
8866 SND_PCI_QUIRK(0x147b, 0x1083, "Abit IP35-PRO", ALC883_6ST_DIG
),
8867 SND_PCI_QUIRK(0x1558, 0x0721, "Clevo laptop M720R", ALC883_CLEVO_M720
),
8868 SND_PCI_QUIRK(0x1558, 0x0722, "Clevo laptop M720SR", ALC883_CLEVO_M720
),
8869 SND_PCI_QUIRK(0x1558, 0x5409, "Clevo laptop M540R", ALC883_CLEVO_M540R
),
8870 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC883_LAPTOP_EAPD
),
8871 SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch
),
8872 /* SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA), */
8873 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION
),
8874 SND_PCI_QUIRK_MASK(0x1734, 0xfff0, 0x1100, "FSC AMILO Xi/Pi25xx",
8875 ALC883_FUJITSU_PI2515
),
8876 SND_PCI_QUIRK_MASK(0x1734, 0xfff0, 0x1130, "Fujitsu AMILO Xa35xx",
8877 ALC888_FUJITSU_XA3530
),
8878 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch
),
8879 SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763
),
8880 SND_PCI_QUIRK(0x17aa, 0x3bfc, "Lenovo NB0763", ALC883_LENOVO_NB0763
),
8881 SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763
),
8882 SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY
),
8883 SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2
),
8884 SND_PCI_QUIRK(0x17c0, 0x4085, "MEDION MD96630", ALC888_LENOVO_MS7195_DIG
),
8885 SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG
),
8886 SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66
),
8888 SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL
),
8889 SND_PCI_QUIRK(0x8086, 0x0002, "DG33FBC", ALC883_3ST_6ch_INTEL
),
8890 SND_PCI_QUIRK(0x8086, 0x2503, "82801H", ALC883_MITAC
),
8891 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_INTEL
),
8892 SND_PCI_QUIRK(0x8086, 0x0021, "Intel IbexPeak", ALC889A_INTEL
),
8893 SND_PCI_QUIRK(0x8086, 0x3b56, "Intel IbexPeak", ALC889A_INTEL
),
8894 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch
),
8899 /* codec SSID table for Intel Mac */
8900 static struct snd_pci_quirk alc882_ssid_cfg_tbl
[] = {
8901 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC885_MBP3
),
8902 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC885_MBP3
),
8903 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC885_MBP3
),
8904 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC885_MACPRO
),
8905 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_IMAC24
),
8906 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_IMAC24
),
8907 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC885_MBP3
),
8908 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889A_MB31
),
8909 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3
),
8910 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24
),
8911 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5
),
8912 /* FIXME: HP jack sense seems not working for MBP 5,1, so apparently
8913 * no perfect solution yet
8915 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC885_MB5
),
8919 static struct alc_config_preset alc882_presets
[] = {
8920 [ALC882_3ST_DIG
] = {
8921 .mixers
= { alc882_base_mixer
},
8922 .init_verbs
= { alc882_base_init_verbs
,
8923 alc882_adc1_init_verbs
},
8924 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
8925 .dac_nids
= alc882_dac_nids
,
8926 .dig_out_nid
= ALC882_DIGOUT_NID
,
8927 .dig_in_nid
= ALC882_DIGIN_NID
,
8928 .num_channel_mode
= ARRAY_SIZE(alc882_ch_modes
),
8929 .channel_mode
= alc882_ch_modes
,
8931 .input_mux
= &alc882_capture_source
,
8933 [ALC882_6ST_DIG
] = {
8934 .mixers
= { alc882_base_mixer
, alc882_chmode_mixer
},
8935 .init_verbs
= { alc882_base_init_verbs
,
8936 alc882_adc1_init_verbs
},
8937 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
8938 .dac_nids
= alc882_dac_nids
,
8939 .dig_out_nid
= ALC882_DIGOUT_NID
,
8940 .dig_in_nid
= ALC882_DIGIN_NID
,
8941 .num_channel_mode
= ARRAY_SIZE(alc882_sixstack_modes
),
8942 .channel_mode
= alc882_sixstack_modes
,
8943 .input_mux
= &alc882_capture_source
,
8946 .mixers
= { alc882_base_mixer
, alc882_chmode_mixer
},
8947 .init_verbs
= { alc882_base_init_verbs
, alc882_adc1_init_verbs
,
8948 alc882_eapd_verbs
},
8949 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
8950 .dac_nids
= alc882_dac_nids
,
8951 .num_channel_mode
= ARRAY_SIZE(alc882_sixstack_modes
),
8952 .channel_mode
= alc882_sixstack_modes
,
8953 .input_mux
= &alc882_capture_source
,
8956 .mixers
= { alc882_w2jc_mixer
, alc882_chmode_mixer
},
8957 .init_verbs
= { alc882_base_init_verbs
, alc882_adc1_init_verbs
,
8958 alc882_eapd_verbs
, alc880_gpio1_init_verbs
},
8959 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
8960 .dac_nids
= alc882_dac_nids
,
8961 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
8962 .channel_mode
= alc880_threestack_modes
,
8964 .input_mux
= &alc882_capture_source
,
8965 .dig_out_nid
= ALC882_DIGOUT_NID
,
8968 .mixers
= { alc885_mbp3_mixer
, alc882_chmode_mixer
},
8969 .init_verbs
= { alc885_mbp3_init_verbs
,
8970 alc880_gpio1_init_verbs
},
8972 .dac_nids
= alc882_dac_nids
,
8974 .channel_mode
= alc885_mbp_4ch_modes
,
8975 .num_channel_mode
= ARRAY_SIZE(alc885_mbp_4ch_modes
),
8976 .input_mux
= &alc882_capture_source
,
8977 .dig_out_nid
= ALC882_DIGOUT_NID
,
8978 .dig_in_nid
= ALC882_DIGIN_NID
,
8979 .unsol_event
= alc_automute_amp_unsol_event
,
8980 .setup
= alc885_mbp3_setup
,
8981 .init_hook
= alc_automute_amp
,
8984 .mixers
= { alc885_mb5_mixer
, alc882_chmode_mixer
},
8985 .init_verbs
= { alc885_mb5_init_verbs
,
8986 alc880_gpio1_init_verbs
},
8987 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
8988 .dac_nids
= alc882_dac_nids
,
8989 .channel_mode
= alc885_mb5_6ch_modes
,
8990 .num_channel_mode
= ARRAY_SIZE(alc885_mb5_6ch_modes
),
8991 .input_mux
= &mb5_capture_source
,
8992 .dig_out_nid
= ALC882_DIGOUT_NID
,
8993 .dig_in_nid
= ALC882_DIGIN_NID
,
8996 .mixers
= { alc882_macpro_mixer
},
8997 .init_verbs
= { alc882_macpro_init_verbs
},
8998 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
8999 .dac_nids
= alc882_dac_nids
,
9000 .dig_out_nid
= ALC882_DIGOUT_NID
,
9001 .dig_in_nid
= ALC882_DIGIN_NID
,
9002 .num_channel_mode
= ARRAY_SIZE(alc882_ch_modes
),
9003 .channel_mode
= alc882_ch_modes
,
9004 .input_mux
= &alc882_capture_source
,
9005 .init_hook
= alc885_macpro_init_hook
,
9008 .mixers
= { alc885_imac24_mixer
},
9009 .init_verbs
= { alc885_imac24_init_verbs
},
9010 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
9011 .dac_nids
= alc882_dac_nids
,
9012 .dig_out_nid
= ALC882_DIGOUT_NID
,
9013 .dig_in_nid
= ALC882_DIGIN_NID
,
9014 .num_channel_mode
= ARRAY_SIZE(alc882_ch_modes
),
9015 .channel_mode
= alc882_ch_modes
,
9016 .input_mux
= &alc882_capture_source
,
9017 .unsol_event
= alc_automute_amp_unsol_event
,
9018 .setup
= alc885_imac24_setup
,
9019 .init_hook
= alc885_imac24_init_hook
,
9022 .mixers
= { alc882_targa_mixer
, alc882_chmode_mixer
},
9023 .init_verbs
= { alc882_base_init_verbs
, alc882_adc1_init_verbs
,
9024 alc880_gpio3_init_verbs
, alc882_targa_verbs
},
9025 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
9026 .dac_nids
= alc882_dac_nids
,
9027 .dig_out_nid
= ALC882_DIGOUT_NID
,
9028 .num_adc_nids
= ARRAY_SIZE(alc882_adc_nids
),
9029 .adc_nids
= alc882_adc_nids
,
9030 .capsrc_nids
= alc882_capsrc_nids
,
9031 .num_channel_mode
= ARRAY_SIZE(alc882_3ST_6ch_modes
),
9032 .channel_mode
= alc882_3ST_6ch_modes
,
9034 .input_mux
= &alc882_capture_source
,
9035 .unsol_event
= alc882_targa_unsol_event
,
9036 .setup
= alc882_targa_setup
,
9037 .init_hook
= alc882_targa_automute
,
9039 [ALC882_ASUS_A7J
] = {
9040 .mixers
= { alc882_asus_a7j_mixer
, alc882_chmode_mixer
},
9041 .init_verbs
= { alc882_base_init_verbs
, alc882_adc1_init_verbs
,
9042 alc882_asus_a7j_verbs
},
9043 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
9044 .dac_nids
= alc882_dac_nids
,
9045 .dig_out_nid
= ALC882_DIGOUT_NID
,
9046 .num_adc_nids
= ARRAY_SIZE(alc882_adc_nids
),
9047 .adc_nids
= alc882_adc_nids
,
9048 .capsrc_nids
= alc882_capsrc_nids
,
9049 .num_channel_mode
= ARRAY_SIZE(alc882_3ST_6ch_modes
),
9050 .channel_mode
= alc882_3ST_6ch_modes
,
9052 .input_mux
= &alc882_capture_source
,
9054 [ALC882_ASUS_A7M
] = {
9055 .mixers
= { alc882_asus_a7m_mixer
, alc882_chmode_mixer
},
9056 .init_verbs
= { alc882_base_init_verbs
, alc882_adc1_init_verbs
,
9057 alc882_eapd_verbs
, alc880_gpio1_init_verbs
,
9058 alc882_asus_a7m_verbs
},
9059 .num_dacs
= ARRAY_SIZE(alc882_dac_nids
),
9060 .dac_nids
= alc882_dac_nids
,
9061 .dig_out_nid
= ALC882_DIGOUT_NID
,
9062 .num_channel_mode
= ARRAY_SIZE(alc880_threestack_modes
),
9063 .channel_mode
= alc880_threestack_modes
,
9065 .input_mux
= &alc882_capture_source
,
9067 [ALC883_3ST_2ch_DIG
] = {
9068 .mixers
= { alc883_3ST_2ch_mixer
},
9069 .init_verbs
= { alc883_init_verbs
},
9070 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9071 .dac_nids
= alc883_dac_nids
,
9072 .dig_out_nid
= ALC883_DIGOUT_NID
,
9073 .dig_in_nid
= ALC883_DIGIN_NID
,
9074 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9075 .channel_mode
= alc883_3ST_2ch_modes
,
9076 .input_mux
= &alc883_capture_source
,
9078 [ALC883_3ST_6ch_DIG
] = {
9079 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
9080 .init_verbs
= { alc883_init_verbs
},
9081 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9082 .dac_nids
= alc883_dac_nids
,
9083 .dig_out_nid
= ALC883_DIGOUT_NID
,
9084 .dig_in_nid
= ALC883_DIGIN_NID
,
9085 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9086 .channel_mode
= alc883_3ST_6ch_modes
,
9088 .input_mux
= &alc883_capture_source
,
9090 [ALC883_3ST_6ch
] = {
9091 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
9092 .init_verbs
= { alc883_init_verbs
},
9093 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9094 .dac_nids
= alc883_dac_nids
,
9095 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9096 .channel_mode
= alc883_3ST_6ch_modes
,
9098 .input_mux
= &alc883_capture_source
,
9100 [ALC883_3ST_6ch_INTEL
] = {
9101 .mixers
= { alc883_3ST_6ch_intel_mixer
, alc883_chmode_mixer
},
9102 .init_verbs
= { alc883_init_verbs
},
9103 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9104 .dac_nids
= alc883_dac_nids
,
9105 .dig_out_nid
= ALC883_DIGOUT_NID
,
9106 .dig_in_nid
= ALC883_DIGIN_NID
,
9107 .slave_dig_outs
= alc883_slave_dig_outs
,
9108 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_intel_modes
),
9109 .channel_mode
= alc883_3ST_6ch_intel_modes
,
9111 .input_mux
= &alc883_3stack_6ch_intel
,
9114 .mixers
= { alc885_8ch_intel_mixer
, alc883_chmode_mixer
},
9115 .init_verbs
= { alc885_init_verbs
, alc885_init_input_verbs
,
9116 alc_hp15_unsol_verbs
},
9117 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9118 .dac_nids
= alc883_dac_nids
,
9119 .num_adc_nids
= ARRAY_SIZE(alc889_adc_nids
),
9120 .adc_nids
= alc889_adc_nids
,
9121 .dig_out_nid
= ALC883_DIGOUT_NID
,
9122 .dig_in_nid
= ALC883_DIGIN_NID
,
9123 .slave_dig_outs
= alc883_slave_dig_outs
,
9124 .num_channel_mode
= ARRAY_SIZE(alc889_8ch_intel_modes
),
9125 .channel_mode
= alc889_8ch_intel_modes
,
9126 .capsrc_nids
= alc889_capsrc_nids
,
9127 .input_mux
= &alc889_capture_source
,
9128 .setup
= alc889_automute_setup
,
9129 .init_hook
= alc_automute_amp
,
9130 .unsol_event
= alc_automute_amp_unsol_event
,
9134 .mixers
= { alc885_8ch_intel_mixer
, alc883_chmode_mixer
},
9135 .init_verbs
= { alc885_init_verbs
, alc889_init_input_verbs
,
9136 alc889_eapd_verbs
, alc_hp15_unsol_verbs
},
9137 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9138 .dac_nids
= alc883_dac_nids
,
9139 .num_adc_nids
= ARRAY_SIZE(alc889_adc_nids
),
9140 .adc_nids
= alc889_adc_nids
,
9141 .dig_out_nid
= ALC883_DIGOUT_NID
,
9142 .dig_in_nid
= ALC883_DIGIN_NID
,
9143 .slave_dig_outs
= alc883_slave_dig_outs
,
9144 .num_channel_mode
= ARRAY_SIZE(alc889_8ch_intel_modes
),
9145 .channel_mode
= alc889_8ch_intel_modes
,
9146 .capsrc_nids
= alc889_capsrc_nids
,
9147 .input_mux
= &alc889_capture_source
,
9148 .setup
= alc889_automute_setup
,
9149 .init_hook
= alc889_intel_init_hook
,
9150 .unsol_event
= alc_automute_amp_unsol_event
,
9153 [ALC883_6ST_DIG
] = {
9154 .mixers
= { alc883_base_mixer
, alc883_chmode_mixer
},
9155 .init_verbs
= { alc883_init_verbs
},
9156 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9157 .dac_nids
= alc883_dac_nids
,
9158 .dig_out_nid
= ALC883_DIGOUT_NID
,
9159 .dig_in_nid
= ALC883_DIGIN_NID
,
9160 .num_channel_mode
= ARRAY_SIZE(alc883_sixstack_modes
),
9161 .channel_mode
= alc883_sixstack_modes
,
9162 .input_mux
= &alc883_capture_source
,
9164 [ALC883_TARGA_DIG
] = {
9165 .mixers
= { alc883_targa_mixer
, alc883_chmode_mixer
},
9166 .init_verbs
= { alc883_init_verbs
, alc880_gpio3_init_verbs
,
9167 alc883_targa_verbs
},
9168 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9169 .dac_nids
= alc883_dac_nids
,
9170 .dig_out_nid
= ALC883_DIGOUT_NID
,
9171 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9172 .channel_mode
= alc883_3ST_6ch_modes
,
9174 .input_mux
= &alc883_capture_source
,
9175 .unsol_event
= alc883_targa_unsol_event
,
9176 .setup
= alc882_targa_setup
,
9177 .init_hook
= alc882_targa_automute
,
9179 [ALC883_TARGA_2ch_DIG
] = {
9180 .mixers
= { alc883_targa_2ch_mixer
},
9181 .init_verbs
= { alc883_init_verbs
, alc880_gpio3_init_verbs
,
9182 alc883_targa_verbs
},
9183 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9184 .dac_nids
= alc883_dac_nids
,
9185 .adc_nids
= alc883_adc_nids_alt
,
9186 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_alt
),
9187 .dig_out_nid
= ALC883_DIGOUT_NID
,
9188 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9189 .channel_mode
= alc883_3ST_2ch_modes
,
9190 .input_mux
= &alc883_capture_source
,
9191 .unsol_event
= alc883_targa_unsol_event
,
9192 .setup
= alc882_targa_setup
,
9193 .init_hook
= alc882_targa_automute
,
9195 [ALC883_TARGA_8ch_DIG
] = {
9196 .mixers
= { alc883_targa_mixer
, alc883_targa_8ch_mixer
,
9197 alc883_chmode_mixer
},
9198 .init_verbs
= { alc883_init_verbs
, alc880_gpio3_init_verbs
,
9199 alc883_targa_verbs
},
9200 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9201 .dac_nids
= alc883_dac_nids
,
9202 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_rev
),
9203 .adc_nids
= alc883_adc_nids_rev
,
9204 .capsrc_nids
= alc883_capsrc_nids_rev
,
9205 .dig_out_nid
= ALC883_DIGOUT_NID
,
9206 .dig_in_nid
= ALC883_DIGIN_NID
,
9207 .num_channel_mode
= ARRAY_SIZE(alc883_4ST_8ch_modes
),
9208 .channel_mode
= alc883_4ST_8ch_modes
,
9210 .input_mux
= &alc883_capture_source
,
9211 .unsol_event
= alc883_targa_unsol_event
,
9212 .setup
= alc882_targa_setup
,
9213 .init_hook
= alc882_targa_automute
,
9216 .mixers
= { alc883_base_mixer
},
9217 /* On TravelMate laptops, GPIO 0 enables the internal speaker
9218 * and the headphone jack. Turn this on and rely on the
9219 * standard mute methods whenever the user wants to turn
9220 * these outputs off.
9222 .init_verbs
= { alc883_init_verbs
, alc880_gpio1_init_verbs
},
9223 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9224 .dac_nids
= alc883_dac_nids
,
9225 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9226 .channel_mode
= alc883_3ST_2ch_modes
,
9227 .input_mux
= &alc883_capture_source
,
9229 [ALC883_ACER_ASPIRE
] = {
9230 .mixers
= { alc883_acer_aspire_mixer
},
9231 .init_verbs
= { alc883_init_verbs
, alc883_acer_eapd_verbs
},
9232 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9233 .dac_nids
= alc883_dac_nids
,
9234 .dig_out_nid
= ALC883_DIGOUT_NID
,
9235 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9236 .channel_mode
= alc883_3ST_2ch_modes
,
9237 .input_mux
= &alc883_capture_source
,
9238 .unsol_event
= alc_automute_amp_unsol_event
,
9239 .setup
= alc883_acer_aspire_setup
,
9240 .init_hook
= alc_automute_amp
,
9242 [ALC888_ACER_ASPIRE_4930G
] = {
9243 .mixers
= { alc888_base_mixer
,
9244 alc883_chmode_mixer
},
9245 .init_verbs
= { alc883_init_verbs
, alc880_gpio1_init_verbs
,
9246 alc888_acer_aspire_4930g_verbs
},
9247 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9248 .dac_nids
= alc883_dac_nids
,
9249 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_rev
),
9250 .adc_nids
= alc883_adc_nids_rev
,
9251 .capsrc_nids
= alc883_capsrc_nids_rev
,
9252 .dig_out_nid
= ALC883_DIGOUT_NID
,
9253 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9254 .channel_mode
= alc883_3ST_6ch_modes
,
9257 ARRAY_SIZE(alc888_2_capture_sources
),
9258 .input_mux
= alc888_2_capture_sources
,
9259 .unsol_event
= alc_automute_amp_unsol_event
,
9260 .setup
= alc888_acer_aspire_4930g_setup
,
9261 .init_hook
= alc_automute_amp
,
9263 [ALC888_ACER_ASPIRE_6530G
] = {
9264 .mixers
= { alc888_acer_aspire_6530_mixer
},
9265 .init_verbs
= { alc883_init_verbs
, alc880_gpio1_init_verbs
,
9266 alc888_acer_aspire_6530g_verbs
},
9267 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9268 .dac_nids
= alc883_dac_nids
,
9269 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_rev
),
9270 .adc_nids
= alc883_adc_nids_rev
,
9271 .capsrc_nids
= alc883_capsrc_nids_rev
,
9272 .dig_out_nid
= ALC883_DIGOUT_NID
,
9273 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9274 .channel_mode
= alc883_3ST_2ch_modes
,
9276 ARRAY_SIZE(alc888_2_capture_sources
),
9277 .input_mux
= alc888_acer_aspire_6530_sources
,
9278 .unsol_event
= alc_automute_amp_unsol_event
,
9279 .setup
= alc888_acer_aspire_6530g_setup
,
9280 .init_hook
= alc_automute_amp
,
9282 [ALC888_ACER_ASPIRE_8930G
] = {
9283 .mixers
= { alc888_base_mixer
,
9284 alc883_chmode_mixer
},
9285 .init_verbs
= { alc883_init_verbs
, alc880_gpio1_init_verbs
,
9286 alc889_acer_aspire_8930g_verbs
},
9287 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9288 .dac_nids
= alc883_dac_nids
,
9289 .num_adc_nids
= ARRAY_SIZE(alc889_adc_nids
),
9290 .adc_nids
= alc889_adc_nids
,
9291 .capsrc_nids
= alc889_capsrc_nids
,
9292 .dig_out_nid
= ALC883_DIGOUT_NID
,
9293 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9294 .channel_mode
= alc883_3ST_6ch_modes
,
9296 .const_channel_count
= 6,
9298 ARRAY_SIZE(alc889_capture_sources
),
9299 .input_mux
= alc889_capture_sources
,
9300 .unsol_event
= alc_automute_amp_unsol_event
,
9301 .setup
= alc889_acer_aspire_8930g_setup
,
9302 .init_hook
= alc_automute_amp
,
9304 [ALC888_ACER_ASPIRE_7730G
] = {
9305 .mixers
= { alc883_3ST_6ch_mixer
,
9306 alc883_chmode_mixer
},
9307 .init_verbs
= { alc883_init_verbs
, alc880_gpio1_init_verbs
,
9308 alc888_acer_aspire_7730G_verbs
},
9309 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9310 .dac_nids
= alc883_dac_nids
,
9311 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_rev
),
9312 .adc_nids
= alc883_adc_nids_rev
,
9313 .capsrc_nids
= alc883_capsrc_nids_rev
,
9314 .dig_out_nid
= ALC883_DIGOUT_NID
,
9315 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9316 .channel_mode
= alc883_3ST_6ch_modes
,
9318 .const_channel_count
= 6,
9319 .input_mux
= &alc883_capture_source
,
9320 .unsol_event
= alc_automute_amp_unsol_event
,
9321 .setup
= alc888_acer_aspire_6530g_setup
,
9322 .init_hook
= alc_automute_amp
,
9325 .mixers
= { alc883_fivestack_mixer
,
9326 alc883_chmode_mixer
},
9327 .init_verbs
= { alc883_init_verbs
,
9328 alc883_medion_eapd_verbs
},
9329 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9330 .dac_nids
= alc883_dac_nids
,
9331 .adc_nids
= alc883_adc_nids_alt
,
9332 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_alt
),
9333 .num_channel_mode
= ARRAY_SIZE(alc883_sixstack_modes
),
9334 .channel_mode
= alc883_sixstack_modes
,
9335 .input_mux
= &alc883_capture_source
,
9337 [ALC883_MEDION_MD2
] = {
9338 .mixers
= { alc883_medion_md2_mixer
},
9339 .init_verbs
= { alc883_init_verbs
, alc883_medion_md2_verbs
},
9340 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9341 .dac_nids
= alc883_dac_nids
,
9342 .dig_out_nid
= ALC883_DIGOUT_NID
,
9343 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9344 .channel_mode
= alc883_3ST_2ch_modes
,
9345 .input_mux
= &alc883_capture_source
,
9346 .unsol_event
= alc_automute_amp_unsol_event
,
9347 .setup
= alc883_medion_md2_setup
,
9348 .init_hook
= alc_automute_amp
,
9350 [ALC883_LAPTOP_EAPD
] = {
9351 .mixers
= { alc883_base_mixer
},
9352 .init_verbs
= { alc883_init_verbs
, alc882_eapd_verbs
},
9353 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9354 .dac_nids
= alc883_dac_nids
,
9355 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9356 .channel_mode
= alc883_3ST_2ch_modes
,
9357 .input_mux
= &alc883_capture_source
,
9359 [ALC883_CLEVO_M540R
] = {
9360 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
9361 .init_verbs
= { alc883_init_verbs
, alc883_clevo_m540r_verbs
},
9362 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9363 .dac_nids
= alc883_dac_nids
,
9364 .dig_out_nid
= ALC883_DIGOUT_NID
,
9365 .dig_in_nid
= ALC883_DIGIN_NID
,
9366 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_clevo_modes
),
9367 .channel_mode
= alc883_3ST_6ch_clevo_modes
,
9369 .input_mux
= &alc883_capture_source
,
9370 /* This machine has the hardware HP auto-muting, thus
9371 * we need no software mute via unsol event
9374 [ALC883_CLEVO_M720
] = {
9375 .mixers
= { alc883_clevo_m720_mixer
},
9376 .init_verbs
= { alc883_init_verbs
, alc883_clevo_m720_verbs
},
9377 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9378 .dac_nids
= alc883_dac_nids
,
9379 .dig_out_nid
= ALC883_DIGOUT_NID
,
9380 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9381 .channel_mode
= alc883_3ST_2ch_modes
,
9382 .input_mux
= &alc883_capture_source
,
9383 .unsol_event
= alc883_clevo_m720_unsol_event
,
9384 .setup
= alc883_clevo_m720_setup
,
9385 .init_hook
= alc883_clevo_m720_init_hook
,
9387 [ALC883_LENOVO_101E_2ch
] = {
9388 .mixers
= { alc883_lenovo_101e_2ch_mixer
},
9389 .init_verbs
= { alc883_init_verbs
, alc883_lenovo_101e_verbs
},
9390 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9391 .dac_nids
= alc883_dac_nids
,
9392 .adc_nids
= alc883_adc_nids_alt
,
9393 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_alt
),
9394 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9395 .channel_mode
= alc883_3ST_2ch_modes
,
9396 .input_mux
= &alc883_lenovo_101e_capture_source
,
9397 .unsol_event
= alc883_lenovo_101e_unsol_event
,
9398 .init_hook
= alc883_lenovo_101e_all_automute
,
9400 [ALC883_LENOVO_NB0763
] = {
9401 .mixers
= { alc883_lenovo_nb0763_mixer
},
9402 .init_verbs
= { alc883_init_verbs
, alc883_lenovo_nb0763_verbs
},
9403 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9404 .dac_nids
= alc883_dac_nids
,
9405 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9406 .channel_mode
= alc883_3ST_2ch_modes
,
9408 .input_mux
= &alc883_lenovo_nb0763_capture_source
,
9409 .unsol_event
= alc_automute_amp_unsol_event
,
9410 .setup
= alc883_medion_md2_setup
,
9411 .init_hook
= alc_automute_amp
,
9413 [ALC888_LENOVO_MS7195_DIG
] = {
9414 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
9415 .init_verbs
= { alc883_init_verbs
, alc888_lenovo_ms7195_verbs
},
9416 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9417 .dac_nids
= alc883_dac_nids
,
9418 .dig_out_nid
= ALC883_DIGOUT_NID
,
9419 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9420 .channel_mode
= alc883_3ST_6ch_modes
,
9422 .input_mux
= &alc883_capture_source
,
9423 .unsol_event
= alc883_lenovo_ms7195_unsol_event
,
9424 .init_hook
= alc888_lenovo_ms7195_front_automute
,
9426 [ALC883_HAIER_W66
] = {
9427 .mixers
= { alc883_targa_2ch_mixer
},
9428 .init_verbs
= { alc883_init_verbs
, alc883_haier_w66_verbs
},
9429 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9430 .dac_nids
= alc883_dac_nids
,
9431 .dig_out_nid
= ALC883_DIGOUT_NID
,
9432 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9433 .channel_mode
= alc883_3ST_2ch_modes
,
9434 .input_mux
= &alc883_capture_source
,
9435 .unsol_event
= alc_automute_amp_unsol_event
,
9436 .setup
= alc883_haier_w66_setup
,
9437 .init_hook
= alc_automute_amp
,
9440 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
9441 .init_verbs
= { alc883_init_verbs
, alc888_3st_hp_verbs
},
9442 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9443 .dac_nids
= alc883_dac_nids
,
9444 .num_channel_mode
= ARRAY_SIZE(alc888_3st_hp_modes
),
9445 .channel_mode
= alc888_3st_hp_modes
,
9447 .input_mux
= &alc883_capture_source
,
9448 .unsol_event
= alc_automute_amp_unsol_event
,
9449 .setup
= alc888_3st_hp_setup
,
9450 .init_hook
= alc_automute_amp
,
9452 [ALC888_6ST_DELL
] = {
9453 .mixers
= { alc883_base_mixer
, alc883_chmode_mixer
},
9454 .init_verbs
= { alc883_init_verbs
, alc888_6st_dell_verbs
},
9455 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9456 .dac_nids
= alc883_dac_nids
,
9457 .dig_out_nid
= ALC883_DIGOUT_NID
,
9458 .dig_in_nid
= ALC883_DIGIN_NID
,
9459 .num_channel_mode
= ARRAY_SIZE(alc883_sixstack_modes
),
9460 .channel_mode
= alc883_sixstack_modes
,
9461 .input_mux
= &alc883_capture_source
,
9462 .unsol_event
= alc_automute_amp_unsol_event
,
9463 .setup
= alc888_6st_dell_setup
,
9464 .init_hook
= alc_automute_amp
,
9467 .mixers
= { alc883_mitac_mixer
},
9468 .init_verbs
= { alc883_init_verbs
, alc883_mitac_verbs
},
9469 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9470 .dac_nids
= alc883_dac_nids
,
9471 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9472 .channel_mode
= alc883_3ST_2ch_modes
,
9473 .input_mux
= &alc883_capture_source
,
9474 .unsol_event
= alc_automute_amp_unsol_event
,
9475 .setup
= alc883_mitac_setup
,
9476 .init_hook
= alc_automute_amp
,
9478 [ALC883_FUJITSU_PI2515
] = {
9479 .mixers
= { alc883_2ch_fujitsu_pi2515_mixer
},
9480 .init_verbs
= { alc883_init_verbs
,
9481 alc883_2ch_fujitsu_pi2515_verbs
},
9482 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9483 .dac_nids
= alc883_dac_nids
,
9484 .dig_out_nid
= ALC883_DIGOUT_NID
,
9485 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9486 .channel_mode
= alc883_3ST_2ch_modes
,
9487 .input_mux
= &alc883_fujitsu_pi2515_capture_source
,
9488 .unsol_event
= alc_automute_amp_unsol_event
,
9489 .setup
= alc883_2ch_fujitsu_pi2515_setup
,
9490 .init_hook
= alc_automute_amp
,
9492 [ALC888_FUJITSU_XA3530
] = {
9493 .mixers
= { alc888_base_mixer
, alc883_chmode_mixer
},
9494 .init_verbs
= { alc883_init_verbs
,
9495 alc888_fujitsu_xa3530_verbs
},
9496 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9497 .dac_nids
= alc883_dac_nids
,
9498 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids_rev
),
9499 .adc_nids
= alc883_adc_nids_rev
,
9500 .capsrc_nids
= alc883_capsrc_nids_rev
,
9501 .dig_out_nid
= ALC883_DIGOUT_NID
,
9502 .num_channel_mode
= ARRAY_SIZE(alc888_4ST_8ch_intel_modes
),
9503 .channel_mode
= alc888_4ST_8ch_intel_modes
,
9505 ARRAY_SIZE(alc888_2_capture_sources
),
9506 .input_mux
= alc888_2_capture_sources
,
9507 .unsol_event
= alc_automute_amp_unsol_event
,
9508 .setup
= alc888_fujitsu_xa3530_setup
,
9509 .init_hook
= alc_automute_amp
,
9511 [ALC888_LENOVO_SKY
] = {
9512 .mixers
= { alc888_lenovo_sky_mixer
, alc883_chmode_mixer
},
9513 .init_verbs
= { alc883_init_verbs
, alc888_lenovo_sky_verbs
},
9514 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9515 .dac_nids
= alc883_dac_nids
,
9516 .dig_out_nid
= ALC883_DIGOUT_NID
,
9517 .num_channel_mode
= ARRAY_SIZE(alc883_sixstack_modes
),
9518 .channel_mode
= alc883_sixstack_modes
,
9520 .input_mux
= &alc883_lenovo_sky_capture_source
,
9521 .unsol_event
= alc_automute_amp_unsol_event
,
9522 .setup
= alc888_lenovo_sky_setup
,
9523 .init_hook
= alc_automute_amp
,
9525 [ALC888_ASUS_M90V
] = {
9526 .mixers
= { alc883_3ST_6ch_mixer
, alc883_chmode_mixer
},
9527 .init_verbs
= { alc883_init_verbs
, alc888_asus_m90v_verbs
},
9528 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9529 .dac_nids
= alc883_dac_nids
,
9530 .dig_out_nid
= ALC883_DIGOUT_NID
,
9531 .dig_in_nid
= ALC883_DIGIN_NID
,
9532 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_6ch_modes
),
9533 .channel_mode
= alc883_3ST_6ch_modes
,
9535 .input_mux
= &alc883_fujitsu_pi2515_capture_source
,
9536 .unsol_event
= alc_sku_unsol_event
,
9537 .setup
= alc883_mode2_setup
,
9538 .init_hook
= alc_inithook
,
9540 [ALC888_ASUS_EEE1601
] = {
9541 .mixers
= { alc883_asus_eee1601_mixer
},
9542 .cap_mixer
= alc883_asus_eee1601_cap_mixer
,
9543 .init_verbs
= { alc883_init_verbs
, alc888_asus_eee1601_verbs
},
9544 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9545 .dac_nids
= alc883_dac_nids
,
9546 .dig_out_nid
= ALC883_DIGOUT_NID
,
9547 .dig_in_nid
= ALC883_DIGIN_NID
,
9548 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9549 .channel_mode
= alc883_3ST_2ch_modes
,
9551 .input_mux
= &alc883_asus_eee1601_capture_source
,
9552 .unsol_event
= alc_sku_unsol_event
,
9553 .init_hook
= alc883_eee1601_inithook
,
9555 [ALC1200_ASUS_P5Q
] = {
9556 .mixers
= { alc883_base_mixer
, alc883_chmode_mixer
},
9557 .init_verbs
= { alc883_init_verbs
},
9558 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9559 .dac_nids
= alc883_dac_nids
,
9560 .dig_out_nid
= ALC1200_DIGOUT_NID
,
9561 .dig_in_nid
= ALC883_DIGIN_NID
,
9562 .slave_dig_outs
= alc1200_slave_dig_outs
,
9563 .num_channel_mode
= ARRAY_SIZE(alc883_sixstack_modes
),
9564 .channel_mode
= alc883_sixstack_modes
,
9565 .input_mux
= &alc883_capture_source
,
9568 .mixers
= { alc889A_mb31_mixer
, alc883_chmode_mixer
},
9569 .init_verbs
= { alc883_init_verbs
, alc889A_mb31_verbs
,
9570 alc880_gpio1_init_verbs
},
9571 .adc_nids
= alc883_adc_nids
,
9572 .num_adc_nids
= ARRAY_SIZE(alc883_adc_nids
),
9573 .dac_nids
= alc883_dac_nids
,
9574 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9575 .channel_mode
= alc889A_mb31_6ch_modes
,
9576 .num_channel_mode
= ARRAY_SIZE(alc889A_mb31_6ch_modes
),
9577 .input_mux
= &alc889A_mb31_capture_source
,
9578 .dig_out_nid
= ALC883_DIGOUT_NID
,
9579 .unsol_event
= alc889A_mb31_unsol_event
,
9580 .init_hook
= alc889A_mb31_automute
,
9582 [ALC883_SONY_VAIO_TT
] = {
9583 .mixers
= { alc883_vaiott_mixer
},
9584 .init_verbs
= { alc883_init_verbs
, alc883_vaiott_verbs
},
9585 .num_dacs
= ARRAY_SIZE(alc883_dac_nids
),
9586 .dac_nids
= alc883_dac_nids
,
9587 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
9588 .channel_mode
= alc883_3ST_2ch_modes
,
9589 .input_mux
= &alc883_capture_source
,
9590 .unsol_event
= alc_automute_amp_unsol_event
,
9591 .setup
= alc883_vaiott_setup
,
9592 .init_hook
= alc_automute_amp
,
9601 PINFIX_ABIT_AW9D_MAX
9604 static struct alc_pincfg alc882_abit_aw9d_pinfix
[] = {
9605 { 0x15, 0x01080104 }, /* side */
9606 { 0x16, 0x01011012 }, /* rear */
9607 { 0x17, 0x01016011 }, /* clfe */
9611 static const struct alc_fixup alc882_fixups
[] = {
9612 [PINFIX_ABIT_AW9D_MAX
] = {
9613 .pins
= alc882_abit_aw9d_pinfix
9617 static struct snd_pci_quirk alc882_fixup_tbl
[] = {
9618 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX
),
9623 * BIOS auto configuration
9625 static int alc882_auto_create_input_ctls(struct hda_codec
*codec
,
9626 const struct auto_pin_cfg
*cfg
)
9628 return alc_auto_create_input_ctls(codec
, cfg
, 0x0b, 0x23, 0x22);
9631 static void alc882_auto_set_output_and_unmute(struct hda_codec
*codec
,
9632 hda_nid_t nid
, int pin_type
,
9636 struct alc_spec
*spec
= codec
->spec
;
9639 alc_set_pin_output(codec
, nid
, pin_type
);
9640 if (spec
->multiout
.dac_nids
[dac_idx
] == 0x25)
9643 idx
= spec
->multiout
.dac_nids
[dac_idx
] - 2;
9644 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_CONNECT_SEL
, idx
);
9648 static void alc882_auto_init_multi_out(struct hda_codec
*codec
)
9650 struct alc_spec
*spec
= codec
->spec
;
9653 for (i
= 0; i
<= HDA_SIDE
; i
++) {
9654 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
9655 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
9657 alc882_auto_set_output_and_unmute(codec
, nid
, pin_type
,
9662 static void alc882_auto_init_hp_out(struct hda_codec
*codec
)
9664 struct alc_spec
*spec
= codec
->spec
;
9667 pin
= spec
->autocfg
.hp_pins
[0];
9668 if (pin
) /* connect to front */
9670 alc882_auto_set_output_and_unmute(codec
, pin
, PIN_HP
, 0);
9671 pin
= spec
->autocfg
.speaker_pins
[0];
9673 alc882_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
, 0);
9676 static void alc882_auto_init_analog_input(struct hda_codec
*codec
)
9678 struct alc_spec
*spec
= codec
->spec
;
9681 for (i
= 0; i
< AUTO_PIN_LAST
; i
++) {
9682 hda_nid_t nid
= spec
->autocfg
.input_pins
[i
];
9685 alc_set_input_pin(codec
, nid
, i
);
9686 if (get_wcaps(codec
, nid
) & AC_WCAP_OUT_AMP
)
9687 snd_hda_codec_write(codec
, nid
, 0,
9688 AC_VERB_SET_AMP_GAIN_MUTE
,
9693 static void alc882_auto_init_input_src(struct hda_codec
*codec
)
9695 struct alc_spec
*spec
= codec
->spec
;
9698 for (c
= 0; c
< spec
->num_adc_nids
; c
++) {
9699 hda_nid_t conn_list
[HDA_MAX_NUM_INPUTS
];
9700 hda_nid_t nid
= spec
->capsrc_nids
[c
];
9701 unsigned int mux_idx
;
9702 const struct hda_input_mux
*imux
;
9703 int conns
, mute
, idx
, item
;
9705 conns
= snd_hda_get_connections(codec
, nid
, conn_list
,
9706 ARRAY_SIZE(conn_list
));
9709 mux_idx
= c
>= spec
->num_mux_defs
? 0 : c
;
9710 imux
= &spec
->input_mux
[mux_idx
];
9711 for (idx
= 0; idx
< conns
; idx
++) {
9712 /* if the current connection is the selected one,
9713 * unmute it as default - otherwise mute it
9715 mute
= AMP_IN_MUTE(idx
);
9716 for (item
= 0; item
< imux
->num_items
; item
++) {
9717 if (imux
->items
[item
].index
== idx
) {
9718 if (spec
->cur_mux
[c
] == item
)
9719 mute
= AMP_IN_UNMUTE(idx
);
9723 /* check if we have a selector or mixer
9724 * we could check for the widget type instead, but
9725 * just check for Amp-In presence (in case of mixer
9726 * without amp-in there is something wrong, this
9727 * function shouldn't be used or capsrc nid is wrong)
9729 if (get_wcaps(codec
, nid
) & AC_WCAP_IN_AMP
)
9730 snd_hda_codec_write(codec
, nid
, 0,
9731 AC_VERB_SET_AMP_GAIN_MUTE
,
9733 else if (mute
!= AMP_IN_MUTE(idx
))
9734 snd_hda_codec_write(codec
, nid
, 0,
9735 AC_VERB_SET_CONNECT_SEL
,
9741 /* add mic boosts if needed */
9742 static int alc_auto_add_mic_boost(struct hda_codec
*codec
)
9744 struct alc_spec
*spec
= codec
->spec
;
9748 nid
= spec
->autocfg
.input_pins
[AUTO_PIN_MIC
];
9749 if (nid
&& (get_wcaps(codec
, nid
) & AC_WCAP_IN_AMP
)) {
9750 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
,
9752 HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_INPUT
));
9756 nid
= spec
->autocfg
.input_pins
[AUTO_PIN_FRONT_MIC
];
9757 if (nid
&& (get_wcaps(codec
, nid
) & AC_WCAP_IN_AMP
)) {
9758 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
,
9760 HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_INPUT
));
9767 /* almost identical with ALC880 parser... */
9768 static int alc882_parse_auto_config(struct hda_codec
*codec
)
9770 struct alc_spec
*spec
= codec
->spec
;
9771 static hda_nid_t alc882_ignore
[] = { 0x1d, 0 };
9774 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
9778 if (!spec
->autocfg
.line_outs
)
9779 return 0; /* can't find valid BIOS pin config */
9781 err
= alc880_auto_fill_dac_nids(spec
, &spec
->autocfg
);
9784 err
= alc880_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
9787 err
= alc880_auto_create_extra_out(spec
,
9788 spec
->autocfg
.speaker_pins
[0],
9792 err
= alc880_auto_create_extra_out(spec
, spec
->autocfg
.hp_pins
[0],
9796 err
= alc882_auto_create_input_ctls(codec
, &spec
->autocfg
);
9800 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
9802 /* check multiple SPDIF-out (for recent codecs) */
9803 for (i
= 0; i
< spec
->autocfg
.dig_outs
; i
++) {
9805 err
= snd_hda_get_connections(codec
,
9806 spec
->autocfg
.dig_out_pins
[i
],
9811 spec
->multiout
.dig_out_nid
= dig_nid
;
9813 spec
->multiout
.slave_dig_outs
= spec
->slave_dig_outs
;
9814 spec
->slave_dig_outs
[i
- 1] = dig_nid
;
9815 if (i
== ARRAY_SIZE(spec
->slave_dig_outs
) - 1)
9819 if (spec
->autocfg
.dig_in_pin
)
9820 spec
->dig_in_nid
= ALC880_DIGIN_NID
;
9822 if (spec
->kctls
.list
)
9823 add_mixer(spec
, spec
->kctls
.list
);
9825 add_verb(spec
, alc883_auto_init_verbs
);
9826 /* if ADC 0x07 is available, initialize it, too */
9827 if (get_wcaps_type(get_wcaps(codec
, 0x07)) == AC_WID_AUD_IN
)
9828 add_verb(spec
, alc882_adc1_init_verbs
);
9830 spec
->num_mux_defs
= 1;
9831 spec
->input_mux
= &spec
->private_imux
[0];
9833 alc_ssid_check(codec
, 0x15, 0x1b, 0x14);
9835 err
= alc_auto_add_mic_boost(codec
);
9839 return 1; /* config found */
9842 /* additional initialization for auto-configuration model */
9843 static void alc882_auto_init(struct hda_codec
*codec
)
9845 struct alc_spec
*spec
= codec
->spec
;
9846 alc882_auto_init_multi_out(codec
);
9847 alc882_auto_init_hp_out(codec
);
9848 alc882_auto_init_analog_input(codec
);
9849 alc882_auto_init_input_src(codec
);
9850 if (spec
->unsol_event
)
9851 alc_inithook(codec
);
9854 static int patch_alc882(struct hda_codec
*codec
)
9856 struct alc_spec
*spec
;
9857 int err
, board_config
;
9859 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
9865 switch (codec
->vendor_id
) {
9870 /* ALC883 and variants */
9871 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
9875 board_config
= snd_hda_check_board_config(codec
, ALC882_MODEL_LAST
,
9879 if (board_config
< 0 || board_config
>= ALC882_MODEL_LAST
)
9880 board_config
= snd_hda_check_board_codec_sid_config(codec
,
9881 ALC882_MODEL_LAST
, alc882_models
, alc882_ssid_cfg_tbl
);
9883 if (board_config
< 0 || board_config
>= ALC882_MODEL_LAST
) {
9884 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
9886 board_config
= ALC882_AUTO
;
9889 alc_pick_fixup(codec
, alc882_fixup_tbl
, alc882_fixups
);
9891 if (board_config
== ALC882_AUTO
) {
9892 /* automatic parse from the BIOS config */
9893 err
= alc882_parse_auto_config(codec
);
9899 "hda_codec: Cannot set up configuration "
9900 "from BIOS. Using base mode...\n");
9901 board_config
= ALC882_3ST_DIG
;
9905 err
= snd_hda_attach_beep_device(codec
, 0x1);
9911 if (board_config
!= ALC882_AUTO
)
9912 setup_preset(codec
, &alc882_presets
[board_config
]);
9914 spec
->stream_analog_playback
= &alc882_pcm_analog_playback
;
9915 spec
->stream_analog_capture
= &alc882_pcm_analog_capture
;
9916 /* FIXME: setup DAC5 */
9917 /*spec->stream_analog_alt_playback = &alc880_pcm_analog_alt_playback;*/
9918 spec
->stream_analog_alt_capture
= &alc880_pcm_analog_alt_capture
;
9920 spec
->stream_digital_playback
= &alc882_pcm_digital_playback
;
9921 spec
->stream_digital_capture
= &alc882_pcm_digital_capture
;
9923 if (codec
->vendor_id
== 0x10ec0888)
9924 spec
->init_amp
= ALC_INIT_DEFAULT
; /* always initialize */
9926 if (!spec
->adc_nids
&& spec
->input_mux
) {
9928 spec
->num_adc_nids
= 0;
9929 for (i
= 0; i
< ARRAY_SIZE(alc882_adc_nids
); i
++) {
9931 hda_nid_t nid
= alc882_adc_nids
[i
];
9932 unsigned int wcap
= get_wcaps(codec
, nid
);
9934 wcap
= get_wcaps_type(wcap
);
9935 if (wcap
!= AC_WID_AUD_IN
)
9937 spec
->private_adc_nids
[spec
->num_adc_nids
] = nid
;
9938 err
= snd_hda_get_connections(codec
, nid
, &cap
, 1);
9941 spec
->private_capsrc_nids
[spec
->num_adc_nids
] = cap
;
9942 spec
->num_adc_nids
++;
9944 spec
->adc_nids
= spec
->private_adc_nids
;
9945 spec
->capsrc_nids
= spec
->private_capsrc_nids
;
9948 set_capture_mixer(codec
);
9949 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
9951 spec
->vmaster_nid
= 0x0c;
9953 codec
->patch_ops
= alc_patch_ops
;
9954 if (board_config
== ALC882_AUTO
)
9955 spec
->init_hook
= alc882_auto_init
;
9956 #ifdef CONFIG_SND_HDA_POWER_SAVE
9957 if (!spec
->loopback
.amplist
)
9958 spec
->loopback
.amplist
= alc882_loopbacks
;
9960 codec
->proc_widget_hook
= print_realtek_coef
;
9970 #define ALC262_DIGOUT_NID ALC880_DIGOUT_NID
9971 #define ALC262_DIGIN_NID ALC880_DIGIN_NID
9973 #define alc262_dac_nids alc260_dac_nids
9974 #define alc262_adc_nids alc882_adc_nids
9975 #define alc262_adc_nids_alt alc882_adc_nids_alt
9976 #define alc262_capsrc_nids alc882_capsrc_nids
9977 #define alc262_capsrc_nids_alt alc882_capsrc_nids_alt
9979 #define alc262_modes alc260_modes
9980 #define alc262_capture_source alc882_capture_source
9982 static hda_nid_t alc262_dmic_adc_nids
[1] = {
9987 static hda_nid_t alc262_dmic_capsrc_nids
[1] = { 0x22 };
9989 static struct snd_kcontrol_new alc262_base_mixer
[] = {
9990 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
9991 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
9992 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
9993 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
9994 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
9995 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
9996 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
9997 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
9998 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
9999 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10000 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10001 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
10002 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0D, 0x0, HDA_OUTPUT
),
10003 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
10004 HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT
),
10005 HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x16, 2, 0x0, HDA_OUTPUT
),
10009 /* update HP, line and mono-out pins according to the master switch */
10010 static void alc262_hp_master_update(struct hda_codec
*codec
)
10012 struct alc_spec
*spec
= codec
->spec
;
10013 int val
= spec
->master_sw
;
10015 /* HP & line-out */
10016 snd_hda_codec_write_cache(codec
, 0x1b, 0,
10017 AC_VERB_SET_PIN_WIDGET_CONTROL
,
10019 snd_hda_codec_write_cache(codec
, 0x15, 0,
10020 AC_VERB_SET_PIN_WIDGET_CONTROL
,
10022 /* mono (speaker) depending on the HP jack sense */
10023 val
= val
&& !spec
->jack_present
;
10024 snd_hda_codec_write_cache(codec
, 0x16, 0,
10025 AC_VERB_SET_PIN_WIDGET_CONTROL
,
10026 val
? PIN_OUT
: 0);
10029 static void alc262_hp_bpc_automute(struct hda_codec
*codec
)
10031 struct alc_spec
*spec
= codec
->spec
;
10032 unsigned int presence
;
10033 presence
= snd_hda_codec_read(codec
, 0x1b, 0,
10034 AC_VERB_GET_PIN_SENSE
, 0);
10035 spec
->jack_present
= !!(presence
& AC_PINSENSE_PRESENCE
);
10036 alc262_hp_master_update(codec
);
10039 static void alc262_hp_bpc_unsol_event(struct hda_codec
*codec
, unsigned int res
)
10041 if ((res
>> 26) != ALC880_HP_EVENT
)
10043 alc262_hp_bpc_automute(codec
);
10046 static void alc262_hp_wildwest_automute(struct hda_codec
*codec
)
10048 struct alc_spec
*spec
= codec
->spec
;
10049 unsigned int presence
;
10050 presence
= snd_hda_codec_read(codec
, 0x15, 0,
10051 AC_VERB_GET_PIN_SENSE
, 0);
10052 spec
->jack_present
= !!(presence
& AC_PINSENSE_PRESENCE
);
10053 alc262_hp_master_update(codec
);
10056 static void alc262_hp_wildwest_unsol_event(struct hda_codec
*codec
,
10059 if ((res
>> 26) != ALC880_HP_EVENT
)
10061 alc262_hp_wildwest_automute(codec
);
10064 #define alc262_hp_master_sw_get alc260_hp_master_sw_get
10066 static int alc262_hp_master_sw_put(struct snd_kcontrol
*kcontrol
,
10067 struct snd_ctl_elem_value
*ucontrol
)
10069 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
10070 struct alc_spec
*spec
= codec
->spec
;
10071 int val
= !!*ucontrol
->value
.integer
.value
;
10073 if (val
== spec
->master_sw
)
10075 spec
->master_sw
= val
;
10076 alc262_hp_master_update(codec
);
10080 #define ALC262_HP_MASTER_SWITCH \
10082 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
10083 .name = "Master Playback Switch", \
10084 .info = snd_ctl_boolean_mono_info, \
10085 .get = alc262_hp_master_sw_get, \
10086 .put = alc262_hp_master_sw_put, \
10089 static struct snd_kcontrol_new alc262_HP_BPC_mixer
[] = {
10090 ALC262_HP_MASTER_SWITCH
,
10091 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10092 HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
10093 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
10094 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0e, 2, 0x0,
10096 HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x16, 2, 0x0,
10098 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10099 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10100 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10101 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10102 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10103 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
10104 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
10105 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
10106 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
10107 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
10108 HDA_CODEC_VOLUME("AUX IN Playback Volume", 0x0b, 0x06, HDA_INPUT
),
10109 HDA_CODEC_MUTE("AUX IN Playback Switch", 0x0b, 0x06, HDA_INPUT
),
10113 static struct snd_kcontrol_new alc262_HP_BPC_WildWest_mixer
[] = {
10114 ALC262_HP_MASTER_SWITCH
,
10115 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10116 HDA_CODEC_MUTE("Front Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
10117 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
10118 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
10119 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0e, 2, 0x0,
10121 HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x16, 2, 0x0,
10123 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x02, HDA_INPUT
),
10124 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x02, HDA_INPUT
),
10125 HDA_CODEC_VOLUME("Front Mic Boost", 0x1a, 0, HDA_INPUT
),
10126 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10127 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10128 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
10129 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
10133 static struct snd_kcontrol_new alc262_HP_BPC_WildWest_option_mixer
[] = {
10134 HDA_CODEC_VOLUME("Rear Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10135 HDA_CODEC_MUTE("Rear Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10136 HDA_CODEC_VOLUME("Rear Mic Boost", 0x18, 0, HDA_INPUT
),
10140 /* mute/unmute internal speaker according to the hp jack and mute state */
10141 static void alc262_hp_t5735_setup(struct hda_codec
*codec
)
10143 struct alc_spec
*spec
= codec
->spec
;
10145 spec
->autocfg
.hp_pins
[0] = 0x15;
10146 spec
->autocfg
.speaker_pins
[0] = 0x0c; /* HACK: not actually a pin */
10149 static struct snd_kcontrol_new alc262_hp_t5735_mixer
[] = {
10150 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10151 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
10152 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
10153 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
10154 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10155 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10156 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10160 static struct hda_verb alc262_hp_t5735_verbs
[] = {
10161 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
10162 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10164 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
10168 static struct snd_kcontrol_new alc262_hp_rp5700_mixer
[] = {
10169 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10170 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
10171 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0e, 0x0, HDA_OUTPUT
),
10172 HDA_CODEC_MUTE("Speaker Playback Switch", 0x16, 0x0, HDA_OUTPUT
),
10173 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10174 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10178 static struct hda_verb alc262_hp_rp5700_verbs
[] = {
10179 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
10180 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
10181 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
10182 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
10183 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
10184 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
10185 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
10186 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
10187 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x00 << 8))},
10188 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x00 << 8))},
10192 static struct hda_input_mux alc262_hp_rp5700_capture_source
= {
10199 /* bind hp and internal speaker mute (with plug check) as master switch */
10200 static void alc262_hippo_master_update(struct hda_codec
*codec
)
10202 struct alc_spec
*spec
= codec
->spec
;
10203 hda_nid_t hp_nid
= spec
->autocfg
.hp_pins
[0];
10204 hda_nid_t line_nid
= spec
->autocfg
.line_out_pins
[0];
10205 hda_nid_t speaker_nid
= spec
->autocfg
.speaker_pins
[0];
10209 mute
= spec
->master_sw
? 0 : HDA_AMP_MUTE
;
10210 snd_hda_codec_amp_stereo(codec
, hp_nid
, HDA_OUTPUT
, 0,
10211 HDA_AMP_MUTE
, mute
);
10212 /* mute internal speaker per jack sense */
10213 if (spec
->jack_present
)
10214 mute
= HDA_AMP_MUTE
;
10216 snd_hda_codec_amp_stereo(codec
, line_nid
, HDA_OUTPUT
, 0,
10217 HDA_AMP_MUTE
, mute
);
10218 if (speaker_nid
&& speaker_nid
!= line_nid
)
10219 snd_hda_codec_amp_stereo(codec
, speaker_nid
, HDA_OUTPUT
, 0,
10220 HDA_AMP_MUTE
, mute
);
10223 #define alc262_hippo_master_sw_get alc262_hp_master_sw_get
10225 static int alc262_hippo_master_sw_put(struct snd_kcontrol
*kcontrol
,
10226 struct snd_ctl_elem_value
*ucontrol
)
10228 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
10229 struct alc_spec
*spec
= codec
->spec
;
10230 int val
= !!*ucontrol
->value
.integer
.value
;
10232 if (val
== spec
->master_sw
)
10234 spec
->master_sw
= val
;
10235 alc262_hippo_master_update(codec
);
10239 #define ALC262_HIPPO_MASTER_SWITCH \
10241 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
10242 .name = "Master Playback Switch", \
10243 .info = snd_ctl_boolean_mono_info, \
10244 .get = alc262_hippo_master_sw_get, \
10245 .put = alc262_hippo_master_sw_put, \
10248 static struct snd_kcontrol_new alc262_hippo_mixer
[] = {
10249 ALC262_HIPPO_MASTER_SWITCH
,
10250 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10251 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
10252 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
10253 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
10254 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
10255 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10256 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10257 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10258 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10259 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10260 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
10261 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
10265 static struct snd_kcontrol_new alc262_hippo1_mixer
[] = {
10266 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10267 ALC262_HIPPO_MASTER_SWITCH
,
10268 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
10269 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
10270 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
10271 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
10272 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10273 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10274 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10275 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10276 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10277 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
10281 /* mute/unmute internal speaker according to the hp jack and mute state */
10282 static void alc262_hippo_automute(struct hda_codec
*codec
)
10284 struct alc_spec
*spec
= codec
->spec
;
10285 hda_nid_t hp_nid
= spec
->autocfg
.hp_pins
[0];
10286 unsigned int present
;
10288 /* need to execute and sync at first */
10289 snd_hda_codec_read(codec
, hp_nid
, 0, AC_VERB_SET_PIN_SENSE
, 0);
10290 present
= snd_hda_codec_read(codec
, hp_nid
, 0,
10291 AC_VERB_GET_PIN_SENSE
, 0);
10292 spec
->jack_present
= (present
& 0x80000000) != 0;
10293 alc262_hippo_master_update(codec
);
10296 static void alc262_hippo_unsol_event(struct hda_codec
*codec
, unsigned int res
)
10298 if ((res
>> 26) != ALC880_HP_EVENT
)
10300 alc262_hippo_automute(codec
);
10303 static void alc262_hippo_setup(struct hda_codec
*codec
)
10305 struct alc_spec
*spec
= codec
->spec
;
10307 spec
->autocfg
.hp_pins
[0] = 0x15;
10308 spec
->autocfg
.speaker_pins
[0] = 0x14;
10311 static void alc262_hippo1_setup(struct hda_codec
*codec
)
10313 struct alc_spec
*spec
= codec
->spec
;
10315 spec
->autocfg
.hp_pins
[0] = 0x1b;
10316 spec
->autocfg
.speaker_pins
[0] = 0x14;
10320 static struct snd_kcontrol_new alc262_sony_mixer
[] = {
10321 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10322 ALC262_HIPPO_MASTER_SWITCH
,
10323 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10324 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10325 HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10326 HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10330 static struct snd_kcontrol_new alc262_benq_t31_mixer
[] = {
10331 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10332 ALC262_HIPPO_MASTER_SWITCH
,
10333 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
10334 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10335 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10336 HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10337 HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10341 static struct snd_kcontrol_new alc262_tyan_mixer
[] = {
10342 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10343 HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT
),
10344 HDA_CODEC_VOLUME("Aux Playback Volume", 0x0b, 0x06, HDA_INPUT
),
10345 HDA_CODEC_MUTE("Aux Playback Switch", 0x0b, 0x06, HDA_INPUT
),
10346 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
10347 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
10348 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10349 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10350 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10351 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10352 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10353 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
10357 static struct hda_verb alc262_tyan_verbs
[] = {
10358 /* Headphone automute */
10359 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
10360 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10361 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
10363 /* P11 AUX_IN, white 4-pin connector */
10364 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
10365 {0x14, AC_VERB_SET_CONFIG_DEFAULT_BYTES_1
, 0xe1},
10366 {0x14, AC_VERB_SET_CONFIG_DEFAULT_BYTES_2
, 0x93},
10367 {0x14, AC_VERB_SET_CONFIG_DEFAULT_BYTES_3
, 0x19},
10372 /* unsolicited event for HP jack sensing */
10373 static void alc262_tyan_setup(struct hda_codec
*codec
)
10375 struct alc_spec
*spec
= codec
->spec
;
10377 spec
->autocfg
.hp_pins
[0] = 0x1b;
10378 spec
->autocfg
.speaker_pins
[0] = 0x15;
10382 #define alc262_capture_mixer alc882_capture_mixer
10383 #define alc262_capture_alt_mixer alc882_capture_alt_mixer
10386 * generic initialization of ADC, input mixers and output mixers
10388 static struct hda_verb alc262_init_verbs
[] = {
10390 * Unmute ADC0-2 and set the default input to mic-in
10392 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
10393 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10394 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
10395 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10396 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
10397 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10399 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
10401 * Note: PASD motherboards uses the Line In 2 as the input for
10402 * front panel mic (mic 2)
10404 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
10405 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
10406 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
10407 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
10408 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
10409 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
10412 * Set up output mixers (0x0c - 0x0e)
10414 /* set vol=0 to output mixers */
10415 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
10416 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
10417 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
10418 /* set up input amps for analog loopback */
10419 /* Amp Indices: DAC = 0, mixer = 1 */
10420 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10421 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
10422 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10423 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
10424 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10425 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
10427 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
10428 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
10429 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
10430 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
10431 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
10432 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
10434 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
10435 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
10436 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
10437 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
10438 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
10440 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
10441 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
10443 /* FIXME: use matrix-type input source selection */
10444 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
10445 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
10446 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
10447 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
10448 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
10449 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
10451 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
10452 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
10453 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
10454 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
10456 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
10457 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
10458 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
10459 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
10464 static struct hda_verb alc262_eapd_verbs
[] = {
10465 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
10466 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
10470 static struct hda_verb alc262_hippo1_unsol_verbs
[] = {
10471 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
10472 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
10473 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, 0x0000},
10475 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
10476 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10480 static struct hda_verb alc262_sony_unsol_verbs
[] = {
10481 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
10482 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
10483 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24}, // Front Mic
10485 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
10486 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10490 static struct snd_kcontrol_new alc262_toshiba_s06_mixer
[] = {
10491 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10492 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
10493 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
10494 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10495 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10499 static struct hda_verb alc262_toshiba_s06_verbs
[] = {
10500 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
10501 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
10502 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10503 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
10504 {0x22, AC_VERB_SET_CONNECT_SEL
, 0x09},
10505 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
10506 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
10507 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
10511 static void alc262_toshiba_s06_setup(struct hda_codec
*codec
)
10513 struct alc_spec
*spec
= codec
->spec
;
10515 spec
->autocfg
.hp_pins
[0] = 0x15;
10516 spec
->autocfg
.speaker_pins
[0] = 0x14;
10517 spec
->ext_mic
.pin
= 0x18;
10518 spec
->ext_mic
.mux_idx
= 0;
10519 spec
->int_mic
.pin
= 0x12;
10520 spec
->int_mic
.mux_idx
= 9;
10521 spec
->auto_mic
= 1;
10527 * 0x16 = internal speaker
10528 * 0x18 = external mic
10531 static struct snd_kcontrol_new alc262_nec_mixer
[] = {
10532 HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT
),
10533 HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x16, 0, 0x0, HDA_OUTPUT
),
10535 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10536 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10537 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10539 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT
),
10540 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
10544 static struct hda_verb alc262_nec_verbs
[] = {
10545 /* Unmute Speaker */
10546 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
10549 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
10550 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
10552 /* External mic to headphone */
10553 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
10554 /* External mic to speaker */
10555 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
10561 * 0x14 = headphone/spdif-out, 0x15 = internal speaker,
10562 * 0x1b = port replicator headphone out
10565 #define ALC_HP_EVENT 0x37
10567 static struct hda_verb alc262_fujitsu_unsol_verbs
[] = {
10568 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC_HP_EVENT
},
10569 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10570 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC_HP_EVENT
},
10571 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10575 static struct hda_verb alc262_lenovo_3000_unsol_verbs
[] = {
10576 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC_HP_EVENT
},
10577 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10581 static struct hda_input_mux alc262_fujitsu_capture_source
= {
10585 { "Int Mic", 0x1 },
10590 static struct hda_input_mux alc262_HP_capture_source
= {
10594 { "Front Mic", 0x1 },
10601 static struct hda_input_mux alc262_HP_D7000_capture_source
= {
10605 { "Front Mic", 0x2 },
10611 /* mute/unmute internal speaker according to the hp jacks and mute state */
10612 static void alc262_fujitsu_automute(struct hda_codec
*codec
, int force
)
10614 struct alc_spec
*spec
= codec
->spec
;
10617 if (force
|| !spec
->sense_updated
) {
10618 unsigned int present
;
10619 /* need to execute and sync at first */
10620 snd_hda_codec_read(codec
, 0x14, 0, AC_VERB_SET_PIN_SENSE
, 0);
10621 /* check laptop HP jack */
10622 present
= snd_hda_codec_read(codec
, 0x14, 0,
10623 AC_VERB_GET_PIN_SENSE
, 0);
10624 /* need to execute and sync at first */
10625 snd_hda_codec_read(codec
, 0x1b, 0, AC_VERB_SET_PIN_SENSE
, 0);
10626 /* check docking HP jack */
10627 present
|= snd_hda_codec_read(codec
, 0x1b, 0,
10628 AC_VERB_GET_PIN_SENSE
, 0);
10629 if (present
& AC_PINSENSE_PRESENCE
)
10630 spec
->jack_present
= 1;
10632 spec
->jack_present
= 0;
10633 spec
->sense_updated
= 1;
10635 /* unmute internal speaker only if both HPs are unplugged and
10636 * master switch is on
10638 if (spec
->jack_present
)
10639 mute
= HDA_AMP_MUTE
;
10641 mute
= snd_hda_codec_amp_read(codec
, 0x14, 0, HDA_OUTPUT
, 0);
10642 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
10643 HDA_AMP_MUTE
, mute
);
10646 /* unsolicited event for HP jack sensing */
10647 static void alc262_fujitsu_unsol_event(struct hda_codec
*codec
,
10650 if ((res
>> 26) != ALC_HP_EVENT
)
10652 alc262_fujitsu_automute(codec
, 1);
10655 static void alc262_fujitsu_init_hook(struct hda_codec
*codec
)
10657 alc262_fujitsu_automute(codec
, 1);
10660 /* bind volumes of both NID 0x0c and 0x0d */
10661 static struct hda_bind_ctls alc262_fujitsu_bind_master_vol
= {
10662 .ops
= &snd_hda_bind_vol
,
10664 HDA_COMPOSE_AMP_VAL(0x0c, 3, 0, HDA_OUTPUT
),
10665 HDA_COMPOSE_AMP_VAL(0x0d, 3, 0, HDA_OUTPUT
),
10670 /* mute/unmute internal speaker according to the hp jack and mute state */
10671 static void alc262_lenovo_3000_automute(struct hda_codec
*codec
, int force
)
10673 struct alc_spec
*spec
= codec
->spec
;
10676 if (force
|| !spec
->sense_updated
) {
10677 unsigned int present_int_hp
;
10678 /* need to execute and sync at first */
10679 snd_hda_codec_read(codec
, 0x1b, 0, AC_VERB_SET_PIN_SENSE
, 0);
10680 present_int_hp
= snd_hda_codec_read(codec
, 0x1b, 0,
10681 AC_VERB_GET_PIN_SENSE
, 0);
10682 spec
->jack_present
= (present_int_hp
& 0x80000000) != 0;
10683 spec
->sense_updated
= 1;
10685 if (spec
->jack_present
) {
10686 /* mute internal speaker */
10687 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
10688 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
10689 snd_hda_codec_amp_stereo(codec
, 0x16, HDA_OUTPUT
, 0,
10690 HDA_AMP_MUTE
, HDA_AMP_MUTE
);
10692 /* unmute internal speaker if necessary */
10693 mute
= snd_hda_codec_amp_read(codec
, 0x1b, 0, HDA_OUTPUT
, 0);
10694 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
10695 HDA_AMP_MUTE
, mute
);
10696 snd_hda_codec_amp_stereo(codec
, 0x16, HDA_OUTPUT
, 0,
10697 HDA_AMP_MUTE
, mute
);
10701 /* unsolicited event for HP jack sensing */
10702 static void alc262_lenovo_3000_unsol_event(struct hda_codec
*codec
,
10705 if ((res
>> 26) != ALC_HP_EVENT
)
10707 alc262_lenovo_3000_automute(codec
, 1);
10710 static int amp_stereo_mute_update(struct hda_codec
*codec
, hda_nid_t nid
,
10711 int dir
, int idx
, long *valp
)
10715 for (i
= 0; i
< 2; i
++, valp
++)
10716 change
|= snd_hda_codec_amp_update(codec
, nid
, i
, dir
, idx
,
10718 *valp
? 0 : HDA_AMP_MUTE
);
10722 /* bind hp and internal speaker mute (with plug check) */
10723 static int alc262_fujitsu_master_sw_put(struct snd_kcontrol
*kcontrol
,
10724 struct snd_ctl_elem_value
*ucontrol
)
10726 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
10727 long *valp
= ucontrol
->value
.integer
.value
;
10730 change
= amp_stereo_mute_update(codec
, 0x14, HDA_OUTPUT
, 0, valp
);
10731 change
|= amp_stereo_mute_update(codec
, 0x1b, HDA_OUTPUT
, 0, valp
);
10733 alc262_fujitsu_automute(codec
, 0);
10737 static struct snd_kcontrol_new alc262_fujitsu_mixer
[] = {
10738 HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol
),
10740 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
10741 .name
= "Master Playback Switch",
10742 .info
= snd_hda_mixer_amp_switch_info
,
10743 .get
= snd_hda_mixer_amp_switch_get
,
10744 .put
= alc262_fujitsu_master_sw_put
,
10745 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
10747 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
10748 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
10749 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10750 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10751 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10752 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
10753 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
10754 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
10758 /* bind hp and internal speaker mute (with plug check) */
10759 static int alc262_lenovo_3000_master_sw_put(struct snd_kcontrol
*kcontrol
,
10760 struct snd_ctl_elem_value
*ucontrol
)
10762 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
10763 long *valp
= ucontrol
->value
.integer
.value
;
10766 change
= amp_stereo_mute_update(codec
, 0x1b, HDA_OUTPUT
, 0, valp
);
10768 alc262_lenovo_3000_automute(codec
, 0);
10772 static struct snd_kcontrol_new alc262_lenovo_3000_mixer
[] = {
10773 HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol
),
10775 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
10776 .name
= "Master Playback Switch",
10777 .info
= snd_hda_mixer_amp_switch_info
,
10778 .get
= snd_hda_mixer_amp_switch_get
,
10779 .put
= alc262_lenovo_3000_master_sw_put
,
10780 .private_value
= HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_OUTPUT
),
10782 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
10783 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
10784 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10785 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10786 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10787 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
10788 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
10789 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
10793 static struct snd_kcontrol_new alc262_toshiba_rx1_mixer
[] = {
10794 HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol
),
10795 ALC262_HIPPO_MASTER_SWITCH
,
10796 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
10797 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
10798 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
10799 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10800 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10801 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
10805 /* additional init verbs for Benq laptops */
10806 static struct hda_verb alc262_EAPD_verbs
[] = {
10807 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
10808 {0x20, AC_VERB_SET_PROC_COEF
, 0x3070},
10812 static struct hda_verb alc262_benq_t31_EAPD_verbs
[] = {
10813 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
10814 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
10816 {0x20, AC_VERB_SET_COEF_INDEX
, 0x07},
10817 {0x20, AC_VERB_SET_PROC_COEF
, 0x3050},
10821 /* Samsung Q1 Ultra Vista model setup */
10822 static struct snd_kcontrol_new alc262_ultra_mixer
[] = {
10823 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT
),
10824 HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT
),
10825 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
10826 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
10827 HDA_CODEC_VOLUME("Mic Boost", 0x19, 0, HDA_INPUT
),
10828 HDA_CODEC_VOLUME("Headphone Mic Boost", 0x15, 0, HDA_INPUT
),
10832 static struct hda_verb alc262_ultra_verbs
[] = {
10834 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
10835 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
10836 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
10838 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
10839 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
10840 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10841 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
10843 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
10844 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
10845 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
10846 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
10847 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
10849 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
10850 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
10851 /* ADC, choose mic */
10852 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
10853 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
10854 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
10855 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
10856 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
10857 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
10858 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)},
10859 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)},
10860 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)},
10861 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(8)},
10865 /* mute/unmute internal speaker according to the hp jack and mute state */
10866 static void alc262_ultra_automute(struct hda_codec
*codec
)
10868 struct alc_spec
*spec
= codec
->spec
;
10872 /* auto-mute only when HP is used as HP */
10873 if (!spec
->cur_mux
[0]) {
10874 unsigned int present
;
10875 /* need to execute and sync at first */
10876 snd_hda_codec_read(codec
, 0x15, 0, AC_VERB_SET_PIN_SENSE
, 0);
10877 present
= snd_hda_codec_read(codec
, 0x15, 0,
10878 AC_VERB_GET_PIN_SENSE
, 0);
10879 spec
->jack_present
= (present
& AC_PINSENSE_PRESENCE
) != 0;
10880 if (spec
->jack_present
)
10881 mute
= HDA_AMP_MUTE
;
10883 /* mute/unmute internal speaker */
10884 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
10885 HDA_AMP_MUTE
, mute
);
10886 /* mute/unmute HP */
10887 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
10888 HDA_AMP_MUTE
, mute
? 0 : HDA_AMP_MUTE
);
10891 /* unsolicited event for HP jack sensing */
10892 static void alc262_ultra_unsol_event(struct hda_codec
*codec
,
10895 if ((res
>> 26) != ALC880_HP_EVENT
)
10897 alc262_ultra_automute(codec
);
10900 static struct hda_input_mux alc262_ultra_capture_source
= {
10904 { "Headphone", 0x7 },
10908 static int alc262_ultra_mux_enum_put(struct snd_kcontrol
*kcontrol
,
10909 struct snd_ctl_elem_value
*ucontrol
)
10911 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
10912 struct alc_spec
*spec
= codec
->spec
;
10915 ret
= alc_mux_enum_put(kcontrol
, ucontrol
);
10918 /* reprogram the HP pin as mic or HP according to the input source */
10919 snd_hda_codec_write_cache(codec
, 0x15, 0,
10920 AC_VERB_SET_PIN_WIDGET_CONTROL
,
10921 spec
->cur_mux
[0] ? PIN_VREF80
: PIN_HP
);
10922 alc262_ultra_automute(codec
); /* mute/unmute HP */
10926 static struct snd_kcontrol_new alc262_ultra_capture_mixer
[] = {
10927 HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT
),
10928 HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT
),
10930 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
10931 .name
= "Capture Source",
10932 .info
= alc_mux_enum_info
,
10933 .get
= alc_mux_enum_get
,
10934 .put
= alc262_ultra_mux_enum_put
,
10939 /* We use two mixers depending on the output pin; 0x16 is a mono output
10940 * and thus it's bound with a different mixer.
10941 * This function returns which mixer amp should be used.
10943 static int alc262_check_volbit(hda_nid_t nid
)
10947 else if (nid
== 0x16)
10953 static int alc262_add_out_vol_ctl(struct alc_spec
*spec
, hda_nid_t nid
,
10954 const char *pfx
, int *vbits
)
10960 vbit
= alc262_check_volbit(nid
);
10963 if (*vbits
& vbit
) /* a volume control for this mixer already there */
10966 snprintf(name
, sizeof(name
), "%s Playback Volume", pfx
);
10968 val
= HDA_COMPOSE_AMP_VAL(0x0e, 2, 0, HDA_OUTPUT
);
10970 val
= HDA_COMPOSE_AMP_VAL(0x0c, 3, 0, HDA_OUTPUT
);
10971 return add_control(spec
, ALC_CTL_WIDGET_VOL
, name
, val
);
10974 static int alc262_add_out_sw_ctl(struct alc_spec
*spec
, hda_nid_t nid
,
10982 snprintf(name
, sizeof(name
), "%s Playback Switch", pfx
);
10984 val
= HDA_COMPOSE_AMP_VAL(nid
, 2, 0, HDA_OUTPUT
);
10986 val
= HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_OUTPUT
);
10987 return add_control(spec
, ALC_CTL_WIDGET_MUTE
, name
, val
);
10990 /* add playback controls from the parsed DAC table */
10991 static int alc262_auto_create_multi_out_ctls(struct alc_spec
*spec
,
10992 const struct auto_pin_cfg
*cfg
)
10998 spec
->multiout
.num_dacs
= 1; /* only use one dac */
10999 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
11000 spec
->multiout
.dac_nids
[0] = 2;
11002 if (!cfg
->speaker_pins
[0] && !cfg
->hp_pins
[0])
11004 else if (cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
11008 err
= alc262_add_out_sw_ctl(spec
, cfg
->line_out_pins
[0], pfx
);
11011 err
= alc262_add_out_sw_ctl(spec
, cfg
->speaker_pins
[0], "Speaker");
11014 err
= alc262_add_out_sw_ctl(spec
, cfg
->hp_pins
[0], "Headphone");
11018 vbits
= alc262_check_volbit(cfg
->line_out_pins
[0]) |
11019 alc262_check_volbit(cfg
->speaker_pins
[0]) |
11020 alc262_check_volbit(cfg
->hp_pins
[0]);
11021 if (vbits
== 1 || vbits
== 2)
11022 pfx
= "Master"; /* only one mixer is used */
11023 else if (cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
11028 err
= alc262_add_out_vol_ctl(spec
, cfg
->line_out_pins
[0], pfx
, &vbits
);
11031 err
= alc262_add_out_vol_ctl(spec
, cfg
->speaker_pins
[0], "Speaker",
11035 err
= alc262_add_out_vol_ctl(spec
, cfg
->hp_pins
[0], "Headphone",
11042 #define alc262_auto_create_input_ctls \
11043 alc880_auto_create_input_ctls
11046 * generic initialization of ADC, input mixers and output mixers
11048 static struct hda_verb alc262_volume_init_verbs
[] = {
11050 * Unmute ADC0-2 and set the default input to mic-in
11052 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
11053 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11054 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
11055 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11056 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
11057 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11059 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
11061 * Note: PASD motherboards uses the Line In 2 as the input for
11062 * front panel mic (mic 2)
11064 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
11065 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
11066 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
11067 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
11068 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
11069 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
11072 * Set up output mixers (0x0c - 0x0f)
11074 /* set vol=0 to output mixers */
11075 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11076 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11077 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11079 /* set up input amps for analog loopback */
11080 /* Amp Indices: DAC = 0, mixer = 1 */
11081 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11082 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11083 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11084 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11085 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11086 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11088 /* FIXME: use matrix-type input source selection */
11089 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
11090 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
11091 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11092 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
11093 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
11094 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
11096 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11097 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
11098 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
11099 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
11101 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11102 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
11103 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
11104 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
11109 static struct hda_verb alc262_HP_BPC_init_verbs
[] = {
11111 * Unmute ADC0-2 and set the default input to mic-in
11113 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
11114 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11115 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
11116 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11117 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
11118 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11120 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
11122 * Note: PASD motherboards uses the Line In 2 as the input for
11123 * front panel mic (mic 2)
11125 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
11126 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
11127 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
11128 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
11129 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
11130 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
11131 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)},
11132 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)},
11135 * Set up output mixers (0x0c - 0x0e)
11137 /* set vol=0 to output mixers */
11138 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11139 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11140 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11142 /* set up input amps for analog loopback */
11143 /* Amp Indices: DAC = 0, mixer = 1 */
11144 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11145 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11146 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11147 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11148 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11149 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11151 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
11152 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
11153 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
11155 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
11156 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
11158 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
11159 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
11161 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
11162 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
11163 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
11164 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
11165 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
11167 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11168 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11169 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11170 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11171 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11172 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11175 /* FIXME: use matrix-type input source selection */
11176 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 0b, 12 */
11177 /* Input mixer1: only unmute Mic */
11178 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11179 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8))},
11180 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
11181 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
11182 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
11183 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x05 << 8))},
11184 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x06 << 8))},
11185 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x07 << 8))},
11186 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x08 << 8))},
11188 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11189 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8))},
11190 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
11191 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
11192 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
11193 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x05 << 8))},
11194 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x06 << 8))},
11195 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x07 << 8))},
11196 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x08 << 8))},
11198 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11199 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8))},
11200 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8))},
11201 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x03 << 8))},
11202 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x04 << 8))},
11203 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x05 << 8))},
11204 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x06 << 8))},
11205 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x07 << 8))},
11206 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x08 << 8))},
11208 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
11213 static struct hda_verb alc262_HP_BPC_WildWest_init_verbs
[] = {
11215 * Unmute ADC0-2 and set the default input to mic-in
11217 {0x07, AC_VERB_SET_CONNECT_SEL
, 0x00},
11218 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11219 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
11220 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11221 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
11222 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11224 /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
11226 * Note: PASD motherboards uses the Line In 2 as the input for front
11227 * panel mic (mic 2)
11229 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
11230 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
11231 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
11232 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
11233 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
11234 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
11235 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)},
11236 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(6)},
11237 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(7)},
11239 * Set up output mixers (0x0c - 0x0e)
11241 /* set vol=0 to output mixers */
11242 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11243 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11244 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
11246 /* set up input amps for analog loopback */
11247 /* Amp Indices: DAC = 0, mixer = 1 */
11248 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11249 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11250 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11251 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11252 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
11253 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
11256 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
}, /* HP */
11257 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
}, /* Mono */
11258 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
}, /* rear MIC */
11259 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* Line in */
11260 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
}, /* Front MIC */
11261 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
}, /* Line out */
11262 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* CD in */
11264 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
11265 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
11267 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
11268 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
11270 /* {0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0x7023 }, */
11271 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11272 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11273 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7023 },
11274 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11275 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000 },
11277 /* FIXME: use matrix-type input source selection */
11278 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
11279 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
11280 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))}, /*rear MIC*/
11281 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))}, /*Line in*/
11282 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x02 << 8))}, /*F MIC*/
11283 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x03 << 8))}, /*Front*/
11284 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x04 << 8))}, /*CD*/
11285 /* {0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x06 << 8))}, */
11286 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x07 << 8))}, /*HP*/
11288 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11289 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
11290 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x02 << 8))},
11291 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x03 << 8))},
11292 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x04 << 8))},
11293 /* {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x06 << 8))}, */
11294 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x07 << 8))},
11296 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x00 << 8))},
11297 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8))},
11298 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x02 << 8))},
11299 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x03 << 8))},
11300 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x04 << 8))},
11301 /* {0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x06 << 8))}, */
11302 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x07 << 8))},
11304 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
11309 static struct hda_verb alc262_toshiba_rx1_unsol_verbs
[] = {
11311 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
}, /* Front Speaker */
11312 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
11313 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x01},
11315 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
}, /* MIC jack */
11316 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
}, /* Front MIC */
11317 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0) },
11318 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0) },
11320 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
}, /* HP jack */
11321 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
11322 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
11327 #ifdef CONFIG_SND_HDA_POWER_SAVE
11328 #define alc262_loopbacks alc880_loopbacks
11331 /* pcm configuration: identical with ALC880 */
11332 #define alc262_pcm_analog_playback alc880_pcm_analog_playback
11333 #define alc262_pcm_analog_capture alc880_pcm_analog_capture
11334 #define alc262_pcm_digital_playback alc880_pcm_digital_playback
11335 #define alc262_pcm_digital_capture alc880_pcm_digital_capture
11338 * BIOS auto configuration
11340 static int alc262_parse_auto_config(struct hda_codec
*codec
)
11342 struct alc_spec
*spec
= codec
->spec
;
11344 static hda_nid_t alc262_ignore
[] = { 0x1d, 0 };
11346 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
11350 if (!spec
->autocfg
.line_outs
) {
11351 if (spec
->autocfg
.dig_outs
|| spec
->autocfg
.dig_in_pin
) {
11352 spec
->multiout
.max_channels
= 2;
11353 spec
->no_analog
= 1;
11356 return 0; /* can't find valid BIOS pin config */
11358 err
= alc262_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
11361 err
= alc262_auto_create_input_ctls(codec
, &spec
->autocfg
);
11365 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
11368 if (spec
->autocfg
.dig_outs
) {
11369 spec
->multiout
.dig_out_nid
= ALC262_DIGOUT_NID
;
11370 spec
->dig_out_type
= spec
->autocfg
.dig_out_type
[0];
11372 if (spec
->autocfg
.dig_in_pin
)
11373 spec
->dig_in_nid
= ALC262_DIGIN_NID
;
11375 if (spec
->kctls
.list
)
11376 add_mixer(spec
, spec
->kctls
.list
);
11378 add_verb(spec
, alc262_volume_init_verbs
);
11379 spec
->num_mux_defs
= 1;
11380 spec
->input_mux
= &spec
->private_imux
[0];
11382 err
= alc_auto_add_mic_boost(codec
);
11386 alc_ssid_check(codec
, 0x15, 0x14, 0x1b);
11391 #define alc262_auto_init_multi_out alc882_auto_init_multi_out
11392 #define alc262_auto_init_hp_out alc882_auto_init_hp_out
11393 #define alc262_auto_init_analog_input alc882_auto_init_analog_input
11394 #define alc262_auto_init_input_src alc882_auto_init_input_src
11397 /* init callback for auto-configuration model -- overriding the default init */
11398 static void alc262_auto_init(struct hda_codec
*codec
)
11400 struct alc_spec
*spec
= codec
->spec
;
11401 alc262_auto_init_multi_out(codec
);
11402 alc262_auto_init_hp_out(codec
);
11403 alc262_auto_init_analog_input(codec
);
11404 alc262_auto_init_input_src(codec
);
11405 if (spec
->unsol_event
)
11406 alc_inithook(codec
);
11410 * configuration and preset
11412 static const char *alc262_models
[ALC262_MODEL_LAST
] = {
11413 [ALC262_BASIC
] = "basic",
11414 [ALC262_HIPPO
] = "hippo",
11415 [ALC262_HIPPO_1
] = "hippo_1",
11416 [ALC262_FUJITSU
] = "fujitsu",
11417 [ALC262_HP_BPC
] = "hp-bpc",
11418 [ALC262_HP_BPC_D7000_WL
]= "hp-bpc-d7000",
11419 [ALC262_HP_TC_T5735
] = "hp-tc-t5735",
11420 [ALC262_HP_RP5700
] = "hp-rp5700",
11421 [ALC262_BENQ_ED8
] = "benq",
11422 [ALC262_BENQ_T31
] = "benq-t31",
11423 [ALC262_SONY_ASSAMD
] = "sony-assamd",
11424 [ALC262_TOSHIBA_S06
] = "toshiba-s06",
11425 [ALC262_TOSHIBA_RX1
] = "toshiba-rx1",
11426 [ALC262_ULTRA
] = "ultra",
11427 [ALC262_LENOVO_3000
] = "lenovo-3000",
11428 [ALC262_NEC
] = "nec",
11429 [ALC262_TYAN
] = "tyan",
11430 [ALC262_AUTO
] = "auto",
11433 static struct snd_pci_quirk alc262_cfg_tbl
[] = {
11434 SND_PCI_QUIRK(0x1002, 0x437b, "Hippo", ALC262_HIPPO
),
11435 SND_PCI_QUIRK(0x1033, 0x8895, "NEC Versa S9100", ALC262_NEC
),
11436 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1200, "HP xw series",
11438 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1300, "HP xw series",
11440 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series",
11442 SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL
),
11443 SND_PCI_QUIRK(0x103c, 0x2801, "HP D7000", ALC262_HP_BPC_D7000_WF
),
11444 SND_PCI_QUIRK(0x103c, 0x2802, "HP D7000", ALC262_HP_BPC_D7000_WL
),
11445 SND_PCI_QUIRK(0x103c, 0x2803, "HP D7000", ALC262_HP_BPC_D7000_WF
),
11446 SND_PCI_QUIRK(0x103c, 0x2804, "HP D7000", ALC262_HP_BPC_D7000_WL
),
11447 SND_PCI_QUIRK(0x103c, 0x2805, "HP D7000", ALC262_HP_BPC_D7000_WF
),
11448 SND_PCI_QUIRK(0x103c, 0x2806, "HP D7000", ALC262_HP_BPC_D7000_WL
),
11449 SND_PCI_QUIRK(0x103c, 0x2807, "HP D7000", ALC262_HP_BPC_D7000_WF
),
11450 SND_PCI_QUIRK(0x103c, 0x280c, "HP xw4400", ALC262_HP_BPC
),
11451 SND_PCI_QUIRK(0x103c, 0x3014, "HP xw6400", ALC262_HP_BPC
),
11452 SND_PCI_QUIRK(0x103c, 0x3015, "HP xw8400", ALC262_HP_BPC
),
11453 SND_PCI_QUIRK(0x103c, 0x302f, "HP Thin Client T5735",
11454 ALC262_HP_TC_T5735
),
11455 SND_PCI_QUIRK(0x103c, 0x2817, "HP RP5700", ALC262_HP_RP5700
),
11456 SND_PCI_QUIRK(0x104d, 0x1f00, "Sony ASSAMD", ALC262_SONY_ASSAMD
),
11457 SND_PCI_QUIRK(0x104d, 0x8203, "Sony UX-90", ALC262_HIPPO
),
11458 SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD
),
11459 SND_PCI_QUIRK(0x104d, 0x9016, "Sony VAIO", ALC262_AUTO
), /* dig-only */
11460 SND_PCI_QUIRK(0x104d, 0x9025, "Sony VAIO Z21MN", ALC262_TOSHIBA_S06
),
11461 SND_PCI_QUIRK_MASK(0x104d, 0xff00, 0x9000, "Sony VAIO",
11462 ALC262_SONY_ASSAMD
),
11463 SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1",
11464 ALC262_TOSHIBA_RX1
),
11465 SND_PCI_QUIRK(0x1179, 0xff7b, "Toshiba S06", ALC262_TOSHIBA_S06
),
11466 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU
),
11467 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU
),
11468 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_TYAN
),
11469 SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc032, "Samsung Q1",
11471 SND_PCI_QUIRK(0x144d, 0xc510, "Samsung Q45", ALC262_HIPPO
),
11472 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000 y410", ALC262_LENOVO_3000
),
11473 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8
),
11474 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_BENQ_T31
),
11475 SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1
),
11479 static struct alc_config_preset alc262_presets
[] = {
11481 .mixers
= { alc262_base_mixer
},
11482 .init_verbs
= { alc262_init_verbs
},
11483 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11484 .dac_nids
= alc262_dac_nids
,
11486 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11487 .channel_mode
= alc262_modes
,
11488 .input_mux
= &alc262_capture_source
,
11491 .mixers
= { alc262_hippo_mixer
},
11492 .init_verbs
= { alc262_init_verbs
, alc_hp15_unsol_verbs
},
11493 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11494 .dac_nids
= alc262_dac_nids
,
11496 .dig_out_nid
= ALC262_DIGOUT_NID
,
11497 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11498 .channel_mode
= alc262_modes
,
11499 .input_mux
= &alc262_capture_source
,
11500 .unsol_event
= alc262_hippo_unsol_event
,
11501 .setup
= alc262_hippo_setup
,
11502 .init_hook
= alc262_hippo_automute
,
11504 [ALC262_HIPPO_1
] = {
11505 .mixers
= { alc262_hippo1_mixer
},
11506 .init_verbs
= { alc262_init_verbs
, alc262_hippo1_unsol_verbs
},
11507 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11508 .dac_nids
= alc262_dac_nids
,
11510 .dig_out_nid
= ALC262_DIGOUT_NID
,
11511 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11512 .channel_mode
= alc262_modes
,
11513 .input_mux
= &alc262_capture_source
,
11514 .unsol_event
= alc262_hippo_unsol_event
,
11515 .setup
= alc262_hippo1_setup
,
11516 .init_hook
= alc262_hippo_automute
,
11518 [ALC262_FUJITSU
] = {
11519 .mixers
= { alc262_fujitsu_mixer
},
11520 .init_verbs
= { alc262_init_verbs
, alc262_EAPD_verbs
,
11521 alc262_fujitsu_unsol_verbs
},
11522 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11523 .dac_nids
= alc262_dac_nids
,
11525 .dig_out_nid
= ALC262_DIGOUT_NID
,
11526 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11527 .channel_mode
= alc262_modes
,
11528 .input_mux
= &alc262_fujitsu_capture_source
,
11529 .unsol_event
= alc262_fujitsu_unsol_event
,
11530 .init_hook
= alc262_fujitsu_init_hook
,
11532 [ALC262_HP_BPC
] = {
11533 .mixers
= { alc262_HP_BPC_mixer
},
11534 .init_verbs
= { alc262_HP_BPC_init_verbs
},
11535 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11536 .dac_nids
= alc262_dac_nids
,
11538 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11539 .channel_mode
= alc262_modes
,
11540 .input_mux
= &alc262_HP_capture_source
,
11541 .unsol_event
= alc262_hp_bpc_unsol_event
,
11542 .init_hook
= alc262_hp_bpc_automute
,
11544 [ALC262_HP_BPC_D7000_WF
] = {
11545 .mixers
= { alc262_HP_BPC_WildWest_mixer
},
11546 .init_verbs
= { alc262_HP_BPC_WildWest_init_verbs
},
11547 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11548 .dac_nids
= alc262_dac_nids
,
11550 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11551 .channel_mode
= alc262_modes
,
11552 .input_mux
= &alc262_HP_D7000_capture_source
,
11553 .unsol_event
= alc262_hp_wildwest_unsol_event
,
11554 .init_hook
= alc262_hp_wildwest_automute
,
11556 [ALC262_HP_BPC_D7000_WL
] = {
11557 .mixers
= { alc262_HP_BPC_WildWest_mixer
,
11558 alc262_HP_BPC_WildWest_option_mixer
},
11559 .init_verbs
= { alc262_HP_BPC_WildWest_init_verbs
},
11560 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11561 .dac_nids
= alc262_dac_nids
,
11563 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11564 .channel_mode
= alc262_modes
,
11565 .input_mux
= &alc262_HP_D7000_capture_source
,
11566 .unsol_event
= alc262_hp_wildwest_unsol_event
,
11567 .init_hook
= alc262_hp_wildwest_automute
,
11569 [ALC262_HP_TC_T5735
] = {
11570 .mixers
= { alc262_hp_t5735_mixer
},
11571 .init_verbs
= { alc262_init_verbs
, alc262_hp_t5735_verbs
},
11572 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11573 .dac_nids
= alc262_dac_nids
,
11575 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11576 .channel_mode
= alc262_modes
,
11577 .input_mux
= &alc262_capture_source
,
11578 .unsol_event
= alc_automute_amp_unsol_event
,
11579 .setup
= alc262_hp_t5735_setup
,
11580 .init_hook
= alc_automute_amp
,
11582 [ALC262_HP_RP5700
] = {
11583 .mixers
= { alc262_hp_rp5700_mixer
},
11584 .init_verbs
= { alc262_init_verbs
, alc262_hp_rp5700_verbs
},
11585 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11586 .dac_nids
= alc262_dac_nids
,
11587 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11588 .channel_mode
= alc262_modes
,
11589 .input_mux
= &alc262_hp_rp5700_capture_source
,
11591 [ALC262_BENQ_ED8
] = {
11592 .mixers
= { alc262_base_mixer
},
11593 .init_verbs
= { alc262_init_verbs
, alc262_EAPD_verbs
},
11594 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11595 .dac_nids
= alc262_dac_nids
,
11597 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11598 .channel_mode
= alc262_modes
,
11599 .input_mux
= &alc262_capture_source
,
11601 [ALC262_SONY_ASSAMD
] = {
11602 .mixers
= { alc262_sony_mixer
},
11603 .init_verbs
= { alc262_init_verbs
, alc262_sony_unsol_verbs
},
11604 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11605 .dac_nids
= alc262_dac_nids
,
11607 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11608 .channel_mode
= alc262_modes
,
11609 .input_mux
= &alc262_capture_source
,
11610 .unsol_event
= alc262_hippo_unsol_event
,
11611 .setup
= alc262_hippo_setup
,
11612 .init_hook
= alc262_hippo_automute
,
11614 [ALC262_BENQ_T31
] = {
11615 .mixers
= { alc262_benq_t31_mixer
},
11616 .init_verbs
= { alc262_init_verbs
, alc262_benq_t31_EAPD_verbs
,
11617 alc_hp15_unsol_verbs
},
11618 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11619 .dac_nids
= alc262_dac_nids
,
11621 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11622 .channel_mode
= alc262_modes
,
11623 .input_mux
= &alc262_capture_source
,
11624 .unsol_event
= alc262_hippo_unsol_event
,
11625 .setup
= alc262_hippo_setup
,
11626 .init_hook
= alc262_hippo_automute
,
11629 .mixers
= { alc262_ultra_mixer
},
11630 .cap_mixer
= alc262_ultra_capture_mixer
,
11631 .init_verbs
= { alc262_ultra_verbs
},
11632 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11633 .dac_nids
= alc262_dac_nids
,
11634 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11635 .channel_mode
= alc262_modes
,
11636 .input_mux
= &alc262_ultra_capture_source
,
11637 .adc_nids
= alc262_adc_nids
, /* ADC0 */
11638 .capsrc_nids
= alc262_capsrc_nids
,
11639 .num_adc_nids
= 1, /* single ADC */
11640 .unsol_event
= alc262_ultra_unsol_event
,
11641 .init_hook
= alc262_ultra_automute
,
11643 [ALC262_LENOVO_3000
] = {
11644 .mixers
= { alc262_lenovo_3000_mixer
},
11645 .init_verbs
= { alc262_init_verbs
, alc262_EAPD_verbs
,
11646 alc262_lenovo_3000_unsol_verbs
},
11647 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11648 .dac_nids
= alc262_dac_nids
,
11650 .dig_out_nid
= ALC262_DIGOUT_NID
,
11651 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11652 .channel_mode
= alc262_modes
,
11653 .input_mux
= &alc262_fujitsu_capture_source
,
11654 .unsol_event
= alc262_lenovo_3000_unsol_event
,
11657 .mixers
= { alc262_nec_mixer
},
11658 .init_verbs
= { alc262_nec_verbs
},
11659 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11660 .dac_nids
= alc262_dac_nids
,
11662 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11663 .channel_mode
= alc262_modes
,
11664 .input_mux
= &alc262_capture_source
,
11666 [ALC262_TOSHIBA_S06
] = {
11667 .mixers
= { alc262_toshiba_s06_mixer
},
11668 .init_verbs
= { alc262_init_verbs
, alc262_toshiba_s06_verbs
,
11669 alc262_eapd_verbs
},
11670 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11671 .capsrc_nids
= alc262_dmic_capsrc_nids
,
11672 .dac_nids
= alc262_dac_nids
,
11673 .adc_nids
= alc262_dmic_adc_nids
, /* ADC0 */
11674 .num_adc_nids
= 1, /* single ADC */
11675 .dig_out_nid
= ALC262_DIGOUT_NID
,
11676 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11677 .channel_mode
= alc262_modes
,
11678 .unsol_event
= alc_sku_unsol_event
,
11679 .setup
= alc262_toshiba_s06_setup
,
11680 .init_hook
= alc_inithook
,
11682 [ALC262_TOSHIBA_RX1
] = {
11683 .mixers
= { alc262_toshiba_rx1_mixer
},
11684 .init_verbs
= { alc262_init_verbs
, alc262_toshiba_rx1_unsol_verbs
},
11685 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11686 .dac_nids
= alc262_dac_nids
,
11688 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11689 .channel_mode
= alc262_modes
,
11690 .input_mux
= &alc262_capture_source
,
11691 .unsol_event
= alc262_hippo_unsol_event
,
11692 .setup
= alc262_hippo_setup
,
11693 .init_hook
= alc262_hippo_automute
,
11696 .mixers
= { alc262_tyan_mixer
},
11697 .init_verbs
= { alc262_init_verbs
, alc262_tyan_verbs
},
11698 .num_dacs
= ARRAY_SIZE(alc262_dac_nids
),
11699 .dac_nids
= alc262_dac_nids
,
11701 .dig_out_nid
= ALC262_DIGOUT_NID
,
11702 .num_channel_mode
= ARRAY_SIZE(alc262_modes
),
11703 .channel_mode
= alc262_modes
,
11704 .input_mux
= &alc262_capture_source
,
11705 .unsol_event
= alc_automute_amp_unsol_event
,
11706 .setup
= alc262_tyan_setup
,
11707 .init_hook
= alc_automute_amp
,
11711 static int patch_alc262(struct hda_codec
*codec
)
11713 struct alc_spec
*spec
;
11717 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
11721 codec
->spec
= spec
;
11723 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
11728 snd_hda_codec_write(codec
, 0x1a, 0, AC_VERB_SET_COEF_INDEX
, 7);
11729 tmp
= snd_hda_codec_read(codec
, 0x20, 0, AC_VERB_GET_PROC_COEF
, 0);
11730 snd_hda_codec_write(codec
, 0x1a, 0, AC_VERB_SET_COEF_INDEX
, 7);
11731 snd_hda_codec_write(codec
, 0x1a, 0, AC_VERB_SET_PROC_COEF
, tmp
| 0x80);
11735 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
11737 board_config
= snd_hda_check_board_config(codec
, ALC262_MODEL_LAST
,
11741 if (board_config
< 0) {
11742 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
11744 board_config
= ALC262_AUTO
;
11747 if (board_config
== ALC262_AUTO
) {
11748 /* automatic parse from the BIOS config */
11749 err
= alc262_parse_auto_config(codec
);
11755 "hda_codec: Cannot set up configuration "
11756 "from BIOS. Using base mode...\n");
11757 board_config
= ALC262_BASIC
;
11761 if (!spec
->no_analog
) {
11762 err
= snd_hda_attach_beep_device(codec
, 0x1);
11769 if (board_config
!= ALC262_AUTO
)
11770 setup_preset(codec
, &alc262_presets
[board_config
]);
11772 spec
->stream_analog_playback
= &alc262_pcm_analog_playback
;
11773 spec
->stream_analog_capture
= &alc262_pcm_analog_capture
;
11775 spec
->stream_digital_playback
= &alc262_pcm_digital_playback
;
11776 spec
->stream_digital_capture
= &alc262_pcm_digital_capture
;
11778 if (!spec
->adc_nids
&& spec
->input_mux
) {
11780 /* check whether the digital-mic has to be supported */
11781 for (i
= 0; i
< spec
->input_mux
->num_items
; i
++) {
11782 if (spec
->input_mux
->items
[i
].index
>= 9)
11785 if (i
< spec
->input_mux
->num_items
) {
11786 /* use only ADC0 */
11787 spec
->adc_nids
= alc262_dmic_adc_nids
;
11788 spec
->num_adc_nids
= 1;
11789 spec
->capsrc_nids
= alc262_dmic_capsrc_nids
;
11791 /* all analog inputs */
11792 /* check whether NID 0x07 is valid */
11793 unsigned int wcap
= get_wcaps(codec
, 0x07);
11796 wcap
= get_wcaps_type(wcap
);
11797 if (wcap
!= AC_WID_AUD_IN
) {
11798 spec
->adc_nids
= alc262_adc_nids_alt
;
11799 spec
->num_adc_nids
=
11800 ARRAY_SIZE(alc262_adc_nids_alt
);
11801 spec
->capsrc_nids
= alc262_capsrc_nids_alt
;
11803 spec
->adc_nids
= alc262_adc_nids
;
11804 spec
->num_adc_nids
=
11805 ARRAY_SIZE(alc262_adc_nids
);
11806 spec
->capsrc_nids
= alc262_capsrc_nids
;
11810 if (!spec
->cap_mixer
&& !spec
->no_analog
)
11811 set_capture_mixer(codec
);
11812 if (!spec
->no_analog
)
11813 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
11815 spec
->vmaster_nid
= 0x0c;
11817 codec
->patch_ops
= alc_patch_ops
;
11818 if (board_config
== ALC262_AUTO
)
11819 spec
->init_hook
= alc262_auto_init
;
11820 #ifdef CONFIG_SND_HDA_POWER_SAVE
11821 if (!spec
->loopback
.amplist
)
11822 spec
->loopback
.amplist
= alc262_loopbacks
;
11824 codec
->proc_widget_hook
= print_realtek_coef
;
11830 * ALC268 channel source setting (2 channel)
11832 #define ALC268_DIGOUT_NID ALC880_DIGOUT_NID
11833 #define alc268_modes alc260_modes
11835 static hda_nid_t alc268_dac_nids
[2] = {
11840 static hda_nid_t alc268_adc_nids
[2] = {
11845 static hda_nid_t alc268_adc_nids_alt
[1] = {
11850 static hda_nid_t alc268_capsrc_nids
[2] = { 0x23, 0x24 };
11852 static struct snd_kcontrol_new alc268_base_mixer
[] = {
11853 /* output mixer control */
11854 HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT
),
11855 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
11856 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT
),
11857 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
11858 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
11859 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
11860 HDA_CODEC_VOLUME("Line In Boost", 0x1a, 0, HDA_INPUT
),
11864 static struct snd_kcontrol_new alc268_toshiba_mixer
[] = {
11865 /* output mixer control */
11866 HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT
),
11867 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT
),
11868 ALC262_HIPPO_MASTER_SWITCH
,
11869 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
11870 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
11871 HDA_CODEC_VOLUME("Line In Boost", 0x1a, 0, HDA_INPUT
),
11875 /* bind Beep switches of both NID 0x0f and 0x10 */
11876 static struct hda_bind_ctls alc268_bind_beep_sw
= {
11877 .ops
= &snd_hda_bind_sw
,
11879 HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT
),
11880 HDA_COMPOSE_AMP_VAL(0x10, 3, 1, HDA_INPUT
),
11885 static struct snd_kcontrol_new alc268_beep_mixer
[] = {
11886 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT
),
11887 HDA_BIND_SW("Beep Playback Switch", &alc268_bind_beep_sw
),
11891 static struct hda_verb alc268_eapd_verbs
[] = {
11892 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
11893 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
11897 /* Toshiba specific */
11898 static struct hda_verb alc268_toshiba_verbs
[] = {
11899 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
11903 /* Acer specific */
11904 /* bind volumes of both NID 0x02 and 0x03 */
11905 static struct hda_bind_ctls alc268_acer_bind_master_vol
= {
11906 .ops
= &snd_hda_bind_vol
,
11908 HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT
),
11909 HDA_COMPOSE_AMP_VAL(0x03, 3, 0, HDA_OUTPUT
),
11914 /* mute/unmute internal speaker according to the hp jack and mute state */
11915 static void alc268_acer_automute(struct hda_codec
*codec
, int force
)
11917 struct alc_spec
*spec
= codec
->spec
;
11920 if (force
|| !spec
->sense_updated
) {
11921 unsigned int present
;
11922 present
= snd_hda_codec_read(codec
, 0x14, 0,
11923 AC_VERB_GET_PIN_SENSE
, 0);
11924 spec
->jack_present
= (present
& 0x80000000) != 0;
11925 spec
->sense_updated
= 1;
11927 if (spec
->jack_present
)
11928 mute
= HDA_AMP_MUTE
; /* mute internal speaker */
11929 else /* unmute internal speaker if necessary */
11930 mute
= snd_hda_codec_amp_read(codec
, 0x14, 0, HDA_OUTPUT
, 0);
11931 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
11932 HDA_AMP_MUTE
, mute
);
11936 /* bind hp and internal speaker mute (with plug check) */
11937 static int alc268_acer_master_sw_put(struct snd_kcontrol
*kcontrol
,
11938 struct snd_ctl_elem_value
*ucontrol
)
11940 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
11941 long *valp
= ucontrol
->value
.integer
.value
;
11944 change
= amp_stereo_mute_update(codec
, 0x14, HDA_OUTPUT
, 0, valp
);
11946 alc268_acer_automute(codec
, 0);
11950 static struct snd_kcontrol_new alc268_acer_aspire_one_mixer
[] = {
11951 /* output mixer control */
11952 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol
),
11954 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
11955 .name
= "Master Playback Switch",
11956 .info
= snd_hda_mixer_amp_switch_info
,
11957 .get
= snd_hda_mixer_amp_switch_get
,
11958 .put
= alc268_acer_master_sw_put
,
11959 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
11961 HDA_CODEC_VOLUME("Mic Boost Capture Volume", 0x18, 0, HDA_INPUT
),
11965 static struct snd_kcontrol_new alc268_acer_mixer
[] = {
11966 /* output mixer control */
11967 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol
),
11969 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
11970 .name
= "Master Playback Switch",
11971 .info
= snd_hda_mixer_amp_switch_info
,
11972 .get
= snd_hda_mixer_amp_switch_get
,
11973 .put
= alc268_acer_master_sw_put
,
11974 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
11976 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
11977 HDA_CODEC_VOLUME("Internal Mic Boost", 0x19, 0, HDA_INPUT
),
11978 HDA_CODEC_VOLUME("Line In Boost", 0x1a, 0, HDA_INPUT
),
11982 static struct snd_kcontrol_new alc268_acer_dmic_mixer
[] = {
11983 /* output mixer control */
11984 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol
),
11986 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
11987 .name
= "Master Playback Switch",
11988 .info
= snd_hda_mixer_amp_switch_info
,
11989 .get
= snd_hda_mixer_amp_switch_get
,
11990 .put
= alc268_acer_master_sw_put
,
11991 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
11993 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
11994 HDA_CODEC_VOLUME("Line In Boost", 0x1a, 0, HDA_INPUT
),
11998 static struct hda_verb alc268_acer_aspire_one_verbs
[] = {
11999 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
12000 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
12001 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
12002 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
12003 {0x23, AC_VERB_SET_CONNECT_SEL
, 0x06},
12004 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, 0xa017},
12008 static struct hda_verb alc268_acer_verbs
[] = {
12009 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
}, /* internal dmic? */
12010 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
12011 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
12012 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
12013 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
12014 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
12015 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
12019 /* unsolicited event for HP jack sensing */
12020 #define alc268_toshiba_unsol_event alc262_hippo_unsol_event
12021 #define alc268_toshiba_setup alc262_hippo_setup
12022 #define alc268_toshiba_automute alc262_hippo_automute
12024 static void alc268_acer_unsol_event(struct hda_codec
*codec
,
12027 if ((res
>> 26) != ALC880_HP_EVENT
)
12029 alc268_acer_automute(codec
, 1);
12032 static void alc268_acer_init_hook(struct hda_codec
*codec
)
12034 alc268_acer_automute(codec
, 1);
12037 /* toggle speaker-output according to the hp-jack state */
12038 static void alc268_aspire_one_speaker_automute(struct hda_codec
*codec
)
12040 unsigned int present
;
12041 unsigned char bits
;
12043 present
= snd_hda_codec_read(codec
, 0x15, 0,
12044 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
12045 bits
= present
? AMP_IN_MUTE(0) : 0;
12046 snd_hda_codec_amp_stereo(codec
, 0x0f, HDA_INPUT
, 0,
12047 AMP_IN_MUTE(0), bits
);
12048 snd_hda_codec_amp_stereo(codec
, 0x0f, HDA_INPUT
, 1,
12049 AMP_IN_MUTE(0), bits
);
12052 static void alc268_acer_lc_unsol_event(struct hda_codec
*codec
,
12055 switch (res
>> 26) {
12056 case ALC880_HP_EVENT
:
12057 alc268_aspire_one_speaker_automute(codec
);
12059 case ALC880_MIC_EVENT
:
12060 alc_mic_automute(codec
);
12065 static void alc268_acer_lc_setup(struct hda_codec
*codec
)
12067 struct alc_spec
*spec
= codec
->spec
;
12068 spec
->ext_mic
.pin
= 0x18;
12069 spec
->ext_mic
.mux_idx
= 0;
12070 spec
->int_mic
.pin
= 0x12;
12071 spec
->int_mic
.mux_idx
= 6;
12072 spec
->auto_mic
= 1;
12075 static void alc268_acer_lc_init_hook(struct hda_codec
*codec
)
12077 alc268_aspire_one_speaker_automute(codec
);
12078 alc_mic_automute(codec
);
12081 static struct snd_kcontrol_new alc268_dell_mixer
[] = {
12082 /* output mixer control */
12083 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
12084 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
12085 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
12086 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
12087 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
12088 HDA_CODEC_VOLUME("Internal Mic Boost", 0x19, 0, HDA_INPUT
),
12092 static struct hda_verb alc268_dell_verbs
[] = {
12093 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
12094 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
12095 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
12096 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_MIC_EVENT
| AC_USRSP_EN
},
12100 /* mute/unmute internal speaker according to the hp jack and mute state */
12101 static void alc268_dell_setup(struct hda_codec
*codec
)
12103 struct alc_spec
*spec
= codec
->spec
;
12105 spec
->autocfg
.hp_pins
[0] = 0x15;
12106 spec
->autocfg
.speaker_pins
[0] = 0x14;
12107 spec
->ext_mic
.pin
= 0x18;
12108 spec
->ext_mic
.mux_idx
= 0;
12109 spec
->int_mic
.pin
= 0x19;
12110 spec
->int_mic
.mux_idx
= 1;
12111 spec
->auto_mic
= 1;
12114 static struct snd_kcontrol_new alc267_quanta_il1_mixer
[] = {
12115 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x2, 0x0, HDA_OUTPUT
),
12116 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
12117 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT
),
12118 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
12119 HDA_CODEC_VOLUME("Mic Capture Volume", 0x23, 0x0, HDA_OUTPUT
),
12120 HDA_BIND_MUTE("Mic Capture Switch", 0x23, 2, HDA_OUTPUT
),
12121 HDA_CODEC_VOLUME("Ext Mic Boost", 0x18, 0, HDA_INPUT
),
12122 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
12126 static struct hda_verb alc267_quanta_il1_verbs
[] = {
12127 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
12128 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_MIC_EVENT
| AC_USRSP_EN
},
12132 static void alc267_quanta_il1_setup(struct hda_codec
*codec
)
12134 struct alc_spec
*spec
= codec
->spec
;
12135 spec
->autocfg
.hp_pins
[0] = 0x15;
12136 spec
->autocfg
.speaker_pins
[0] = 0x14;
12137 spec
->ext_mic
.pin
= 0x18;
12138 spec
->ext_mic
.mux_idx
= 0;
12139 spec
->int_mic
.pin
= 0x19;
12140 spec
->int_mic
.mux_idx
= 1;
12141 spec
->auto_mic
= 1;
12145 * generic initialization of ADC, input mixers and output mixers
12147 static struct hda_verb alc268_base_init_verbs
[] = {
12148 /* Unmute DAC0-1 and set vol = 0 */
12149 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12150 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12153 * Set up output mixers (0x0c - 0x0e)
12155 /* set vol=0 to output mixers */
12156 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12157 {0x0e, AC_VERB_SET_CONNECT_SEL
, 0x00},
12159 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12160 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12162 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
12163 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0},
12164 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40},
12165 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
12166 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
12167 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
12168 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
12169 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
12171 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12172 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12173 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12174 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12175 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12177 /* set PCBEEP vol = 0, mute connections */
12178 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12179 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
12180 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
12182 /* Unmute Selector 23h,24h and set the default input to mic-in */
12184 {0x23, AC_VERB_SET_CONNECT_SEL
, 0x00},
12185 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
12186 {0x24, AC_VERB_SET_CONNECT_SEL
, 0x00},
12187 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
12193 * generic initialization of ADC, input mixers and output mixers
12195 static struct hda_verb alc268_volume_init_verbs
[] = {
12196 /* set output DAC */
12197 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12198 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
12200 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
12201 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
12202 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
12203 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
12204 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20},
12206 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12207 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12208 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12210 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12211 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
12213 /* set PCBEEP vol = 0, mute connections */
12214 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
12215 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
12216 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
12221 static struct snd_kcontrol_new alc268_capture_nosrc_mixer
[] = {
12222 HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT
),
12223 HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT
),
12227 static struct snd_kcontrol_new alc268_capture_alt_mixer
[] = {
12228 HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT
),
12229 HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT
),
12234 static struct snd_kcontrol_new alc268_capture_mixer
[] = {
12235 HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT
),
12236 HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT
),
12237 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x24, 0x0, HDA_OUTPUT
),
12238 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x24, 0x0, HDA_OUTPUT
),
12243 static struct hda_input_mux alc268_capture_source
= {
12247 { "Front Mic", 0x1 },
12253 static struct hda_input_mux alc268_acer_capture_source
= {
12257 { "Internal Mic", 0x1 },
12262 static struct hda_input_mux alc268_acer_dmic_capture_source
= {
12266 { "Internal Mic", 0x6 },
12271 #ifdef CONFIG_SND_DEBUG
12272 static struct snd_kcontrol_new alc268_test_mixer
[] = {
12273 /* Volume widgets */
12274 HDA_CODEC_VOLUME("LOUT1 Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
12275 HDA_CODEC_VOLUME("LOUT2 Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
12276 HDA_BIND_MUTE_MONO("Mono sum Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
12277 HDA_BIND_MUTE("LINE-OUT sum Playback Switch", 0x0f, 2, HDA_INPUT
),
12278 HDA_BIND_MUTE("HP-OUT sum Playback Switch", 0x10, 2, HDA_INPUT
),
12279 HDA_BIND_MUTE("LINE-OUT Playback Switch", 0x14, 2, HDA_OUTPUT
),
12280 HDA_BIND_MUTE("HP-OUT Playback Switch", 0x15, 2, HDA_OUTPUT
),
12281 HDA_BIND_MUTE("Mono Playback Switch", 0x16, 2, HDA_OUTPUT
),
12282 HDA_CODEC_VOLUME("MIC1 Capture Volume", 0x18, 0x0, HDA_INPUT
),
12283 HDA_BIND_MUTE("MIC1 Capture Switch", 0x18, 2, HDA_OUTPUT
),
12284 HDA_CODEC_VOLUME("MIC2 Capture Volume", 0x19, 0x0, HDA_INPUT
),
12285 HDA_CODEC_VOLUME("LINE1 Capture Volume", 0x1a, 0x0, HDA_INPUT
),
12286 HDA_BIND_MUTE("LINE1 Capture Switch", 0x1a, 2, HDA_OUTPUT
),
12287 /* The below appears problematic on some hardwares */
12288 /*HDA_CODEC_VOLUME("PCBEEP Playback Volume", 0x1d, 0x0, HDA_INPUT),*/
12289 HDA_CODEC_VOLUME("PCM-IN1 Capture Volume", 0x23, 0x0, HDA_OUTPUT
),
12290 HDA_BIND_MUTE("PCM-IN1 Capture Switch", 0x23, 2, HDA_OUTPUT
),
12291 HDA_CODEC_VOLUME("PCM-IN2 Capture Volume", 0x24, 0x0, HDA_OUTPUT
),
12292 HDA_BIND_MUTE("PCM-IN2 Capture Switch", 0x24, 2, HDA_OUTPUT
),
12294 /* Modes for retasking pin widgets */
12295 ALC_PIN_MODE("LINE-OUT pin mode", 0x14, ALC_PIN_DIR_INOUT
),
12296 ALC_PIN_MODE("HP-OUT pin mode", 0x15, ALC_PIN_DIR_INOUT
),
12297 ALC_PIN_MODE("MIC1 pin mode", 0x18, ALC_PIN_DIR_INOUT
),
12298 ALC_PIN_MODE("LINE1 pin mode", 0x1a, ALC_PIN_DIR_INOUT
),
12300 /* Controls for GPIO pins, assuming they are configured as outputs */
12301 ALC_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
12302 ALC_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
12303 ALC_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
12304 ALC_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
12306 /* Switches to allow the digital SPDIF output pin to be enabled.
12307 * The ALC268 does not have an SPDIF input.
12309 ALC_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x06, 0x01),
12311 /* A switch allowing EAPD to be enabled. Some laptops seem to use
12312 * this output to turn on an external amplifier.
12314 ALC_EAPD_CTRL_SWITCH("LINE-OUT EAPD Enable Switch", 0x0f, 0x02),
12315 ALC_EAPD_CTRL_SWITCH("HP-OUT EAPD Enable Switch", 0x10, 0x02),
12321 /* create input playback/capture controls for the given pin */
12322 static int alc268_new_analog_output(struct alc_spec
*spec
, hda_nid_t nid
,
12323 const char *ctlname
, int idx
)
12329 sprintf(name
, "%s Playback Volume", ctlname
);
12341 if (spec
->multiout
.dac_nids
[0] != dac
&&
12342 spec
->multiout
.dac_nids
[1] != dac
) {
12343 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
, name
,
12344 HDA_COMPOSE_AMP_VAL(dac
, 3, idx
,
12348 spec
->multiout
.dac_nids
[spec
->multiout
.num_dacs
++] = dac
;
12351 sprintf(name
, "%s Playback Switch", ctlname
);
12353 err
= add_control(spec
, ALC_CTL_WIDGET_MUTE
, name
,
12354 HDA_COMPOSE_AMP_VAL(nid
, 3, idx
, HDA_OUTPUT
));
12356 err
= add_control(spec
, ALC_CTL_WIDGET_MUTE
, name
,
12357 HDA_COMPOSE_AMP_VAL(nid
, 2, idx
, HDA_OUTPUT
));
12363 /* add playback controls from the parsed DAC table */
12364 static int alc268_auto_create_multi_out_ctls(struct alc_spec
*spec
,
12365 const struct auto_pin_cfg
*cfg
)
12370 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
12372 nid
= cfg
->line_out_pins
[0];
12375 if (cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
12379 err
= alc268_new_analog_output(spec
, nid
, name
, 0);
12384 nid
= cfg
->speaker_pins
[0];
12386 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
,
12387 "Speaker Playback Volume",
12388 HDA_COMPOSE_AMP_VAL(nid
, 3, 0, HDA_INPUT
));
12392 err
= alc268_new_analog_output(spec
, nid
, "Speaker", 0);
12396 nid
= cfg
->hp_pins
[0];
12398 err
= alc268_new_analog_output(spec
, nid
, "Headphone", 0);
12403 nid
= cfg
->line_out_pins
[1] | cfg
->line_out_pins
[2];
12405 err
= add_control(spec
, ALC_CTL_WIDGET_MUTE
,
12406 "Mono Playback Switch",
12407 HDA_COMPOSE_AMP_VAL(nid
, 2, 0, HDA_OUTPUT
));
12414 /* create playback/capture controls for input pins */
12415 static int alc268_auto_create_input_ctls(struct hda_codec
*codec
,
12416 const struct auto_pin_cfg
*cfg
)
12418 return alc_auto_create_input_ctls(codec
, cfg
, 0, 0x23, 0x24);
12421 static void alc268_auto_set_output_and_unmute(struct hda_codec
*codec
,
12422 hda_nid_t nid
, int pin_type
)
12426 alc_set_pin_output(codec
, nid
, pin_type
);
12427 if (nid
== 0x14 || nid
== 0x16)
12431 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_CONNECT_SEL
, idx
);
12434 static void alc268_auto_init_multi_out(struct hda_codec
*codec
)
12436 struct alc_spec
*spec
= codec
->spec
;
12437 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[0];
12439 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
12440 alc268_auto_set_output_and_unmute(codec
, nid
, pin_type
);
12444 static void alc268_auto_init_hp_out(struct hda_codec
*codec
)
12446 struct alc_spec
*spec
= codec
->spec
;
12449 pin
= spec
->autocfg
.hp_pins
[0];
12451 alc268_auto_set_output_and_unmute(codec
, pin
, PIN_HP
);
12452 pin
= spec
->autocfg
.speaker_pins
[0];
12454 alc268_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
);
12457 static void alc268_auto_init_mono_speaker_out(struct hda_codec
*codec
)
12459 struct alc_spec
*spec
= codec
->spec
;
12460 hda_nid_t speaker_nid
= spec
->autocfg
.speaker_pins
[0];
12461 hda_nid_t hp_nid
= spec
->autocfg
.hp_pins
[0];
12462 hda_nid_t line_nid
= spec
->autocfg
.line_out_pins
[0];
12463 unsigned int dac_vol1
, dac_vol2
;
12465 if (line_nid
== 0x1d || speaker_nid
== 0x1d) {
12466 snd_hda_codec_write(codec
, speaker_nid
, 0,
12467 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
12468 /* mute mixer inputs from 0x1d */
12469 snd_hda_codec_write(codec
, 0x0f, 0,
12470 AC_VERB_SET_AMP_GAIN_MUTE
,
12472 snd_hda_codec_write(codec
, 0x10, 0,
12473 AC_VERB_SET_AMP_GAIN_MUTE
,
12476 /* unmute mixer inputs from 0x1d */
12477 snd_hda_codec_write(codec
, 0x0f, 0,
12478 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1));
12479 snd_hda_codec_write(codec
, 0x10, 0,
12480 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1));
12483 dac_vol1
= dac_vol2
= 0xb000 | 0x40; /* set max volume */
12484 if (line_nid
== 0x14)
12485 dac_vol2
= AMP_OUT_ZERO
;
12486 else if (line_nid
== 0x15)
12487 dac_vol1
= AMP_OUT_ZERO
;
12488 if (hp_nid
== 0x14)
12489 dac_vol2
= AMP_OUT_ZERO
;
12490 else if (hp_nid
== 0x15)
12491 dac_vol1
= AMP_OUT_ZERO
;
12492 if (line_nid
!= 0x16 || hp_nid
!= 0x16 ||
12493 spec
->autocfg
.line_out_pins
[1] != 0x16 ||
12494 spec
->autocfg
.line_out_pins
[2] != 0x16)
12495 dac_vol1
= dac_vol2
= AMP_OUT_ZERO
;
12497 snd_hda_codec_write(codec
, 0x02, 0,
12498 AC_VERB_SET_AMP_GAIN_MUTE
, dac_vol1
);
12499 snd_hda_codec_write(codec
, 0x03, 0,
12500 AC_VERB_SET_AMP_GAIN_MUTE
, dac_vol2
);
12503 /* pcm configuration: identical with ALC880 */
12504 #define alc268_pcm_analog_playback alc880_pcm_analog_playback
12505 #define alc268_pcm_analog_capture alc880_pcm_analog_capture
12506 #define alc268_pcm_analog_alt_capture alc880_pcm_analog_alt_capture
12507 #define alc268_pcm_digital_playback alc880_pcm_digital_playback
12510 * BIOS auto configuration
12512 static int alc268_parse_auto_config(struct hda_codec
*codec
)
12514 struct alc_spec
*spec
= codec
->spec
;
12516 static hda_nid_t alc268_ignore
[] = { 0 };
12518 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
12522 if (!spec
->autocfg
.line_outs
) {
12523 if (spec
->autocfg
.dig_outs
|| spec
->autocfg
.dig_in_pin
) {
12524 spec
->multiout
.max_channels
= 2;
12525 spec
->no_analog
= 1;
12528 return 0; /* can't find valid BIOS pin config */
12530 err
= alc268_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
12533 err
= alc268_auto_create_input_ctls(codec
, &spec
->autocfg
);
12537 spec
->multiout
.max_channels
= 2;
12540 /* digital only support output */
12541 if (spec
->autocfg
.dig_outs
) {
12542 spec
->multiout
.dig_out_nid
= ALC268_DIGOUT_NID
;
12543 spec
->dig_out_type
= spec
->autocfg
.dig_out_type
[0];
12545 if (spec
->kctls
.list
)
12546 add_mixer(spec
, spec
->kctls
.list
);
12548 if (!spec
->no_analog
&& spec
->autocfg
.speaker_pins
[0] != 0x1d)
12549 add_mixer(spec
, alc268_beep_mixer
);
12551 add_verb(spec
, alc268_volume_init_verbs
);
12552 spec
->num_mux_defs
= 2;
12553 spec
->input_mux
= &spec
->private_imux
[0];
12555 err
= alc_auto_add_mic_boost(codec
);
12559 alc_ssid_check(codec
, 0x15, 0x1b, 0x14);
12564 #define alc268_auto_init_analog_input alc882_auto_init_analog_input
12566 /* init callback for auto-configuration model -- overriding the default init */
12567 static void alc268_auto_init(struct hda_codec
*codec
)
12569 struct alc_spec
*spec
= codec
->spec
;
12570 alc268_auto_init_multi_out(codec
);
12571 alc268_auto_init_hp_out(codec
);
12572 alc268_auto_init_mono_speaker_out(codec
);
12573 alc268_auto_init_analog_input(codec
);
12574 if (spec
->unsol_event
)
12575 alc_inithook(codec
);
12579 * configuration and preset
12581 static const char *alc268_models
[ALC268_MODEL_LAST
] = {
12582 [ALC267_QUANTA_IL1
] = "quanta-il1",
12583 [ALC268_3ST
] = "3stack",
12584 [ALC268_TOSHIBA
] = "toshiba",
12585 [ALC268_ACER
] = "acer",
12586 [ALC268_ACER_DMIC
] = "acer-dmic",
12587 [ALC268_ACER_ASPIRE_ONE
] = "acer-aspire",
12588 [ALC268_DELL
] = "dell",
12589 [ALC268_ZEPTO
] = "zepto",
12590 #ifdef CONFIG_SND_DEBUG
12591 [ALC268_TEST
] = "test",
12593 [ALC268_AUTO
] = "auto",
12596 static struct snd_pci_quirk alc268_cfg_tbl
[] = {
12597 SND_PCI_QUIRK(0x1025, 0x011e, "Acer Aspire 5720z", ALC268_ACER
),
12598 SND_PCI_QUIRK(0x1025, 0x0126, "Acer", ALC268_ACER
),
12599 SND_PCI_QUIRK(0x1025, 0x012e, "Acer Aspire 5310", ALC268_ACER
),
12600 SND_PCI_QUIRK(0x1025, 0x0130, "Acer Extensa 5210", ALC268_ACER
),
12601 SND_PCI_QUIRK(0x1025, 0x0136, "Acer Aspire 5315", ALC268_ACER
),
12602 SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One",
12603 ALC268_ACER_ASPIRE_ONE
),
12604 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL
),
12605 SND_PCI_QUIRK(0x1028, 0x02b0, "Dell Inspiron Mini9", ALC268_DELL
),
12606 /* almost compatible with toshiba but with optional digital outs;
12607 * auto-probing seems working fine
12609 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x3000, "HP TX25xx series",
12611 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST
),
12612 SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO
),
12613 SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA
),
12614 SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER
),
12615 SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1
),
12616 SND_PCI_QUIRK(0x1854, 0x1775, "LG R510", ALC268_DELL
),
12620 /* Toshiba laptops have no unique PCI SSID but only codec SSID */
12621 static struct snd_pci_quirk alc268_ssid_cfg_tbl
[] = {
12622 SND_PCI_QUIRK(0x1179, 0xff0a, "TOSHIBA X-200", ALC268_AUTO
),
12623 SND_PCI_QUIRK(0x1179, 0xff0e, "TOSHIBA X-200 HDMI", ALC268_AUTO
),
12624 SND_PCI_QUIRK_MASK(0x1179, 0xff00, 0xff00, "TOSHIBA A/Lx05",
12629 static struct alc_config_preset alc268_presets
[] = {
12630 [ALC267_QUANTA_IL1
] = {
12631 .mixers
= { alc267_quanta_il1_mixer
, alc268_beep_mixer
,
12632 alc268_capture_nosrc_mixer
},
12633 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12634 alc267_quanta_il1_verbs
},
12635 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12636 .dac_nids
= alc268_dac_nids
,
12637 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12638 .adc_nids
= alc268_adc_nids_alt
,
12640 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12641 .channel_mode
= alc268_modes
,
12642 .unsol_event
= alc_sku_unsol_event
,
12643 .setup
= alc267_quanta_il1_setup
,
12644 .init_hook
= alc_inithook
,
12647 .mixers
= { alc268_base_mixer
, alc268_capture_alt_mixer
,
12648 alc268_beep_mixer
},
12649 .init_verbs
= { alc268_base_init_verbs
},
12650 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12651 .dac_nids
= alc268_dac_nids
,
12652 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12653 .adc_nids
= alc268_adc_nids_alt
,
12654 .capsrc_nids
= alc268_capsrc_nids
,
12656 .dig_out_nid
= ALC268_DIGOUT_NID
,
12657 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12658 .channel_mode
= alc268_modes
,
12659 .input_mux
= &alc268_capture_source
,
12661 [ALC268_TOSHIBA
] = {
12662 .mixers
= { alc268_toshiba_mixer
, alc268_capture_alt_mixer
,
12663 alc268_beep_mixer
},
12664 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12665 alc268_toshiba_verbs
},
12666 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12667 .dac_nids
= alc268_dac_nids
,
12668 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12669 .adc_nids
= alc268_adc_nids_alt
,
12670 .capsrc_nids
= alc268_capsrc_nids
,
12672 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12673 .channel_mode
= alc268_modes
,
12674 .input_mux
= &alc268_capture_source
,
12675 .unsol_event
= alc268_toshiba_unsol_event
,
12676 .setup
= alc268_toshiba_setup
,
12677 .init_hook
= alc268_toshiba_automute
,
12680 .mixers
= { alc268_acer_mixer
, alc268_capture_alt_mixer
,
12681 alc268_beep_mixer
},
12682 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12683 alc268_acer_verbs
},
12684 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12685 .dac_nids
= alc268_dac_nids
,
12686 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12687 .adc_nids
= alc268_adc_nids_alt
,
12688 .capsrc_nids
= alc268_capsrc_nids
,
12690 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12691 .channel_mode
= alc268_modes
,
12692 .input_mux
= &alc268_acer_capture_source
,
12693 .unsol_event
= alc268_acer_unsol_event
,
12694 .init_hook
= alc268_acer_init_hook
,
12696 [ALC268_ACER_DMIC
] = {
12697 .mixers
= { alc268_acer_dmic_mixer
, alc268_capture_alt_mixer
,
12698 alc268_beep_mixer
},
12699 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12700 alc268_acer_verbs
},
12701 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12702 .dac_nids
= alc268_dac_nids
,
12703 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12704 .adc_nids
= alc268_adc_nids_alt
,
12705 .capsrc_nids
= alc268_capsrc_nids
,
12707 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12708 .channel_mode
= alc268_modes
,
12709 .input_mux
= &alc268_acer_dmic_capture_source
,
12710 .unsol_event
= alc268_acer_unsol_event
,
12711 .init_hook
= alc268_acer_init_hook
,
12713 [ALC268_ACER_ASPIRE_ONE
] = {
12714 .mixers
= { alc268_acer_aspire_one_mixer
,
12716 alc268_capture_nosrc_mixer
},
12717 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12718 alc268_acer_aspire_one_verbs
},
12719 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12720 .dac_nids
= alc268_dac_nids
,
12721 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12722 .adc_nids
= alc268_adc_nids_alt
,
12723 .capsrc_nids
= alc268_capsrc_nids
,
12725 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12726 .channel_mode
= alc268_modes
,
12727 .unsol_event
= alc268_acer_lc_unsol_event
,
12728 .setup
= alc268_acer_lc_setup
,
12729 .init_hook
= alc268_acer_lc_init_hook
,
12732 .mixers
= { alc268_dell_mixer
, alc268_beep_mixer
,
12733 alc268_capture_nosrc_mixer
},
12734 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12735 alc268_dell_verbs
},
12736 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12737 .dac_nids
= alc268_dac_nids
,
12738 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12739 .adc_nids
= alc268_adc_nids_alt
,
12740 .capsrc_nids
= alc268_capsrc_nids
,
12742 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12743 .channel_mode
= alc268_modes
,
12744 .unsol_event
= alc_sku_unsol_event
,
12745 .setup
= alc268_dell_setup
,
12746 .init_hook
= alc_inithook
,
12749 .mixers
= { alc268_base_mixer
, alc268_capture_alt_mixer
,
12750 alc268_beep_mixer
},
12751 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12752 alc268_toshiba_verbs
},
12753 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12754 .dac_nids
= alc268_dac_nids
,
12755 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12756 .adc_nids
= alc268_adc_nids_alt
,
12757 .capsrc_nids
= alc268_capsrc_nids
,
12759 .dig_out_nid
= ALC268_DIGOUT_NID
,
12760 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12761 .channel_mode
= alc268_modes
,
12762 .input_mux
= &alc268_capture_source
,
12763 .setup
= alc268_toshiba_setup
,
12764 .init_hook
= alc268_toshiba_automute
,
12766 #ifdef CONFIG_SND_DEBUG
12768 .mixers
= { alc268_test_mixer
, alc268_capture_mixer
},
12769 .init_verbs
= { alc268_base_init_verbs
, alc268_eapd_verbs
,
12770 alc268_volume_init_verbs
},
12771 .num_dacs
= ARRAY_SIZE(alc268_dac_nids
),
12772 .dac_nids
= alc268_dac_nids
,
12773 .num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
),
12774 .adc_nids
= alc268_adc_nids_alt
,
12775 .capsrc_nids
= alc268_capsrc_nids
,
12777 .dig_out_nid
= ALC268_DIGOUT_NID
,
12778 .num_channel_mode
= ARRAY_SIZE(alc268_modes
),
12779 .channel_mode
= alc268_modes
,
12780 .input_mux
= &alc268_capture_source
,
12785 static int patch_alc268(struct hda_codec
*codec
)
12787 struct alc_spec
*spec
;
12789 int i
, has_beep
, err
;
12791 spec
= kcalloc(1, sizeof(*spec
), GFP_KERNEL
);
12795 codec
->spec
= spec
;
12797 board_config
= snd_hda_check_board_config(codec
, ALC268_MODEL_LAST
,
12801 if (board_config
< 0 || board_config
>= ALC268_MODEL_LAST
)
12802 board_config
= snd_hda_check_board_codec_sid_config(codec
,
12803 ALC882_MODEL_LAST
, alc268_models
, alc268_ssid_cfg_tbl
);
12805 if (board_config
< 0 || board_config
>= ALC268_MODEL_LAST
) {
12806 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
12808 board_config
= ALC268_AUTO
;
12811 if (board_config
== ALC268_AUTO
) {
12812 /* automatic parse from the BIOS config */
12813 err
= alc268_parse_auto_config(codec
);
12819 "hda_codec: Cannot set up configuration "
12820 "from BIOS. Using base mode...\n");
12821 board_config
= ALC268_3ST
;
12825 if (board_config
!= ALC268_AUTO
)
12826 setup_preset(codec
, &alc268_presets
[board_config
]);
12828 spec
->stream_analog_playback
= &alc268_pcm_analog_playback
;
12829 spec
->stream_analog_capture
= &alc268_pcm_analog_capture
;
12830 spec
->stream_analog_alt_capture
= &alc268_pcm_analog_alt_capture
;
12832 spec
->stream_digital_playback
= &alc268_pcm_digital_playback
;
12835 for (i
= 0; i
< spec
->num_mixers
; i
++) {
12836 if (spec
->mixers
[i
] == alc268_beep_mixer
) {
12843 err
= snd_hda_attach_beep_device(codec
, 0x1);
12848 if (!query_amp_caps(codec
, 0x1d, HDA_INPUT
))
12849 /* override the amp caps for beep generator */
12850 snd_hda_override_amp_caps(codec
, 0x1d, HDA_INPUT
,
12851 (0x0c << AC_AMPCAP_OFFSET_SHIFT
) |
12852 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT
) |
12853 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
12854 (0 << AC_AMPCAP_MUTE_SHIFT
));
12857 if (!spec
->no_analog
&& !spec
->adc_nids
&& spec
->input_mux
) {
12858 /* check whether NID 0x07 is valid */
12859 unsigned int wcap
= get_wcaps(codec
, 0x07);
12863 wcap
= get_wcaps_type(wcap
);
12864 if (spec
->auto_mic
||
12865 wcap
!= AC_WID_AUD_IN
|| spec
->input_mux
->num_items
== 1) {
12866 spec
->adc_nids
= alc268_adc_nids_alt
;
12867 spec
->num_adc_nids
= ARRAY_SIZE(alc268_adc_nids_alt
);
12868 if (spec
->auto_mic
|| spec
->input_mux
->num_items
== 1)
12869 add_mixer(spec
, alc268_capture_nosrc_mixer
);
12871 add_mixer(spec
, alc268_capture_alt_mixer
);
12873 spec
->adc_nids
= alc268_adc_nids
;
12874 spec
->num_adc_nids
= ARRAY_SIZE(alc268_adc_nids
);
12875 add_mixer(spec
, alc268_capture_mixer
);
12877 spec
->capsrc_nids
= alc268_capsrc_nids
;
12878 /* set default input source */
12879 for (i
= 0; i
< spec
->num_adc_nids
; i
++)
12880 snd_hda_codec_write_cache(codec
, alc268_capsrc_nids
[i
],
12881 0, AC_VERB_SET_CONNECT_SEL
,
12882 i
< spec
->num_mux_defs
?
12883 spec
->input_mux
[i
].items
[0].index
:
12884 spec
->input_mux
->items
[0].index
);
12887 spec
->vmaster_nid
= 0x02;
12889 codec
->patch_ops
= alc_patch_ops
;
12890 if (board_config
== ALC268_AUTO
)
12891 spec
->init_hook
= alc268_auto_init
;
12893 codec
->proc_widget_hook
= print_realtek_coef
;
12899 * ALC269 channel source setting (2 channel)
12901 #define ALC269_DIGOUT_NID ALC880_DIGOUT_NID
12903 #define alc269_dac_nids alc260_dac_nids
12905 static hda_nid_t alc269_adc_nids
[1] = {
12910 static hda_nid_t alc269_capsrc_nids
[1] = {
12914 /* NOTE: ADC2 (0x07) is connected from a recording *MIXER* (0x24),
12918 #define alc269_modes alc260_modes
12919 #define alc269_capture_source alc880_lg_lw_capture_source
12921 static struct snd_kcontrol_new alc269_base_mixer
[] = {
12922 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
12923 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
12924 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
12925 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
12926 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
12927 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
12928 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
12929 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
12930 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
12931 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
12932 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
12933 HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x16, 2, 0x0, HDA_OUTPUT
),
12937 static struct snd_kcontrol_new alc269_quanta_fl1_mixer
[] = {
12938 /* output mixer control */
12939 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol
),
12941 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
12942 .name
= "Master Playback Switch",
12943 .info
= snd_hda_mixer_amp_switch_info
,
12944 .get
= snd_hda_mixer_amp_switch_get
,
12945 .put
= alc268_acer_master_sw_put
,
12946 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
12948 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
12949 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
12950 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
12951 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
12952 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
12953 HDA_CODEC_VOLUME("Internal Mic Boost", 0x19, 0, HDA_INPUT
),
12957 static struct snd_kcontrol_new alc269_lifebook_mixer
[] = {
12958 /* output mixer control */
12959 HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol
),
12961 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
12962 .name
= "Master Playback Switch",
12963 .info
= snd_hda_mixer_amp_switch_info
,
12964 .get
= snd_hda_mixer_amp_switch_get
,
12965 .put
= alc268_acer_master_sw_put
,
12966 .private_value
= HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
12968 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
12969 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
12970 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
12971 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT
),
12972 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT
),
12973 HDA_CODEC_VOLUME("Internal Mic Boost", 0x19, 0, HDA_INPUT
),
12974 HDA_CODEC_VOLUME("Dock Mic Playback Volume", 0x0b, 0x03, HDA_INPUT
),
12975 HDA_CODEC_MUTE("Dock Mic Playback Switch", 0x0b, 0x03, HDA_INPUT
),
12976 HDA_CODEC_VOLUME("Dock Mic Boost", 0x1b, 0, HDA_INPUT
),
12980 static struct snd_kcontrol_new alc269_eeepc_mixer
[] = {
12981 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
12982 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
12983 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
12984 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
12988 /* capture mixer elements */
12989 static struct snd_kcontrol_new alc269_epc_capture_mixer
[] = {
12990 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT
),
12991 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT
),
12992 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
12997 #define alc269_fujitsu_mixer alc269_eeepc_mixer
12999 static struct hda_verb alc269_quanta_fl1_verbs
[] = {
13000 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
13001 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13002 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
13003 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
13004 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
13005 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13009 static struct hda_verb alc269_lifebook_verbs
[] = {
13010 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
13011 {0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01},
13012 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13013 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
13014 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
13015 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13016 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
13017 {0x1a, AC_VERB_SET_UNSOLICITED_ENABLE
, ALC880_HP_EVENT
| AC_USRSP_EN
},
13018 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
13019 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13023 /* toggle speaker-output according to the hp-jack state */
13024 static void alc269_quanta_fl1_speaker_automute(struct hda_codec
*codec
)
13026 unsigned int present
;
13027 unsigned char bits
;
13029 present
= snd_hda_codec_read(codec
, 0x15, 0,
13030 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
13031 bits
= present
? AMP_IN_MUTE(0) : 0;
13032 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
13033 AMP_IN_MUTE(0), bits
);
13034 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
13035 AMP_IN_MUTE(0), bits
);
13037 snd_hda_codec_write(codec
, 0x20, 0,
13038 AC_VERB_SET_COEF_INDEX
, 0x0c);
13039 snd_hda_codec_write(codec
, 0x20, 0,
13040 AC_VERB_SET_PROC_COEF
, 0x680);
13042 snd_hda_codec_write(codec
, 0x20, 0,
13043 AC_VERB_SET_COEF_INDEX
, 0x0c);
13044 snd_hda_codec_write(codec
, 0x20, 0,
13045 AC_VERB_SET_PROC_COEF
, 0x480);
13048 /* toggle speaker-output according to the hp-jacks state */
13049 static void alc269_lifebook_speaker_automute(struct hda_codec
*codec
)
13051 unsigned int present
;
13052 unsigned char bits
;
13054 /* Check laptop headphone socket */
13055 present
= snd_hda_codec_read(codec
, 0x15, 0,
13056 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
13058 /* Check port replicator headphone socket */
13059 present
|= snd_hda_codec_read(codec
, 0x1a, 0,
13060 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
13062 bits
= present
? AMP_IN_MUTE(0) : 0;
13063 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
13064 AMP_IN_MUTE(0), bits
);
13065 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
13066 AMP_IN_MUTE(0), bits
);
13068 snd_hda_codec_write(codec
, 0x20, 0,
13069 AC_VERB_SET_COEF_INDEX
, 0x0c);
13070 snd_hda_codec_write(codec
, 0x20, 0,
13071 AC_VERB_SET_PROC_COEF
, 0x680);
13073 snd_hda_codec_write(codec
, 0x20, 0,
13074 AC_VERB_SET_COEF_INDEX
, 0x0c);
13075 snd_hda_codec_write(codec
, 0x20, 0,
13076 AC_VERB_SET_PROC_COEF
, 0x480);
13079 static void alc269_lifebook_mic_autoswitch(struct hda_codec
*codec
)
13081 unsigned int present_laptop
;
13082 unsigned int present_dock
;
13084 present_laptop
= snd_hda_codec_read(codec
, 0x18, 0,
13085 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
13087 present_dock
= snd_hda_codec_read(codec
, 0x1b, 0,
13088 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
13090 /* Laptop mic port overrides dock mic port, design decision */
13092 snd_hda_codec_write(codec
, 0x23, 0,
13093 AC_VERB_SET_CONNECT_SEL
, 0x3);
13094 if (present_laptop
)
13095 snd_hda_codec_write(codec
, 0x23, 0,
13096 AC_VERB_SET_CONNECT_SEL
, 0x0);
13097 if (!present_dock
&& !present_laptop
)
13098 snd_hda_codec_write(codec
, 0x23, 0,
13099 AC_VERB_SET_CONNECT_SEL
, 0x1);
13102 static void alc269_quanta_fl1_unsol_event(struct hda_codec
*codec
,
13105 switch (res
>> 26) {
13106 case ALC880_HP_EVENT
:
13107 alc269_quanta_fl1_speaker_automute(codec
);
13109 case ALC880_MIC_EVENT
:
13110 alc_mic_automute(codec
);
13115 static void alc269_lifebook_unsol_event(struct hda_codec
*codec
,
13118 if ((res
>> 26) == ALC880_HP_EVENT
)
13119 alc269_lifebook_speaker_automute(codec
);
13120 if ((res
>> 26) == ALC880_MIC_EVENT
)
13121 alc269_lifebook_mic_autoswitch(codec
);
13124 static void alc269_quanta_fl1_setup(struct hda_codec
*codec
)
13126 struct alc_spec
*spec
= codec
->spec
;
13127 spec
->ext_mic
.pin
= 0x18;
13128 spec
->ext_mic
.mux_idx
= 0;
13129 spec
->int_mic
.pin
= 0x19;
13130 spec
->int_mic
.mux_idx
= 1;
13131 spec
->auto_mic
= 1;
13134 static void alc269_quanta_fl1_init_hook(struct hda_codec
*codec
)
13136 alc269_quanta_fl1_speaker_automute(codec
);
13137 alc_mic_automute(codec
);
13140 static void alc269_lifebook_init_hook(struct hda_codec
*codec
)
13142 alc269_lifebook_speaker_automute(codec
);
13143 alc269_lifebook_mic_autoswitch(codec
);
13146 static struct hda_verb alc269_eeepc_dmic_init_verbs
[] = {
13147 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
13148 {0x23, AC_VERB_SET_CONNECT_SEL
, 0x05},
13149 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb026 },
13150 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7019 | (0x00 << 8))},
13151 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13152 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
13153 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
13157 static struct hda_verb alc269_eeepc_amic_init_verbs
[] = {
13158 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
13159 {0x23, AC_VERB_SET_CONNECT_SEL
, 0x01},
13160 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb026 },
13161 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, (0x701b | (0x00 << 8))},
13162 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
13163 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
13167 /* toggle speaker-output according to the hp-jack state */
13168 static void alc269_speaker_automute(struct hda_codec
*codec
)
13170 unsigned int present
;
13171 unsigned char bits
;
13173 present
= snd_hda_codec_read(codec
, 0x15, 0,
13174 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
13175 bits
= present
? AMP_IN_MUTE(0) : 0;
13176 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
13177 AMP_IN_MUTE(0), bits
);
13178 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
13179 AMP_IN_MUTE(0), bits
);
13182 /* unsolicited event for HP jack sensing */
13183 static void alc269_eeepc_unsol_event(struct hda_codec
*codec
,
13186 switch (res
>> 26) {
13187 case ALC880_HP_EVENT
:
13188 alc269_speaker_automute(codec
);
13190 case ALC880_MIC_EVENT
:
13191 alc_mic_automute(codec
);
13196 static void alc269_eeepc_dmic_setup(struct hda_codec
*codec
)
13198 struct alc_spec
*spec
= codec
->spec
;
13199 spec
->ext_mic
.pin
= 0x18;
13200 spec
->ext_mic
.mux_idx
= 0;
13201 spec
->int_mic
.pin
= 0x12;
13202 spec
->int_mic
.mux_idx
= 5;
13203 spec
->auto_mic
= 1;
13206 static void alc269_eeepc_amic_setup(struct hda_codec
*codec
)
13208 struct alc_spec
*spec
= codec
->spec
;
13209 spec
->ext_mic
.pin
= 0x18;
13210 spec
->ext_mic
.mux_idx
= 0;
13211 spec
->int_mic
.pin
= 0x19;
13212 spec
->int_mic
.mux_idx
= 1;
13213 spec
->auto_mic
= 1;
13216 static void alc269_eeepc_inithook(struct hda_codec
*codec
)
13218 alc269_speaker_automute(codec
);
13219 alc_mic_automute(codec
);
13223 * generic initialization of ADC, input mixers and output mixers
13225 static struct hda_verb alc269_init_verbs
[] = {
13227 * Unmute ADC0 and set the default input to mic-in
13229 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13231 /* Mute input amps (PCBeep, Line In, Mic 1 & Mic 2) of the
13232 * analog-loopback mixer widget
13233 * Note: PASD motherboards uses the Line In 2 as the input for
13234 * front panel mic (mic 2)
13236 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
13237 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
13238 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
13239 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
13240 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
13241 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
13244 * Set up output mixers (0x0c - 0x0e)
13246 /* set vol=0 to output mixers */
13247 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
13248 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
13250 /* set up input amps for analog loopback */
13251 /* Amp Indices: DAC = 0, mixer = 1 */
13252 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13253 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13254 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13255 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13256 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13257 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13259 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
13260 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
13261 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
13262 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
13263 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
13264 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13265 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
13267 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13268 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13269 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13270 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13271 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13272 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13273 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
13275 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
13276 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x00},
13278 /* FIXME: use matrix-type input source selection */
13279 /* Mixer elements: 0x18, 19, 1a, 1b, 1d, 0b */
13280 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
13281 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
13282 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13283 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
13284 {0x24, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
13287 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
13288 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
13292 #define alc269_auto_create_multi_out_ctls \
13293 alc268_auto_create_multi_out_ctls
13294 #define alc269_auto_create_input_ctls \
13295 alc268_auto_create_input_ctls
13297 #ifdef CONFIG_SND_HDA_POWER_SAVE
13298 #define alc269_loopbacks alc880_loopbacks
13301 /* pcm configuration: identical with ALC880 */
13302 #define alc269_pcm_analog_playback alc880_pcm_analog_playback
13303 #define alc269_pcm_analog_capture alc880_pcm_analog_capture
13304 #define alc269_pcm_digital_playback alc880_pcm_digital_playback
13305 #define alc269_pcm_digital_capture alc880_pcm_digital_capture
13307 static struct hda_pcm_stream alc269_44k_pcm_analog_playback
= {
13311 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
13312 /* NID is set in alc_build_pcms */
13314 .open
= alc880_playback_pcm_open
,
13315 .prepare
= alc880_playback_pcm_prepare
,
13316 .cleanup
= alc880_playback_pcm_cleanup
13320 static struct hda_pcm_stream alc269_44k_pcm_analog_capture
= {
13324 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
13325 /* NID is set in alc_build_pcms */
13329 * BIOS auto configuration
13331 static int alc269_parse_auto_config(struct hda_codec
*codec
)
13333 struct alc_spec
*spec
= codec
->spec
;
13335 static hda_nid_t alc269_ignore
[] = { 0x1d, 0 };
13337 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
13342 err
= alc269_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
13345 err
= alc269_auto_create_input_ctls(codec
, &spec
->autocfg
);
13349 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
13351 if (spec
->autocfg
.dig_outs
)
13352 spec
->multiout
.dig_out_nid
= ALC269_DIGOUT_NID
;
13354 if (spec
->kctls
.list
)
13355 add_mixer(spec
, spec
->kctls
.list
);
13357 add_verb(spec
, alc269_init_verbs
);
13358 spec
->num_mux_defs
= 1;
13359 spec
->input_mux
= &spec
->private_imux
[0];
13360 /* set default input source */
13361 snd_hda_codec_write_cache(codec
, alc269_capsrc_nids
[0],
13362 0, AC_VERB_SET_CONNECT_SEL
,
13363 spec
->input_mux
->items
[0].index
);
13365 err
= alc_auto_add_mic_boost(codec
);
13369 if (!spec
->cap_mixer
&& !spec
->no_analog
)
13370 set_capture_mixer(codec
);
13372 alc_ssid_check(codec
, 0x15, 0x1b, 0x14);
13377 #define alc269_auto_init_multi_out alc268_auto_init_multi_out
13378 #define alc269_auto_init_hp_out alc268_auto_init_hp_out
13379 #define alc269_auto_init_analog_input alc882_auto_init_analog_input
13382 /* init callback for auto-configuration model -- overriding the default init */
13383 static void alc269_auto_init(struct hda_codec
*codec
)
13385 struct alc_spec
*spec
= codec
->spec
;
13386 alc269_auto_init_multi_out(codec
);
13387 alc269_auto_init_hp_out(codec
);
13388 alc269_auto_init_analog_input(codec
);
13389 if (spec
->unsol_event
)
13390 alc_inithook(codec
);
13394 * configuration and preset
13396 static const char *alc269_models
[ALC269_MODEL_LAST
] = {
13397 [ALC269_BASIC
] = "basic",
13398 [ALC269_QUANTA_FL1
] = "quanta",
13399 [ALC269_ASUS_EEEPC_P703
] = "eeepc-p703",
13400 [ALC269_ASUS_EEEPC_P901
] = "eeepc-p901",
13401 [ALC269_FUJITSU
] = "fujitsu",
13402 [ALC269_LIFEBOOK
] = "lifebook",
13403 [ALC269_AUTO
] = "auto",
13406 static struct snd_pci_quirk alc269_cfg_tbl
[] = {
13407 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1
),
13408 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
13409 ALC269_ASUS_EEEPC_P703
),
13410 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_ASUS_EEEPC_P703
),
13411 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_ASUS_EEEPC_P703
),
13412 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_ASUS_EEEPC_P703
),
13413 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_ASUS_EEEPC_P703
),
13414 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_ASUS_EEEPC_P703
),
13415 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_ASUS_EEEPC_P703
),
13416 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901",
13417 ALC269_ASUS_EEEPC_P901
),
13418 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101",
13419 ALC269_ASUS_EEEPC_P901
),
13420 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_ASUS_EEEPC_P901
),
13421 SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU
),
13422 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK
),
13426 static struct alc_config_preset alc269_presets
[] = {
13428 .mixers
= { alc269_base_mixer
},
13429 .init_verbs
= { alc269_init_verbs
},
13430 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
13431 .dac_nids
= alc269_dac_nids
,
13433 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
13434 .channel_mode
= alc269_modes
,
13435 .input_mux
= &alc269_capture_source
,
13437 [ALC269_QUANTA_FL1
] = {
13438 .mixers
= { alc269_quanta_fl1_mixer
},
13439 .init_verbs
= { alc269_init_verbs
, alc269_quanta_fl1_verbs
},
13440 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
13441 .dac_nids
= alc269_dac_nids
,
13443 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
13444 .channel_mode
= alc269_modes
,
13445 .input_mux
= &alc269_capture_source
,
13446 .unsol_event
= alc269_quanta_fl1_unsol_event
,
13447 .setup
= alc269_quanta_fl1_setup
,
13448 .init_hook
= alc269_quanta_fl1_init_hook
,
13450 [ALC269_ASUS_EEEPC_P703
] = {
13451 .mixers
= { alc269_eeepc_mixer
},
13452 .cap_mixer
= alc269_epc_capture_mixer
,
13453 .init_verbs
= { alc269_init_verbs
,
13454 alc269_eeepc_amic_init_verbs
},
13455 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
13456 .dac_nids
= alc269_dac_nids
,
13458 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
13459 .channel_mode
= alc269_modes
,
13460 .unsol_event
= alc269_eeepc_unsol_event
,
13461 .setup
= alc269_eeepc_amic_setup
,
13462 .init_hook
= alc269_eeepc_inithook
,
13464 [ALC269_ASUS_EEEPC_P901
] = {
13465 .mixers
= { alc269_eeepc_mixer
},
13466 .cap_mixer
= alc269_epc_capture_mixer
,
13467 .init_verbs
= { alc269_init_verbs
,
13468 alc269_eeepc_dmic_init_verbs
},
13469 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
13470 .dac_nids
= alc269_dac_nids
,
13472 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
13473 .channel_mode
= alc269_modes
,
13474 .unsol_event
= alc269_eeepc_unsol_event
,
13475 .setup
= alc269_eeepc_dmic_setup
,
13476 .init_hook
= alc269_eeepc_inithook
,
13478 [ALC269_FUJITSU
] = {
13479 .mixers
= { alc269_fujitsu_mixer
},
13480 .cap_mixer
= alc269_epc_capture_mixer
,
13481 .init_verbs
= { alc269_init_verbs
,
13482 alc269_eeepc_dmic_init_verbs
},
13483 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
13484 .dac_nids
= alc269_dac_nids
,
13486 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
13487 .channel_mode
= alc269_modes
,
13488 .unsol_event
= alc269_eeepc_unsol_event
,
13489 .setup
= alc269_eeepc_dmic_setup
,
13490 .init_hook
= alc269_eeepc_inithook
,
13492 [ALC269_LIFEBOOK
] = {
13493 .mixers
= { alc269_lifebook_mixer
},
13494 .init_verbs
= { alc269_init_verbs
, alc269_lifebook_verbs
},
13495 .num_dacs
= ARRAY_SIZE(alc269_dac_nids
),
13496 .dac_nids
= alc269_dac_nids
,
13498 .num_channel_mode
= ARRAY_SIZE(alc269_modes
),
13499 .channel_mode
= alc269_modes
,
13500 .input_mux
= &alc269_capture_source
,
13501 .unsol_event
= alc269_lifebook_unsol_event
,
13502 .init_hook
= alc269_lifebook_init_hook
,
13506 static int patch_alc269(struct hda_codec
*codec
)
13508 struct alc_spec
*spec
;
13512 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
13516 codec
->spec
= spec
;
13518 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
13520 board_config
= snd_hda_check_board_config(codec
, ALC269_MODEL_LAST
,
13524 if (board_config
< 0) {
13525 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
13527 board_config
= ALC269_AUTO
;
13530 if (board_config
== ALC269_AUTO
) {
13531 /* automatic parse from the BIOS config */
13532 err
= alc269_parse_auto_config(codec
);
13538 "hda_codec: Cannot set up configuration "
13539 "from BIOS. Using base mode...\n");
13540 board_config
= ALC269_BASIC
;
13544 err
= snd_hda_attach_beep_device(codec
, 0x1);
13550 if (board_config
!= ALC269_AUTO
)
13551 setup_preset(codec
, &alc269_presets
[board_config
]);
13553 if (codec
->subsystem_id
== 0x17aa3bf8) {
13554 /* Due to a hardware problem on Lenovo Ideadpad, we need to
13555 * fix the sample rate of analog I/O to 44.1kHz
13557 spec
->stream_analog_playback
= &alc269_44k_pcm_analog_playback
;
13558 spec
->stream_analog_capture
= &alc269_44k_pcm_analog_capture
;
13560 spec
->stream_analog_playback
= &alc269_pcm_analog_playback
;
13561 spec
->stream_analog_capture
= &alc269_pcm_analog_capture
;
13563 spec
->stream_digital_playback
= &alc269_pcm_digital_playback
;
13564 spec
->stream_digital_capture
= &alc269_pcm_digital_capture
;
13566 spec
->adc_nids
= alc269_adc_nids
;
13567 spec
->num_adc_nids
= ARRAY_SIZE(alc269_adc_nids
);
13568 spec
->capsrc_nids
= alc269_capsrc_nids
;
13569 if (!spec
->cap_mixer
)
13570 set_capture_mixer(codec
);
13571 set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
13573 spec
->vmaster_nid
= 0x02;
13575 codec
->patch_ops
= alc_patch_ops
;
13576 if (board_config
== ALC269_AUTO
)
13577 spec
->init_hook
= alc269_auto_init
;
13578 #ifdef CONFIG_SND_HDA_POWER_SAVE
13579 if (!spec
->loopback
.amplist
)
13580 spec
->loopback
.amplist
= alc269_loopbacks
;
13582 codec
->proc_widget_hook
= print_realtek_coef
;
13588 * ALC861 channel source setting (2/6 channel selection for 3-stack)
13592 * set the path ways for 2 channel output
13593 * need to set the codec line out and mic 1 pin widgets to inputs
13595 static struct hda_verb alc861_threestack_ch2_init
[] = {
13596 /* set pin widget 1Ah (line in) for input */
13597 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13598 /* set pin widget 18h (mic1/2) for input, for mic also enable
13601 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13603 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c },
13605 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8)) }, /*mic*/
13606 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x02 << 8)) }, /*line-in*/
13612 * need to set the codec line out and mic 1 pin widgets to outputs
13614 static struct hda_verb alc861_threestack_ch6_init
[] = {
13615 /* set pin widget 1Ah (line in) for output (Back Surround)*/
13616 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13617 /* set pin widget 18h (mic1) for output (CLFE)*/
13618 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13620 { 0x0c, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13621 { 0x0d, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13623 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb080 },
13625 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8)) }, /*mic*/
13626 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8)) }, /*line in*/
13631 static struct hda_channel_mode alc861_threestack_modes
[2] = {
13632 { 2, alc861_threestack_ch2_init
},
13633 { 6, alc861_threestack_ch6_init
},
13635 /* Set mic1 as input and unmute the mixer */
13636 static struct hda_verb alc861_uniwill_m31_ch2_init
[] = {
13637 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13638 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8)) }, /*mic*/
13641 /* Set mic1 as output and mute mixer */
13642 static struct hda_verb alc861_uniwill_m31_ch4_init
[] = {
13643 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13644 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8)) }, /*mic*/
13648 static struct hda_channel_mode alc861_uniwill_m31_modes
[2] = {
13649 { 2, alc861_uniwill_m31_ch2_init
},
13650 { 4, alc861_uniwill_m31_ch4_init
},
13653 /* Set mic1 and line-in as input and unmute the mixer */
13654 static struct hda_verb alc861_asus_ch2_init
[] = {
13655 /* set pin widget 1Ah (line in) for input */
13656 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13657 /* set pin widget 18h (mic1/2) for input, for mic also enable
13660 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13662 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c },
13664 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x01 << 8)) }, /*mic*/
13665 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7000 | (0x02 << 8)) }, /*line-in*/
13669 /* Set mic1 nad line-in as output and mute mixer */
13670 static struct hda_verb alc861_asus_ch6_init
[] = {
13671 /* set pin widget 1Ah (line in) for output (Back Surround)*/
13672 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13673 /* { 0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, */
13674 /* set pin widget 18h (mic1) for output (CLFE)*/
13675 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13676 /* { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, */
13677 { 0x0c, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13678 { 0x0d, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13680 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb080 },
13682 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x01 << 8)) }, /*mic*/
13683 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, (0x7080 | (0x02 << 8)) }, /*line in*/
13688 static struct hda_channel_mode alc861_asus_modes
[2] = {
13689 { 2, alc861_asus_ch2_init
},
13690 { 6, alc861_asus_ch6_init
},
13695 static struct snd_kcontrol_new alc861_base_mixer
[] = {
13696 /* output mixer control */
13697 HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT
),
13698 HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT
),
13699 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT
),
13700 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT
),
13701 HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT
),
13703 /*Input mixer control */
13704 /* HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT),
13705 HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT), */
13706 HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT
),
13707 HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT
),
13708 HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT
),
13709 HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT
),
13710 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT
),
13711 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT
),
13712 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT
),
13713 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT
),
13718 static struct snd_kcontrol_new alc861_3ST_mixer
[] = {
13719 /* output mixer control */
13720 HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT
),
13721 HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT
),
13722 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT
),
13723 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT
),
13724 /*HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT), */
13726 /* Input mixer control */
13727 /* HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT),
13728 HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT), */
13729 HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT
),
13730 HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT
),
13731 HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT
),
13732 HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT
),
13733 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT
),
13734 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT
),
13735 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT
),
13736 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT
),
13739 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
13740 .name
= "Channel Mode",
13741 .info
= alc_ch_mode_info
,
13742 .get
= alc_ch_mode_get
,
13743 .put
= alc_ch_mode_put
,
13744 .private_value
= ARRAY_SIZE(alc861_threestack_modes
),
13749 static struct snd_kcontrol_new alc861_toshiba_mixer
[] = {
13750 /* output mixer control */
13751 HDA_CODEC_MUTE("Master Playback Switch", 0x03, 0x0, HDA_OUTPUT
),
13752 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT
),
13753 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT
),
13758 static struct snd_kcontrol_new alc861_uniwill_m31_mixer
[] = {
13759 /* output mixer control */
13760 HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT
),
13761 HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT
),
13762 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT
),
13763 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT
),
13764 /*HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT), */
13766 /* Input mixer control */
13767 /* HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT),
13768 HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT), */
13769 HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT
),
13770 HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT
),
13771 HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT
),
13772 HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT
),
13773 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT
),
13774 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT
),
13775 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT
),
13776 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT
),
13779 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
13780 .name
= "Channel Mode",
13781 .info
= alc_ch_mode_info
,
13782 .get
= alc_ch_mode_get
,
13783 .put
= alc_ch_mode_put
,
13784 .private_value
= ARRAY_SIZE(alc861_uniwill_m31_modes
),
13789 static struct snd_kcontrol_new alc861_asus_mixer
[] = {
13790 /* output mixer control */
13791 HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT
),
13792 HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT
),
13793 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT
),
13794 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT
),
13795 HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT
),
13797 /* Input mixer control */
13798 HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT
),
13799 HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
13800 HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT
),
13801 HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT
),
13802 HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT
),
13803 HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT
),
13804 HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT
),
13805 HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT
),
13806 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT
),
13807 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_OUTPUT
),
13810 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
13811 .name
= "Channel Mode",
13812 .info
= alc_ch_mode_info
,
13813 .get
= alc_ch_mode_get
,
13814 .put
= alc_ch_mode_put
,
13815 .private_value
= ARRAY_SIZE(alc861_asus_modes
),
13820 /* additional mixer */
13821 static struct snd_kcontrol_new alc861_asus_laptop_mixer
[] = {
13822 HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT
),
13823 HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT
),
13828 * generic initialization of ADC, input mixers and output mixers
13830 static struct hda_verb alc861_base_init_verbs
[] = {
13832 * Unmute ADC0 and set the default input to mic-in
13834 /* port-A for surround (rear panel) */
13835 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13836 { 0x0e, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13837 /* port-B for mic-in (rear panel) with vref */
13838 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13839 /* port-C for line-in (rear panel) */
13840 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13841 /* port-D for Front */
13842 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13843 { 0x0b, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13844 /* port-E for HP out (front panel) */
13845 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0 },
13846 /* route front PCM to HP */
13847 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13848 /* port-F for mic-in (front panel) with vref */
13849 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13850 /* port-G for CLFE (rear panel) */
13851 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13852 { 0x1f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13853 /* port-H for side (rear panel) */
13854 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13855 { 0x20, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13857 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13858 /* route front mic to ADC1*/
13859 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
13860 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13862 /* Unmute DAC0~3 & spdif out*/
13863 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13864 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13865 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13866 {0x06, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13867 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13869 /* Unmute Mixer 14 (mic) 1c (Line in)*/
13870 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13871 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13872 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13873 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13875 /* Unmute Stereo Mixer 15 */
13876 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13877 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13878 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
13879 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c}, /* Output 0~12 step */
13881 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13882 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13883 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13884 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13885 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13886 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13887 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13888 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13889 /* hp used DAC 3 (Front) */
13890 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
13891 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
13896 static struct hda_verb alc861_threestack_init_verbs
[] = {
13898 * Unmute ADC0 and set the default input to mic-in
13900 /* port-A for surround (rear panel) */
13901 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
13902 /* port-B for mic-in (rear panel) with vref */
13903 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13904 /* port-C for line-in (rear panel) */
13905 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13906 /* port-D for Front */
13907 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13908 { 0x0b, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13909 /* port-E for HP out (front panel) */
13910 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0 },
13911 /* route front PCM to HP */
13912 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13913 /* port-F for mic-in (front panel) with vref */
13914 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13915 /* port-G for CLFE (rear panel) */
13916 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
13917 /* port-H for side (rear panel) */
13918 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
13920 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13921 /* route front mic to ADC1*/
13922 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
13923 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13924 /* Unmute DAC0~3 & spdif out*/
13925 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13926 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13927 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13928 {0x06, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13929 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13931 /* Unmute Mixer 14 (mic) 1c (Line in)*/
13932 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13933 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13934 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13935 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13937 /* Unmute Stereo Mixer 15 */
13938 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13939 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13940 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
13941 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c}, /* Output 0~12 step */
13943 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13944 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13945 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13946 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13947 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13948 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13949 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13950 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13951 /* hp used DAC 3 (Front) */
13952 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
13953 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
13957 static struct hda_verb alc861_uniwill_m31_init_verbs
[] = {
13959 * Unmute ADC0 and set the default input to mic-in
13961 /* port-A for surround (rear panel) */
13962 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
13963 /* port-B for mic-in (rear panel) with vref */
13964 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13965 /* port-C for line-in (rear panel) */
13966 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13967 /* port-D for Front */
13968 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
13969 { 0x0b, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13970 /* port-E for HP out (front panel) */
13971 /* this has to be set to VREF80 */
13972 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13973 /* route front PCM to HP */
13974 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
13975 /* port-F for mic-in (front panel) with vref */
13976 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
13977 /* port-G for CLFE (rear panel) */
13978 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
13979 /* port-H for side (rear panel) */
13980 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
13982 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
13983 /* route front mic to ADC1*/
13984 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
13985 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13986 /* Unmute DAC0~3 & spdif out*/
13987 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13988 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13989 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13990 {0x06, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13991 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
13993 /* Unmute Mixer 14 (mic) 1c (Line in)*/
13994 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13995 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13996 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
13997 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
13999 /* Unmute Stereo Mixer 15 */
14000 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14001 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14002 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
14003 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c}, /* Output 0~12 step */
14005 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14006 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14007 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14008 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14009 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14010 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14011 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14012 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14013 /* hp used DAC 3 (Front) */
14014 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
14015 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
14019 static struct hda_verb alc861_asus_init_verbs
[] = {
14021 * Unmute ADC0 and set the default input to mic-in
14023 /* port-A for surround (rear panel)
14024 * according to codec#0 this is the HP jack
14026 { 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0 }, /* was 0x00 */
14027 /* route front PCM to HP */
14028 { 0x0e, AC_VERB_SET_CONNECT_SEL
, 0x01 },
14029 /* port-B for mic-in (rear panel) with vref */
14030 { 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
14031 /* port-C for line-in (rear panel) */
14032 { 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
14033 /* port-D for Front */
14034 { 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
14035 { 0x0b, AC_VERB_SET_CONNECT_SEL
, 0x00 },
14036 /* port-E for HP out (front panel) */
14037 /* this has to be set to VREF80 */
14038 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
14039 /* route front PCM to HP */
14040 { 0x0f, AC_VERB_SET_CONNECT_SEL
, 0x00 },
14041 /* port-F for mic-in (front panel) with vref */
14042 { 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24 },
14043 /* port-G for CLFE (rear panel) */
14044 { 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
14045 /* port-H for side (rear panel) */
14046 { 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x40 },
14048 { 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x20 },
14049 /* route front mic to ADC1*/
14050 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00},
14051 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14052 /* Unmute DAC0~3 & spdif out*/
14053 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14054 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14055 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14056 {0x06, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14057 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14058 /* Unmute Mixer 14 (mic) 1c (Line in)*/
14059 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14060 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14061 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14062 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14064 /* Unmute Stereo Mixer 15 */
14065 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14066 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14067 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
14068 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c}, /* Output 0~12 step */
14070 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14071 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14072 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14073 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14074 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14075 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14076 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14077 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14078 /* hp used DAC 3 (Front) */
14079 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(3)},
14080 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
14084 /* additional init verbs for ASUS laptops */
14085 static struct hda_verb alc861_asus_laptop_init_verbs
[] = {
14086 { 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x45 }, /* HP-out */
14087 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2) }, /* mute line-in */
14092 * generic initialization of ADC, input mixers and output mixers
14094 static struct hda_verb alc861_auto_init_verbs
[] = {
14096 * Unmute ADC0 and set the default input to mic-in
14098 /* {0x08, AC_VERB_SET_CONNECT_SEL, 0x00}, */
14099 {0x08, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14101 /* Unmute DAC0~3 & spdif out*/
14102 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
14103 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
14104 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
14105 {0x06, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
14106 {0x07, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14108 /* Unmute Mixer 14 (mic) 1c (Line in)*/
14109 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14110 {0x014, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14111 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14112 {0x01c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14114 /* Unmute Stereo Mixer 15 */
14115 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14116 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14117 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
14118 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb00c},
14120 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14121 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14122 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14123 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14124 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14125 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14126 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14127 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14129 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14130 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14131 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
14132 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
14133 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14134 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14135 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
14136 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
14138 {0x08, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* set Mic 1 */
14143 static struct hda_verb alc861_toshiba_init_verbs
[] = {
14144 {0x0f, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
14149 /* toggle speaker-output according to the hp-jack state */
14150 static void alc861_toshiba_automute(struct hda_codec
*codec
)
14152 unsigned int present
;
14154 present
= snd_hda_codec_read(codec
, 0x0f, 0,
14155 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
14156 snd_hda_codec_amp_stereo(codec
, 0x16, HDA_INPUT
, 0,
14157 HDA_AMP_MUTE
, present
? HDA_AMP_MUTE
: 0);
14158 snd_hda_codec_amp_stereo(codec
, 0x1a, HDA_INPUT
, 3,
14159 HDA_AMP_MUTE
, present
? 0 : HDA_AMP_MUTE
);
14162 static void alc861_toshiba_unsol_event(struct hda_codec
*codec
,
14165 if ((res
>> 26) == ALC880_HP_EVENT
)
14166 alc861_toshiba_automute(codec
);
14169 /* pcm configuration: identical with ALC880 */
14170 #define alc861_pcm_analog_playback alc880_pcm_analog_playback
14171 #define alc861_pcm_analog_capture alc880_pcm_analog_capture
14172 #define alc861_pcm_digital_playback alc880_pcm_digital_playback
14173 #define alc861_pcm_digital_capture alc880_pcm_digital_capture
14176 #define ALC861_DIGOUT_NID 0x07
14178 static struct hda_channel_mode alc861_8ch_modes
[1] = {
14182 static hda_nid_t alc861_dac_nids
[4] = {
14183 /* front, surround, clfe, side */
14184 0x03, 0x06, 0x05, 0x04
14187 static hda_nid_t alc660_dac_nids
[3] = {
14188 /* front, clfe, surround */
14192 static hda_nid_t alc861_adc_nids
[1] = {
14197 static struct hda_input_mux alc861_capture_source
= {
14201 { "Front Mic", 0x3 },
14208 static hda_nid_t
alc861_look_for_dac(struct hda_codec
*codec
, hda_nid_t pin
)
14210 struct alc_spec
*spec
= codec
->spec
;
14211 hda_nid_t mix
, srcs
[5];
14214 if (snd_hda_get_connections(codec
, pin
, &mix
, 1) != 1)
14216 num
= snd_hda_get_connections(codec
, mix
, srcs
, ARRAY_SIZE(srcs
));
14219 for (i
= 0; i
< num
; i
++) {
14221 type
= get_wcaps_type(get_wcaps(codec
, srcs
[i
]));
14222 if (type
!= AC_WID_AUD_OUT
)
14224 for (j
= 0; j
< spec
->multiout
.num_dacs
; j
++)
14225 if (spec
->multiout
.dac_nids
[j
] == srcs
[i
])
14227 if (j
>= spec
->multiout
.num_dacs
)
14233 /* fill in the dac_nids table from the parsed pin configuration */
14234 static int alc861_auto_fill_dac_nids(struct hda_codec
*codec
,
14235 const struct auto_pin_cfg
*cfg
)
14237 struct alc_spec
*spec
= codec
->spec
;
14239 hda_nid_t nid
, dac
;
14241 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
14242 for (i
= 0; i
< cfg
->line_outs
; i
++) {
14243 nid
= cfg
->line_out_pins
[i
];
14244 dac
= alc861_look_for_dac(codec
, nid
);
14247 spec
->multiout
.dac_nids
[spec
->multiout
.num_dacs
++] = dac
;
14252 static int alc861_create_out_sw(struct hda_codec
*codec
, const char *pfx
,
14253 hda_nid_t nid
, unsigned int chs
)
14256 snprintf(name
, sizeof(name
), "%s Playback Switch", pfx
);
14257 return add_control(codec
->spec
, ALC_CTL_WIDGET_MUTE
, name
,
14258 HDA_COMPOSE_AMP_VAL(nid
, chs
, 0, HDA_OUTPUT
));
14261 /* add playback controls from the parsed DAC table */
14262 static int alc861_auto_create_multi_out_ctls(struct hda_codec
*codec
,
14263 const struct auto_pin_cfg
*cfg
)
14265 struct alc_spec
*spec
= codec
->spec
;
14266 static const char *chname
[4] = {
14267 "Front", "Surround", NULL
/*CLFE*/, "Side"
14272 if (cfg
->line_outs
== 1) {
14273 const char *pfx
= NULL
;
14276 else if (cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
14279 nid
= spec
->multiout
.dac_nids
[0];
14280 return alc861_create_out_sw(codec
, pfx
, nid
, 3);
14284 for (i
= 0; i
< cfg
->line_outs
; i
++) {
14285 nid
= spec
->multiout
.dac_nids
[i
];
14290 err
= alc861_create_out_sw(codec
, "Center", nid
, 1);
14293 err
= alc861_create_out_sw(codec
, "LFE", nid
, 2);
14297 err
= alc861_create_out_sw(codec
, chname
[i
], nid
, 3);
14305 static int alc861_auto_create_hp_ctls(struct hda_codec
*codec
, hda_nid_t pin
)
14307 struct alc_spec
*spec
= codec
->spec
;
14314 if ((pin
>= 0x0b && pin
<= 0x10) || pin
== 0x1f || pin
== 0x20) {
14315 nid
= alc861_look_for_dac(codec
, pin
);
14317 err
= alc861_create_out_sw(codec
, "Headphone", nid
, 3);
14320 spec
->multiout
.hp_nid
= nid
;
14326 /* create playback/capture controls for input pins */
14327 static int alc861_auto_create_input_ctls(struct hda_codec
*codec
,
14328 const struct auto_pin_cfg
*cfg
)
14330 return alc_auto_create_input_ctls(codec
, cfg
, 0x15, 0x08, 0);
14333 static void alc861_auto_set_output_and_unmute(struct hda_codec
*codec
,
14335 int pin_type
, hda_nid_t dac
)
14337 hda_nid_t mix
, srcs
[5];
14340 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
14342 snd_hda_codec_write(codec
, dac
, 0, AC_VERB_SET_AMP_GAIN_MUTE
,
14344 if (snd_hda_get_connections(codec
, nid
, &mix
, 1) != 1)
14346 num
= snd_hda_get_connections(codec
, mix
, srcs
, ARRAY_SIZE(srcs
));
14349 for (i
= 0; i
< num
; i
++) {
14351 if (srcs
[i
] == dac
|| srcs
[i
] == 0x15)
14352 mute
= AMP_IN_UNMUTE(i
);
14354 mute
= AMP_IN_MUTE(i
);
14355 snd_hda_codec_write(codec
, mix
, 0, AC_VERB_SET_AMP_GAIN_MUTE
,
14360 static void alc861_auto_init_multi_out(struct hda_codec
*codec
)
14362 struct alc_spec
*spec
= codec
->spec
;
14365 for (i
= 0; i
< spec
->autocfg
.line_outs
; i
++) {
14366 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
14367 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
14369 alc861_auto_set_output_and_unmute(codec
, nid
, pin_type
,
14370 spec
->multiout
.dac_nids
[i
]);
14374 static void alc861_auto_init_hp_out(struct hda_codec
*codec
)
14376 struct alc_spec
*spec
= codec
->spec
;
14378 if (spec
->autocfg
.hp_outs
)
14379 alc861_auto_set_output_and_unmute(codec
,
14380 spec
->autocfg
.hp_pins
[0],
14382 spec
->multiout
.hp_nid
);
14383 if (spec
->autocfg
.speaker_outs
)
14384 alc861_auto_set_output_and_unmute(codec
,
14385 spec
->autocfg
.speaker_pins
[0],
14387 spec
->multiout
.dac_nids
[0]);
14390 static void alc861_auto_init_analog_input(struct hda_codec
*codec
)
14392 struct alc_spec
*spec
= codec
->spec
;
14395 for (i
= 0; i
< AUTO_PIN_LAST
; i
++) {
14396 hda_nid_t nid
= spec
->autocfg
.input_pins
[i
];
14397 if (nid
>= 0x0c && nid
<= 0x11)
14398 alc_set_input_pin(codec
, nid
, i
);
14402 /* parse the BIOS configuration and set up the alc_spec */
14403 /* return 1 if successful, 0 if the proper config is not found,
14404 * or a negative error code
14406 static int alc861_parse_auto_config(struct hda_codec
*codec
)
14408 struct alc_spec
*spec
= codec
->spec
;
14410 static hda_nid_t alc861_ignore
[] = { 0x1d, 0 };
14412 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
14416 if (!spec
->autocfg
.line_outs
)
14417 return 0; /* can't find valid BIOS pin config */
14419 err
= alc861_auto_fill_dac_nids(codec
, &spec
->autocfg
);
14422 err
= alc861_auto_create_multi_out_ctls(codec
, &spec
->autocfg
);
14425 err
= alc861_auto_create_hp_ctls(codec
, spec
->autocfg
.hp_pins
[0]);
14428 err
= alc861_auto_create_input_ctls(codec
, &spec
->autocfg
);
14432 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
14434 if (spec
->autocfg
.dig_outs
)
14435 spec
->multiout
.dig_out_nid
= ALC861_DIGOUT_NID
;
14437 if (spec
->kctls
.list
)
14438 add_mixer(spec
, spec
->kctls
.list
);
14440 add_verb(spec
, alc861_auto_init_verbs
);
14442 spec
->num_mux_defs
= 1;
14443 spec
->input_mux
= &spec
->private_imux
[0];
14445 spec
->adc_nids
= alc861_adc_nids
;
14446 spec
->num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
);
14447 set_capture_mixer(codec
);
14449 alc_ssid_check(codec
, 0x0e, 0x0f, 0x0b);
14454 /* additional initialization for auto-configuration model */
14455 static void alc861_auto_init(struct hda_codec
*codec
)
14457 struct alc_spec
*spec
= codec
->spec
;
14458 alc861_auto_init_multi_out(codec
);
14459 alc861_auto_init_hp_out(codec
);
14460 alc861_auto_init_analog_input(codec
);
14461 if (spec
->unsol_event
)
14462 alc_inithook(codec
);
14465 #ifdef CONFIG_SND_HDA_POWER_SAVE
14466 static struct hda_amp_list alc861_loopbacks
[] = {
14467 { 0x15, HDA_INPUT
, 0 },
14468 { 0x15, HDA_INPUT
, 1 },
14469 { 0x15, HDA_INPUT
, 2 },
14470 { 0x15, HDA_INPUT
, 3 },
14477 * configuration and preset
14479 static const char *alc861_models
[ALC861_MODEL_LAST
] = {
14480 [ALC861_3ST
] = "3stack",
14481 [ALC660_3ST
] = "3stack-660",
14482 [ALC861_3ST_DIG
] = "3stack-dig",
14483 [ALC861_6ST_DIG
] = "6stack-dig",
14484 [ALC861_UNIWILL_M31
] = "uniwill-m31",
14485 [ALC861_TOSHIBA
] = "toshiba",
14486 [ALC861_ASUS
] = "asus",
14487 [ALC861_ASUS_LAPTOP
] = "asus-laptop",
14488 [ALC861_AUTO
] = "auto",
14491 static struct snd_pci_quirk alc861_cfg_tbl
[] = {
14492 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC861_3ST
),
14493 SND_PCI_QUIRK(0x1043, 0x1335, "ASUS F2/3", ALC861_ASUS_LAPTOP
),
14494 SND_PCI_QUIRK(0x1043, 0x1338, "ASUS F2/3", ALC861_ASUS_LAPTOP
),
14495 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS", ALC861_ASUS
),
14496 SND_PCI_QUIRK(0x1043, 0x13d7, "ASUS A9rp", ALC861_ASUS_LAPTOP
),
14497 SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS P1-AH2", ALC861_3ST_DIG
),
14498 SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba", ALC861_TOSHIBA
),
14499 /* FIXME: the entry below breaks Toshiba A100 (model=auto works!)
14500 * Any other models that need this preset?
14502 /* SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba", ALC861_TOSHIBA), */
14503 SND_PCI_QUIRK(0x1462, 0x7254, "HP dx2200 (MSI MS-7254)", ALC861_3ST
),
14504 SND_PCI_QUIRK(0x1462, 0x7297, "HP dx2250 (MSI MS-7297)", ALC861_3ST
),
14505 SND_PCI_QUIRK(0x1584, 0x2b01, "Uniwill X40AIx", ALC861_UNIWILL_M31
),
14506 SND_PCI_QUIRK(0x1584, 0x9072, "Uniwill m31", ALC861_UNIWILL_M31
),
14507 SND_PCI_QUIRK(0x1584, 0x9075, "Airis Praxis N1212", ALC861_ASUS_LAPTOP
),
14508 /* FIXME: the below seems conflict */
14509 /* SND_PCI_QUIRK(0x1584, 0x9075, "Uniwill", ALC861_UNIWILL_M31), */
14510 SND_PCI_QUIRK(0x1849, 0x0660, "Asrock 939SLI32", ALC660_3ST
),
14511 SND_PCI_QUIRK(0x8086, 0xd600, "Intel", ALC861_3ST
),
14515 static struct alc_config_preset alc861_presets
[] = {
14517 .mixers
= { alc861_3ST_mixer
},
14518 .init_verbs
= { alc861_threestack_init_verbs
},
14519 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
14520 .dac_nids
= alc861_dac_nids
,
14521 .num_channel_mode
= ARRAY_SIZE(alc861_threestack_modes
),
14522 .channel_mode
= alc861_threestack_modes
,
14524 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14525 .adc_nids
= alc861_adc_nids
,
14526 .input_mux
= &alc861_capture_source
,
14528 [ALC861_3ST_DIG
] = {
14529 .mixers
= { alc861_base_mixer
},
14530 .init_verbs
= { alc861_threestack_init_verbs
},
14531 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
14532 .dac_nids
= alc861_dac_nids
,
14533 .dig_out_nid
= ALC861_DIGOUT_NID
,
14534 .num_channel_mode
= ARRAY_SIZE(alc861_threestack_modes
),
14535 .channel_mode
= alc861_threestack_modes
,
14537 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14538 .adc_nids
= alc861_adc_nids
,
14539 .input_mux
= &alc861_capture_source
,
14541 [ALC861_6ST_DIG
] = {
14542 .mixers
= { alc861_base_mixer
},
14543 .init_verbs
= { alc861_base_init_verbs
},
14544 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
14545 .dac_nids
= alc861_dac_nids
,
14546 .dig_out_nid
= ALC861_DIGOUT_NID
,
14547 .num_channel_mode
= ARRAY_SIZE(alc861_8ch_modes
),
14548 .channel_mode
= alc861_8ch_modes
,
14549 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14550 .adc_nids
= alc861_adc_nids
,
14551 .input_mux
= &alc861_capture_source
,
14554 .mixers
= { alc861_3ST_mixer
},
14555 .init_verbs
= { alc861_threestack_init_verbs
},
14556 .num_dacs
= ARRAY_SIZE(alc660_dac_nids
),
14557 .dac_nids
= alc660_dac_nids
,
14558 .num_channel_mode
= ARRAY_SIZE(alc861_threestack_modes
),
14559 .channel_mode
= alc861_threestack_modes
,
14561 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14562 .adc_nids
= alc861_adc_nids
,
14563 .input_mux
= &alc861_capture_source
,
14565 [ALC861_UNIWILL_M31
] = {
14566 .mixers
= { alc861_uniwill_m31_mixer
},
14567 .init_verbs
= { alc861_uniwill_m31_init_verbs
},
14568 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
14569 .dac_nids
= alc861_dac_nids
,
14570 .dig_out_nid
= ALC861_DIGOUT_NID
,
14571 .num_channel_mode
= ARRAY_SIZE(alc861_uniwill_m31_modes
),
14572 .channel_mode
= alc861_uniwill_m31_modes
,
14574 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14575 .adc_nids
= alc861_adc_nids
,
14576 .input_mux
= &alc861_capture_source
,
14578 [ALC861_TOSHIBA
] = {
14579 .mixers
= { alc861_toshiba_mixer
},
14580 .init_verbs
= { alc861_base_init_verbs
,
14581 alc861_toshiba_init_verbs
},
14582 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
14583 .dac_nids
= alc861_dac_nids
,
14584 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
14585 .channel_mode
= alc883_3ST_2ch_modes
,
14586 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14587 .adc_nids
= alc861_adc_nids
,
14588 .input_mux
= &alc861_capture_source
,
14589 .unsol_event
= alc861_toshiba_unsol_event
,
14590 .init_hook
= alc861_toshiba_automute
,
14593 .mixers
= { alc861_asus_mixer
},
14594 .init_verbs
= { alc861_asus_init_verbs
},
14595 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
14596 .dac_nids
= alc861_dac_nids
,
14597 .dig_out_nid
= ALC861_DIGOUT_NID
,
14598 .num_channel_mode
= ARRAY_SIZE(alc861_asus_modes
),
14599 .channel_mode
= alc861_asus_modes
,
14602 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14603 .adc_nids
= alc861_adc_nids
,
14604 .input_mux
= &alc861_capture_source
,
14606 [ALC861_ASUS_LAPTOP
] = {
14607 .mixers
= { alc861_toshiba_mixer
, alc861_asus_laptop_mixer
},
14608 .init_verbs
= { alc861_asus_init_verbs
,
14609 alc861_asus_laptop_init_verbs
},
14610 .num_dacs
= ARRAY_SIZE(alc861_dac_nids
),
14611 .dac_nids
= alc861_dac_nids
,
14612 .dig_out_nid
= ALC861_DIGOUT_NID
,
14613 .num_channel_mode
= ARRAY_SIZE(alc883_3ST_2ch_modes
),
14614 .channel_mode
= alc883_3ST_2ch_modes
,
14616 .num_adc_nids
= ARRAY_SIZE(alc861_adc_nids
),
14617 .adc_nids
= alc861_adc_nids
,
14618 .input_mux
= &alc861_capture_source
,
14623 static int patch_alc861(struct hda_codec
*codec
)
14625 struct alc_spec
*spec
;
14629 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
14633 codec
->spec
= spec
;
14635 board_config
= snd_hda_check_board_config(codec
, ALC861_MODEL_LAST
,
14639 if (board_config
< 0) {
14640 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
14642 board_config
= ALC861_AUTO
;
14645 if (board_config
== ALC861_AUTO
) {
14646 /* automatic parse from the BIOS config */
14647 err
= alc861_parse_auto_config(codec
);
14653 "hda_codec: Cannot set up configuration "
14654 "from BIOS. Using base mode...\n");
14655 board_config
= ALC861_3ST_DIG
;
14659 err
= snd_hda_attach_beep_device(codec
, 0x23);
14665 if (board_config
!= ALC861_AUTO
)
14666 setup_preset(codec
, &alc861_presets
[board_config
]);
14668 spec
->stream_analog_playback
= &alc861_pcm_analog_playback
;
14669 spec
->stream_analog_capture
= &alc861_pcm_analog_capture
;
14671 spec
->stream_digital_playback
= &alc861_pcm_digital_playback
;
14672 spec
->stream_digital_capture
= &alc861_pcm_digital_capture
;
14674 set_beep_amp(spec
, 0x23, 0, HDA_OUTPUT
);
14676 spec
->vmaster_nid
= 0x03;
14678 codec
->patch_ops
= alc_patch_ops
;
14679 if (board_config
== ALC861_AUTO
)
14680 spec
->init_hook
= alc861_auto_init
;
14681 #ifdef CONFIG_SND_HDA_POWER_SAVE
14682 if (!spec
->loopback
.amplist
)
14683 spec
->loopback
.amplist
= alc861_loopbacks
;
14685 codec
->proc_widget_hook
= print_realtek_coef
;
14691 * ALC861-VD support
14695 * In addition, an independent DAC
14697 #define ALC861VD_DIGOUT_NID 0x06
14699 static hda_nid_t alc861vd_dac_nids
[4] = {
14700 /* front, surr, clfe, side surr */
14701 0x02, 0x03, 0x04, 0x05
14704 /* dac_nids for ALC660vd are in a different order - according to
14705 * Realtek's driver.
14706 * This should probably result in a different mixer for 6stack models
14707 * of ALC660vd codecs, but for now there is only 3stack mixer
14708 * - and it is the same as in 861vd.
14709 * adc_nids in ALC660vd are (is) the same as in 861vd
14711 static hda_nid_t alc660vd_dac_nids
[3] = {
14712 /* front, rear, clfe, rear_surr */
14716 static hda_nid_t alc861vd_adc_nids
[1] = {
14721 static hda_nid_t alc861vd_capsrc_nids
[1] = { 0x22 };
14724 /* FIXME: should be a matrix-type input source selection */
14725 static struct hda_input_mux alc861vd_capture_source
= {
14729 { "Front Mic", 0x1 },
14735 static struct hda_input_mux alc861vd_dallas_capture_source
= {
14738 { "Ext Mic", 0x0 },
14739 { "Int Mic", 0x1 },
14743 static struct hda_input_mux alc861vd_hp_capture_source
= {
14746 { "Front Mic", 0x0 },
14747 { "ATAPI Mic", 0x1 },
14754 static struct hda_channel_mode alc861vd_3stack_2ch_modes
[1] = {
14761 static struct hda_verb alc861vd_6stack_ch6_init
[] = {
14762 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
14763 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14764 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14765 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14772 static struct hda_verb alc861vd_6stack_ch8_init
[] = {
14773 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14774 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14775 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14776 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14780 static struct hda_channel_mode alc861vd_6stack_modes
[2] = {
14781 { 6, alc861vd_6stack_ch6_init
},
14782 { 8, alc861vd_6stack_ch8_init
},
14785 static struct snd_kcontrol_new alc861vd_chmode_mixer
[] = {
14787 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
14788 .name
= "Channel Mode",
14789 .info
= alc_ch_mode_info
,
14790 .get
= alc_ch_mode_get
,
14791 .put
= alc_ch_mode_put
,
14796 /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
14797 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
14799 static struct snd_kcontrol_new alc861vd_6st_mixer
[] = {
14800 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
14801 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
14803 HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
14804 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT
),
14806 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0,
14808 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0,
14810 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT
),
14811 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT
),
14813 HDA_CODEC_VOLUME("Side Playback Volume", 0x05, 0x0, HDA_OUTPUT
),
14814 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT
),
14816 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
14818 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
14819 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
14820 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
14822 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
14823 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
14824 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
14826 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
14827 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
14829 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
14830 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
14835 static struct snd_kcontrol_new alc861vd_3st_mixer
[] = {
14836 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
14837 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
14839 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
14841 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
14842 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
14843 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
14845 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
14846 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
14847 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
14849 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
14850 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
14852 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
14853 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
14858 static struct snd_kcontrol_new alc861vd_lenovo_mixer
[] = {
14859 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
14860 /*HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),*/
14861 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
14863 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
14865 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT
),
14866 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
14867 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
14869 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT
),
14870 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
14871 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
14873 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
14874 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
14879 /* Pin assignment: Speaker=0x14, HP = 0x15,
14880 * Ext Mic=0x18, Int Mic = 0x19, CD = 0x1c, PC Beep = 0x1d
14882 static struct snd_kcontrol_new alc861vd_dallas_mixer
[] = {
14883 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
14884 HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 2, HDA_INPUT
),
14885 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
14886 HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT
),
14887 HDA_CODEC_VOLUME("Ext Mic Boost", 0x18, 0, HDA_INPUT
),
14888 HDA_CODEC_VOLUME("Ext Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
14889 HDA_CODEC_MUTE("Ext Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
14890 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
14891 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
14892 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
14896 /* Pin assignment: Speaker=0x14, Line-out = 0x15,
14897 * Front Mic=0x18, ATAPI Mic = 0x19,
14899 static struct snd_kcontrol_new alc861vd_hp_mixer
[] = {
14900 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
14901 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT
),
14902 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
14903 HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT
),
14904 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
14905 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
14906 HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
14907 HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
14913 * generic initialization of ADC, input mixers and output mixers
14915 static struct hda_verb alc861vd_volume_init_verbs
[] = {
14917 * Unmute ADC0 and set the default input to mic-in
14919 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
14920 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14922 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of
14923 * the analog-loopback mixer widget
14925 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
14926 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14927 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14928 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
14929 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
14930 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
14932 /* Capture mixer: unmute Mic, F-Mic, Line, CD inputs */
14933 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
14934 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
14935 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(2)},
14936 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(4)},
14939 * Set up output mixers (0x02 - 0x05)
14941 /* set vol=0 to output mixers */
14942 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
14943 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
14944 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
14945 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
14947 /* set up input amps for analog loopback */
14948 /* Amp Indices: DAC = 0, mixer = 1 */
14949 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14950 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14951 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14952 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14953 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14954 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14955 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
14956 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
14962 * 3-stack pin configuration:
14963 * front = 0x14, mic/clfe = 0x18, HP = 0x19, line/surr = 0x1a, f-mic = 0x1b
14965 static struct hda_verb alc861vd_3stack_init_verbs
[] = {
14967 * Set pin mode and muting
14969 /* set front pin widgets 0x14 for output */
14970 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
14971 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14972 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
14974 /* Mic (rear) pin: input vref at 80% */
14975 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
14976 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
14977 /* Front Mic pin: input vref at 80% */
14978 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
14979 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
14980 /* Line In pin: input */
14981 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14982 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
14983 /* Line-2 In: Headphone output (output 0 - 0x0c) */
14984 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
14985 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
14986 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
14987 /* CD pin widget for input */
14988 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
14994 * 6-stack pin configuration:
14996 static struct hda_verb alc861vd_6stack_init_verbs
[] = {
14998 * Set pin mode and muting
15000 /* set front pin widgets 0x14 for output */
15001 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15002 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15003 {0x14, AC_VERB_SET_CONNECT_SEL
, 0x00},
15005 /* Rear Pin: output 1 (0x0d) */
15006 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15007 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15008 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01},
15009 /* CLFE Pin: output 2 (0x0e) */
15010 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15011 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15012 {0x16, AC_VERB_SET_CONNECT_SEL
, 0x02},
15013 /* Side Pin: output 3 (0x0f) */
15014 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15015 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15016 {0x17, AC_VERB_SET_CONNECT_SEL
, 0x03},
15018 /* Mic (rear) pin: input vref at 80% */
15019 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
15020 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15021 /* Front Mic pin: input vref at 80% */
15022 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
15023 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15024 /* Line In pin: input */
15025 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
15026 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15027 /* Line-2 In: Headphone output (output 0 - 0x0c) */
15028 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
15029 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15030 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
15031 /* CD pin widget for input */
15032 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
15037 static struct hda_verb alc861vd_eapd_verbs
[] = {
15038 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
15042 static struct hda_verb alc660vd_eapd_verbs
[] = {
15043 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
15044 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
15048 static struct hda_verb alc861vd_lenovo_unsol_verbs
[] = {
15049 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15050 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15051 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(5)},
15052 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
15053 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
15057 static void alc861vd_lenovo_mic_automute(struct hda_codec
*codec
)
15059 unsigned int present
;
15060 unsigned char bits
;
15062 present
= snd_hda_codec_read(codec
, 0x18, 0,
15063 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
15064 bits
= present
? HDA_AMP_MUTE
: 0;
15065 snd_hda_codec_amp_stereo(codec
, 0x0b, HDA_INPUT
, 1,
15066 HDA_AMP_MUTE
, bits
);
15069 static void alc861vd_lenovo_setup(struct hda_codec
*codec
)
15071 struct alc_spec
*spec
= codec
->spec
;
15072 spec
->autocfg
.hp_pins
[0] = 0x1b;
15073 spec
->autocfg
.speaker_pins
[0] = 0x14;
15076 static void alc861vd_lenovo_init_hook(struct hda_codec
*codec
)
15078 alc_automute_amp(codec
);
15079 alc861vd_lenovo_mic_automute(codec
);
15082 static void alc861vd_lenovo_unsol_event(struct hda_codec
*codec
,
15085 switch (res
>> 26) {
15086 case ALC880_MIC_EVENT
:
15087 alc861vd_lenovo_mic_automute(codec
);
15090 alc_automute_amp_unsol_event(codec
, res
);
15095 static struct hda_verb alc861vd_dallas_verbs
[] = {
15096 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
15097 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
15098 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
15099 {0x05, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
15101 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15102 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
15103 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
15104 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
15105 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
15106 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
15107 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
15108 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
15110 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15111 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15112 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15113 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15114 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15115 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15116 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15117 {0x17, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15119 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
15120 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15121 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF50
},
15122 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15123 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
15124 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
15125 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
15126 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
15128 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
15129 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
15130 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
15131 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
15133 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
15134 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
15135 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
15140 /* toggle speaker-output according to the hp-jack state */
15141 static void alc861vd_dallas_setup(struct hda_codec
*codec
)
15143 struct alc_spec
*spec
= codec
->spec
;
15145 spec
->autocfg
.hp_pins
[0] = 0x15;
15146 spec
->autocfg
.speaker_pins
[0] = 0x14;
15149 #ifdef CONFIG_SND_HDA_POWER_SAVE
15150 #define alc861vd_loopbacks alc880_loopbacks
15153 /* pcm configuration: identical with ALC880 */
15154 #define alc861vd_pcm_analog_playback alc880_pcm_analog_playback
15155 #define alc861vd_pcm_analog_capture alc880_pcm_analog_capture
15156 #define alc861vd_pcm_digital_playback alc880_pcm_digital_playback
15157 #define alc861vd_pcm_digital_capture alc880_pcm_digital_capture
15160 * configuration and preset
15162 static const char *alc861vd_models
[ALC861VD_MODEL_LAST
] = {
15163 [ALC660VD_3ST
] = "3stack-660",
15164 [ALC660VD_3ST_DIG
] = "3stack-660-digout",
15165 [ALC660VD_ASUS_V1S
] = "asus-v1s",
15166 [ALC861VD_3ST
] = "3stack",
15167 [ALC861VD_3ST_DIG
] = "3stack-digout",
15168 [ALC861VD_6ST_DIG
] = "6stack-digout",
15169 [ALC861VD_LENOVO
] = "lenovo",
15170 [ALC861VD_DALLAS
] = "dallas",
15171 [ALC861VD_HP
] = "hp",
15172 [ALC861VD_AUTO
] = "auto",
15175 static struct snd_pci_quirk alc861vd_cfg_tbl
[] = {
15176 SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST
),
15177 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_HP
),
15178 SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST
),
15179 /*SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST),*/ /* auto */
15180 SND_PCI_QUIRK(0x1043, 0x1633, "Asus V1Sn", ALC660VD_ASUS_V1S
),
15181 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST_DIG
),
15182 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST
),
15183 SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO
),
15184 /*SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS),*/ /*lenovo*/
15185 SND_PCI_QUIRK(0x1179, 0xff01, "Toshiba A135", ALC861VD_LENOVO
),
15186 SND_PCI_QUIRK(0x1179, 0xff03, "Toshiba P205", ALC861VD_LENOVO
),
15187 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_DALLAS
),
15188 SND_PCI_QUIRK(0x1565, 0x820d, "Biostar NF61S SE", ALC861VD_6ST_DIG
),
15189 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", ALC861VD_LENOVO
),
15190 SND_PCI_QUIRK(0x1849, 0x0862, "ASRock K8NF6G-VSTA", ALC861VD_6ST_DIG
),
15194 static struct alc_config_preset alc861vd_presets
[] = {
15196 .mixers
= { alc861vd_3st_mixer
},
15197 .init_verbs
= { alc861vd_volume_init_verbs
,
15198 alc861vd_3stack_init_verbs
},
15199 .num_dacs
= ARRAY_SIZE(alc660vd_dac_nids
),
15200 .dac_nids
= alc660vd_dac_nids
,
15201 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15202 .channel_mode
= alc861vd_3stack_2ch_modes
,
15203 .input_mux
= &alc861vd_capture_source
,
15205 [ALC660VD_3ST_DIG
] = {
15206 .mixers
= { alc861vd_3st_mixer
},
15207 .init_verbs
= { alc861vd_volume_init_verbs
,
15208 alc861vd_3stack_init_verbs
},
15209 .num_dacs
= ARRAY_SIZE(alc660vd_dac_nids
),
15210 .dac_nids
= alc660vd_dac_nids
,
15211 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
15212 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15213 .channel_mode
= alc861vd_3stack_2ch_modes
,
15214 .input_mux
= &alc861vd_capture_source
,
15217 .mixers
= { alc861vd_3st_mixer
},
15218 .init_verbs
= { alc861vd_volume_init_verbs
,
15219 alc861vd_3stack_init_verbs
},
15220 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
15221 .dac_nids
= alc861vd_dac_nids
,
15222 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15223 .channel_mode
= alc861vd_3stack_2ch_modes
,
15224 .input_mux
= &alc861vd_capture_source
,
15226 [ALC861VD_3ST_DIG
] = {
15227 .mixers
= { alc861vd_3st_mixer
},
15228 .init_verbs
= { alc861vd_volume_init_verbs
,
15229 alc861vd_3stack_init_verbs
},
15230 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
15231 .dac_nids
= alc861vd_dac_nids
,
15232 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
15233 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15234 .channel_mode
= alc861vd_3stack_2ch_modes
,
15235 .input_mux
= &alc861vd_capture_source
,
15237 [ALC861VD_6ST_DIG
] = {
15238 .mixers
= { alc861vd_6st_mixer
, alc861vd_chmode_mixer
},
15239 .init_verbs
= { alc861vd_volume_init_verbs
,
15240 alc861vd_6stack_init_verbs
},
15241 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
15242 .dac_nids
= alc861vd_dac_nids
,
15243 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
15244 .num_channel_mode
= ARRAY_SIZE(alc861vd_6stack_modes
),
15245 .channel_mode
= alc861vd_6stack_modes
,
15246 .input_mux
= &alc861vd_capture_source
,
15248 [ALC861VD_LENOVO
] = {
15249 .mixers
= { alc861vd_lenovo_mixer
},
15250 .init_verbs
= { alc861vd_volume_init_verbs
,
15251 alc861vd_3stack_init_verbs
,
15252 alc861vd_eapd_verbs
,
15253 alc861vd_lenovo_unsol_verbs
},
15254 .num_dacs
= ARRAY_SIZE(alc660vd_dac_nids
),
15255 .dac_nids
= alc660vd_dac_nids
,
15256 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15257 .channel_mode
= alc861vd_3stack_2ch_modes
,
15258 .input_mux
= &alc861vd_capture_source
,
15259 .unsol_event
= alc861vd_lenovo_unsol_event
,
15260 .setup
= alc861vd_lenovo_setup
,
15261 .init_hook
= alc861vd_lenovo_init_hook
,
15263 [ALC861VD_DALLAS
] = {
15264 .mixers
= { alc861vd_dallas_mixer
},
15265 .init_verbs
= { alc861vd_dallas_verbs
},
15266 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
15267 .dac_nids
= alc861vd_dac_nids
,
15268 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15269 .channel_mode
= alc861vd_3stack_2ch_modes
,
15270 .input_mux
= &alc861vd_dallas_capture_source
,
15271 .unsol_event
= alc_automute_amp_unsol_event
,
15272 .setup
= alc861vd_dallas_setup
,
15273 .init_hook
= alc_automute_amp
,
15276 .mixers
= { alc861vd_hp_mixer
},
15277 .init_verbs
= { alc861vd_dallas_verbs
, alc861vd_eapd_verbs
},
15278 .num_dacs
= ARRAY_SIZE(alc861vd_dac_nids
),
15279 .dac_nids
= alc861vd_dac_nids
,
15280 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
15281 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15282 .channel_mode
= alc861vd_3stack_2ch_modes
,
15283 .input_mux
= &alc861vd_hp_capture_source
,
15284 .unsol_event
= alc_automute_amp_unsol_event
,
15285 .setup
= alc861vd_dallas_setup
,
15286 .init_hook
= alc_automute_amp
,
15288 [ALC660VD_ASUS_V1S
] = {
15289 .mixers
= { alc861vd_lenovo_mixer
},
15290 .init_verbs
= { alc861vd_volume_init_verbs
,
15291 alc861vd_3stack_init_verbs
,
15292 alc861vd_eapd_verbs
,
15293 alc861vd_lenovo_unsol_verbs
},
15294 .num_dacs
= ARRAY_SIZE(alc660vd_dac_nids
),
15295 .dac_nids
= alc660vd_dac_nids
,
15296 .dig_out_nid
= ALC861VD_DIGOUT_NID
,
15297 .num_channel_mode
= ARRAY_SIZE(alc861vd_3stack_2ch_modes
),
15298 .channel_mode
= alc861vd_3stack_2ch_modes
,
15299 .input_mux
= &alc861vd_capture_source
,
15300 .unsol_event
= alc861vd_lenovo_unsol_event
,
15301 .setup
= alc861vd_lenovo_setup
,
15302 .init_hook
= alc861vd_lenovo_init_hook
,
15307 * BIOS auto configuration
15309 static int alc861vd_auto_create_input_ctls(struct hda_codec
*codec
,
15310 const struct auto_pin_cfg
*cfg
)
15312 return alc_auto_create_input_ctls(codec
, cfg
, 0x15, 0x09, 0);
15316 static void alc861vd_auto_set_output_and_unmute(struct hda_codec
*codec
,
15317 hda_nid_t nid
, int pin_type
, int dac_idx
)
15319 alc_set_pin_output(codec
, nid
, pin_type
);
15322 static void alc861vd_auto_init_multi_out(struct hda_codec
*codec
)
15324 struct alc_spec
*spec
= codec
->spec
;
15327 for (i
= 0; i
<= HDA_SIDE
; i
++) {
15328 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
15329 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
15331 alc861vd_auto_set_output_and_unmute(codec
, nid
,
15337 static void alc861vd_auto_init_hp_out(struct hda_codec
*codec
)
15339 struct alc_spec
*spec
= codec
->spec
;
15342 pin
= spec
->autocfg
.hp_pins
[0];
15343 if (pin
) /* connect to front and use dac 0 */
15344 alc861vd_auto_set_output_and_unmute(codec
, pin
, PIN_HP
, 0);
15345 pin
= spec
->autocfg
.speaker_pins
[0];
15347 alc861vd_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
, 0);
15350 #define ALC861VD_PIN_CD_NID ALC880_PIN_CD_NID
15352 static void alc861vd_auto_init_analog_input(struct hda_codec
*codec
)
15354 struct alc_spec
*spec
= codec
->spec
;
15357 for (i
= 0; i
< AUTO_PIN_LAST
; i
++) {
15358 hda_nid_t nid
= spec
->autocfg
.input_pins
[i
];
15359 if (alc_is_input_pin(codec
, nid
)) {
15360 alc_set_input_pin(codec
, nid
, i
);
15361 if (nid
!= ALC861VD_PIN_CD_NID
&&
15362 (get_wcaps(codec
, nid
) & AC_WCAP_OUT_AMP
))
15363 snd_hda_codec_write(codec
, nid
, 0,
15364 AC_VERB_SET_AMP_GAIN_MUTE
,
15370 #define alc861vd_auto_init_input_src alc882_auto_init_input_src
15372 #define alc861vd_idx_to_mixer_vol(nid) ((nid) + 0x02)
15373 #define alc861vd_idx_to_mixer_switch(nid) ((nid) + 0x0c)
15375 /* add playback controls from the parsed DAC table */
15376 /* Based on ALC880 version. But ALC861VD has separate,
15377 * different NIDs for mute/unmute switch and volume control */
15378 static int alc861vd_auto_create_multi_out_ctls(struct alc_spec
*spec
,
15379 const struct auto_pin_cfg
*cfg
)
15382 static const char *chname
[4] = {"Front", "Surround", "CLFE", "Side"};
15383 hda_nid_t nid_v
, nid_s
;
15386 for (i
= 0; i
< cfg
->line_outs
; i
++) {
15387 if (!spec
->multiout
.dac_nids
[i
])
15389 nid_v
= alc861vd_idx_to_mixer_vol(
15391 spec
->multiout
.dac_nids
[i
]));
15392 nid_s
= alc861vd_idx_to_mixer_switch(
15394 spec
->multiout
.dac_nids
[i
]));
15398 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
,
15399 "Center Playback Volume",
15400 HDA_COMPOSE_AMP_VAL(nid_v
, 1, 0,
15404 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
,
15405 "LFE Playback Volume",
15406 HDA_COMPOSE_AMP_VAL(nid_v
, 2, 0,
15410 err
= add_control(spec
, ALC_CTL_BIND_MUTE
,
15411 "Center Playback Switch",
15412 HDA_COMPOSE_AMP_VAL(nid_s
, 1, 2,
15416 err
= add_control(spec
, ALC_CTL_BIND_MUTE
,
15417 "LFE Playback Switch",
15418 HDA_COMPOSE_AMP_VAL(nid_s
, 2, 2,
15424 if (cfg
->line_outs
== 1 &&
15425 cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
) {
15432 sprintf(name
, "%s Playback Volume", pfx
);
15433 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
, name
,
15434 HDA_COMPOSE_AMP_VAL(nid_v
, 3, 0,
15438 if (cfg
->line_outs
== 1 &&
15439 cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
15441 sprintf(name
, "%s Playback Switch", pfx
);
15442 err
= add_control(spec
, ALC_CTL_BIND_MUTE
, name
,
15443 HDA_COMPOSE_AMP_VAL(nid_s
, 3, 2,
15452 /* add playback controls for speaker and HP outputs */
15453 /* Based on ALC880 version. But ALC861VD has separate,
15454 * different NIDs for mute/unmute switch and volume control */
15455 static int alc861vd_auto_create_extra_out(struct alc_spec
*spec
,
15456 hda_nid_t pin
, const char *pfx
)
15458 hda_nid_t nid_v
, nid_s
;
15465 if (alc880_is_fixed_pin(pin
)) {
15466 nid_v
= alc880_idx_to_dac(alc880_fixed_pin_idx(pin
));
15467 /* specify the DAC as the extra output */
15468 if (!spec
->multiout
.hp_nid
)
15469 spec
->multiout
.hp_nid
= nid_v
;
15471 spec
->multiout
.extra_out_nid
[0] = nid_v
;
15472 /* control HP volume/switch on the output mixer amp */
15473 nid_v
= alc861vd_idx_to_mixer_vol(
15474 alc880_fixed_pin_idx(pin
));
15475 nid_s
= alc861vd_idx_to_mixer_switch(
15476 alc880_fixed_pin_idx(pin
));
15478 sprintf(name
, "%s Playback Volume", pfx
);
15479 err
= add_control(spec
, ALC_CTL_WIDGET_VOL
, name
,
15480 HDA_COMPOSE_AMP_VAL(nid_v
, 3, 0, HDA_OUTPUT
));
15483 sprintf(name
, "%s Playback Switch", pfx
);
15484 err
= add_control(spec
, ALC_CTL_BIND_MUTE
, name
,
15485 HDA_COMPOSE_AMP_VAL(nid_s
, 3, 2, HDA_INPUT
));
15488 } else if (alc880_is_multi_pin(pin
)) {
15489 /* set manual connection */
15490 /* we have only a switch on HP-out PIN */
15491 sprintf(name
, "%s Playback Switch", pfx
);
15492 err
= add_control(spec
, ALC_CTL_WIDGET_MUTE
, name
,
15493 HDA_COMPOSE_AMP_VAL(pin
, 3, 0, HDA_OUTPUT
));
15500 /* parse the BIOS configuration and set up the alc_spec
15501 * return 1 if successful, 0 if the proper config is not found,
15502 * or a negative error code
15503 * Based on ALC880 version - had to change it to override
15504 * alc880_auto_create_extra_out and alc880_auto_create_multi_out_ctls */
15505 static int alc861vd_parse_auto_config(struct hda_codec
*codec
)
15507 struct alc_spec
*spec
= codec
->spec
;
15509 static hda_nid_t alc861vd_ignore
[] = { 0x1d, 0 };
15511 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
15515 if (!spec
->autocfg
.line_outs
)
15516 return 0; /* can't find valid BIOS pin config */
15518 err
= alc880_auto_fill_dac_nids(spec
, &spec
->autocfg
);
15521 err
= alc861vd_auto_create_multi_out_ctls(spec
, &spec
->autocfg
);
15524 err
= alc861vd_auto_create_extra_out(spec
,
15525 spec
->autocfg
.speaker_pins
[0],
15529 err
= alc861vd_auto_create_extra_out(spec
,
15530 spec
->autocfg
.hp_pins
[0],
15534 err
= alc861vd_auto_create_input_ctls(codec
, &spec
->autocfg
);
15538 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
15540 if (spec
->autocfg
.dig_outs
)
15541 spec
->multiout
.dig_out_nid
= ALC861VD_DIGOUT_NID
;
15543 if (spec
->kctls
.list
)
15544 add_mixer(spec
, spec
->kctls
.list
);
15546 add_verb(spec
, alc861vd_volume_init_verbs
);
15548 spec
->num_mux_defs
= 1;
15549 spec
->input_mux
= &spec
->private_imux
[0];
15551 err
= alc_auto_add_mic_boost(codec
);
15555 alc_ssid_check(codec
, 0x15, 0x1b, 0x14);
15560 /* additional initialization for auto-configuration model */
15561 static void alc861vd_auto_init(struct hda_codec
*codec
)
15563 struct alc_spec
*spec
= codec
->spec
;
15564 alc861vd_auto_init_multi_out(codec
);
15565 alc861vd_auto_init_hp_out(codec
);
15566 alc861vd_auto_init_analog_input(codec
);
15567 alc861vd_auto_init_input_src(codec
);
15568 if (spec
->unsol_event
)
15569 alc_inithook(codec
);
15573 ALC660VD_FIX_ASUS_GPIO1
15577 static const struct hda_verb alc660vd_fix_asus_gpio1_verbs
[] = {
15578 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
15579 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
15580 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
15584 static const struct alc_fixup alc861vd_fixups
[] = {
15585 [ALC660VD_FIX_ASUS_GPIO1
] = {
15586 .verbs
= alc660vd_fix_asus_gpio1_verbs
,
15590 static struct snd_pci_quirk alc861vd_fixup_tbl
[] = {
15591 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1
),
15595 static int patch_alc861vd(struct hda_codec
*codec
)
15597 struct alc_spec
*spec
;
15598 int err
, board_config
;
15600 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
15604 codec
->spec
= spec
;
15606 board_config
= snd_hda_check_board_config(codec
, ALC861VD_MODEL_LAST
,
15610 if (board_config
< 0 || board_config
>= ALC861VD_MODEL_LAST
) {
15611 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
15613 board_config
= ALC861VD_AUTO
;
15616 alc_pick_fixup(codec
, alc861vd_fixup_tbl
, alc861vd_fixups
);
15618 if (board_config
== ALC861VD_AUTO
) {
15619 /* automatic parse from the BIOS config */
15620 err
= alc861vd_parse_auto_config(codec
);
15626 "hda_codec: Cannot set up configuration "
15627 "from BIOS. Using base mode...\n");
15628 board_config
= ALC861VD_3ST
;
15632 err
= snd_hda_attach_beep_device(codec
, 0x23);
15638 if (board_config
!= ALC861VD_AUTO
)
15639 setup_preset(codec
, &alc861vd_presets
[board_config
]);
15641 if (codec
->vendor_id
== 0x10ec0660) {
15642 /* always turn on EAPD */
15643 add_verb(spec
, alc660vd_eapd_verbs
);
15646 spec
->stream_analog_playback
= &alc861vd_pcm_analog_playback
;
15647 spec
->stream_analog_capture
= &alc861vd_pcm_analog_capture
;
15649 spec
->stream_digital_playback
= &alc861vd_pcm_digital_playback
;
15650 spec
->stream_digital_capture
= &alc861vd_pcm_digital_capture
;
15652 if (!spec
->adc_nids
) {
15653 spec
->adc_nids
= alc861vd_adc_nids
;
15654 spec
->num_adc_nids
= ARRAY_SIZE(alc861vd_adc_nids
);
15656 if (!spec
->capsrc_nids
)
15657 spec
->capsrc_nids
= alc861vd_capsrc_nids
;
15659 set_capture_mixer(codec
);
15660 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
15662 spec
->vmaster_nid
= 0x02;
15664 codec
->patch_ops
= alc_patch_ops
;
15666 if (board_config
== ALC861VD_AUTO
)
15667 spec
->init_hook
= alc861vd_auto_init
;
15668 #ifdef CONFIG_SND_HDA_POWER_SAVE
15669 if (!spec
->loopback
.amplist
)
15670 spec
->loopback
.amplist
= alc861vd_loopbacks
;
15672 codec
->proc_widget_hook
= print_realtek_coef
;
15680 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
15681 * configuration. Each pin widget can choose any input DACs and a mixer.
15682 * Each ADC is connected from a mixer of all inputs. This makes possible
15683 * 6-channel independent captures.
15685 * In addition, an independent DAC for the multi-playback (not used in this
15688 #define ALC662_DIGOUT_NID 0x06
15689 #define ALC662_DIGIN_NID 0x0a
15691 static hda_nid_t alc662_dac_nids
[4] = {
15692 /* front, rear, clfe, rear_surr */
15696 static hda_nid_t alc272_dac_nids
[2] = {
15700 static hda_nid_t alc662_adc_nids
[2] = {
15705 static hda_nid_t alc272_adc_nids
[1] = {
15710 static hda_nid_t alc662_capsrc_nids
[2] = { 0x22, 0x23 };
15711 static hda_nid_t alc272_capsrc_nids
[1] = { 0x23 };
15715 /* FIXME: should be a matrix-type input source selection */
15716 static struct hda_input_mux alc662_capture_source
= {
15720 { "Front Mic", 0x1 },
15726 static struct hda_input_mux alc662_lenovo_101e_capture_source
= {
15734 static struct hda_input_mux alc663_capture_source
= {
15738 { "Front Mic", 0x1 },
15743 #if 0 /* set to 1 for testing other input sources below */
15744 static struct hda_input_mux alc272_nc10_capture_source
= {
15747 { "Autoselect Mic", 0x0 },
15748 { "Internal Mic", 0x1 },
15749 { "In-0x02", 0x2 },
15750 { "In-0x03", 0x3 },
15751 { "In-0x04", 0x4 },
15752 { "In-0x05", 0x5 },
15753 { "In-0x06", 0x6 },
15754 { "In-0x07", 0x7 },
15755 { "In-0x08", 0x8 },
15756 { "In-0x09", 0x9 },
15757 { "In-0x0a", 0x0a },
15758 { "In-0x0b", 0x0b },
15759 { "In-0x0c", 0x0c },
15760 { "In-0x0d", 0x0d },
15761 { "In-0x0e", 0x0e },
15762 { "In-0x0f", 0x0f },
15770 static struct hda_channel_mode alc662_3ST_2ch_modes
[1] = {
15777 static struct hda_verb alc662_3ST_ch2_init
[] = {
15778 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
15779 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15780 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
15781 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
15788 static struct hda_verb alc662_3ST_ch6_init
[] = {
15789 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15790 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15791 { 0x18, AC_VERB_SET_CONNECT_SEL
, 0x02 },
15792 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15793 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
15794 { 0x1a, AC_VERB_SET_CONNECT_SEL
, 0x01 },
15798 static struct hda_channel_mode alc662_3ST_6ch_modes
[2] = {
15799 { 2, alc662_3ST_ch2_init
},
15800 { 6, alc662_3ST_ch6_init
},
15806 static struct hda_verb alc662_sixstack_ch6_init
[] = {
15807 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
15808 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x00 },
15809 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15816 static struct hda_verb alc662_sixstack_ch8_init
[] = {
15817 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15818 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15819 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
15823 static struct hda_channel_mode alc662_5stack_modes
[2] = {
15824 { 2, alc662_sixstack_ch6_init
},
15825 { 6, alc662_sixstack_ch8_init
},
15828 /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
15829 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
15832 static struct snd_kcontrol_new alc662_base_mixer
[] = {
15833 /* output mixer control */
15834 HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT
),
15835 HDA_CODEC_MUTE("Front Playback Switch", 0x0c, 0x0, HDA_INPUT
),
15836 HDA_CODEC_VOLUME("Surround Playback Volume", 0x3, 0x0, HDA_OUTPUT
),
15837 HDA_CODEC_MUTE("Surround Playback Switch", 0x0d, 0x0, HDA_INPUT
),
15838 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0, HDA_OUTPUT
),
15839 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0, HDA_OUTPUT
),
15840 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x0, HDA_INPUT
),
15841 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x0, HDA_INPUT
),
15842 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
15844 /*Input mixer control */
15845 HDA_CODEC_VOLUME("CD Playback Volume", 0xb, 0x4, HDA_INPUT
),
15846 HDA_CODEC_MUTE("CD Playback Switch", 0xb, 0x4, HDA_INPUT
),
15847 HDA_CODEC_VOLUME("Line Playback Volume", 0xb, 0x02, HDA_INPUT
),
15848 HDA_CODEC_MUTE("Line Playback Switch", 0xb, 0x02, HDA_INPUT
),
15849 HDA_CODEC_VOLUME("Mic Playback Volume", 0xb, 0x0, HDA_INPUT
),
15850 HDA_CODEC_MUTE("Mic Playback Switch", 0xb, 0x0, HDA_INPUT
),
15851 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0xb, 0x01, HDA_INPUT
),
15852 HDA_CODEC_MUTE("Front Mic Playback Switch", 0xb, 0x01, HDA_INPUT
),
15856 static struct snd_kcontrol_new alc662_3ST_2ch_mixer
[] = {
15857 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
15858 HDA_CODEC_MUTE("Front Playback Switch", 0x0c, 0x0, HDA_INPUT
),
15859 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
15860 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
15861 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
15862 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
15863 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
15864 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
15865 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
15866 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
15867 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
15871 static struct snd_kcontrol_new alc662_3ST_6ch_mixer
[] = {
15872 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
15873 HDA_CODEC_MUTE("Front Playback Switch", 0x0c, 0x0, HDA_INPUT
),
15874 HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
15875 HDA_CODEC_MUTE("Surround Playback Switch", 0x0d, 0x0, HDA_INPUT
),
15876 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0, HDA_OUTPUT
),
15877 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0, HDA_OUTPUT
),
15878 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x0, HDA_INPUT
),
15879 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x0, HDA_INPUT
),
15880 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
15881 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT
),
15882 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT
),
15883 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
15884 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
15885 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
15886 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
15887 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
15888 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
15892 static struct snd_kcontrol_new alc662_lenovo_101e_mixer
[] = {
15893 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
15894 HDA_BIND_MUTE("Front Playback Switch", 0x02, 2, HDA_INPUT
),
15895 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
15896 HDA_BIND_MUTE("Speaker Playback Switch", 0x03, 2, HDA_INPUT
),
15897 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
15898 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
15899 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
15900 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
15901 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
15905 static struct snd_kcontrol_new alc662_eeepc_p701_mixer
[] = {
15906 HDA_CODEC_VOLUME("Master Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
15907 ALC262_HIPPO_MASTER_SWITCH
,
15909 HDA_CODEC_VOLUME("e-Mic Boost", 0x18, 0, HDA_INPUT
),
15910 HDA_CODEC_VOLUME("e-Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
15911 HDA_CODEC_MUTE("e-Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
15913 HDA_CODEC_VOLUME("i-Mic Boost", 0x19, 0, HDA_INPUT
),
15914 HDA_CODEC_VOLUME("i-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
15915 HDA_CODEC_MUTE("i-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
15919 static struct snd_kcontrol_new alc662_eeepc_ep20_mixer
[] = {
15920 ALC262_HIPPO_MASTER_SWITCH
,
15921 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
15922 HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
15923 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0, HDA_OUTPUT
),
15924 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0, HDA_OUTPUT
),
15925 HDA_BIND_MUTE("MuteCtrl Playback Switch", 0x0c, 2, HDA_INPUT
),
15926 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
15927 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
15928 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
15929 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
15933 static struct hda_bind_ctls alc663_asus_bind_master_vol
= {
15934 .ops
= &snd_hda_bind_vol
,
15936 HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT
),
15937 HDA_COMPOSE_AMP_VAL(0x03, 3, 0, HDA_OUTPUT
),
15942 static struct hda_bind_ctls alc663_asus_one_bind_switch
= {
15943 .ops
= &snd_hda_bind_sw
,
15945 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
15946 HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT
),
15951 static struct snd_kcontrol_new alc663_m51va_mixer
[] = {
15952 HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol
),
15953 HDA_BIND_SW("Master Playback Switch", &alc663_asus_one_bind_switch
),
15954 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
15955 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
15959 static struct hda_bind_ctls alc663_asus_tree_bind_switch
= {
15960 .ops
= &snd_hda_bind_sw
,
15962 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
15963 HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT
),
15964 HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT
),
15969 static struct snd_kcontrol_new alc663_two_hp_m1_mixer
[] = {
15970 HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol
),
15971 HDA_BIND_SW("Master Playback Switch", &alc663_asus_tree_bind_switch
),
15972 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
15973 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
15974 HDA_CODEC_VOLUME("F-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
15975 HDA_CODEC_MUTE("F-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
15980 static struct hda_bind_ctls alc663_asus_four_bind_switch
= {
15981 .ops
= &snd_hda_bind_sw
,
15983 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
15984 HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT
),
15985 HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_OUTPUT
),
15990 static struct snd_kcontrol_new alc663_two_hp_m2_mixer
[] = {
15991 HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol
),
15992 HDA_BIND_SW("Master Playback Switch", &alc663_asus_four_bind_switch
),
15993 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
15994 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
15995 HDA_CODEC_VOLUME("F-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
15996 HDA_CODEC_MUTE("F-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16000 static struct snd_kcontrol_new alc662_1bjd_mixer
[] = {
16001 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
16002 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
16003 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT
),
16004 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16005 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16006 HDA_CODEC_VOLUME("F-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
16007 HDA_CODEC_MUTE("F-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16011 static struct hda_bind_ctls alc663_asus_two_bind_master_vol
= {
16012 .ops
= &snd_hda_bind_vol
,
16014 HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT
),
16015 HDA_COMPOSE_AMP_VAL(0x04, 3, 0, HDA_OUTPUT
),
16020 static struct hda_bind_ctls alc663_asus_two_bind_switch
= {
16021 .ops
= &snd_hda_bind_sw
,
16023 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT
),
16024 HDA_COMPOSE_AMP_VAL(0x16, 3, 0, HDA_OUTPUT
),
16029 static struct snd_kcontrol_new alc663_asus_21jd_clfe_mixer
[] = {
16030 HDA_BIND_VOL("Master Playback Volume",
16031 &alc663_asus_two_bind_master_vol
),
16032 HDA_BIND_SW("Master Playback Switch", &alc663_asus_two_bind_switch
),
16033 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
16034 HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT
),
16035 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16036 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16040 static struct snd_kcontrol_new alc663_asus_15jd_clfe_mixer
[] = {
16041 HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol
),
16042 HDA_BIND_SW("Master Playback Switch", &alc663_asus_two_bind_switch
),
16043 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
16044 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
16045 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16046 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16050 static struct snd_kcontrol_new alc663_g71v_mixer
[] = {
16051 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
16052 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
16053 HDA_CODEC_VOLUME("Front Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
16054 HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT
),
16055 HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT
),
16057 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16058 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16059 HDA_CODEC_VOLUME("i-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
16060 HDA_CODEC_MUTE("i-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16064 static struct snd_kcontrol_new alc663_g50v_mixer
[] = {
16065 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
16066 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
16067 HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT
),
16069 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16070 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16071 HDA_CODEC_VOLUME("i-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
16072 HDA_CODEC_MUTE("i-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16073 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT
),
16074 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT
),
16078 static struct snd_kcontrol_new alc662_chmode_mixer
[] = {
16080 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
16081 .name
= "Channel Mode",
16082 .info
= alc_ch_mode_info
,
16083 .get
= alc_ch_mode_get
,
16084 .put
= alc_ch_mode_put
,
16089 static struct hda_verb alc662_init_verbs
[] = {
16090 /* ADC: mute amp left and right */
16091 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16092 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
16093 /* Front mixer: unmute input/output amp left and right (volume = 0) */
16095 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16096 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
16097 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
16098 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
16099 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
16101 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16102 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16103 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16104 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16105 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16106 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16108 /* Front Pin: output 0 (0x0c) */
16109 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16110 {0x14, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16112 /* Rear Pin: output 1 (0x0d) */
16113 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16114 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16116 /* CLFE Pin: output 2 (0x0e) */
16117 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16118 {0x16, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16120 /* Mic (rear) pin: input vref at 80% */
16121 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
16122 {0x18, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
16123 /* Front Mic pin: input vref at 80% */
16124 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_VREF80
},
16125 {0x19, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
16126 /* Line In pin: input */
16127 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16128 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
},
16129 /* Line-2 In: Headphone output (output 0 - 0x0c) */
16130 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16131 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16132 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00},
16133 /* CD pin widget for input */
16134 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16136 /* FIXME: use matrix-type input source selection */
16137 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
16139 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16140 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16142 /* always trun on EAPD */
16143 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 2},
16144 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 2},
16149 static struct hda_verb alc662_sue_init_verbs
[] = {
16150 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_FRONT_EVENT
},
16151 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_HP_EVENT
},
16155 static struct hda_verb alc662_eeepc_sue_init_verbs
[] = {
16156 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16157 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16161 /* Set Unsolicited Event*/
16162 static struct hda_verb alc662_eeepc_ep20_sue_init_verbs
[] = {
16163 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
},
16164 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16169 * generic initialization of ADC, input mixers and output mixers
16171 static struct hda_verb alc662_auto_init_verbs
[] = {
16173 * Unmute ADC and set the default input to mic-in
16175 {0x09, AC_VERB_SET_CONNECT_SEL
, 0x00},
16176 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16178 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
16180 * Note: PASD motherboards uses the Line In 2 as the input for front
16181 * panel mic (mic 2)
16183 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
16184 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16185 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
16186 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(2)},
16187 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(3)},
16188 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(4)},
16191 * Set up output mixers (0x0c - 0x0f)
16193 /* set vol=0 to output mixers */
16194 {0x02, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
16195 {0x03, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
16196 {0x04, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_ZERO
},
16198 /* set up input amps for analog loopback */
16199 /* Amp Indices: DAC = 0, mixer = 1 */
16200 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16201 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16202 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16203 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16204 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16205 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16208 /* FIXME: use matrix-type input source selection */
16209 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
16211 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16212 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16216 /* additional verbs for ALC663 */
16217 static struct hda_verb alc663_auto_init_verbs
[] = {
16218 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
16219 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16223 static struct hda_verb alc663_m51va_init_verbs
[] = {
16224 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16225 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16226 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16227 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16228 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
16229 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16230 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(9)},
16231 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16232 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16236 static struct hda_verb alc663_21jd_amic_init_verbs
[] = {
16237 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16238 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16239 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
16240 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16241 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16242 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16243 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16247 static struct hda_verb alc662_1bjd_amic_init_verbs
[] = {
16248 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16249 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16250 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16251 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Headphone */
16252 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16253 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16254 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16255 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16259 static struct hda_verb alc663_15jd_amic_init_verbs
[] = {
16260 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16261 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16262 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
16263 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16264 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16265 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16266 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16270 static struct hda_verb alc663_two_hp_amic_m1_init_verbs
[] = {
16271 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16272 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16273 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16274 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x0}, /* Headphone */
16275 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16276 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16277 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x0}, /* Headphone */
16278 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16279 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16280 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16281 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16282 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16286 static struct hda_verb alc663_two_hp_amic_m2_init_verbs
[] = {
16287 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16288 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16289 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16290 {0x1b, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
16291 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16292 {0x15, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16293 {0x15, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
16294 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16295 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(1)},
16296 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16297 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16298 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16302 static struct hda_verb alc663_g71v_init_verbs
[] = {
16303 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16304 /* {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, */
16305 /* {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, */ /* Headphone */
16307 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16308 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16309 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Headphone */
16311 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_FRONT_EVENT
},
16312 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_MIC_EVENT
},
16313 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
|ALC880_HP_EVENT
},
16317 static struct hda_verb alc663_g50v_init_verbs
[] = {
16318 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16319 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16320 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x00}, /* Headphone */
16322 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16323 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16327 static struct hda_verb alc662_ecs_init_verbs
[] = {
16328 {0x09, AC_VERB_SET_AMP_GAIN_MUTE
, 0x701f},
16329 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16330 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16331 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16335 static struct hda_verb alc272_dell_zm1_init_verbs
[] = {
16336 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16337 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16338 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16339 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16340 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16341 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16342 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
16343 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16344 {0x22, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(9)},
16345 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16346 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16350 static struct hda_verb alc272_dell_init_verbs
[] = {
16351 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16352 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16353 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16354 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_IN
},
16355 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
},
16356 {0x21, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
},
16357 {0x21, AC_VERB_SET_CONNECT_SEL
, 0x01}, /* Headphone */
16358 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(0)},
16359 {0x23, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(9)},
16360 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_MIC_EVENT
},
16361 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE
, AC_USRSP_EN
| ALC880_HP_EVENT
},
16365 static struct snd_kcontrol_new alc662_auto_capture_mixer
[] = {
16366 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT
),
16367 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT
),
16371 static struct snd_kcontrol_new alc272_auto_capture_mixer
[] = {
16372 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT
),
16373 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT
),
16377 static void alc662_lenovo_101e_ispeaker_automute(struct hda_codec
*codec
)
16379 unsigned int present
;
16380 unsigned char bits
;
16382 present
= snd_hda_codec_read(codec
, 0x14, 0,
16383 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
16384 bits
= present
? HDA_AMP_MUTE
: 0;
16385 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
16386 HDA_AMP_MUTE
, bits
);
16389 static void alc662_lenovo_101e_all_automute(struct hda_codec
*codec
)
16391 unsigned int present
;
16392 unsigned char bits
;
16394 present
= snd_hda_codec_read(codec
, 0x1b, 0,
16395 AC_VERB_GET_PIN_SENSE
, 0) & 0x80000000;
16396 bits
= present
? HDA_AMP_MUTE
: 0;
16397 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
16398 HDA_AMP_MUTE
, bits
);
16399 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
16400 HDA_AMP_MUTE
, bits
);
16403 static void alc662_lenovo_101e_unsol_event(struct hda_codec
*codec
,
16406 if ((res
>> 26) == ALC880_HP_EVENT
)
16407 alc662_lenovo_101e_all_automute(codec
);
16408 if ((res
>> 26) == ALC880_FRONT_EVENT
)
16409 alc662_lenovo_101e_ispeaker_automute(codec
);
16412 /* unsolicited event for HP jack sensing */
16413 static void alc662_eeepc_unsol_event(struct hda_codec
*codec
,
16416 if ((res
>> 26) == ALC880_MIC_EVENT
)
16417 alc_mic_automute(codec
);
16419 alc262_hippo_unsol_event(codec
, res
);
16422 static void alc662_eeepc_setup(struct hda_codec
*codec
)
16424 struct alc_spec
*spec
= codec
->spec
;
16426 alc262_hippo1_setup(codec
);
16427 spec
->ext_mic
.pin
= 0x18;
16428 spec
->ext_mic
.mux_idx
= 0;
16429 spec
->int_mic
.pin
= 0x19;
16430 spec
->int_mic
.mux_idx
= 1;
16431 spec
->auto_mic
= 1;
16434 static void alc662_eeepc_inithook(struct hda_codec
*codec
)
16436 alc262_hippo_automute(codec
);
16437 alc_mic_automute(codec
);
16440 static void alc662_eeepc_ep20_setup(struct hda_codec
*codec
)
16442 struct alc_spec
*spec
= codec
->spec
;
16444 spec
->autocfg
.hp_pins
[0] = 0x14;
16445 spec
->autocfg
.speaker_pins
[0] = 0x1b;
16448 #define alc662_eeepc_ep20_inithook alc262_hippo_master_update
16450 static void alc663_m51va_speaker_automute(struct hda_codec
*codec
)
16452 unsigned int present
;
16453 unsigned char bits
;
16455 present
= snd_hda_codec_read(codec
, 0x21, 0,
16456 AC_VERB_GET_PIN_SENSE
, 0)
16457 & AC_PINSENSE_PRESENCE
;
16458 bits
= present
? HDA_AMP_MUTE
: 0;
16459 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
16460 AMP_IN_MUTE(0), bits
);
16461 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
16462 AMP_IN_MUTE(0), bits
);
16465 static void alc663_21jd_two_speaker_automute(struct hda_codec
*codec
)
16467 unsigned int present
;
16468 unsigned char bits
;
16470 present
= snd_hda_codec_read(codec
, 0x21, 0,
16471 AC_VERB_GET_PIN_SENSE
, 0)
16472 & AC_PINSENSE_PRESENCE
;
16473 bits
= present
? HDA_AMP_MUTE
: 0;
16474 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
16475 AMP_IN_MUTE(0), bits
);
16476 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
16477 AMP_IN_MUTE(0), bits
);
16478 snd_hda_codec_amp_stereo(codec
, 0x0e, HDA_INPUT
, 0,
16479 AMP_IN_MUTE(0), bits
);
16480 snd_hda_codec_amp_stereo(codec
, 0x0e, HDA_INPUT
, 1,
16481 AMP_IN_MUTE(0), bits
);
16484 static void alc663_15jd_two_speaker_automute(struct hda_codec
*codec
)
16486 unsigned int present
;
16487 unsigned char bits
;
16489 present
= snd_hda_codec_read(codec
, 0x15, 0,
16490 AC_VERB_GET_PIN_SENSE
, 0)
16491 & AC_PINSENSE_PRESENCE
;
16492 bits
= present
? HDA_AMP_MUTE
: 0;
16493 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
16494 AMP_IN_MUTE(0), bits
);
16495 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
16496 AMP_IN_MUTE(0), bits
);
16497 snd_hda_codec_amp_stereo(codec
, 0x0e, HDA_INPUT
, 0,
16498 AMP_IN_MUTE(0), bits
);
16499 snd_hda_codec_amp_stereo(codec
, 0x0e, HDA_INPUT
, 1,
16500 AMP_IN_MUTE(0), bits
);
16503 static void alc662_f5z_speaker_automute(struct hda_codec
*codec
)
16505 unsigned int present
;
16506 unsigned char bits
;
16508 present
= snd_hda_codec_read(codec
, 0x1b, 0,
16509 AC_VERB_GET_PIN_SENSE
, 0)
16510 & AC_PINSENSE_PRESENCE
;
16511 bits
= present
? 0 : PIN_OUT
;
16512 snd_hda_codec_write(codec
, 0x14, 0,
16513 AC_VERB_SET_PIN_WIDGET_CONTROL
, bits
);
16516 static void alc663_two_hp_m1_speaker_automute(struct hda_codec
*codec
)
16518 unsigned int present1
, present2
;
16520 present1
= snd_hda_codec_read(codec
, 0x21, 0,
16521 AC_VERB_GET_PIN_SENSE
, 0)
16522 & AC_PINSENSE_PRESENCE
;
16523 present2
= snd_hda_codec_read(codec
, 0x15, 0,
16524 AC_VERB_GET_PIN_SENSE
, 0)
16525 & AC_PINSENSE_PRESENCE
;
16527 if (present1
|| present2
) {
16528 snd_hda_codec_write_cache(codec
, 0x14, 0,
16529 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0);
16531 snd_hda_codec_write_cache(codec
, 0x14, 0,
16532 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
16536 static void alc663_two_hp_m2_speaker_automute(struct hda_codec
*codec
)
16538 unsigned int present1
, present2
;
16540 present1
= snd_hda_codec_read(codec
, 0x1b, 0,
16541 AC_VERB_GET_PIN_SENSE
, 0)
16542 & AC_PINSENSE_PRESENCE
;
16543 present2
= snd_hda_codec_read(codec
, 0x15, 0,
16544 AC_VERB_GET_PIN_SENSE
, 0)
16545 & AC_PINSENSE_PRESENCE
;
16547 if (present1
|| present2
) {
16548 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
16549 AMP_IN_MUTE(0), AMP_IN_MUTE(0));
16550 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
16551 AMP_IN_MUTE(0), AMP_IN_MUTE(0));
16553 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 0,
16554 AMP_IN_MUTE(0), 0);
16555 snd_hda_codec_amp_stereo(codec
, 0x0c, HDA_INPUT
, 1,
16556 AMP_IN_MUTE(0), 0);
16560 static void alc663_m51va_unsol_event(struct hda_codec
*codec
,
16563 switch (res
>> 26) {
16564 case ALC880_HP_EVENT
:
16565 alc663_m51va_speaker_automute(codec
);
16567 case ALC880_MIC_EVENT
:
16568 alc_mic_automute(codec
);
16573 static void alc663_m51va_setup(struct hda_codec
*codec
)
16575 struct alc_spec
*spec
= codec
->spec
;
16576 spec
->ext_mic
.pin
= 0x18;
16577 spec
->ext_mic
.mux_idx
= 0;
16578 spec
->int_mic
.pin
= 0x12;
16579 spec
->int_mic
.mux_idx
= 1;
16580 spec
->auto_mic
= 1;
16583 static void alc663_m51va_inithook(struct hda_codec
*codec
)
16585 alc663_m51va_speaker_automute(codec
);
16586 alc_mic_automute(codec
);
16589 /* ***************** Mode1 ******************************/
16590 #define alc663_mode1_unsol_event alc663_m51va_unsol_event
16591 #define alc663_mode1_setup alc663_m51va_setup
16592 #define alc663_mode1_inithook alc663_m51va_inithook
16594 /* ***************** Mode2 ******************************/
16595 static void alc662_mode2_unsol_event(struct hda_codec
*codec
,
16598 switch (res
>> 26) {
16599 case ALC880_HP_EVENT
:
16600 alc662_f5z_speaker_automute(codec
);
16602 case ALC880_MIC_EVENT
:
16603 alc_mic_automute(codec
);
16608 #define alc662_mode2_setup alc663_m51va_setup
16610 static void alc662_mode2_inithook(struct hda_codec
*codec
)
16612 alc662_f5z_speaker_automute(codec
);
16613 alc_mic_automute(codec
);
16615 /* ***************** Mode3 ******************************/
16616 static void alc663_mode3_unsol_event(struct hda_codec
*codec
,
16619 switch (res
>> 26) {
16620 case ALC880_HP_EVENT
:
16621 alc663_two_hp_m1_speaker_automute(codec
);
16623 case ALC880_MIC_EVENT
:
16624 alc_mic_automute(codec
);
16629 #define alc663_mode3_setup alc663_m51va_setup
16631 static void alc663_mode3_inithook(struct hda_codec
*codec
)
16633 alc663_two_hp_m1_speaker_automute(codec
);
16634 alc_mic_automute(codec
);
16636 /* ***************** Mode4 ******************************/
16637 static void alc663_mode4_unsol_event(struct hda_codec
*codec
,
16640 switch (res
>> 26) {
16641 case ALC880_HP_EVENT
:
16642 alc663_21jd_two_speaker_automute(codec
);
16644 case ALC880_MIC_EVENT
:
16645 alc_mic_automute(codec
);
16650 #define alc663_mode4_setup alc663_m51va_setup
16652 static void alc663_mode4_inithook(struct hda_codec
*codec
)
16654 alc663_21jd_two_speaker_automute(codec
);
16655 alc_mic_automute(codec
);
16657 /* ***************** Mode5 ******************************/
16658 static void alc663_mode5_unsol_event(struct hda_codec
*codec
,
16661 switch (res
>> 26) {
16662 case ALC880_HP_EVENT
:
16663 alc663_15jd_two_speaker_automute(codec
);
16665 case ALC880_MIC_EVENT
:
16666 alc_mic_automute(codec
);
16671 #define alc663_mode5_setup alc663_m51va_setup
16673 static void alc663_mode5_inithook(struct hda_codec
*codec
)
16675 alc663_15jd_two_speaker_automute(codec
);
16676 alc_mic_automute(codec
);
16678 /* ***************** Mode6 ******************************/
16679 static void alc663_mode6_unsol_event(struct hda_codec
*codec
,
16682 switch (res
>> 26) {
16683 case ALC880_HP_EVENT
:
16684 alc663_two_hp_m2_speaker_automute(codec
);
16686 case ALC880_MIC_EVENT
:
16687 alc_mic_automute(codec
);
16692 #define alc663_mode6_setup alc663_m51va_setup
16694 static void alc663_mode6_inithook(struct hda_codec
*codec
)
16696 alc663_two_hp_m2_speaker_automute(codec
);
16697 alc_mic_automute(codec
);
16700 static void alc663_g71v_hp_automute(struct hda_codec
*codec
)
16702 unsigned int present
;
16703 unsigned char bits
;
16705 present
= snd_hda_codec_read(codec
, 0x21, 0,
16706 AC_VERB_GET_PIN_SENSE
, 0)
16707 & AC_PINSENSE_PRESENCE
;
16708 bits
= present
? HDA_AMP_MUTE
: 0;
16709 snd_hda_codec_amp_stereo(codec
, 0x15, HDA_OUTPUT
, 0,
16710 HDA_AMP_MUTE
, bits
);
16711 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
16712 HDA_AMP_MUTE
, bits
);
16715 static void alc663_g71v_front_automute(struct hda_codec
*codec
)
16717 unsigned int present
;
16718 unsigned char bits
;
16720 present
= snd_hda_codec_read(codec
, 0x15, 0,
16721 AC_VERB_GET_PIN_SENSE
, 0)
16722 & AC_PINSENSE_PRESENCE
;
16723 bits
= present
? HDA_AMP_MUTE
: 0;
16724 snd_hda_codec_amp_stereo(codec
, 0x14, HDA_OUTPUT
, 0,
16725 HDA_AMP_MUTE
, bits
);
16728 static void alc663_g71v_unsol_event(struct hda_codec
*codec
,
16731 switch (res
>> 26) {
16732 case ALC880_HP_EVENT
:
16733 alc663_g71v_hp_automute(codec
);
16735 case ALC880_FRONT_EVENT
:
16736 alc663_g71v_front_automute(codec
);
16738 case ALC880_MIC_EVENT
:
16739 alc_mic_automute(codec
);
16744 #define alc663_g71v_setup alc663_m51va_setup
16746 static void alc663_g71v_inithook(struct hda_codec
*codec
)
16748 alc663_g71v_front_automute(codec
);
16749 alc663_g71v_hp_automute(codec
);
16750 alc_mic_automute(codec
);
16753 static void alc663_g50v_unsol_event(struct hda_codec
*codec
,
16756 switch (res
>> 26) {
16757 case ALC880_HP_EVENT
:
16758 alc663_m51va_speaker_automute(codec
);
16760 case ALC880_MIC_EVENT
:
16761 alc_mic_automute(codec
);
16766 #define alc663_g50v_setup alc663_m51va_setup
16768 static void alc663_g50v_inithook(struct hda_codec
*codec
)
16770 alc663_m51va_speaker_automute(codec
);
16771 alc_mic_automute(codec
);
16774 static struct snd_kcontrol_new alc662_ecs_mixer
[] = {
16775 HDA_CODEC_VOLUME("Master Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
16776 ALC262_HIPPO_MASTER_SWITCH
,
16778 HDA_CODEC_VOLUME("e-Mic/LineIn Boost", 0x18, 0, HDA_INPUT
),
16779 HDA_CODEC_VOLUME("e-Mic/LineIn Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16780 HDA_CODEC_MUTE("e-Mic/LineIn Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16782 HDA_CODEC_VOLUME("i-Mic Boost", 0x19, 0, HDA_INPUT
),
16783 HDA_CODEC_VOLUME("i-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
16784 HDA_CODEC_MUTE("i-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16788 static struct snd_kcontrol_new alc272_nc10_mixer
[] = {
16789 /* Master Playback automatically created from Speaker and Headphone */
16790 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT
),
16791 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT
),
16792 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT
),
16793 HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT
),
16795 HDA_CODEC_VOLUME("Ext Mic Playback Volume", 0x0b, 0x0, HDA_INPUT
),
16796 HDA_CODEC_MUTE("Ext Mic Playback Switch", 0x0b, 0x0, HDA_INPUT
),
16797 HDA_CODEC_VOLUME("Ext Mic Boost", 0x18, 0, HDA_INPUT
),
16799 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT
),
16800 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT
),
16801 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT
),
16805 #ifdef CONFIG_SND_HDA_POWER_SAVE
16806 #define alc662_loopbacks alc880_loopbacks
16810 /* pcm configuration: identical with ALC880 */
16811 #define alc662_pcm_analog_playback alc880_pcm_analog_playback
16812 #define alc662_pcm_analog_capture alc880_pcm_analog_capture
16813 #define alc662_pcm_digital_playback alc880_pcm_digital_playback
16814 #define alc662_pcm_digital_capture alc880_pcm_digital_capture
16817 * configuration and preset
16819 static const char *alc662_models
[ALC662_MODEL_LAST
] = {
16820 [ALC662_3ST_2ch_DIG
] = "3stack-dig",
16821 [ALC662_3ST_6ch_DIG
] = "3stack-6ch-dig",
16822 [ALC662_3ST_6ch
] = "3stack-6ch",
16823 [ALC662_5ST_DIG
] = "6stack-dig",
16824 [ALC662_LENOVO_101E
] = "lenovo-101e",
16825 [ALC662_ASUS_EEEPC_P701
] = "eeepc-p701",
16826 [ALC662_ASUS_EEEPC_EP20
] = "eeepc-ep20",
16827 [ALC662_ECS
] = "ecs",
16828 [ALC663_ASUS_M51VA
] = "m51va",
16829 [ALC663_ASUS_G71V
] = "g71v",
16830 [ALC663_ASUS_H13
] = "h13",
16831 [ALC663_ASUS_G50V
] = "g50v",
16832 [ALC663_ASUS_MODE1
] = "asus-mode1",
16833 [ALC662_ASUS_MODE2
] = "asus-mode2",
16834 [ALC663_ASUS_MODE3
] = "asus-mode3",
16835 [ALC663_ASUS_MODE4
] = "asus-mode4",
16836 [ALC663_ASUS_MODE5
] = "asus-mode5",
16837 [ALC663_ASUS_MODE6
] = "asus-mode6",
16838 [ALC272_DELL
] = "dell",
16839 [ALC272_DELL_ZM1
] = "dell-zm1",
16840 [ALC272_SAMSUNG_NC10
] = "samsung-nc10",
16841 [ALC662_AUTO
] = "auto",
16844 static struct snd_pci_quirk alc662_cfg_tbl
[] = {
16845 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_ECS
),
16846 SND_PCI_QUIRK(0x1028, 0x02d6, "DELL", ALC272_DELL
),
16847 SND_PCI_QUIRK(0x1028, 0x02f4, "DELL ZM1", ALC272_DELL_ZM1
),
16848 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC663_ASUS_MODE1
),
16849 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC663_ASUS_MODE3
),
16850 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC663_ASUS_MODE3
),
16851 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1
),
16852 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2
),
16853 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC663_ASUS_MODE1
),
16854 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_ASUS_MODE2
),
16855 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_ASUS_MODE2
),
16856 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_ASUS_MODE2
),
16857 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC663_ASUS_MODE6
),
16858 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC663_ASUS_MODE6
),
16859 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_ASUS_MODE2
),
16860 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC663_ASUS_MODE3
),
16861 SND_PCI_QUIRK(0x1043, 0x17c3, "ASUS UX20", ALC663_ASUS_M51VA
),
16862 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_ASUS_MODE2
),
16863 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_ASUS_MODE2
),
16864 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC663_ASUS_MODE5
),
16865 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC663_ASUS_MODE6
),
16866 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_ASUS_MODE2
),
16867 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC663_ASUS_MODE1
),
16868 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_ASUS_MODE2
),
16869 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_ASUS_MODE2
),
16870 SND_PCI_QUIRK(0x1043, 0x1878, "ASUS M51VA", ALC663_ASUS_M51VA
),
16871 /*SND_PCI_QUIRK(0x1043, 0x1878, "ASUS M50Vr", ALC663_ASUS_MODE1),*/
16872 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC663_ASUS_MODE3
),
16873 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC663_ASUS_MODE3
),
16874 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC663_ASUS_MODE1
),
16875 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC663_ASUS_MODE1
),
16876 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC663_ASUS_MODE1
),
16877 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC663_ASUS_MODE1
),
16878 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_ASUS_MODE2
),
16879 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_ASUS_MODE2
),
16880 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC663_ASUS_MODE1
),
16881 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC663_ASUS_MODE1
),
16882 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC663_ASUS_MODE3
),
16883 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC663_ASUS_MODE1
),
16884 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC663_ASUS_MODE1
),
16885 SND_PCI_QUIRK(0x1043, 0x19a3, "ASUS G50V", ALC663_ASUS_G50V
),
16886 /*SND_PCI_QUIRK(0x1043, 0x19a3, "ASUS NB", ALC663_ASUS_MODE1),*/
16887 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC663_ASUS_MODE1
),
16888 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_ASUS_MODE2
),
16889 SND_PCI_QUIRK(0x1043, 0x19d3, "ASUS NB", ALC663_ASUS_M51VA
),
16890 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC663_ASUS_MODE1
),
16891 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC663_ASUS_MODE4
),
16892 SND_PCI_QUIRK(0x1043, 0x8290, "ASUS P5GC-MX", ALC662_3ST_6ch_DIG
),
16893 SND_PCI_QUIRK(0x1043, 0x82a1, "ASUS Eeepc", ALC662_ASUS_EEEPC_P701
),
16894 SND_PCI_QUIRK(0x1043, 0x82d1, "ASUS Eeepc EP20", ALC662_ASUS_EEEPC_EP20
),
16895 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_ECS
),
16896 SND_PCI_QUIRK(0x105b, 0x0d47, "Foxconn 45CMX/45GMX/45CMX-K",
16897 ALC662_3ST_6ch_DIG
),
16898 SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB200", ALC663_ASUS_MODE4
),
16899 SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10
),
16900 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L",
16901 ALC662_3ST_6ch_DIG
),
16902 SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG
),
16903 SND_PCI_QUIRK(0x1631, 0xc10c, "PB RS65", ALC663_ASUS_M51VA
),
16904 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo", ALC662_LENOVO_101E
),
16905 SND_PCI_QUIRK(0x1849, 0x3662, "ASROCK K10N78FullHD-hSLI R3.0",
16906 ALC662_3ST_6ch_DIG
),
16907 SND_PCI_QUIRK_MASK(0x1854, 0xf000, 0x2000, "ASUS H13-200x",
16912 static struct alc_config_preset alc662_presets
[] = {
16913 [ALC662_3ST_2ch_DIG
] = {
16914 .mixers
= { alc662_3ST_2ch_mixer
},
16915 .init_verbs
= { alc662_init_verbs
},
16916 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16917 .dac_nids
= alc662_dac_nids
,
16918 .dig_out_nid
= ALC662_DIGOUT_NID
,
16919 .dig_in_nid
= ALC662_DIGIN_NID
,
16920 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
16921 .channel_mode
= alc662_3ST_2ch_modes
,
16922 .input_mux
= &alc662_capture_source
,
16924 [ALC662_3ST_6ch_DIG
] = {
16925 .mixers
= { alc662_3ST_6ch_mixer
, alc662_chmode_mixer
},
16926 .init_verbs
= { alc662_init_verbs
},
16927 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16928 .dac_nids
= alc662_dac_nids
,
16929 .dig_out_nid
= ALC662_DIGOUT_NID
,
16930 .dig_in_nid
= ALC662_DIGIN_NID
,
16931 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_6ch_modes
),
16932 .channel_mode
= alc662_3ST_6ch_modes
,
16934 .input_mux
= &alc662_capture_source
,
16936 [ALC662_3ST_6ch
] = {
16937 .mixers
= { alc662_3ST_6ch_mixer
, alc662_chmode_mixer
},
16938 .init_verbs
= { alc662_init_verbs
},
16939 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16940 .dac_nids
= alc662_dac_nids
,
16941 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_6ch_modes
),
16942 .channel_mode
= alc662_3ST_6ch_modes
,
16944 .input_mux
= &alc662_capture_source
,
16946 [ALC662_5ST_DIG
] = {
16947 .mixers
= { alc662_base_mixer
, alc662_chmode_mixer
},
16948 .init_verbs
= { alc662_init_verbs
},
16949 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16950 .dac_nids
= alc662_dac_nids
,
16951 .dig_out_nid
= ALC662_DIGOUT_NID
,
16952 .dig_in_nid
= ALC662_DIGIN_NID
,
16953 .num_channel_mode
= ARRAY_SIZE(alc662_5stack_modes
),
16954 .channel_mode
= alc662_5stack_modes
,
16955 .input_mux
= &alc662_capture_source
,
16957 [ALC662_LENOVO_101E
] = {
16958 .mixers
= { alc662_lenovo_101e_mixer
},
16959 .init_verbs
= { alc662_init_verbs
, alc662_sue_init_verbs
},
16960 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16961 .dac_nids
= alc662_dac_nids
,
16962 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
16963 .channel_mode
= alc662_3ST_2ch_modes
,
16964 .input_mux
= &alc662_lenovo_101e_capture_source
,
16965 .unsol_event
= alc662_lenovo_101e_unsol_event
,
16966 .init_hook
= alc662_lenovo_101e_all_automute
,
16968 [ALC662_ASUS_EEEPC_P701
] = {
16969 .mixers
= { alc662_eeepc_p701_mixer
},
16970 .init_verbs
= { alc662_init_verbs
,
16971 alc662_eeepc_sue_init_verbs
},
16972 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16973 .dac_nids
= alc662_dac_nids
,
16974 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
16975 .channel_mode
= alc662_3ST_2ch_modes
,
16976 .unsol_event
= alc662_eeepc_unsol_event
,
16977 .setup
= alc662_eeepc_setup
,
16978 .init_hook
= alc662_eeepc_inithook
,
16980 [ALC662_ASUS_EEEPC_EP20
] = {
16981 .mixers
= { alc662_eeepc_ep20_mixer
,
16982 alc662_chmode_mixer
},
16983 .init_verbs
= { alc662_init_verbs
,
16984 alc662_eeepc_ep20_sue_init_verbs
},
16985 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16986 .dac_nids
= alc662_dac_nids
,
16987 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_6ch_modes
),
16988 .channel_mode
= alc662_3ST_6ch_modes
,
16989 .input_mux
= &alc662_lenovo_101e_capture_source
,
16990 .unsol_event
= alc662_eeepc_unsol_event
,
16991 .setup
= alc662_eeepc_ep20_setup
,
16992 .init_hook
= alc662_eeepc_ep20_inithook
,
16995 .mixers
= { alc662_ecs_mixer
},
16996 .init_verbs
= { alc662_init_verbs
,
16997 alc662_ecs_init_verbs
},
16998 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
16999 .dac_nids
= alc662_dac_nids
,
17000 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17001 .channel_mode
= alc662_3ST_2ch_modes
,
17002 .unsol_event
= alc662_eeepc_unsol_event
,
17003 .setup
= alc662_eeepc_setup
,
17004 .init_hook
= alc662_eeepc_inithook
,
17006 [ALC663_ASUS_M51VA
] = {
17007 .mixers
= { alc663_m51va_mixer
},
17008 .init_verbs
= { alc662_init_verbs
, alc663_m51va_init_verbs
},
17009 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17010 .dac_nids
= alc662_dac_nids
,
17011 .dig_out_nid
= ALC662_DIGOUT_NID
,
17012 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17013 .channel_mode
= alc662_3ST_2ch_modes
,
17014 .unsol_event
= alc663_m51va_unsol_event
,
17015 .setup
= alc663_m51va_setup
,
17016 .init_hook
= alc663_m51va_inithook
,
17018 [ALC663_ASUS_G71V
] = {
17019 .mixers
= { alc663_g71v_mixer
},
17020 .init_verbs
= { alc662_init_verbs
, alc663_g71v_init_verbs
},
17021 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17022 .dac_nids
= alc662_dac_nids
,
17023 .dig_out_nid
= ALC662_DIGOUT_NID
,
17024 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17025 .channel_mode
= alc662_3ST_2ch_modes
,
17026 .unsol_event
= alc663_g71v_unsol_event
,
17027 .setup
= alc663_g71v_setup
,
17028 .init_hook
= alc663_g71v_inithook
,
17030 [ALC663_ASUS_H13
] = {
17031 .mixers
= { alc663_m51va_mixer
},
17032 .init_verbs
= { alc662_init_verbs
, alc663_m51va_init_verbs
},
17033 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17034 .dac_nids
= alc662_dac_nids
,
17035 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17036 .channel_mode
= alc662_3ST_2ch_modes
,
17037 .unsol_event
= alc663_m51va_unsol_event
,
17038 .init_hook
= alc663_m51va_inithook
,
17040 [ALC663_ASUS_G50V
] = {
17041 .mixers
= { alc663_g50v_mixer
},
17042 .init_verbs
= { alc662_init_verbs
, alc663_g50v_init_verbs
},
17043 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17044 .dac_nids
= alc662_dac_nids
,
17045 .dig_out_nid
= ALC662_DIGOUT_NID
,
17046 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_6ch_modes
),
17047 .channel_mode
= alc662_3ST_6ch_modes
,
17048 .input_mux
= &alc663_capture_source
,
17049 .unsol_event
= alc663_g50v_unsol_event
,
17050 .setup
= alc663_g50v_setup
,
17051 .init_hook
= alc663_g50v_inithook
,
17053 [ALC663_ASUS_MODE1
] = {
17054 .mixers
= { alc663_m51va_mixer
},
17055 .cap_mixer
= alc662_auto_capture_mixer
,
17056 .init_verbs
= { alc662_init_verbs
,
17057 alc663_21jd_amic_init_verbs
},
17058 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17060 .dac_nids
= alc662_dac_nids
,
17061 .dig_out_nid
= ALC662_DIGOUT_NID
,
17062 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17063 .channel_mode
= alc662_3ST_2ch_modes
,
17064 .unsol_event
= alc663_mode1_unsol_event
,
17065 .setup
= alc663_mode1_setup
,
17066 .init_hook
= alc663_mode1_inithook
,
17068 [ALC662_ASUS_MODE2
] = {
17069 .mixers
= { alc662_1bjd_mixer
},
17070 .cap_mixer
= alc662_auto_capture_mixer
,
17071 .init_verbs
= { alc662_init_verbs
,
17072 alc662_1bjd_amic_init_verbs
},
17073 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17074 .dac_nids
= alc662_dac_nids
,
17075 .dig_out_nid
= ALC662_DIGOUT_NID
,
17076 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17077 .channel_mode
= alc662_3ST_2ch_modes
,
17078 .unsol_event
= alc662_mode2_unsol_event
,
17079 .setup
= alc662_mode2_setup
,
17080 .init_hook
= alc662_mode2_inithook
,
17082 [ALC663_ASUS_MODE3
] = {
17083 .mixers
= { alc663_two_hp_m1_mixer
},
17084 .cap_mixer
= alc662_auto_capture_mixer
,
17085 .init_verbs
= { alc662_init_verbs
,
17086 alc663_two_hp_amic_m1_init_verbs
},
17087 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17089 .dac_nids
= alc662_dac_nids
,
17090 .dig_out_nid
= ALC662_DIGOUT_NID
,
17091 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17092 .channel_mode
= alc662_3ST_2ch_modes
,
17093 .unsol_event
= alc663_mode3_unsol_event
,
17094 .setup
= alc663_mode3_setup
,
17095 .init_hook
= alc663_mode3_inithook
,
17097 [ALC663_ASUS_MODE4
] = {
17098 .mixers
= { alc663_asus_21jd_clfe_mixer
},
17099 .cap_mixer
= alc662_auto_capture_mixer
,
17100 .init_verbs
= { alc662_init_verbs
,
17101 alc663_21jd_amic_init_verbs
},
17102 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17104 .dac_nids
= alc662_dac_nids
,
17105 .dig_out_nid
= ALC662_DIGOUT_NID
,
17106 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17107 .channel_mode
= alc662_3ST_2ch_modes
,
17108 .unsol_event
= alc663_mode4_unsol_event
,
17109 .setup
= alc663_mode4_setup
,
17110 .init_hook
= alc663_mode4_inithook
,
17112 [ALC663_ASUS_MODE5
] = {
17113 .mixers
= { alc663_asus_15jd_clfe_mixer
},
17114 .cap_mixer
= alc662_auto_capture_mixer
,
17115 .init_verbs
= { alc662_init_verbs
,
17116 alc663_15jd_amic_init_verbs
},
17117 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17119 .dac_nids
= alc662_dac_nids
,
17120 .dig_out_nid
= ALC662_DIGOUT_NID
,
17121 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17122 .channel_mode
= alc662_3ST_2ch_modes
,
17123 .unsol_event
= alc663_mode5_unsol_event
,
17124 .setup
= alc663_mode5_setup
,
17125 .init_hook
= alc663_mode5_inithook
,
17127 [ALC663_ASUS_MODE6
] = {
17128 .mixers
= { alc663_two_hp_m2_mixer
},
17129 .cap_mixer
= alc662_auto_capture_mixer
,
17130 .init_verbs
= { alc662_init_verbs
,
17131 alc663_two_hp_amic_m2_init_verbs
},
17132 .num_dacs
= ARRAY_SIZE(alc662_dac_nids
),
17134 .dac_nids
= alc662_dac_nids
,
17135 .dig_out_nid
= ALC662_DIGOUT_NID
,
17136 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17137 .channel_mode
= alc662_3ST_2ch_modes
,
17138 .unsol_event
= alc663_mode6_unsol_event
,
17139 .setup
= alc663_mode6_setup
,
17140 .init_hook
= alc663_mode6_inithook
,
17143 .mixers
= { alc663_m51va_mixer
},
17144 .cap_mixer
= alc272_auto_capture_mixer
,
17145 .init_verbs
= { alc662_init_verbs
, alc272_dell_init_verbs
},
17146 .num_dacs
= ARRAY_SIZE(alc272_dac_nids
),
17147 .dac_nids
= alc662_dac_nids
,
17148 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17149 .adc_nids
= alc272_adc_nids
,
17150 .num_adc_nids
= ARRAY_SIZE(alc272_adc_nids
),
17151 .capsrc_nids
= alc272_capsrc_nids
,
17152 .channel_mode
= alc662_3ST_2ch_modes
,
17153 .unsol_event
= alc663_m51va_unsol_event
,
17154 .setup
= alc663_m51va_setup
,
17155 .init_hook
= alc663_m51va_inithook
,
17157 [ALC272_DELL_ZM1
] = {
17158 .mixers
= { alc663_m51va_mixer
},
17159 .cap_mixer
= alc662_auto_capture_mixer
,
17160 .init_verbs
= { alc662_init_verbs
, alc272_dell_zm1_init_verbs
},
17161 .num_dacs
= ARRAY_SIZE(alc272_dac_nids
),
17162 .dac_nids
= alc662_dac_nids
,
17163 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17164 .adc_nids
= alc662_adc_nids
,
17166 .capsrc_nids
= alc662_capsrc_nids
,
17167 .channel_mode
= alc662_3ST_2ch_modes
,
17168 .unsol_event
= alc663_m51va_unsol_event
,
17169 .setup
= alc663_m51va_setup
,
17170 .init_hook
= alc663_m51va_inithook
,
17172 [ALC272_SAMSUNG_NC10
] = {
17173 .mixers
= { alc272_nc10_mixer
},
17174 .init_verbs
= { alc662_init_verbs
,
17175 alc663_21jd_amic_init_verbs
},
17176 .num_dacs
= ARRAY_SIZE(alc272_dac_nids
),
17177 .dac_nids
= alc272_dac_nids
,
17178 .num_channel_mode
= ARRAY_SIZE(alc662_3ST_2ch_modes
),
17179 .channel_mode
= alc662_3ST_2ch_modes
,
17180 /*.input_mux = &alc272_nc10_capture_source,*/
17181 .unsol_event
= alc663_mode4_unsol_event
,
17182 .setup
= alc663_mode4_setup
,
17183 .init_hook
= alc663_mode4_inithook
,
17189 * BIOS auto configuration
17192 /* convert from MIX nid to DAC */
17193 static inline hda_nid_t
alc662_mix_to_dac(hda_nid_t nid
)
17197 else if (nid
>= 0x0c && nid
<= 0x0e)
17198 return nid
- 0x0c + 0x02;
17203 /* get MIX nid connected to the given pin targeted to DAC */
17204 static hda_nid_t
alc662_dac_to_mix(struct hda_codec
*codec
, hda_nid_t pin
,
17210 num
= snd_hda_get_connections(codec
, pin
, mix
, ARRAY_SIZE(mix
));
17211 for (i
= 0; i
< num
; i
++) {
17212 if (alc662_mix_to_dac(mix
[i
]) == dac
)
17218 /* look for an empty DAC slot */
17219 static hda_nid_t
alc662_look_for_dac(struct hda_codec
*codec
, hda_nid_t pin
)
17221 struct alc_spec
*spec
= codec
->spec
;
17225 num
= snd_hda_get_connections(codec
, pin
, srcs
, ARRAY_SIZE(srcs
));
17228 for (i
= 0; i
< num
; i
++) {
17229 hda_nid_t nid
= alc662_mix_to_dac(srcs
[i
]);
17232 for (j
= 0; j
< spec
->multiout
.num_dacs
; j
++)
17233 if (spec
->multiout
.dac_nids
[j
] == nid
)
17235 if (j
>= spec
->multiout
.num_dacs
)
17241 /* fill in the dac_nids table from the parsed pin configuration */
17242 static int alc662_auto_fill_dac_nids(struct hda_codec
*codec
,
17243 const struct auto_pin_cfg
*cfg
)
17245 struct alc_spec
*spec
= codec
->spec
;
17249 spec
->multiout
.dac_nids
= spec
->private_dac_nids
;
17250 for (i
= 0; i
< cfg
->line_outs
; i
++) {
17251 dac
= alc662_look_for_dac(codec
, cfg
->line_out_pins
[i
]);
17254 spec
->multiout
.dac_nids
[spec
->multiout
.num_dacs
++] = dac
;
17259 static int alc662_add_vol_ctl(struct alc_spec
*spec
, const char *pfx
,
17260 hda_nid_t nid
, unsigned int chs
)
17263 sprintf(name
, "%s Playback Volume", pfx
);
17264 return add_control(spec
, ALC_CTL_WIDGET_VOL
, name
,
17265 HDA_COMPOSE_AMP_VAL(nid
, chs
, 0, HDA_OUTPUT
));
17268 static int alc662_add_sw_ctl(struct alc_spec
*spec
, const char *pfx
,
17269 hda_nid_t nid
, unsigned int chs
)
17272 sprintf(name
, "%s Playback Switch", pfx
);
17273 return add_control(spec
, ALC_CTL_WIDGET_MUTE
, name
,
17274 HDA_COMPOSE_AMP_VAL(nid
, chs
, 0, HDA_INPUT
));
17277 #define alc662_add_stereo_vol(spec, pfx, nid) \
17278 alc662_add_vol_ctl(spec, pfx, nid, 3)
17279 #define alc662_add_stereo_sw(spec, pfx, nid) \
17280 alc662_add_sw_ctl(spec, pfx, nid, 3)
17282 /* add playback controls from the parsed DAC table */
17283 static int alc662_auto_create_multi_out_ctls(struct hda_codec
*codec
,
17284 const struct auto_pin_cfg
*cfg
)
17286 struct alc_spec
*spec
= codec
->spec
;
17287 static const char *chname
[4] = {
17288 "Front", "Surround", NULL
/*CLFE*/, "Side"
17290 hda_nid_t nid
, mix
;
17293 for (i
= 0; i
< cfg
->line_outs
; i
++) {
17294 nid
= spec
->multiout
.dac_nids
[i
];
17297 mix
= alc662_dac_to_mix(codec
, cfg
->line_out_pins
[i
], nid
);
17302 err
= alc662_add_vol_ctl(spec
, "Center", nid
, 1);
17305 err
= alc662_add_vol_ctl(spec
, "LFE", nid
, 2);
17308 err
= alc662_add_sw_ctl(spec
, "Center", mix
, 1);
17311 err
= alc662_add_sw_ctl(spec
, "LFE", mix
, 2);
17316 if (cfg
->line_outs
== 1 &&
17317 cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
) {
17324 err
= alc662_add_vol_ctl(spec
, pfx
, nid
, 3);
17327 if (cfg
->line_outs
== 1 &&
17328 cfg
->line_out_type
== AUTO_PIN_SPEAKER_OUT
)
17330 err
= alc662_add_sw_ctl(spec
, pfx
, mix
, 3);
17338 /* add playback controls for speaker and HP outputs */
17339 /* return DAC nid if any new DAC is assigned */
17340 static int alc662_auto_create_extra_out(struct hda_codec
*codec
, hda_nid_t pin
,
17343 struct alc_spec
*spec
= codec
->spec
;
17344 hda_nid_t nid
, mix
;
17349 nid
= alc662_look_for_dac(codec
, pin
);
17352 /* the corresponding DAC is already occupied */
17353 if (!(get_wcaps(codec
, pin
) & AC_WCAP_OUT_AMP
))
17354 return 0; /* no way */
17355 /* create a switch only */
17356 sprintf(name
, "%s Playback Switch", pfx
);
17357 return add_control(spec
, ALC_CTL_WIDGET_MUTE
, name
,
17358 HDA_COMPOSE_AMP_VAL(pin
, 3, 0, HDA_OUTPUT
));
17361 mix
= alc662_dac_to_mix(codec
, pin
, nid
);
17364 err
= alc662_add_vol_ctl(spec
, pfx
, nid
, 3);
17367 err
= alc662_add_sw_ctl(spec
, pfx
, mix
, 3);
17373 /* create playback/capture controls for input pins */
17374 #define alc662_auto_create_input_ctls \
17375 alc880_auto_create_input_ctls
17377 static void alc662_auto_set_output_and_unmute(struct hda_codec
*codec
,
17378 hda_nid_t nid
, int pin_type
,
17384 alc_set_pin_output(codec
, nid
, pin_type
);
17385 /* need the manual connection? */
17386 num
= snd_hda_get_connections(codec
, nid
, srcs
, ARRAY_SIZE(srcs
));
17389 for (i
= 0; i
< num
; i
++) {
17390 if (alc662_mix_to_dac(srcs
[i
]) != dac
)
17392 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_CONNECT_SEL
, i
);
17397 static void alc662_auto_init_multi_out(struct hda_codec
*codec
)
17399 struct alc_spec
*spec
= codec
->spec
;
17400 int pin_type
= get_pin_type(spec
->autocfg
.line_out_type
);
17403 for (i
= 0; i
<= HDA_SIDE
; i
++) {
17404 hda_nid_t nid
= spec
->autocfg
.line_out_pins
[i
];
17406 alc662_auto_set_output_and_unmute(codec
, nid
, pin_type
,
17407 spec
->multiout
.dac_nids
[i
]);
17411 static void alc662_auto_init_hp_out(struct hda_codec
*codec
)
17413 struct alc_spec
*spec
= codec
->spec
;
17416 pin
= spec
->autocfg
.hp_pins
[0];
17418 alc662_auto_set_output_and_unmute(codec
, pin
, PIN_HP
,
17419 spec
->multiout
.hp_nid
);
17420 pin
= spec
->autocfg
.speaker_pins
[0];
17422 alc662_auto_set_output_and_unmute(codec
, pin
, PIN_OUT
,
17423 spec
->multiout
.extra_out_nid
[0]);
17426 #define ALC662_PIN_CD_NID ALC880_PIN_CD_NID
17428 static void alc662_auto_init_analog_input(struct hda_codec
*codec
)
17430 struct alc_spec
*spec
= codec
->spec
;
17433 for (i
= 0; i
< AUTO_PIN_LAST
; i
++) {
17434 hda_nid_t nid
= spec
->autocfg
.input_pins
[i
];
17435 if (alc_is_input_pin(codec
, nid
)) {
17436 alc_set_input_pin(codec
, nid
, i
);
17437 if (nid
!= ALC662_PIN_CD_NID
&&
17438 (get_wcaps(codec
, nid
) & AC_WCAP_OUT_AMP
))
17439 snd_hda_codec_write(codec
, nid
, 0,
17440 AC_VERB_SET_AMP_GAIN_MUTE
,
17446 #define alc662_auto_init_input_src alc882_auto_init_input_src
17448 static int alc662_parse_auto_config(struct hda_codec
*codec
)
17450 struct alc_spec
*spec
= codec
->spec
;
17452 static hda_nid_t alc662_ignore
[] = { 0x1d, 0 };
17454 err
= snd_hda_parse_pin_def_config(codec
, &spec
->autocfg
,
17458 if (!spec
->autocfg
.line_outs
)
17459 return 0; /* can't find valid BIOS pin config */
17461 err
= alc662_auto_fill_dac_nids(codec
, &spec
->autocfg
);
17464 err
= alc662_auto_create_multi_out_ctls(codec
, &spec
->autocfg
);
17467 err
= alc662_auto_create_extra_out(codec
,
17468 spec
->autocfg
.speaker_pins
[0],
17473 spec
->multiout
.extra_out_nid
[0] = err
;
17474 err
= alc662_auto_create_extra_out(codec
, spec
->autocfg
.hp_pins
[0],
17479 spec
->multiout
.hp_nid
= err
;
17480 err
= alc662_auto_create_input_ctls(codec
, &spec
->autocfg
);
17484 spec
->multiout
.max_channels
= spec
->multiout
.num_dacs
* 2;
17486 if (spec
->autocfg
.dig_outs
)
17487 spec
->multiout
.dig_out_nid
= ALC880_DIGOUT_NID
;
17489 if (spec
->kctls
.list
)
17490 add_mixer(spec
, spec
->kctls
.list
);
17492 spec
->num_mux_defs
= 1;
17493 spec
->input_mux
= &spec
->private_imux
[0];
17495 add_verb(spec
, alc662_auto_init_verbs
);
17496 if (codec
->vendor_id
== 0x10ec0663)
17497 add_verb(spec
, alc663_auto_init_verbs
);
17499 err
= alc_auto_add_mic_boost(codec
);
17503 alc_ssid_check(codec
, 0x15, 0x1b, 0x14);
17508 /* additional initialization for auto-configuration model */
17509 static void alc662_auto_init(struct hda_codec
*codec
)
17511 struct alc_spec
*spec
= codec
->spec
;
17512 alc662_auto_init_multi_out(codec
);
17513 alc662_auto_init_hp_out(codec
);
17514 alc662_auto_init_analog_input(codec
);
17515 alc662_auto_init_input_src(codec
);
17516 if (spec
->unsol_event
)
17517 alc_inithook(codec
);
17520 static int patch_alc662(struct hda_codec
*codec
)
17522 struct alc_spec
*spec
;
17523 int err
, board_config
;
17525 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
17529 codec
->spec
= spec
;
17531 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
17533 board_config
= snd_hda_check_board_config(codec
, ALC662_MODEL_LAST
,
17536 if (board_config
< 0) {
17537 printk(KERN_INFO
"hda_codec: %s: BIOS auto-probing.\n",
17539 board_config
= ALC662_AUTO
;
17542 if (board_config
== ALC662_AUTO
) {
17543 /* automatic parse from the BIOS config */
17544 err
= alc662_parse_auto_config(codec
);
17550 "hda_codec: Cannot set up configuration "
17551 "from BIOS. Using base mode...\n");
17552 board_config
= ALC662_3ST_2ch_DIG
;
17556 err
= snd_hda_attach_beep_device(codec
, 0x1);
17562 if (board_config
!= ALC662_AUTO
)
17563 setup_preset(codec
, &alc662_presets
[board_config
]);
17565 spec
->stream_analog_playback
= &alc662_pcm_analog_playback
;
17566 spec
->stream_analog_capture
= &alc662_pcm_analog_capture
;
17568 spec
->stream_digital_playback
= &alc662_pcm_digital_playback
;
17569 spec
->stream_digital_capture
= &alc662_pcm_digital_capture
;
17571 if (!spec
->adc_nids
) {
17572 spec
->adc_nids
= alc662_adc_nids
;
17573 spec
->num_adc_nids
= ARRAY_SIZE(alc662_adc_nids
);
17575 if (!spec
->capsrc_nids
)
17576 spec
->capsrc_nids
= alc662_capsrc_nids
;
17578 if (!spec
->cap_mixer
)
17579 set_capture_mixer(codec
);
17580 if (codec
->vendor_id
== 0x10ec0662)
17581 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
17583 set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
17585 spec
->vmaster_nid
= 0x02;
17587 codec
->patch_ops
= alc_patch_ops
;
17588 if (board_config
== ALC662_AUTO
)
17589 spec
->init_hook
= alc662_auto_init
;
17590 #ifdef CONFIG_SND_HDA_POWER_SAVE
17591 if (!spec
->loopback
.amplist
)
17592 spec
->loopback
.amplist
= alc662_loopbacks
;
17594 codec
->proc_widget_hook
= print_realtek_coef
;
17602 static struct hda_codec_preset snd_hda_preset_realtek
[] = {
17603 { .id
= 0x10ec0260, .name
= "ALC260", .patch
= patch_alc260
},
17604 { .id
= 0x10ec0262, .name
= "ALC262", .patch
= patch_alc262
},
17605 { .id
= 0x10ec0267, .name
= "ALC267", .patch
= patch_alc268
},
17606 { .id
= 0x10ec0268, .name
= "ALC268", .patch
= patch_alc268
},
17607 { .id
= 0x10ec0269, .name
= "ALC269", .patch
= patch_alc269
},
17608 { .id
= 0x10ec0272, .name
= "ALC272", .patch
= patch_alc662
},
17609 { .id
= 0x10ec0861, .rev
= 0x100340, .name
= "ALC660",
17610 .patch
= patch_alc861
},
17611 { .id
= 0x10ec0660, .name
= "ALC660-VD", .patch
= patch_alc861vd
},
17612 { .id
= 0x10ec0861, .name
= "ALC861", .patch
= patch_alc861
},
17613 { .id
= 0x10ec0862, .name
= "ALC861-VD", .patch
= patch_alc861vd
},
17614 { .id
= 0x10ec0662, .rev
= 0x100002, .name
= "ALC662 rev2",
17615 .patch
= patch_alc882
},
17616 { .id
= 0x10ec0662, .rev
= 0x100101, .name
= "ALC662 rev1",
17617 .patch
= patch_alc662
},
17618 { .id
= 0x10ec0663, .name
= "ALC663", .patch
= patch_alc662
},
17619 { .id
= 0x10ec0880, .name
= "ALC880", .patch
= patch_alc880
},
17620 { .id
= 0x10ec0882, .name
= "ALC882", .patch
= patch_alc882
},
17621 { .id
= 0x10ec0883, .name
= "ALC883", .patch
= patch_alc882
},
17622 { .id
= 0x10ec0885, .rev
= 0x100101, .name
= "ALC889A",
17623 .patch
= patch_alc882
},
17624 { .id
= 0x10ec0885, .rev
= 0x100103, .name
= "ALC889A",
17625 .patch
= patch_alc882
},
17626 { .id
= 0x10ec0885, .name
= "ALC885", .patch
= patch_alc882
},
17627 { .id
= 0x10ec0887, .name
= "ALC887", .patch
= patch_alc882
},
17628 { .id
= 0x10ec0888, .rev
= 0x100101, .name
= "ALC1200",
17629 .patch
= patch_alc882
},
17630 { .id
= 0x10ec0888, .name
= "ALC888", .patch
= patch_alc882
},
17631 { .id
= 0x10ec0889, .name
= "ALC889", .patch
= patch_alc882
},
17632 {} /* terminator */
17635 MODULE_ALIAS("snd-hda-codec-id:10ec*");
17637 MODULE_LICENSE("GPL");
17638 MODULE_DESCRIPTION("Realtek HD-audio codec");
17640 static struct hda_codec_preset_list realtek_list
= {
17641 .preset
= snd_hda_preset_realtek
,
17642 .owner
= THIS_MODULE
,
17645 static int __init
patch_realtek_init(void)
17647 return snd_hda_add_codec_preset(&realtek_list
);
17650 static void __exit
patch_realtek_exit(void)
17652 snd_hda_delete_codec_preset(&realtek_list
);
17655 module_init(patch_realtek_init
)
17656 module_exit(patch_realtek_exit
)