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 */
141
ALC269_MODEL_LAST /* last tag */
158
/* ALC861-VD models */
180
ALC662_ASUS_EEEPC_P701,
181
ALC662_ASUS_EEEPC_EP20,
223
ALC883_TARGA_2ch_DIG,
224
ALC883_TARGA_8ch_DIG,
227
ALC888_ACER_ASPIRE_4930G,
228
ALC888_ACER_ASPIRE_6530G,
229
ALC888_ACER_ASPIRE_8930G,
230
ALC888_ACER_ASPIRE_7730G,
233
ALC883_MEDION_WIM2160,
235
ALC883_LENOVO_101E_2ch,
236
ALC883_LENOVO_NB0763,
237
ALC888_LENOVO_MS7195_DIG,
245
ALC883_FUJITSU_PI2515,
246
ALC888_FUJITSU_XA3530,
247
ALC883_3ST_6ch_INTEL,
260
#define GPIO_MASK 0x03
262
/* extra amp-initialization sequence types */
271
struct alc_mic_route {
273
unsigned char mux_idx;
274
unsigned char amix_idx;
277
#define MUX_IDX_UNDEF ((unsigned char)-1)
279
struct alc_customize_define {
280
unsigned int sku_cfg;
281
unsigned char port_connectivity;
282
unsigned char check_sum;
283
unsigned char customization;
284
unsigned char external_amp;
285
unsigned int enable_pcbeep:1;
286
unsigned int platform_type:1;
288
unsigned int override:1;
292
/* codec parameterization */
293
struct snd_kcontrol_new *mixers[5]; /* mixer arrays */
294
unsigned int num_mixers;
295
struct snd_kcontrol_new *cap_mixer; /* capture mixer */
296
unsigned int beep_amp; /* beep amp value, set via set_beep_amp() */
298
const struct hda_verb *init_verbs[10]; /* initialization verbs
302
unsigned int num_init_verbs;
304
char stream_name_analog[32]; /* analog PCM stream */
305
struct hda_pcm_stream *stream_analog_playback;
306
struct hda_pcm_stream *stream_analog_capture;
307
struct hda_pcm_stream *stream_analog_alt_playback;
308
struct hda_pcm_stream *stream_analog_alt_capture;
310
char stream_name_digital[32]; /* digital PCM stream */
311
struct hda_pcm_stream *stream_digital_playback;
312
struct hda_pcm_stream *stream_digital_capture;
315
struct hda_multi_out multiout; /* playback set-up
316
* max_channels, dacs must be set
317
* dig_out_nid and hp_nid are optional
319
hda_nid_t alt_dac_nid;
320
hda_nid_t slave_dig_outs[3]; /* optional - for auto-parsing */
324
unsigned int num_adc_nids;
326
hda_nid_t *capsrc_nids;
327
hda_nid_t dig_in_nid; /* digital-in NID; optional */
330
unsigned int num_mux_defs;
331
const struct hda_input_mux *input_mux;
332
unsigned int cur_mux[3];
333
struct alc_mic_route ext_mic;
334
struct alc_mic_route int_mic;
337
const struct hda_channel_mode *channel_mode;
338
int num_channel_mode;
340
int const_channel_count;
341
int ext_channel_count;
343
/* PCM information */
344
struct hda_pcm pcm_rec[3]; /* used in alc_build_pcms() */
346
/* dynamic controls, init_verbs and input_mux */
347
struct auto_pin_cfg autocfg;
348
struct alc_customize_define cdefine;
349
struct snd_array kctls;
350
struct hda_input_mux private_imux[3];
351
hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
352
hda_nid_t private_adc_nids[AUTO_CFG_MAX_OUTS];
353
hda_nid_t private_capsrc_nids[AUTO_CFG_MAX_OUTS];
356
void (*init_hook)(struct hda_codec *codec);
357
void (*unsol_event)(struct hda_codec *codec, unsigned int res);
358
#ifdef CONFIG_SND_HDA_POWER_SAVE
359
void (*power_hook)(struct hda_codec *codec);
362
/* for pin sensing */
363
unsigned int sense_updated: 1;
364
unsigned int jack_present: 1;
365
unsigned int master_sw: 1;
366
unsigned int auto_mic:1;
369
unsigned int no_analog :1; /* digital I/O only */
372
/* for virtual master */
373
hda_nid_t vmaster_nid;
374
#ifdef CONFIG_SND_HDA_POWER_SAVE
375
struct hda_loopback_check loopback;
380
unsigned int pll_coef_idx, pll_coef_bit;
384
* configuration template - to be copied to the spec instance
386
struct alc_config_preset {
387
struct snd_kcontrol_new *mixers[5]; /* should be identical size
390
struct snd_kcontrol_new *cap_mixer; /* capture mixer */
391
const struct hda_verb *init_verbs[5];
392
unsigned int num_dacs;
394
hda_nid_t dig_out_nid; /* optional */
395
hda_nid_t hp_nid; /* optional */
396
hda_nid_t *slave_dig_outs;
397
unsigned int num_adc_nids;
399
hda_nid_t *capsrc_nids;
400
hda_nid_t dig_in_nid;
401
unsigned int num_channel_mode;
402
const struct hda_channel_mode *channel_mode;
404
int const_channel_count;
405
unsigned int num_mux_defs;
406
const struct hda_input_mux *input_mux;
407
void (*unsol_event)(struct hda_codec *, unsigned int);
408
void (*setup)(struct hda_codec *);
409
void (*init_hook)(struct hda_codec *);
410
#ifdef CONFIG_SND_HDA_POWER_SAVE
411
struct hda_amp_list *loopbacks;
412
void (*power_hook)(struct hda_codec *codec);
420
static int alc_mux_enum_info(struct snd_kcontrol *kcontrol,
421
struct snd_ctl_elem_info *uinfo)
423
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
424
struct alc_spec *spec = codec->spec;
425
unsigned int mux_idx = snd_ctl_get_ioffidx(kcontrol, &uinfo->id);
426
if (mux_idx >= spec->num_mux_defs)
428
if (!spec->input_mux[mux_idx].num_items && mux_idx > 0)
430
return snd_hda_input_mux_info(&spec->input_mux[mux_idx], uinfo);
433
static int alc_mux_enum_get(struct snd_kcontrol *kcontrol,
434
struct snd_ctl_elem_value *ucontrol)
436
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
437
struct alc_spec *spec = codec->spec;
438
unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
440
ucontrol->value.enumerated.item[0] = spec->cur_mux[adc_idx];
444
static int alc_mux_enum_put(struct snd_kcontrol *kcontrol,
445
struct snd_ctl_elem_value *ucontrol)
447
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
448
struct alc_spec *spec = codec->spec;
449
const struct hda_input_mux *imux;
450
unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
451
unsigned int mux_idx;
452
hda_nid_t nid = spec->capsrc_nids ?
453
spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx];
456
mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx;
457
imux = &spec->input_mux[mux_idx];
458
if (!imux->num_items && mux_idx > 0)
459
imux = &spec->input_mux[0];
461
type = get_wcaps_type(get_wcaps(codec, nid));
462
if (type == AC_WID_AUD_MIX) {
463
/* Matrix-mixer style (e.g. ALC882) */
464
unsigned int *cur_val = &spec->cur_mux[adc_idx];
467
idx = ucontrol->value.enumerated.item[0];
468
if (idx >= imux->num_items)
469
idx = imux->num_items - 1;
472
for (i = 0; i < imux->num_items; i++) {
473
unsigned int v = (i == idx) ? 0 : HDA_AMP_MUTE;
474
snd_hda_codec_amp_stereo(codec, nid, HDA_INPUT,
475
imux->items[i].index,
481
/* MUX style (e.g. ALC880) */
482
return snd_hda_input_mux_put(codec, imux, ucontrol, nid,
483
&spec->cur_mux[adc_idx]);
488
* channel mode setting
490
static int alc_ch_mode_info(struct snd_kcontrol *kcontrol,
491
struct snd_ctl_elem_info *uinfo)
493
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
494
struct alc_spec *spec = codec->spec;
495
return snd_hda_ch_mode_info(codec, uinfo, spec->channel_mode,
496
spec->num_channel_mode);
499
static int alc_ch_mode_get(struct snd_kcontrol *kcontrol,
500
struct snd_ctl_elem_value *ucontrol)
502
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
503
struct alc_spec *spec = codec->spec;
504
return snd_hda_ch_mode_get(codec, ucontrol, spec->channel_mode,
505
spec->num_channel_mode,
506
spec->ext_channel_count);
509
static int alc_ch_mode_put(struct snd_kcontrol *kcontrol,
510
struct snd_ctl_elem_value *ucontrol)
512
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
513
struct alc_spec *spec = codec->spec;
514
int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode,
515
spec->num_channel_mode,
516
&spec->ext_channel_count);
517
if (err >= 0 && !spec->const_channel_count) {
518
spec->multiout.max_channels = spec->ext_channel_count;
519
if (spec->need_dac_fix)
520
spec->multiout.num_dacs = spec->multiout.max_channels / 2;
526
* Control the mode of pin widget settings via the mixer. "pc" is used
527
* instead of "%" to avoid consequences of accidently treating the % as
528
* being part of a format specifier. Maximum allowed length of a value is
529
* 63 characters plus NULL terminator.
531
* Note: some retasking pin complexes seem to ignore requests for input
532
* states other than HiZ (eg: PIN_VREFxx) and revert to HiZ if any of these
533
* are requested. Therefore order this list so that this behaviour will not
534
* cause problems when mixer clients move through the enum sequentially.
535
* NIDs 0x0f and 0x10 have been observed to have this behaviour as of
538
static char *alc_pin_mode_names[] = {
539
"Mic 50pc bias", "Mic 80pc bias",
540
"Line in", "Line out", "Headphone out",
542
static unsigned char alc_pin_mode_values[] = {
543
PIN_VREF50, PIN_VREF80, PIN_IN, PIN_OUT, PIN_HP,
545
/* The control can present all 5 options, or it can limit the options based
546
* in the pin being assumed to be exclusively an input or an output pin. In
547
* addition, "input" pins may or may not process the mic bias option
548
* depending on actual widget capability (NIDs 0x0f and 0x10 don't seem to
549
* accept requests for bias as of chip versions up to March 2006) and/or
550
* wiring in the computer.
552
#define ALC_PIN_DIR_IN 0x00
553
#define ALC_PIN_DIR_OUT 0x01
554
#define ALC_PIN_DIR_INOUT 0x02
555
#define ALC_PIN_DIR_IN_NOMICBIAS 0x03
556
#define ALC_PIN_DIR_INOUT_NOMICBIAS 0x04
558
/* Info about the pin modes supported by the different pin direction modes.
559
* For each direction the minimum and maximum values are given.
561
static signed char alc_pin_mode_dir_info[5][2] = {
562
{ 0, 2 }, /* ALC_PIN_DIR_IN */
563
{ 3, 4 }, /* ALC_PIN_DIR_OUT */
564
{ 0, 4 }, /* ALC_PIN_DIR_INOUT */
565
{ 2, 2 }, /* ALC_PIN_DIR_IN_NOMICBIAS */
566
{ 2, 4 }, /* ALC_PIN_DIR_INOUT_NOMICBIAS */
568
#define alc_pin_mode_min(_dir) (alc_pin_mode_dir_info[_dir][0])
569
#define alc_pin_mode_max(_dir) (alc_pin_mode_dir_info[_dir][1])
570
#define alc_pin_mode_n_items(_dir) \
571
(alc_pin_mode_max(_dir)-alc_pin_mode_min(_dir)+1)
573
static int alc_pin_mode_info(struct snd_kcontrol *kcontrol,
574
struct snd_ctl_elem_info *uinfo)
576
unsigned int item_num = uinfo->value.enumerated.item;
577
unsigned char dir = (kcontrol->private_value >> 16) & 0xff;
579
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
581
uinfo->value.enumerated.items = alc_pin_mode_n_items(dir);
583
if (item_num<alc_pin_mode_min(dir) || item_num>alc_pin_mode_max(dir))
584
item_num = alc_pin_mode_min(dir);
585
strcpy(uinfo->value.enumerated.name, alc_pin_mode_names[item_num]);
589
static int alc_pin_mode_get(struct snd_kcontrol *kcontrol,
590
struct snd_ctl_elem_value *ucontrol)
593
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
594
hda_nid_t nid = kcontrol->private_value & 0xffff;
595
unsigned char dir = (kcontrol->private_value >> 16) & 0xff;
596
long *valp = ucontrol->value.integer.value;
597
unsigned int pinctl = snd_hda_codec_read(codec, nid, 0,
598
AC_VERB_GET_PIN_WIDGET_CONTROL,
601
/* Find enumerated value for current pinctl setting */
602
i = alc_pin_mode_min(dir);
603
while (i <= alc_pin_mode_max(dir) && alc_pin_mode_values[i] != pinctl)
605
*valp = i <= alc_pin_mode_max(dir) ? i: alc_pin_mode_min(dir);
609
static int alc_pin_mode_put(struct snd_kcontrol *kcontrol,
610
struct snd_ctl_elem_value *ucontrol)
613
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
614
hda_nid_t nid = kcontrol->private_value & 0xffff;
615
unsigned char dir = (kcontrol->private_value >> 16) & 0xff;
616
long val = *ucontrol->value.integer.value;
617
unsigned int pinctl = snd_hda_codec_read(codec, nid, 0,
618
AC_VERB_GET_PIN_WIDGET_CONTROL,
621
if (val < alc_pin_mode_min(dir) || val > alc_pin_mode_max(dir))
622
val = alc_pin_mode_min(dir);
624
change = pinctl != alc_pin_mode_values[val];
626
/* Set pin mode to that requested */
627
snd_hda_codec_write_cache(codec, nid, 0,
628
AC_VERB_SET_PIN_WIDGET_CONTROL,
629
alc_pin_mode_values[val]);
631
/* Also enable the retasking pin's input/output as required
632
* for the requested pin mode. Enum values of 2 or less are
635
* Dynamically switching the input/output buffers probably
636
* reduces noise slightly (particularly on input) so we'll
637
* do it. However, having both input and output buffers
638
* enabled simultaneously doesn't seem to be problematic if
639
* this turns out to be necessary in the future.
642
snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0,
643
HDA_AMP_MUTE, HDA_AMP_MUTE);
644
snd_hda_codec_amp_stereo(codec, nid, HDA_INPUT, 0,
647
snd_hda_codec_amp_stereo(codec, nid, HDA_INPUT, 0,
648
HDA_AMP_MUTE, HDA_AMP_MUTE);
649
snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0,
656
#define ALC_PIN_MODE(xname, nid, dir) \
657
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
658
.subdevice = HDA_SUBDEV_NID_FLAG | nid, \
659
.info = alc_pin_mode_info, \
660
.get = alc_pin_mode_get, \
661
.put = alc_pin_mode_put, \
662
.private_value = nid | (dir<<16) }
664
/* A switch control for ALC260 GPIO pins. Multiple GPIOs can be ganged
665
* together using a mask with more than one bit set. This control is
666
* currently used only by the ALC260 test model. At this stage they are not
667
* needed for any "production" models.
669
#ifdef CONFIG_SND_DEBUG
670
#define alc_gpio_data_info snd_ctl_boolean_mono_info
672
static int alc_gpio_data_get(struct snd_kcontrol *kcontrol,
673
struct snd_ctl_elem_value *ucontrol)
675
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
676
hda_nid_t nid = kcontrol->private_value & 0xffff;
677
unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
678
long *valp = ucontrol->value.integer.value;
679
unsigned int val = snd_hda_codec_read(codec, nid, 0,
680
AC_VERB_GET_GPIO_DATA, 0x00);
682
*valp = (val & mask) != 0;
685
static int alc_gpio_data_put(struct snd_kcontrol *kcontrol,
686
struct snd_ctl_elem_value *ucontrol)
689
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
690
hda_nid_t nid = kcontrol->private_value & 0xffff;
691
unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
692
long val = *ucontrol->value.integer.value;
693
unsigned int gpio_data = snd_hda_codec_read(codec, nid, 0,
694
AC_VERB_GET_GPIO_DATA,
697
/* Set/unset the masked GPIO bit(s) as needed */
698
change = (val == 0 ? 0 : mask) != (gpio_data & mask);
703
snd_hda_codec_write_cache(codec, nid, 0,
704
AC_VERB_SET_GPIO_DATA, gpio_data);
708
#define ALC_GPIO_DATA_SWITCH(xname, nid, mask) \
709
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
710
.subdevice = HDA_SUBDEV_NID_FLAG | nid, \
711
.info = alc_gpio_data_info, \
712
.get = alc_gpio_data_get, \
713
.put = alc_gpio_data_put, \
714
.private_value = nid | (mask<<16) }
715
#endif /* CONFIG_SND_DEBUG */
717
/* A switch control to allow the enabling of the digital IO pins on the
718
* ALC260. This is incredibly simplistic; the intention of this control is
719
* to provide something in the test model allowing digital outputs to be
720
* identified if present. If models are found which can utilise these
721
* outputs a more complete mixer control can be devised for those models if
724
#ifdef CONFIG_SND_DEBUG
725
#define alc_spdif_ctrl_info snd_ctl_boolean_mono_info
727
static int alc_spdif_ctrl_get(struct snd_kcontrol *kcontrol,
728
struct snd_ctl_elem_value *ucontrol)
730
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
731
hda_nid_t nid = kcontrol->private_value & 0xffff;
732
unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
733
long *valp = ucontrol->value.integer.value;
734
unsigned int val = snd_hda_codec_read(codec, nid, 0,
735
AC_VERB_GET_DIGI_CONVERT_1, 0x00);
737
*valp = (val & mask) != 0;
740
static int alc_spdif_ctrl_put(struct snd_kcontrol *kcontrol,
741
struct snd_ctl_elem_value *ucontrol)
744
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
745
hda_nid_t nid = kcontrol->private_value & 0xffff;
746
unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
747
long val = *ucontrol->value.integer.value;
748
unsigned int ctrl_data = snd_hda_codec_read(codec, nid, 0,
749
AC_VERB_GET_DIGI_CONVERT_1,
752
/* Set/unset the masked control bit(s) as needed */
753
change = (val == 0 ? 0 : mask) != (ctrl_data & mask);
758
snd_hda_codec_write_cache(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1,
763
#define ALC_SPDIF_CTRL_SWITCH(xname, nid, mask) \
764
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
765
.subdevice = HDA_SUBDEV_NID_FLAG | nid, \
766
.info = alc_spdif_ctrl_info, \
767
.get = alc_spdif_ctrl_get, \
768
.put = alc_spdif_ctrl_put, \
769
.private_value = nid | (mask<<16) }
770
#endif /* CONFIG_SND_DEBUG */
772
/* A switch control to allow the enabling EAPD digital outputs on the ALC26x.
773
* Again, this is only used in the ALC26x test models to help identify when
774
* the EAPD line must be asserted for features to work.
776
#ifdef CONFIG_SND_DEBUG
777
#define alc_eapd_ctrl_info snd_ctl_boolean_mono_info
779
static int alc_eapd_ctrl_get(struct snd_kcontrol *kcontrol,
780
struct snd_ctl_elem_value *ucontrol)
782
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
783
hda_nid_t nid = kcontrol->private_value & 0xffff;
784
unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
785
long *valp = ucontrol->value.integer.value;
786
unsigned int val = snd_hda_codec_read(codec, nid, 0,
787
AC_VERB_GET_EAPD_BTLENABLE, 0x00);
789
*valp = (val & mask) != 0;
793
static int alc_eapd_ctrl_put(struct snd_kcontrol *kcontrol,
794
struct snd_ctl_elem_value *ucontrol)
797
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
798
hda_nid_t nid = kcontrol->private_value & 0xffff;
799
unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
800
long val = *ucontrol->value.integer.value;
801
unsigned int ctrl_data = snd_hda_codec_read(codec, nid, 0,
802
AC_VERB_GET_EAPD_BTLENABLE,
805
/* Set/unset the masked control bit(s) as needed */
806
change = (!val ? 0 : mask) != (ctrl_data & mask);
811
snd_hda_codec_write_cache(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
817
#define ALC_EAPD_CTRL_SWITCH(xname, nid, mask) \
818
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
819
.subdevice = HDA_SUBDEV_NID_FLAG | nid, \
820
.info = alc_eapd_ctrl_info, \
821
.get = alc_eapd_ctrl_get, \
822
.put = alc_eapd_ctrl_put, \
823
.private_value = nid | (mask<<16) }
824
#endif /* CONFIG_SND_DEBUG */
827
* set up the input pin config (depending on the given auto-pin type)
829
static void alc_set_input_pin(struct hda_codec *codec, hda_nid_t nid,
832
unsigned int val = PIN_IN;
834
if (auto_pin_type <= AUTO_PIN_FRONT_MIC) {
836
pincap = snd_hda_query_pin_caps(codec, nid);
837
pincap = (pincap & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT;
838
if (pincap & AC_PINCAP_VREF_80)
840
else if (pincap & AC_PINCAP_VREF_50)
842
else if (pincap & AC_PINCAP_VREF_100)
844
else if (pincap & AC_PINCAP_VREF_GRD)
847
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, val);
852
static void add_mixer(struct alc_spec *spec, struct snd_kcontrol_new *mix)
854
if (snd_BUG_ON(spec->num_mixers >= ARRAY_SIZE(spec->mixers)))
856
spec->mixers[spec->num_mixers++] = mix;
859
static void add_verb(struct alc_spec *spec, const struct hda_verb *verb)
861
if (snd_BUG_ON(spec->num_init_verbs >= ARRAY_SIZE(spec->init_verbs)))
863
spec->init_verbs[spec->num_init_verbs++] = verb;
867
* set up from the preset table
869
static void setup_preset(struct hda_codec *codec,
870
const struct alc_config_preset *preset)
872
struct alc_spec *spec = codec->spec;
875
for (i = 0; i < ARRAY_SIZE(preset->mixers) && preset->mixers[i]; i++)
876
add_mixer(spec, preset->mixers[i]);
877
spec->cap_mixer = preset->cap_mixer;
878
for (i = 0; i < ARRAY_SIZE(preset->init_verbs) && preset->init_verbs[i];
880
add_verb(spec, preset->init_verbs[i]);
882
spec->channel_mode = preset->channel_mode;
883
spec->num_channel_mode = preset->num_channel_mode;
884
spec->need_dac_fix = preset->need_dac_fix;
885
spec->const_channel_count = preset->const_channel_count;
887
if (preset->const_channel_count)
888
spec->multiout.max_channels = preset->const_channel_count;
890
spec->multiout.max_channels = spec->channel_mode[0].channels;
891
spec->ext_channel_count = spec->channel_mode[0].channels;
893
spec->multiout.num_dacs = preset->num_dacs;
894
spec->multiout.dac_nids = preset->dac_nids;
895
spec->multiout.dig_out_nid = preset->dig_out_nid;
896
spec->multiout.slave_dig_outs = preset->slave_dig_outs;
897
spec->multiout.hp_nid = preset->hp_nid;
899
spec->num_mux_defs = preset->num_mux_defs;
900
if (!spec->num_mux_defs)
901
spec->num_mux_defs = 1;
902
spec->input_mux = preset->input_mux;
904
spec->num_adc_nids = preset->num_adc_nids;
905
spec->adc_nids = preset->adc_nids;
906
spec->capsrc_nids = preset->capsrc_nids;
907
spec->dig_in_nid = preset->dig_in_nid;
909
spec->unsol_event = preset->unsol_event;
910
spec->init_hook = preset->init_hook;
911
#ifdef CONFIG_SND_HDA_POWER_SAVE
912
spec->power_hook = preset->power_hook;
913
spec->loopback.amplist = preset->loopbacks;
917
preset->setup(codec);
920
/* Enable GPIO mask and set output */
921
static struct hda_verb alc_gpio1_init_verbs[] = {
922
{0x01, AC_VERB_SET_GPIO_MASK, 0x01},
923
{0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01},
924
{0x01, AC_VERB_SET_GPIO_DATA, 0x01},
928
static struct hda_verb alc_gpio2_init_verbs[] = {
929
{0x01, AC_VERB_SET_GPIO_MASK, 0x02},
930
{0x01, AC_VERB_SET_GPIO_DIRECTION, 0x02},
931
{0x01, AC_VERB_SET_GPIO_DATA, 0x02},
935
static struct hda_verb alc_gpio3_init_verbs[] = {
936
{0x01, AC_VERB_SET_GPIO_MASK, 0x03},
937
{0x01, AC_VERB_SET_GPIO_DIRECTION, 0x03},
938
{0x01, AC_VERB_SET_GPIO_DATA, 0x03},
943
* Fix hardware PLL issue
944
* On some codecs, the analog PLL gating control must be off while
945
* the default value is 1.
947
static void alc_fix_pll(struct hda_codec *codec)
949
struct alc_spec *spec = codec->spec;
954
snd_hda_codec_write(codec, spec->pll_nid, 0, AC_VERB_SET_COEF_INDEX,
956
val = snd_hda_codec_read(codec, spec->pll_nid, 0,
957
AC_VERB_GET_PROC_COEF, 0);
958
snd_hda_codec_write(codec, spec->pll_nid, 0, AC_VERB_SET_COEF_INDEX,
960
snd_hda_codec_write(codec, spec->pll_nid, 0, AC_VERB_SET_PROC_COEF,
961
val & ~(1 << spec->pll_coef_bit));
964
static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
965
unsigned int coef_idx, unsigned int coef_bit)
967
struct alc_spec *spec = codec->spec;
969
spec->pll_coef_idx = coef_idx;
970
spec->pll_coef_bit = coef_bit;
974
static void alc_automute_pin(struct hda_codec *codec)
976
struct alc_spec *spec = codec->spec;
977
unsigned int nid = spec->autocfg.hp_pins[0];
982
spec->jack_present = snd_hda_jack_detect(codec, nid);
983
for (i = 0; i < ARRAY_SIZE(spec->autocfg.speaker_pins); i++) {
984
nid = spec->autocfg.speaker_pins[i];
987
snd_hda_codec_write(codec, nid, 0,
988
AC_VERB_SET_PIN_WIDGET_CONTROL,
989
spec->jack_present ? 0 : PIN_OUT);
993
static int get_connection_index(struct hda_codec *codec, hda_nid_t mux,
996
hda_nid_t conn[HDA_MAX_NUM_INPUTS];
999
nums = snd_hda_get_connections(codec, mux, conn, ARRAY_SIZE(conn));
1000
for (i = 0; i < nums; i++)
1006
static void alc_mic_automute(struct hda_codec *codec)
1008
struct alc_spec *spec = codec->spec;
1009
struct alc_mic_route *dead, *alive;
1010
unsigned int present, type;
1013
if (!spec->auto_mic)
1015
if (!spec->int_mic.pin || !spec->ext_mic.pin)
1017
if (snd_BUG_ON(!spec->adc_nids))
1020
cap_nid = spec->capsrc_nids ? spec->capsrc_nids[0] : spec->adc_nids[0];
1022
present = snd_hda_jack_detect(codec, spec->ext_mic.pin);
1024
alive = &spec->ext_mic;
1025
dead = &spec->int_mic;
1027
alive = &spec->int_mic;
1028
dead = &spec->ext_mic;
1031
type = get_wcaps_type(get_wcaps(codec, cap_nid));
1032
if (type == AC_WID_AUD_MIX) {
1033
/* Matrix-mixer style (e.g. ALC882) */
1034
snd_hda_codec_amp_stereo(codec, cap_nid, HDA_INPUT,
1037
snd_hda_codec_amp_stereo(codec, cap_nid, HDA_INPUT,
1039
HDA_AMP_MUTE, HDA_AMP_MUTE);
1041
/* MUX style (e.g. ALC880) */
1042
snd_hda_codec_write_cache(codec, cap_nid, 0,
1043
AC_VERB_SET_CONNECT_SEL,
1047
/* FIXME: analog mixer */
1050
/* unsolicited event for HP jack sensing */
1051
static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res)
1053
if (codec->vendor_id == 0x10ec0880)
1058
case ALC880_HP_EVENT:
1059
alc_automute_pin(codec);
1061
case ALC880_MIC_EVENT:
1062
alc_mic_automute(codec);
1067
static void alc_inithook(struct hda_codec *codec)
1069
alc_automute_pin(codec);
1070
alc_mic_automute(codec);
1073
/* additional initialization for ALC888 variants */
1074
static void alc888_coef_init(struct hda_codec *codec)
1078
snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0);
1079
tmp = snd_hda_codec_read(codec, 0x20, 0, AC_VERB_GET_PROC_COEF, 0);
1080
snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 7);
1081
if ((tmp & 0xf0) == 0x20)
1083
snd_hda_codec_read(codec, 0x20, 0,
1084
AC_VERB_SET_PROC_COEF, 0x830);
1087
snd_hda_codec_read(codec, 0x20, 0,
1088
AC_VERB_SET_PROC_COEF, 0x3030);
1091
static void alc889_coef_init(struct hda_codec *codec)
1095
snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 7);
1096
tmp = snd_hda_codec_read(codec, 0x20, 0, AC_VERB_GET_PROC_COEF, 0);
1097
snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 7);
1098
snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, tmp|0x2010);
1101
/* turn on/off EAPD control (only if available) */
1102
static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
1104
if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
1106
if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
1107
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
1111
static void alc_auto_init_amp(struct hda_codec *codec, int type)
1116
case ALC_INIT_GPIO1:
1117
snd_hda_sequence_write(codec, alc_gpio1_init_verbs);
1119
case ALC_INIT_GPIO2:
1120
snd_hda_sequence_write(codec, alc_gpio2_init_verbs);
1122
case ALC_INIT_GPIO3:
1123
snd_hda_sequence_write(codec, alc_gpio3_init_verbs);
1125
case ALC_INIT_DEFAULT:
1126
switch (codec->vendor_id) {
1128
set_eapd(codec, 0x0f, 1);
1129
set_eapd(codec, 0x10, 1);
1142
set_eapd(codec, 0x14, 1);
1143
set_eapd(codec, 0x15, 1);
1146
switch (codec->vendor_id) {
1148
snd_hda_codec_write(codec, 0x1a, 0,
1149
AC_VERB_SET_COEF_INDEX, 7);
1150
tmp = snd_hda_codec_read(codec, 0x1a, 0,
1151
AC_VERB_GET_PROC_COEF, 0);
1152
snd_hda_codec_write(codec, 0x1a, 0,
1153
AC_VERB_SET_COEF_INDEX, 7);
1154
snd_hda_codec_write(codec, 0x1a, 0,
1155
AC_VERB_SET_PROC_COEF,
1165
alc889_coef_init(codec);
1168
alc888_coef_init(codec);
1170
#if 0 /* XXX: This may cause the silent output on speaker on some machines */
1173
snd_hda_codec_write(codec, 0x20, 0,
1174
AC_VERB_SET_COEF_INDEX, 7);
1175
tmp = snd_hda_codec_read(codec, 0x20, 0,
1176
AC_VERB_GET_PROC_COEF, 0);
1177
snd_hda_codec_write(codec, 0x20, 0,
1178
AC_VERB_SET_COEF_INDEX, 7);
1179
snd_hda_codec_write(codec, 0x20, 0,
1180
AC_VERB_SET_PROC_COEF,
1189
static void alc_init_auto_hp(struct hda_codec *codec)
1191
struct alc_spec *spec = codec->spec;
1193
if (!spec->autocfg.hp_pins[0])
1196
if (!spec->autocfg.speaker_pins[0]) {
1197
if (spec->autocfg.line_out_pins[0] &&
1198
spec->autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT)
1199
spec->autocfg.speaker_pins[0] =
1200
spec->autocfg.line_out_pins[0];
1205
snd_printdd("realtek: Enable HP auto-muting on NID 0x%x\n",
1206
spec->autocfg.hp_pins[0]);
1207
snd_hda_codec_write_cache(codec, spec->autocfg.hp_pins[0], 0,
1208
AC_VERB_SET_UNSOLICITED_ENABLE,
1209
AC_USRSP_EN | ALC880_HP_EVENT);
1210
spec->unsol_event = alc_sku_unsol_event;
1213
static void alc_init_auto_mic(struct hda_codec *codec)
1215
struct alc_spec *spec = codec->spec;
1216
struct auto_pin_cfg *cfg = &spec->autocfg;
1217
hda_nid_t fixed, ext;
1220
/* there must be only two mic inputs exclusively */
1221
for (i = AUTO_PIN_LINE; i < AUTO_PIN_LAST; i++)
1222
if (cfg->input_pins[i])
1226
for (i = AUTO_PIN_MIC; i <= AUTO_PIN_FRONT_MIC; i++) {
1227
hda_nid_t nid = cfg->input_pins[i];
1228
unsigned int defcfg;
1231
defcfg = snd_hda_codec_get_pincfg(codec, nid);
1232
switch (get_defcfg_connect(defcfg)) {
1233
case AC_JACK_PORT_FIXED:
1235
return; /* already occupied */
1238
case AC_JACK_PORT_COMPLEX:
1240
return; /* already occupied */
1244
return; /* invalid entry */
1249
if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP))
1250
return; /* no unsol support */
1251
snd_printdd("realtek: Enable auto-mic switch on NID 0x%x/0x%x\n",
1253
spec->ext_mic.pin = ext;
1254
spec->int_mic.pin = fixed;
1255
spec->ext_mic.mux_idx = MUX_IDX_UNDEF; /* set later */
1256
spec->int_mic.mux_idx = MUX_IDX_UNDEF; /* set later */
1258
snd_hda_codec_write_cache(codec, spec->ext_mic.pin, 0,
1259
AC_VERB_SET_UNSOLICITED_ENABLE,
1260
AC_USRSP_EN | ALC880_MIC_EVENT);
1261
spec->unsol_event = alc_sku_unsol_event;
1264
static int alc_auto_parse_customize_define(struct hda_codec *codec)
1266
unsigned int ass, tmp, i;
1268
struct alc_spec *spec = codec->spec;
1270
spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
1272
ass = codec->subsystem_id & 0xffff;
1273
if (ass != codec->bus->pci->subsystem_device && (ass & 1))
1277
if (codec->vendor_id == 0x10ec0260)
1279
ass = snd_hda_codec_get_pincfg(codec, nid);
1282
printk(KERN_INFO "hda_codec: %s: SKU not ready 0x%08x\n",
1283
codec->chip_name, ass);
1289
for (i = 1; i < 16; i++) {
1293
if (((ass >> 16) & 0xf) != tmp)
1296
spec->cdefine.port_connectivity = ass >> 30;
1297
spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
1298
spec->cdefine.check_sum = (ass >> 16) & 0xf;
1299
spec->cdefine.customization = ass >> 8;
1301
spec->cdefine.sku_cfg = ass;
1302
spec->cdefine.external_amp = (ass & 0x38) >> 3;
1303
spec->cdefine.platform_type = (ass & 0x4) >> 2;
1304
spec->cdefine.swap = (ass & 0x2) >> 1;
1305
spec->cdefine.override = ass & 0x1;
1307
snd_printd("SKU: Nid=0x%x sku_cfg=0x%08x\n",
1308
nid, spec->cdefine.sku_cfg);
1309
snd_printd("SKU: port_connectivity=0x%x\n",
1310
spec->cdefine.port_connectivity);
1311
snd_printd("SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
1312
snd_printd("SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
1313
snd_printd("SKU: customization=0x%08x\n", spec->cdefine.customization);
1314
snd_printd("SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
1315
snd_printd("SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
1316
snd_printd("SKU: swap=0x%x\n", spec->cdefine.swap);
1317
snd_printd("SKU: override=0x%x\n", spec->cdefine.override);
1322
/* check subsystem ID and set up device-specific initialization;
1323
* return 1 if initialized, 0 if invalid SSID
1325
/* 32-bit subsystem ID for BIOS loading in HD Audio codec.
1326
* 31 ~ 16 : Manufacture ID
1328
* 7 ~ 0 : Assembly ID
1329
* port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
1331
static int alc_subsystem_id(struct hda_codec *codec,
1332
hda_nid_t porta, hda_nid_t porte,
1333
hda_nid_t portd, hda_nid_t porti)
1335
unsigned int ass, tmp, i;
1337
struct alc_spec *spec = codec->spec;
1339
ass = codec->subsystem_id & 0xffff;
1340
if ((ass != codec->bus->pci->subsystem_device) && (ass & 1))
1343
/* invalid SSID, check the special NID pin defcfg instead */
1345
* 31~30 : port connectivity
1348
* 19~16 : Check sum (15:1)
1353
if (codec->vendor_id == 0x10ec0260)
1355
ass = snd_hda_codec_get_pincfg(codec, nid);
1356
snd_printd("realtek: No valid SSID, "
1357
"checking pincfg 0x%08x for NID 0x%x\n",
1361
if ((ass >> 30) != 1) /* no physical connection */
1366
for (i = 1; i < 16; i++) {
1370
if (((ass >> 16) & 0xf) != tmp)
1373
snd_printd("realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
1374
ass & 0xffff, codec->vendor_id);
1378
* 2 : 0 --> Desktop, 1 --> Laptop
1379
* 3~5 : External Amplifier control
1382
tmp = (ass & 0x38) >> 3; /* external Amp control */
1385
spec->init_amp = ALC_INIT_GPIO1;
1388
spec->init_amp = ALC_INIT_GPIO2;
1391
spec->init_amp = ALC_INIT_GPIO3;
1395
spec->init_amp = ALC_INIT_DEFAULT;
1399
/* is laptop or Desktop and enable the function "Mute internal speaker
1400
* when the external headphone out jack is plugged"
1402
if (!(ass & 0x8000))
1405
* 10~8 : Jack location
1406
* 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
1408
* 15 : 1 --> enable the function "Mute internal speaker
1409
* when the external headphone out jack is plugged"
1411
if (!spec->autocfg.hp_pins[0]) {
1413
tmp = (ass >> 11) & 0x3; /* HP to chassis */
1424
for (i = 0; i < spec->autocfg.line_outs; i++)
1425
if (spec->autocfg.line_out_pins[i] == nid)
1427
spec->autocfg.hp_pins[0] = nid;
1430
alc_init_auto_hp(codec);
1431
alc_init_auto_mic(codec);
1435
static void alc_ssid_check(struct hda_codec *codec,
1436
hda_nid_t porta, hda_nid_t porte,
1437
hda_nid_t portd, hda_nid_t porti)
1439
if (!alc_subsystem_id(codec, porta, porte, portd, porti)) {
1440
struct alc_spec *spec = codec->spec;
1441
snd_printd("realtek: "
1442
"Enable default setup for auto mode as fallback\n");
1443
spec->init_amp = ALC_INIT_DEFAULT;
1444
alc_init_auto_hp(codec);
1445
alc_init_auto_mic(codec);
1450
* Fix-up pin default configurations and add default verbs
1459
const struct alc_pincfg *pins;
1460
const struct hda_verb *verbs;
1463
static void alc_pick_fixup(struct hda_codec *codec,
1464
const struct snd_pci_quirk *quirk,
1465
const struct alc_fixup *fix,
1468
const struct alc_pincfg *cfg;
1470
quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk);
1473
fix += quirk->value;
1475
if (pre_init && cfg) {
1476
#ifdef CONFIG_SND_DEBUG_VERBOSE
1477
snd_printdd(KERN_INFO "hda_codec: %s: Apply pincfg for %s\n",
1478
codec->chip_name, quirk->name);
1480
for (; cfg->nid; cfg++)
1481
snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val);
1483
if (!pre_init && fix->verbs) {
1484
#ifdef CONFIG_SND_DEBUG_VERBOSE
1485
snd_printdd(KERN_INFO "hda_codec: %s: Apply fix-verbs for %s\n",
1486
codec->chip_name, quirk->name);
1488
add_verb(codec->spec, fix->verbs);
1492
static int alc_read_coef_idx(struct hda_codec *codec,
1493
unsigned int coef_idx)
1496
snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX,
1498
val = snd_hda_codec_read(codec, 0x20, 0,
1499
AC_VERB_GET_PROC_COEF, 0);
1510
static struct hda_verb alc888_4ST_ch2_intel_init[] = {
1511
/* Mic-in jack as mic in */
1512
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
1513
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
1514
/* Line-in jack as Line in */
1515
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
1516
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
1517
/* Line-Out as Front */
1518
{ 0x17, AC_VERB_SET_CONNECT_SEL, 0x00},
1525
static struct hda_verb alc888_4ST_ch4_intel_init[] = {
1526
/* Mic-in jack as mic in */
1527
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
1528
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
1529
/* Line-in jack as Surround */
1530
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1531
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
1532
/* Line-Out as Front */
1533
{ 0x17, AC_VERB_SET_CONNECT_SEL, 0x00},
1540
static struct hda_verb alc888_4ST_ch6_intel_init[] = {
1541
/* Mic-in jack as CLFE */
1542
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1543
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
1544
/* Line-in jack as Surround */
1545
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1546
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
1547
/* Line-Out as CLFE (workaround because Mic-in is not loud enough) */
1548
{ 0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
1555
static struct hda_verb alc888_4ST_ch8_intel_init[] = {
1556
/* Mic-in jack as CLFE */
1557
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1558
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
1559
/* Line-in jack as Surround */
1560
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1561
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
1562
/* Line-Out as Side */
1563
{ 0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
1567
static struct hda_channel_mode alc888_4ST_8ch_intel_modes[4] = {
1568
{ 2, alc888_4ST_ch2_intel_init },
1569
{ 4, alc888_4ST_ch4_intel_init },
1570
{ 6, alc888_4ST_ch6_intel_init },
1571
{ 8, alc888_4ST_ch8_intel_init },
1575
* ALC888 Fujitsu Siemens Amillo xa3530
1578
static struct hda_verb alc888_fujitsu_xa3530_verbs[] = {
1579
/* Front Mic: set to PIN_IN (empty by default) */
1580
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1581
/* Connect Internal HP to Front */
1582
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1583
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1584
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1585
/* Connect Bass HP to Front */
1586
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1587
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1588
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
1589
/* Connect Line-Out side jack (SPDIF) to Side */
1590
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1591
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1592
{0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
1593
/* Connect Mic jack to CLFE */
1594
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1595
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1596
{0x18, AC_VERB_SET_CONNECT_SEL, 0x02},
1597
/* Connect Line-in jack to Surround */
1598
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1599
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1600
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x01},
1601
/* Connect HP out jack to Front */
1602
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1603
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1604
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
1605
/* Enable unsolicited event for HP jack and Line-out jack */
1606
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
1607
{0x17, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
1611
static void alc_automute_amp(struct hda_codec *codec)
1613
struct alc_spec *spec = codec->spec;
1618
spec->jack_present = 0;
1619
for (i = 0; i < ARRAY_SIZE(spec->autocfg.hp_pins); i++) {
1620
nid = spec->autocfg.hp_pins[i];
1623
if (snd_hda_jack_detect(codec, nid)) {
1624
spec->jack_present = 1;
1629
mute = spec->jack_present ? HDA_AMP_MUTE : 0;
1630
/* Toggle internal speakers muting */
1631
for (i = 0; i < ARRAY_SIZE(spec->autocfg.speaker_pins); i++) {
1632
nid = spec->autocfg.speaker_pins[i];
1635
snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0,
1636
HDA_AMP_MUTE, mute);
1640
static void alc_automute_amp_unsol_event(struct hda_codec *codec,
1643
if (codec->vendor_id == 0x10ec0880)
1647
if (res == ALC880_HP_EVENT)
1648
alc_automute_amp(codec);
1651
static void alc889_automute_setup(struct hda_codec *codec)
1653
struct alc_spec *spec = codec->spec;
1655
spec->autocfg.hp_pins[0] = 0x15;
1656
spec->autocfg.speaker_pins[0] = 0x14;
1657
spec->autocfg.speaker_pins[1] = 0x16;
1658
spec->autocfg.speaker_pins[2] = 0x17;
1659
spec->autocfg.speaker_pins[3] = 0x19;
1660
spec->autocfg.speaker_pins[4] = 0x1a;
1663
static void alc889_intel_init_hook(struct hda_codec *codec)
1665
alc889_coef_init(codec);
1666
alc_automute_amp(codec);
1669
static void alc888_fujitsu_xa3530_setup(struct hda_codec *codec)
1671
struct alc_spec *spec = codec->spec;
1673
spec->autocfg.hp_pins[0] = 0x17; /* line-out */
1674
spec->autocfg.hp_pins[1] = 0x1b; /* hp */
1675
spec->autocfg.speaker_pins[0] = 0x14; /* speaker */
1676
spec->autocfg.speaker_pins[1] = 0x15; /* bass */
1680
* ALC888 Acer Aspire 4930G model
1683
static struct hda_verb alc888_acer_aspire_4930g_verbs[] = {
1684
/* Front Mic: set to PIN_IN (empty by default) */
1685
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1686
/* Unselect Front Mic by default in input mixer 3 */
1687
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
1688
/* Enable unsolicited event for HP jack */
1689
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
1690
/* Connect Internal HP to front */
1691
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1692
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1693
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1694
/* Connect HP out to front */
1695
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1696
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1697
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
1702
* ALC888 Acer Aspire 6530G model
1705
static struct hda_verb alc888_acer_aspire_6530g_verbs[] = {
1706
/* Route to built-in subwoofer as well as speakers */
1707
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1708
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1709
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1710
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1711
/* Bias voltage on for external mic port */
1712
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80},
1713
/* Front Mic: set to PIN_IN (empty by default) */
1714
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1715
/* Unselect Front Mic by default in input mixer 3 */
1716
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
1717
/* Enable unsolicited event for HP jack */
1718
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
1719
/* Enable speaker output */
1720
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1721
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1722
{0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
1723
/* Enable headphone output */
1724
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP},
1725
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1726
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
1727
{0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
1732
* ALC889 Acer Aspire 8930G model
1735
static struct hda_verb alc889_acer_aspire_8930g_verbs[] = {
1736
/* Front Mic: set to PIN_IN (empty by default) */
1737
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1738
/* Unselect Front Mic by default in input mixer 3 */
1739
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
1740
/* Enable unsolicited event for HP jack */
1741
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
1742
/* Connect Internal Front to Front */
1743
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1744
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1745
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1746
/* Connect Internal Rear to Rear */
1747
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1748
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1749
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x01},
1750
/* Connect Internal CLFE to CLFE */
1751
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1752
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1753
{0x16, AC_VERB_SET_CONNECT_SEL, 0x02},
1754
/* Connect HP out to Front */
1755
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP},
1756
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1757
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
1758
/* Enable all DACs */
1759
/* DAC DISABLE/MUTE 1? */
1760
/* setting bits 1-5 disables DAC nids 0x02-0x06 apparently. Init=0x38 */
1761
{0x20, AC_VERB_SET_COEF_INDEX, 0x03},
1762
{0x20, AC_VERB_SET_PROC_COEF, 0x0000},
1763
/* DAC DISABLE/MUTE 2? */
1764
/* some bit here disables the other DACs. Init=0x4900 */
1765
{0x20, AC_VERB_SET_COEF_INDEX, 0x08},
1766
{0x20, AC_VERB_SET_PROC_COEF, 0x0000},
1768
* This laptop has a stereo digital microphone. The mics are only 1cm apart
1769
* which makes the stereo useless. However, either the mic or the ALC889
1770
* makes the signal become a difference/sum signal instead of standard
1771
* stereo, which is annoying. So instead we flip this bit which makes the
1772
* codec replicate the sum signal to both channels, turning it into a
1775
/* DMIC_CONTROL? Init value = 0x0001 */
1776
{0x20, AC_VERB_SET_COEF_INDEX, 0x0b},
1777
{0x20, AC_VERB_SET_PROC_COEF, 0x0003},
1781
static struct hda_input_mux alc888_2_capture_sources[2] = {
1782
/* Front mic only available on one ADC */
1789
{ "Front Mic", 0xb },
1802
static struct hda_input_mux alc888_acer_aspire_6530_sources[2] = {
1803
/* Interal mic only available on one ADC */
1810
{ "Input Mix", 0xa },
1820
{ "Input Mix", 0xa },
1825
static struct hda_input_mux alc889_capture_sources[3] = {
1826
/* Digital mic only available on first "ADC" */
1833
{ "Front Mic", 0xb },
1834
{ "Input Mix", 0xa },
1843
{ "Input Mix", 0xa },
1852
{ "Input Mix", 0xa },
1857
static struct snd_kcontrol_new alc888_base_mixer[] = {
1858
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1859
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1860
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
1861
HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
1862
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
1864
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
1865
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
1866
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
1867
HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
1868
HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
1869
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1870
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1871
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1872
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1873
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1874
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
1875
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1879
static struct snd_kcontrol_new alc889_acer_aspire_8930g_mixer[] = {
1880
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1881
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1882
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
1883
HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
1884
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
1886
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
1887
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
1888
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
1889
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1890
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1891
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1892
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
1893
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1898
static void alc888_acer_aspire_4930g_setup(struct hda_codec *codec)
1900
struct alc_spec *spec = codec->spec;
1902
spec->autocfg.hp_pins[0] = 0x15;
1903
spec->autocfg.speaker_pins[0] = 0x14;
1904
spec->autocfg.speaker_pins[1] = 0x16;
1905
spec->autocfg.speaker_pins[2] = 0x17;
1908
static void alc888_acer_aspire_6530g_setup(struct hda_codec *codec)
1910
struct alc_spec *spec = codec->spec;
1912
spec->autocfg.hp_pins[0] = 0x15;
1913
spec->autocfg.speaker_pins[0] = 0x14;
1914
spec->autocfg.speaker_pins[1] = 0x16;
1915
spec->autocfg.speaker_pins[2] = 0x17;
1918
static void alc889_acer_aspire_8930g_setup(struct hda_codec *codec)
1920
struct alc_spec *spec = codec->spec;
1922
spec->autocfg.hp_pins[0] = 0x15;
1923
spec->autocfg.speaker_pins[0] = 0x14;
1924
spec->autocfg.speaker_pins[1] = 0x16;
1925
spec->autocfg.speaker_pins[2] = 0x1b;
1929
* ALC880 3-stack model
1931
* DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0e)
1932
* Pin assignment: Front = 0x14, Line-In/Surr = 0x1a, Mic/CLFE = 0x18,
1933
* F-Mic = 0x1b, HP = 0x19
1936
static hda_nid_t alc880_dac_nids[4] = {
1937
/* front, rear, clfe, rear_surr */
1938
0x02, 0x05, 0x04, 0x03
1941
static hda_nid_t alc880_adc_nids[3] = {
1946
/* The datasheet says the node 0x07 is connected from inputs,
1947
* but it shows zero connection in the real implementation on some devices.
1948
* Note: this is a 915GAV bug, fixed on 915GLV
1950
static hda_nid_t alc880_adc_nids_alt[2] = {
1955
#define ALC880_DIGOUT_NID 0x06
1956
#define ALC880_DIGIN_NID 0x0a
1958
static struct hda_input_mux alc880_capture_source = {
1962
{ "Front Mic", 0x3 },
1968
/* channel source setting (2/6 channel selection for 3-stack) */
1970
static struct hda_verb alc880_threestack_ch2_init[] = {
1971
/* set line-in to input, mute it */
1972
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
1973
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
1974
/* set mic-in to input vref 80%, mute it */
1975
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
1976
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
1981
static struct hda_verb alc880_threestack_ch6_init[] = {
1982
/* set line-in to output, unmute it */
1983
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1984
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
1985
/* set mic-in to output, unmute it */
1986
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1987
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
1991
static struct hda_channel_mode alc880_threestack_modes[2] = {
1992
{ 2, alc880_threestack_ch2_init },
1993
{ 6, alc880_threestack_ch6_init },
1996
static struct snd_kcontrol_new alc880_three_stack_mixer[] = {
1997
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1998
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1999
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
2000
HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT),
2001
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
2002
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
2003
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
2004
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
2005
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
2006
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
2007
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
2008
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
2009
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2010
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2011
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x3, HDA_INPUT),
2012
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x3, HDA_INPUT),
2013
HDA_CODEC_MUTE("Headphone Playback Switch", 0x19, 0x0, HDA_OUTPUT),
2015
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2016
.name = "Channel Mode",
2017
.info = alc_ch_mode_info,
2018
.get = alc_ch_mode_get,
2019
.put = alc_ch_mode_put,
2024
/* capture mixer elements */
2025
static int alc_cap_vol_info(struct snd_kcontrol *kcontrol,
2026
struct snd_ctl_elem_info *uinfo)
2028
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2029
struct alc_spec *spec = codec->spec;
2032
mutex_lock(&codec->control_mutex);
2033
kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0,
2035
err = snd_hda_mixer_amp_volume_info(kcontrol, uinfo);
2036
mutex_unlock(&codec->control_mutex);
2040
static int alc_cap_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag,
2041
unsigned int size, unsigned int __user *tlv)
2043
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2044
struct alc_spec *spec = codec->spec;
2047
mutex_lock(&codec->control_mutex);
2048
kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0,
2050
err = snd_hda_mixer_amp_tlv(kcontrol, op_flag, size, tlv);
2051
mutex_unlock(&codec->control_mutex);
2055
typedef int (*getput_call_t)(struct snd_kcontrol *kcontrol,
2056
struct snd_ctl_elem_value *ucontrol);
2058
static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol,
2059
struct snd_ctl_elem_value *ucontrol,
2062
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2063
struct alc_spec *spec = codec->spec;
2064
unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
2067
mutex_lock(&codec->control_mutex);
2068
kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx],
2070
err = func(kcontrol, ucontrol);
2071
mutex_unlock(&codec->control_mutex);
2075
static int alc_cap_vol_get(struct snd_kcontrol *kcontrol,
2076
struct snd_ctl_elem_value *ucontrol)
2078
return alc_cap_getput_caller(kcontrol, ucontrol,
2079
snd_hda_mixer_amp_volume_get);
2082
static int alc_cap_vol_put(struct snd_kcontrol *kcontrol,
2083
struct snd_ctl_elem_value *ucontrol)
2085
return alc_cap_getput_caller(kcontrol, ucontrol,
2086
snd_hda_mixer_amp_volume_put);
2089
/* capture mixer elements */
2090
#define alc_cap_sw_info snd_ctl_boolean_stereo_info
2092
static int alc_cap_sw_get(struct snd_kcontrol *kcontrol,
2093
struct snd_ctl_elem_value *ucontrol)
2095
return alc_cap_getput_caller(kcontrol, ucontrol,
2096
snd_hda_mixer_amp_switch_get);
2099
static int alc_cap_sw_put(struct snd_kcontrol *kcontrol,
2100
struct snd_ctl_elem_value *ucontrol)
2102
return alc_cap_getput_caller(kcontrol, ucontrol,
2103
snd_hda_mixer_amp_switch_put);
2106
#define _DEFINE_CAPMIX(num) \
2108
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
2109
.name = "Capture Switch", \
2110
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
2112
.info = alc_cap_sw_info, \
2113
.get = alc_cap_sw_get, \
2114
.put = alc_cap_sw_put, \
2117
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
2118
.name = "Capture Volume", \
2119
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | \
2120
SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
2121
SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK), \
2123
.info = alc_cap_vol_info, \
2124
.get = alc_cap_vol_get, \
2125
.put = alc_cap_vol_put, \
2126
.tlv = { .c = alc_cap_vol_tlv }, \
2129
#define _DEFINE_CAPSRC(num) \
2131
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
2132
/* .name = "Capture Source", */ \
2133
.name = "Input Source", \
2135
.info = alc_mux_enum_info, \
2136
.get = alc_mux_enum_get, \
2137
.put = alc_mux_enum_put, \
2140
#define DEFINE_CAPMIX(num) \
2141
static struct snd_kcontrol_new alc_capture_mixer ## num[] = { \
2142
_DEFINE_CAPMIX(num), \
2143
_DEFINE_CAPSRC(num), \
2147
#define DEFINE_CAPMIX_NOSRC(num) \
2148
static struct snd_kcontrol_new alc_capture_mixer_nosrc ## num[] = { \
2149
_DEFINE_CAPMIX(num), \
2153
/* up to three ADCs */
2157
DEFINE_CAPMIX_NOSRC(1);
2158
DEFINE_CAPMIX_NOSRC(2);
2159
DEFINE_CAPMIX_NOSRC(3);
2162
* ALC880 5-stack model
2164
* DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0d),
2166
* Pin assignment: Front = 0x14, Surr = 0x17, CLFE = 0x16
2167
* Line-In/Side = 0x1a, Mic = 0x18, F-Mic = 0x1b, HP = 0x19
2170
/* additional mixers to alc880_three_stack_mixer */
2171
static struct snd_kcontrol_new alc880_five_stack_mixer[] = {
2172
HDA_CODEC_VOLUME("Side Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
2173
HDA_BIND_MUTE("Side Playback Switch", 0x0d, 2, HDA_INPUT),
2177
/* channel source setting (6/8 channel selection for 5-stack) */
2179
static struct hda_verb alc880_fivestack_ch6_init[] = {
2180
/* set line-in to input, mute it */
2181
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
2182
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
2187
static struct hda_verb alc880_fivestack_ch8_init[] = {
2188
/* set line-in to output, unmute it */
2189
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
2190
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
2194
static struct hda_channel_mode alc880_fivestack_modes[2] = {
2195
{ 6, alc880_fivestack_ch6_init },
2196
{ 8, alc880_fivestack_ch8_init },
2201
* ALC880 6-stack model
2203
* DAC: Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e),
2204
* Side = 0x05 (0x0f)
2205
* Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, Side = 0x17,
2206
* Mic = 0x18, F-Mic = 0x19, Line = 0x1a, HP = 0x1b
2209
static hda_nid_t alc880_6st_dac_nids[4] = {
2210
/* front, rear, clfe, rear_surr */
2211
0x02, 0x03, 0x04, 0x05
2214
static struct hda_input_mux alc880_6stack_capture_source = {
2218
{ "Front Mic", 0x1 },
2224
/* fixed 8-channels */
2225
static struct hda_channel_mode alc880_sixstack_modes[1] = {
2229
static struct snd_kcontrol_new alc880_six_stack_mixer[] = {
2230
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2231
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
2232
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
2233
HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
2234
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
2235
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
2236
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
2237
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
2238
HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
2239
HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
2240
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
2241
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
2242
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
2243
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
2244
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2245
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2246
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
2247
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
2249
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2250
.name = "Channel Mode",
2251
.info = alc_ch_mode_info,
2252
.get = alc_ch_mode_get,
2253
.put = alc_ch_mode_put,
2262
* W810 has rear IO for:
2265
* Center/LFE (DAC 04)
2268
* The system also has a pair of internal speakers, and a headphone jack.
2269
* These are both connected to Line2 on the codec, hence to DAC 02.
2271
* There is a variable resistor to control the speaker or headphone
2272
* volume. This is a hardware-only device without a software API.
2274
* Plugging headphones in will disable the internal speakers. This is
2275
* implemented in hardware, not via the driver using jack sense. In
2276
* a similar fashion, plugging into the rear socket marked "front" will
2277
* disable both the speakers and headphones.
2279
* For input, there's a microphone jack, and an "audio in" jack.
2280
* These may not do anything useful with this driver yet, because I
2281
* haven't setup any initialization verbs for these yet...
2284
static hda_nid_t alc880_w810_dac_nids[3] = {
2285
/* front, rear/surround, clfe */
2289
/* fixed 6 channels */
2290
static struct hda_channel_mode alc880_w810_modes[1] = {
2294
/* Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, HP = 0x1b */
2295
static struct snd_kcontrol_new alc880_w810_base_mixer[] = {
2296
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2297
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
2298
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
2299
HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
2300
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
2301
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
2302
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
2303
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
2304
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
2312
* DAC: Front = 0x02 (0x0c), HP = 0x03 (0x0d)
2313
* Pin assignment: Front = 0x14, HP = 0x15, Mic = 0x18, Mic2 = 0x19(?),
2317
static hda_nid_t alc880_z71v_dac_nids[1] = {
2320
#define ALC880_Z71V_HP_DAC 0x03
2322
/* fixed 2 channels */
2323
static struct hda_channel_mode alc880_2_jack_modes[1] = {
2327
static struct snd_kcontrol_new alc880_z71v_mixer[] = {
2328
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2329
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
2330
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
2331
HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT),
2332
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
2333
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
2334
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2335
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2341
* ALC880 F1734 model
2343
* DAC: HP = 0x02 (0x0c), Front = 0x03 (0x0d)
2344
* Pin assignment: HP = 0x14, Front = 0x15, Mic = 0x18
2347
static hda_nid_t alc880_f1734_dac_nids[1] = {
2350
#define ALC880_F1734_HP_DAC 0x02
2352
static struct snd_kcontrol_new alc880_f1734_mixer[] = {
2353
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2354
HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
2355
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
2356
HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
2357
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
2358
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
2359
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
2360
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
2364
static struct hda_input_mux alc880_f1734_capture_source = {
2376
* DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
2377
* Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
2378
* Mic = 0x18, Line = 0x1a
2381
#define alc880_asus_dac_nids alc880_w810_dac_nids /* identical with w810 */
2382
#define alc880_asus_modes alc880_threestack_modes /* 2/6 channel mode */
2384
static struct snd_kcontrol_new alc880_asus_mixer[] = {
2385
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2386
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
2387
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
2388
HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
2389
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
2390
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
2391
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
2392
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
2393
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
2394
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
2395
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
2396
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
2397
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2398
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2400
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2401
.name = "Channel Mode",
2402
.info = alc_ch_mode_info,
2403
.get = alc_ch_mode_get,
2404
.put = alc_ch_mode_put,
2410
* ALC880 ASUS W1V model
2412
* DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
2413
* Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
2414
* Mic = 0x18, Line = 0x1a, Line2 = 0x1b
2417
/* additional mixers to alc880_asus_mixer */
2418
static struct snd_kcontrol_new alc880_asus_w1v_mixer[] = {
2419
HDA_CODEC_VOLUME("Line2 Playback Volume", 0x0b, 0x03, HDA_INPUT),
2420
HDA_CODEC_MUTE("Line2 Playback Switch", 0x0b, 0x03, HDA_INPUT),
2425
static struct snd_kcontrol_new alc880_tcl_s700_mixer[] = {
2426
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2427
HDA_CODEC_MUTE("Front Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
2428
HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
2429
HDA_CODEC_VOLUME("CD Playback Volume", 0x0B, 0x04, HDA_INPUT),
2430
HDA_CODEC_MUTE("CD Playback Switch", 0x0B, 0x04, HDA_INPUT),
2431
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0B, 0x0, HDA_INPUT),
2432
HDA_CODEC_MUTE("Mic Playback Switch", 0x0B, 0x0, HDA_INPUT),
2433
HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
2434
HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
2439
static struct snd_kcontrol_new alc880_uniwill_mixer[] = {
2440
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2441
HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
2442
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
2443
HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
2444
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
2445
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
2446
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
2447
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
2448
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
2449
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
2450
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
2451
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
2452
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2453
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2454
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
2455
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
2457
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2458
.name = "Channel Mode",
2459
.info = alc_ch_mode_info,
2460
.get = alc_ch_mode_get,
2461
.put = alc_ch_mode_put,
2466
static struct snd_kcontrol_new alc880_fujitsu_mixer[] = {
2467
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2468
HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
2469
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
2470
HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
2471
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
2472
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
2473
HDA_CODEC_VOLUME("Ext Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2474
HDA_CODEC_MUTE("Ext Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2475
HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
2476
HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
2480
static struct snd_kcontrol_new alc880_uniwill_p53_mixer[] = {
2481
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2482
HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
2483
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
2484
HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
2485
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2486
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2491
* virtual master controls
2495
* slave controls for virtual master
2497
static const char *alc_slave_vols[] = {
2498
"Front Playback Volume",
2499
"Surround Playback Volume",
2500
"Center Playback Volume",
2501
"LFE Playback Volume",
2502
"Side Playback Volume",
2503
"Headphone Playback Volume",
2504
"Speaker Playback Volume",
2505
"Mono Playback Volume",
2506
"Line-Out Playback Volume",
2507
"PCM Playback Volume",
2511
static const char *alc_slave_sws[] = {
2512
"Front Playback Switch",
2513
"Surround Playback Switch",
2514
"Center Playback Switch",
2515
"LFE Playback Switch",
2516
"Side Playback Switch",
2517
"Headphone Playback Switch",
2518
"Speaker Playback Switch",
2519
"Mono Playback Switch",
2520
"IEC958 Playback Switch",
2521
"Line-Out Playback Switch",
2522
"PCM Playback Switch",
2527
* build control elements
2530
#define NID_MAPPING (-1)
2532
#define SUBDEV_SPEAKER_ (0 << 6)
2533
#define SUBDEV_HP_ (1 << 6)
2534
#define SUBDEV_LINE_ (2 << 6)
2535
#define SUBDEV_SPEAKER(x) (SUBDEV_SPEAKER_ | ((x) & 0x3f))
2536
#define SUBDEV_HP(x) (SUBDEV_HP_ | ((x) & 0x3f))
2537
#define SUBDEV_LINE(x) (SUBDEV_LINE_ | ((x) & 0x3f))
2539
static void alc_free_kctls(struct hda_codec *codec);
2541
#ifdef CONFIG_SND_HDA_INPUT_BEEP
2542
/* additional beep mixers; the actual parameters are overwritten at build */
2543
static struct snd_kcontrol_new alc_beep_mixer[] = {
2544
HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
2545
HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
2550
static int alc_build_controls(struct hda_codec *codec)
2552
struct alc_spec *spec = codec->spec;
2553
struct snd_kcontrol *kctl = NULL;
2554
struct snd_kcontrol_new *knew;
2559
for (i = 0; i < spec->num_mixers; i++) {
2560
err = snd_hda_add_new_ctls(codec, spec->mixers[i]);
2564
if (spec->cap_mixer) {
2565
err = snd_hda_add_new_ctls(codec, spec->cap_mixer);
2569
if (spec->multiout.dig_out_nid) {
2570
err = snd_hda_create_spdif_out_ctls(codec,
2571
spec->multiout.dig_out_nid);
2574
if (!spec->no_analog) {
2575
err = snd_hda_create_spdif_share_sw(codec,
2579
spec->multiout.share_spdif = 1;
2582
if (spec->dig_in_nid) {
2583
err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
2588
#ifdef CONFIG_SND_HDA_INPUT_BEEP
2589
/* create beep controls if needed */
2590
if (spec->beep_amp) {
2591
struct snd_kcontrol_new *knew;
2592
for (knew = alc_beep_mixer; knew->name; knew++) {
2593
struct snd_kcontrol *kctl;
2594
kctl = snd_ctl_new1(knew, codec);
2597
kctl->private_value = spec->beep_amp;
2598
err = snd_hda_ctl_add(codec, 0, kctl);
2605
/* if we have no master control, let's create it */
2606
if (!spec->no_analog &&
2607
!snd_hda_find_mixer_ctl(codec, "Master Playback Volume")) {
2608
unsigned int vmaster_tlv[4];
2609
snd_hda_set_vmaster_tlv(codec, spec->vmaster_nid,
2610
HDA_OUTPUT, vmaster_tlv);
2611
err = snd_hda_add_vmaster(codec, "Master Playback Volume",
2612
vmaster_tlv, alc_slave_vols);
2616
if (!spec->no_analog &&
2617
!snd_hda_find_mixer_ctl(codec, "Master Playback Switch")) {
2618
err = snd_hda_add_vmaster(codec, "Master Playback Switch",
2619
NULL, alc_slave_sws);
2624
/* assign Capture Source enums to NID */
2625
if (spec->capsrc_nids || spec->adc_nids) {
2626
kctl = snd_hda_find_mixer_ctl(codec, "Capture Source");
2628
kctl = snd_hda_find_mixer_ctl(codec, "Input Source");
2629
for (i = 0; kctl && i < kctl->count; i++) {
2630
hda_nid_t *nids = spec->capsrc_nids;
2632
nids = spec->adc_nids;
2633
err = snd_hda_add_nid(codec, kctl, i, nids[i]);
2638
if (spec->cap_mixer) {
2639
const char *kname = kctl ? kctl->id.name : NULL;
2640
for (knew = spec->cap_mixer; knew->name; knew++) {
2641
if (kname && strcmp(knew->name, kname) == 0)
2643
kctl = snd_hda_find_mixer_ctl(codec, knew->name);
2644
for (i = 0; kctl && i < kctl->count; i++) {
2645
err = snd_hda_add_nid(codec, kctl, i,
2653
/* other nid->control mapping */
2654
for (i = 0; i < spec->num_mixers; i++) {
2655
for (knew = spec->mixers[i]; knew->name; knew++) {
2656
if (knew->iface != NID_MAPPING)
2658
kctl = snd_hda_find_mixer_ctl(codec, knew->name);
2661
u = knew->subdevice;
2662
for (j = 0; j < 4; j++, u >>= 8) {
2667
case SUBDEV_SPEAKER_:
2668
nid = spec->autocfg.speaker_pins[nid];
2671
nid = spec->autocfg.line_out_pins[nid];
2674
nid = spec->autocfg.hp_pins[nid];
2679
err = snd_hda_add_nid(codec, kctl, 0, nid);
2683
u = knew->private_value;
2684
for (j = 0; j < 4; j++, u >>= 8) {
2688
err = snd_hda_add_nid(codec, kctl, 0, nid);
2695
alc_free_kctls(codec); /* no longer needed */
2702
* initialize the codec volumes, etc
2706
* generic initialization of ADC, input mixers and output mixers
2708
static struct hda_verb alc880_volume_init_verbs[] = {
2710
* Unmute ADC0-2 and set the default input to mic-in
2712
{0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
2713
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2714
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
2715
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2716
{0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
2717
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2719
/* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
2721
* Note: PASD motherboards uses the Line In 2 as the input for front
2724
/* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
2725
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
2726
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2727
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
2728
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
2729
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
2730
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
2731
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
2734
* Set up output mixers (0x0c - 0x0f)
2736
/* set vol=0 to output mixers */
2737
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
2738
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
2739
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
2740
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
2741
/* set up input amps for analog loopback */
2742
/* Amp Indices: DAC = 0, mixer = 1 */
2743
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
2744
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2745
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
2746
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2747
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
2748
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2749
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
2750
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2756
* 3-stack pin configuration:
2757
* front = 0x14, mic/clfe = 0x18, HP = 0x19, line/surr = 0x1a, f-mic = 0x1b
2759
static struct hda_verb alc880_pin_3stack_init_verbs[] = {
2761
* preset connection lists of input pins
2762
* 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
2764
{0x10, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
2765
{0x11, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
2766
{0x12, AC_VERB_SET_CONNECT_SEL, 0x03}, /* line/surround */
2769
* Set pin mode and muting
2771
/* set front pin widgets 0x14 for output */
2772
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2773
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2774
/* Mic1 (rear panel) pin widget for input and vref at 80% */
2775
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
2776
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2777
/* Mic2 (as headphone out) for HP output */
2778
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2779
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2780
/* Line In pin widget for input */
2781
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
2782
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2783
/* Line2 (as front mic) pin widget for input and vref at 80% */
2784
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
2785
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2786
/* CD pin widget for input */
2787
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
2793
* 5-stack pin configuration:
2794
* front = 0x14, surround = 0x17, clfe = 0x16, mic = 0x18, HP = 0x19,
2795
* line-in/side = 0x1a, f-mic = 0x1b
2797
static struct hda_verb alc880_pin_5stack_init_verbs[] = {
2799
* preset connection lists of input pins
2800
* 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
2802
{0x11, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
2803
{0x12, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/side */
2806
* Set pin mode and muting
2808
/* set pin widgets 0x14-0x17 for output */
2809
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2810
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2811
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2812
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2813
/* unmute pins for output (no gain on this amp) */
2814
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2815
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2816
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2817
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2819
/* Mic1 (rear panel) pin widget for input and vref at 80% */
2820
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
2821
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2822
/* Mic2 (as headphone out) for HP output */
2823
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2824
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2825
/* Line In pin widget for input */
2826
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
2827
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2828
/* Line2 (as front mic) pin widget for input and vref at 80% */
2829
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
2830
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2831
/* CD pin widget for input */
2832
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
2838
* W810 pin configuration:
2839
* front = 0x14, surround = 0x15, clfe = 0x16, HP = 0x1b
2841
static struct hda_verb alc880_pin_w810_init_verbs[] = {
2842
/* hphone/speaker input selector: front DAC */
2843
{0x13, AC_VERB_SET_CONNECT_SEL, 0x0},
2845
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2846
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2847
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2848
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2849
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2850
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2852
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2853
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2859
* Z71V pin configuration:
2860
* Speaker-out = 0x14, HP = 0x15, Mic = 0x18, Line-in = 0x1a, Mic2 = 0x1b (?)
2862
static struct hda_verb alc880_pin_z71v_init_verbs[] = {
2863
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2864
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2865
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2866
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2868
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
2869
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
2870
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
2871
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
2877
* 6-stack pin configuration:
2878
* front = 0x14, surr = 0x15, clfe = 0x16, side = 0x17, mic = 0x18,
2879
* f-mic = 0x19, line = 0x1a, HP = 0x1b
2881
static struct hda_verb alc880_pin_6stack_init_verbs[] = {
2882
{0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
2884
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2885
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2886
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2887
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2888
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2889
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2890
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2891
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2893
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
2894
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2895
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
2896
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2897
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
2898
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2899
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2900
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2901
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
2907
* Uniwill pin configuration:
2908
* HP = 0x14, InternalSpeaker = 0x15, mic = 0x18, internal mic = 0x19,
2911
static struct hda_verb alc880_uniwill_init_verbs[] = {
2912
{0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
2914
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2915
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2916
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2917
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2918
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2919
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2920
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2921
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2922
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
2923
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
2924
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
2925
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
2926
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
2927
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
2929
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
2930
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2931
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
2932
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2933
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
2934
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2935
/* {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, */
2936
/* {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, */
2937
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
2939
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
2940
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
2947
* HP = 0x14, InternalSpeaker = 0x15, mic = 0x19,
2949
static struct hda_verb alc880_uniwill_p53_init_verbs[] = {
2950
{0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
2952
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2953
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2954
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2955
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2956
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2957
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2958
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
2959
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
2960
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
2961
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
2962
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
2963
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
2965
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
2966
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2967
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
2968
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2969
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
2970
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
2972
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
2973
{0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_DCVOL_EVENT},
2978
static struct hda_verb alc880_beep_init_verbs[] = {
2979
{ 0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5) },
2983
/* auto-toggle front mic */
2984
static void alc880_uniwill_mic_automute(struct hda_codec *codec)
2986
unsigned int present;
2989
present = snd_hda_jack_detect(codec, 0x18);
2990
bits = present ? HDA_AMP_MUTE : 0;
2991
snd_hda_codec_amp_stereo(codec, 0x0b, HDA_INPUT, 1, HDA_AMP_MUTE, bits);
2994
static void alc880_uniwill_setup(struct hda_codec *codec)
2996
struct alc_spec *spec = codec->spec;
2998
spec->autocfg.hp_pins[0] = 0x14;
2999
spec->autocfg.speaker_pins[0] = 0x15;
3000
spec->autocfg.speaker_pins[0] = 0x16;
3003
static void alc880_uniwill_init_hook(struct hda_codec *codec)
3005
alc_automute_amp(codec);
3006
alc880_uniwill_mic_automute(codec);
3009
static void alc880_uniwill_unsol_event(struct hda_codec *codec,
3012
/* Looks like the unsol event is incompatible with the standard
3013
* definition. 4bit tag is placed at 28 bit!
3015
switch (res >> 28) {
3016
case ALC880_MIC_EVENT:
3017
alc880_uniwill_mic_automute(codec);
3020
alc_automute_amp_unsol_event(codec, res);
3025
static void alc880_uniwill_p53_setup(struct hda_codec *codec)
3027
struct alc_spec *spec = codec->spec;
3029
spec->autocfg.hp_pins[0] = 0x14;
3030
spec->autocfg.speaker_pins[0] = 0x15;
3033
static void alc880_uniwill_p53_dcvol_automute(struct hda_codec *codec)
3035
unsigned int present;
3037
present = snd_hda_codec_read(codec, 0x21, 0,
3038
AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
3039
present &= HDA_AMP_VOLMASK;
3040
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_OUTPUT, 0,
3041
HDA_AMP_VOLMASK, present);
3042
snd_hda_codec_amp_stereo(codec, 0x0d, HDA_OUTPUT, 0,
3043
HDA_AMP_VOLMASK, present);
3046
static void alc880_uniwill_p53_unsol_event(struct hda_codec *codec,
3049
/* Looks like the unsol event is incompatible with the standard
3050
* definition. 4bit tag is placed at 28 bit!
3052
if ((res >> 28) == ALC880_DCVOL_EVENT)
3053
alc880_uniwill_p53_dcvol_automute(codec);
3055
alc_automute_amp_unsol_event(codec, res);
3059
* F1734 pin configuration:
3060
* HP = 0x14, speaker-out = 0x15, mic = 0x18
3062
static struct hda_verb alc880_pin_f1734_init_verbs[] = {
3063
{0x07, AC_VERB_SET_CONNECT_SEL, 0x01},
3064
{0x10, AC_VERB_SET_CONNECT_SEL, 0x02},
3065
{0x11, AC_VERB_SET_CONNECT_SEL, 0x00},
3066
{0x12, AC_VERB_SET_CONNECT_SEL, 0x01},
3067
{0x13, AC_VERB_SET_CONNECT_SEL, 0x00},
3069
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
3070
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3071
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
3072
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3074
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
3075
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
3076
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
3077
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
3078
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
3079
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3080
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
3081
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3082
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
3084
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_HP_EVENT},
3085
{0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_DCVOL_EVENT},
3091
* ASUS pin configuration:
3092
* HP/front = 0x14, surr = 0x15, clfe = 0x16, mic = 0x18, line = 0x1a
3094
static struct hda_verb alc880_pin_asus_init_verbs[] = {
3095
{0x10, AC_VERB_SET_CONNECT_SEL, 0x02},
3096
{0x11, AC_VERB_SET_CONNECT_SEL, 0x00},
3097
{0x12, AC_VERB_SET_CONNECT_SEL, 0x01},
3098
{0x13, AC_VERB_SET_CONNECT_SEL, 0x00},
3100
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
3101
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3102
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
3103
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3104
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
3105
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3106
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
3107
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3109
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
3110
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
3111
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
3112
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
3113
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
3114
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
3115
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
3116
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3117
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
3122
/* Enable GPIO mask and set output */
3123
#define alc880_gpio1_init_verbs alc_gpio1_init_verbs
3124
#define alc880_gpio2_init_verbs alc_gpio2_init_verbs
3125
#define alc880_gpio3_init_verbs alc_gpio3_init_verbs
3127
/* Clevo m520g init */
3128
static struct hda_verb alc880_pin_clevo_init_verbs[] = {
3129
/* headphone output */
3130
{0x11, AC_VERB_SET_CONNECT_SEL, 0x01},
3132
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
3133
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3135
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
3136
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3138
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
3139
{0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3140
/* Mic1 (rear panel) */
3141
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
3142
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3143
/* Mic2 (front panel) */
3144
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
3145
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3147
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
3148
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3149
/* change to EAPD mode */
3150
{0x20, AC_VERB_SET_COEF_INDEX, 0x07},
3151
{0x20, AC_VERB_SET_PROC_COEF, 0x3060},
3156
static struct hda_verb alc880_pin_tcl_S700_init_verbs[] = {
3157
/* change to EAPD mode */
3158
{0x20, AC_VERB_SET_COEF_INDEX, 0x07},
3159
{0x20, AC_VERB_SET_PROC_COEF, 0x3060},
3161
/* Headphone output */
3162
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
3164
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
3165
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
3167
/* Line In pin widget for input */
3168
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
3169
/* CD pin widget for input */
3170
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
3171
/* Mic1 (rear panel) pin widget for input and vref at 80% */
3172
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
3174
/* change to EAPD mode */
3175
{0x20, AC_VERB_SET_COEF_INDEX, 0x07},
3176
{0x20, AC_VERB_SET_PROC_COEF, 0x3070},
3182
* LG m1 express dual
3185
* Rear Line-In/Out (blue): 0x14
3186
* Build-in Mic-In: 0x15
3188
* HP-Out (green): 0x1b
3189
* Mic-In/Out (red): 0x19
3193
/* To make 5.1 output working (green=Front, blue=Surr, red=CLFE) */
3194
static hda_nid_t alc880_lg_dac_nids[3] = {
3198
/* seems analog CD is not working */
3199
static struct hda_input_mux alc880_lg_capture_source = {
3204
{ "Internal Mic", 0x6 },
3208
/* 2,4,6 channel modes */
3209
static struct hda_verb alc880_lg_ch2_init[] = {
3210
/* set line-in and mic-in to input */
3211
{ 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
3212
{ 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
3216
static struct hda_verb alc880_lg_ch4_init[] = {
3217
/* set line-in to out and mic-in to input */
3218
{ 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
3219
{ 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
3223
static struct hda_verb alc880_lg_ch6_init[] = {
3224
/* set line-in and mic-in to output */
3225
{ 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
3226
{ 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
3230
static struct hda_channel_mode alc880_lg_ch_modes[3] = {
3231
{ 2, alc880_lg_ch2_init },
3232
{ 4, alc880_lg_ch4_init },
3233
{ 6, alc880_lg_ch6_init },
3236
static struct snd_kcontrol_new alc880_lg_mixer[] = {
3237
HDA_CODEC_VOLUME("Front Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
3238
HDA_BIND_MUTE("Front Playback Switch", 0x0f, 2, HDA_INPUT),
3239
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
3240
HDA_BIND_MUTE("Surround Playback Switch", 0x0c, 2, HDA_INPUT),
3241
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0d, 1, 0x0, HDA_OUTPUT),
3242
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT),
3243
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT),
3244
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT),
3245
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
3246
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
3247
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x06, HDA_INPUT),
3248
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x06, HDA_INPUT),
3249
HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x07, HDA_INPUT),
3250
HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x07, HDA_INPUT),
3252
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3253
.name = "Channel Mode",
3254
.info = alc_ch_mode_info,
3255
.get = alc_ch_mode_get,
3256
.put = alc_ch_mode_put,
3261
static struct hda_verb alc880_lg_init_verbs[] = {
3262
/* set capture source to mic-in */
3263
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
3264
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
3265
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
3266
/* mute all amp mixer inputs */
3267
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5)},
3268
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
3269
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
3270
/* line-in to input */
3271
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
3272
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3274
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
3275
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3277
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
3278
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3279
/* mic-in to input */
3280
{0x11, AC_VERB_SET_CONNECT_SEL, 0x01},
3281
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
3282
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3284
{0x13, AC_VERB_SET_CONNECT_SEL, 0x03},
3285
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
3286
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3288
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
3292
/* toggle speaker-output according to the hp-jack state */
3293
static void alc880_lg_setup(struct hda_codec *codec)
3295
struct alc_spec *spec = codec->spec;
3297
spec->autocfg.hp_pins[0] = 0x1b;
3298
spec->autocfg.speaker_pins[0] = 0x17;
3307
* Built-in Mic-In: 0x19
3313
static struct hda_input_mux alc880_lg_lw_capture_source = {
3317
{ "Internal Mic", 0x1 },
3322
#define alc880_lg_lw_modes alc880_threestack_modes
3324
static struct snd_kcontrol_new alc880_lg_lw_mixer[] = {
3325
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
3326
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
3327
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
3328
HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT),
3329
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
3330
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
3331
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
3332
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
3333
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
3334
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
3335
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
3336
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
3337
HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
3338
HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
3340
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3341
.name = "Channel Mode",
3342
.info = alc_ch_mode_info,
3343
.get = alc_ch_mode_get,
3344
.put = alc_ch_mode_put,
3349
static struct hda_verb alc880_lg_lw_init_verbs[] = {
3350
{0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
3351
{0x10, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
3352
{0x12, AC_VERB_SET_CONNECT_SEL, 0x03}, /* line/surround */
3354
/* set capture source to mic-in */
3355
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3356
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3357
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3358
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
3360
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
3361
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3363
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
3364
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3365
/* mic-in to input */
3366
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
3367
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3369
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
3370
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3372
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
3376
/* toggle speaker-output according to the hp-jack state */
3377
static void alc880_lg_lw_setup(struct hda_codec *codec)
3379
struct alc_spec *spec = codec->spec;
3381
spec->autocfg.hp_pins[0] = 0x1b;
3382
spec->autocfg.speaker_pins[0] = 0x14;
3385
static struct snd_kcontrol_new alc880_medion_rim_mixer[] = {
3386
HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
3387
HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT),
3388
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
3389
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
3390
HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
3391
HDA_CODEC_MUTE("Internal Playback Switch", 0x0b, 0x1, HDA_INPUT),
3395
static struct hda_input_mux alc880_medion_rim_capture_source = {
3399
{ "Internal Mic", 0x1 },
3403
static struct hda_verb alc880_medion_rim_init_verbs[] = {
3404
{0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
3406
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
3407
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3409
/* Mic1 (rear panel) pin widget for input and vref at 80% */
3410
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
3411
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
3412
/* Mic2 (as headphone out) for HP output */
3413
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
3414
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
3415
/* Internal Speaker */
3416
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
3417
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
3419
{0x20, AC_VERB_SET_COEF_INDEX, 0x07},
3420
{0x20, AC_VERB_SET_PROC_COEF, 0x3060},
3422
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
3426
/* toggle speaker-output according to the hp-jack state */
3427
static void alc880_medion_rim_automute(struct hda_codec *codec)
3429
struct alc_spec *spec = codec->spec;
3430
alc_automute_amp(codec);
3432
if (spec->jack_present)
3433
snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 0);
3435
snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 2);
3438
static void alc880_medion_rim_unsol_event(struct hda_codec *codec,
3441
/* Looks like the unsol event is incompatible with the standard
3442
* definition. 4bit tag is placed at 28 bit!
3444
if ((res >> 28) == ALC880_HP_EVENT)
3445
alc880_medion_rim_automute(codec);
3448
static void alc880_medion_rim_setup(struct hda_codec *codec)
3450
struct alc_spec *spec = codec->spec;
3452
spec->autocfg.hp_pins[0] = 0x14;
3453
spec->autocfg.speaker_pins[0] = 0x1b;
3456
#ifdef CONFIG_SND_HDA_POWER_SAVE
3457
static struct hda_amp_list alc880_loopbacks[] = {
3458
{ 0x0b, HDA_INPUT, 0 },
3459
{ 0x0b, HDA_INPUT, 1 },
3460
{ 0x0b, HDA_INPUT, 2 },
3461
{ 0x0b, HDA_INPUT, 3 },
3462
{ 0x0b, HDA_INPUT, 4 },
3466
static struct hda_amp_list alc880_lg_loopbacks[] = {
3467
{ 0x0b, HDA_INPUT, 1 },
3468
{ 0x0b, HDA_INPUT, 6 },
3469
{ 0x0b, HDA_INPUT, 7 },
3478
static int alc_init(struct hda_codec *codec)
3480
struct alc_spec *spec = codec->spec;
3484
alc_auto_init_amp(codec, spec->init_amp);
3486
for (i = 0; i < spec->num_init_verbs; i++)
3487
snd_hda_sequence_write(codec, spec->init_verbs[i]);
3489
if (spec->init_hook)
3490
spec->init_hook(codec);
3492
#ifdef CONFIG_SND_HDA_POWER_SAVE
3493
if (codec->patch_ops.check_power_status)
3494
codec->patch_ops.check_power_status(codec, 0x01);
3499
static void alc_unsol_event(struct hda_codec *codec, unsigned int res)
3501
struct alc_spec *spec = codec->spec;
3503
if (spec->unsol_event)
3504
spec->unsol_event(codec, res);
3507
#ifdef CONFIG_SND_HDA_POWER_SAVE
3508
static int alc_check_power_status(struct hda_codec *codec, hda_nid_t nid)
3510
struct alc_spec *spec = codec->spec;
3511
return snd_hda_check_amp_list_power(codec, &spec->loopback, nid);
3516
* Analog playback callbacks
3518
static int alc880_playback_pcm_open(struct hda_pcm_stream *hinfo,
3519
struct hda_codec *codec,
3520
struct snd_pcm_substream *substream)
3522
struct alc_spec *spec = codec->spec;
3523
return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream,
3527
static int alc880_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
3528
struct hda_codec *codec,
3529
unsigned int stream_tag,
3530
unsigned int format,
3531
struct snd_pcm_substream *substream)
3533
struct alc_spec *spec = codec->spec;
3534
return snd_hda_multi_out_analog_prepare(codec, &spec->multiout,
3535
stream_tag, format, substream);
3538
static int alc880_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
3539
struct hda_codec *codec,
3540
struct snd_pcm_substream *substream)
3542
struct alc_spec *spec = codec->spec;
3543
return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout);
3549
static int alc880_dig_playback_pcm_open(struct hda_pcm_stream *hinfo,
3550
struct hda_codec *codec,
3551
struct snd_pcm_substream *substream)
3553
struct alc_spec *spec = codec->spec;
3554
return snd_hda_multi_out_dig_open(codec, &spec->multiout);
3557
static int alc880_dig_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
3558
struct hda_codec *codec,
3559
unsigned int stream_tag,
3560
unsigned int format,
3561
struct snd_pcm_substream *substream)
3563
struct alc_spec *spec = codec->spec;
3564
return snd_hda_multi_out_dig_prepare(codec, &spec->multiout,
3565
stream_tag, format, substream);
3568
static int alc880_dig_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
3569
struct hda_codec *codec,
3570
struct snd_pcm_substream *substream)
3572
struct alc_spec *spec = codec->spec;
3573
return snd_hda_multi_out_dig_cleanup(codec, &spec->multiout);
3576
static int alc880_dig_playback_pcm_close(struct hda_pcm_stream *hinfo,
3577
struct hda_codec *codec,
3578
struct snd_pcm_substream *substream)
3580
struct alc_spec *spec = codec->spec;
3581
return snd_hda_multi_out_dig_close(codec, &spec->multiout);
3587
static int alc880_alt_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
3588
struct hda_codec *codec,
3589
unsigned int stream_tag,
3590
unsigned int format,
3591
struct snd_pcm_substream *substream)
3593
struct alc_spec *spec = codec->spec;
3595
snd_hda_codec_setup_stream(codec, spec->adc_nids[substream->number + 1],
3596
stream_tag, 0, format);
3600
static int alc880_alt_capture_pcm_cleanup(struct hda_pcm_stream *hinfo,
3601
struct hda_codec *codec,
3602
struct snd_pcm_substream *substream)
3604
struct alc_spec *spec = codec->spec;
3606
snd_hda_codec_cleanup_stream(codec,
3607
spec->adc_nids[substream->number + 1]);
3614
static struct hda_pcm_stream alc880_pcm_analog_playback = {
3618
/* NID is set in alc_build_pcms */
3620
.open = alc880_playback_pcm_open,
3621
.prepare = alc880_playback_pcm_prepare,
3622
.cleanup = alc880_playback_pcm_cleanup
3626
static struct hda_pcm_stream alc880_pcm_analog_capture = {
3630
/* NID is set in alc_build_pcms */
3633
static struct hda_pcm_stream alc880_pcm_analog_alt_playback = {
3637
/* NID is set in alc_build_pcms */
3640
static struct hda_pcm_stream alc880_pcm_analog_alt_capture = {
3641
.substreams = 2, /* can be overridden */
3644
/* NID is set in alc_build_pcms */
3646
.prepare = alc880_alt_capture_pcm_prepare,
3647
.cleanup = alc880_alt_capture_pcm_cleanup
3651
static struct hda_pcm_stream alc880_pcm_digital_playback = {
3655
/* NID is set in alc_build_pcms */
3657
.open = alc880_dig_playback_pcm_open,
3658
.close = alc880_dig_playback_pcm_close,
3659
.prepare = alc880_dig_playback_pcm_prepare,
3660
.cleanup = alc880_dig_playback_pcm_cleanup
3664
static struct hda_pcm_stream alc880_pcm_digital_capture = {
3668
/* NID is set in alc_build_pcms */
3671
/* Used by alc_build_pcms to flag that a PCM has no playback stream */
3672
static struct hda_pcm_stream alc_pcm_null_stream = {
3678
static int alc_build_pcms(struct hda_codec *codec)
3680
struct alc_spec *spec = codec->spec;
3681
struct hda_pcm *info = spec->pcm_rec;
3684
codec->num_pcms = 1;
3685
codec->pcm_info = info;
3687
if (spec->no_analog)
3690
snprintf(spec->stream_name_analog, sizeof(spec->stream_name_analog),
3691
"%s Analog", codec->chip_name);
3692
info->name = spec->stream_name_analog;
3694
if (spec->stream_analog_playback) {
3695
if (snd_BUG_ON(!spec->multiout.dac_nids))
3697
info->stream[SNDRV_PCM_STREAM_PLAYBACK] = *(spec->stream_analog_playback);
3698
info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->multiout.dac_nids[0];
3700
if (spec->stream_analog_capture) {
3701
if (snd_BUG_ON(!spec->adc_nids))
3703
info->stream[SNDRV_PCM_STREAM_CAPTURE] = *(spec->stream_analog_capture);
3704
info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adc_nids[0];
3707
if (spec->channel_mode) {
3708
info->stream[SNDRV_PCM_STREAM_PLAYBACK].channels_max = 0;
3709
for (i = 0; i < spec->num_channel_mode; i++) {
3710
if (spec->channel_mode[i].channels > info->stream[SNDRV_PCM_STREAM_PLAYBACK].channels_max) {
3711
info->stream[SNDRV_PCM_STREAM_PLAYBACK].channels_max = spec->channel_mode[i].channels;
3717
/* SPDIF for stream index #1 */
3718
if (spec->multiout.dig_out_nid || spec->dig_in_nid) {
3719
snprintf(spec->stream_name_digital,
3720
sizeof(spec->stream_name_digital),
3721
"%s Digital", codec->chip_name);
3722
codec->num_pcms = 2;
3723
codec->slave_dig_outs = spec->multiout.slave_dig_outs;
3724
info = spec->pcm_rec + 1;
3725
info->name = spec->stream_name_digital;
3726
if (spec->dig_out_type)
3727
info->pcm_type = spec->dig_out_type;
3729
info->pcm_type = HDA_PCM_TYPE_SPDIF;
3730
if (spec->multiout.dig_out_nid &&
3731
spec->stream_digital_playback) {
3732
info->stream[SNDRV_PCM_STREAM_PLAYBACK] = *(spec->stream_digital_playback);
3733
info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->multiout.dig_out_nid;
3735
if (spec->dig_in_nid &&
3736
spec->stream_digital_capture) {
3737
info->stream[SNDRV_PCM_STREAM_CAPTURE] = *(spec->stream_digital_capture);
3738
info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->dig_in_nid;
3740
/* FIXME: do we need this for all Realtek codec models? */
3741
codec->spdif_status_reset = 1;
3744
if (spec->no_analog)
3747
/* If the use of more than one ADC is requested for the current
3748
* model, configure a second analog capture-only PCM.
3750
/* Additional Analaog capture for index #2 */
3751
if ((spec->alt_dac_nid && spec->stream_analog_alt_playback) ||
3752
(spec->num_adc_nids > 1 && spec->stream_analog_alt_capture)) {
3753
codec->num_pcms = 3;
3754
info = spec->pcm_rec + 2;
3755
info->name = spec->stream_name_analog;
3756
if (spec->alt_dac_nid) {
3757
info->stream[SNDRV_PCM_STREAM_PLAYBACK] =
3758
*spec->stream_analog_alt_playback;
3759
info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid =
3762
info->stream[SNDRV_PCM_STREAM_PLAYBACK] =
3763
alc_pcm_null_stream;
3764
info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = 0;
3766
if (spec->num_adc_nids > 1) {
3767
info->stream[SNDRV_PCM_STREAM_CAPTURE] =
3768
*spec->stream_analog_alt_capture;
3769
info->stream[SNDRV_PCM_STREAM_CAPTURE].nid =
3771
info->stream[SNDRV_PCM_STREAM_CAPTURE].substreams =
3772
spec->num_adc_nids - 1;
3774
info->stream[SNDRV_PCM_STREAM_CAPTURE] =
3775
alc_pcm_null_stream;
3776
info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = 0;
3783
static inline void alc_shutup(struct hda_codec *codec)
3785
snd_hda_shutup_pins(codec);
3788
static void alc_free_kctls(struct hda_codec *codec)
3790
struct alc_spec *spec = codec->spec;
3792
if (spec->kctls.list) {
3793
struct snd_kcontrol_new *kctl = spec->kctls.list;
3795
for (i = 0; i < spec->kctls.used; i++)
3796
kfree(kctl[i].name);
3798
snd_array_free(&spec->kctls);
3801
static void alc_free(struct hda_codec *codec)
3803
struct alc_spec *spec = codec->spec;
3809
alc_free_kctls(codec);
3811
snd_hda_detach_beep_device(codec);
3814
#ifdef CONFIG_SND_HDA_POWER_SAVE
3815
static void alc_power_eapd(struct hda_codec *codec)
3817
/* We currently only handle front, HP */
3818
switch (codec->vendor_id) {
3820
set_eapd(codec, 0x0f, 0);
3821
set_eapd(codec, 0x10, 0);
3834
set_eapd(codec, 0x14, 0);
3835
set_eapd(codec, 0x15, 0);
3840
static int alc_suspend(struct hda_codec *codec, pm_message_t state)
3842
struct alc_spec *spec = codec->spec;
3844
if (spec && spec->power_hook)
3845
spec->power_hook(codec);
3850
#ifdef SND_HDA_NEEDS_RESUME
3851
static int alc_resume(struct hda_codec *codec)
3853
codec->patch_ops.init(codec);
3854
snd_hda_codec_resume_amp(codec);
3855
snd_hda_codec_resume_cache(codec);
3856
#ifdef CONFIG_SND_HDA_POWER_SAVE
3857
if (codec->patch_ops.check_power_status)
3858
codec->patch_ops.check_power_status(codec, 0x01);
3866
static struct hda_codec_ops alc_patch_ops = {
3867
.build_controls = alc_build_controls,
3868
.build_pcms = alc_build_pcms,
3871
.unsol_event = alc_unsol_event,
3872
#ifdef SND_HDA_NEEDS_RESUME
3873
.resume = alc_resume,
3875
#ifdef CONFIG_SND_HDA_POWER_SAVE
3876
.suspend = alc_suspend,
3877
.check_power_status = alc_check_power_status,
3879
.reboot_notify = alc_shutup,
3882
/* replace the codec chip_name with the given string */
3883
static int alc_codec_rename(struct hda_codec *codec, const char *name)
3885
kfree(codec->chip_name);
3886
codec->chip_name = kstrdup(name, GFP_KERNEL);
3887
if (!codec->chip_name) {
3895
* Test configuration for debugging
3897
* Almost all inputs/outputs are enabled. I/O pins can be configured via
3900
#ifdef CONFIG_SND_DEBUG
3901
static hda_nid_t alc880_test_dac_nids[4] = {
3902
0x02, 0x03, 0x04, 0x05
3905
static struct hda_input_mux alc880_test_capture_source = {
3914
{ "Surround", 0x6 },
3918
static struct hda_channel_mode alc880_test_modes[4] = {
3925
static int alc_test_pin_ctl_info(struct snd_kcontrol *kcontrol,
3926
struct snd_ctl_elem_info *uinfo)
3928
static char *texts[] = {
3929
"N/A", "Line Out", "HP Out",
3930
"In Hi-Z", "In 50%", "In Grd", "In 80%", "In 100%"
3932
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
3934
uinfo->value.enumerated.items = 8;
3935
if (uinfo->value.enumerated.item >= 8)
3936
uinfo->value.enumerated.item = 7;
3937
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
3941
static int alc_test_pin_ctl_get(struct snd_kcontrol *kcontrol,
3942
struct snd_ctl_elem_value *ucontrol)
3944
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
3945
hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
3946
unsigned int pin_ctl, item = 0;
3948
pin_ctl = snd_hda_codec_read(codec, nid, 0,
3949
AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
3950
if (pin_ctl & AC_PINCTL_OUT_EN) {
3951
if (pin_ctl & AC_PINCTL_HP_EN)
3955
} else if (pin_ctl & AC_PINCTL_IN_EN) {
3956
switch (pin_ctl & AC_PINCTL_VREFEN) {
3957
case AC_PINCTL_VREF_HIZ: item = 3; break;
3958
case AC_PINCTL_VREF_50: item = 4; break;
3959
case AC_PINCTL_VREF_GRD: item = 5; break;
3960
case AC_PINCTL_VREF_80: item = 6; break;
3961
case AC_PINCTL_VREF_100: item = 7; break;
3964
ucontrol->value.enumerated.item[0] = item;
3968
static int alc_test_pin_ctl_put(struct snd_kcontrol *kcontrol,
3969
struct snd_ctl_elem_value *ucontrol)
3971
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
3972
hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
3973
static unsigned int ctls[] = {
3974
0, AC_PINCTL_OUT_EN, AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN,
3975
AC_PINCTL_IN_EN | AC_PINCTL_VREF_HIZ,
3976
AC_PINCTL_IN_EN | AC_PINCTL_VREF_50,
3977
AC_PINCTL_IN_EN | AC_PINCTL_VREF_GRD,
3978
AC_PINCTL_IN_EN | AC_PINCTL_VREF_80,
3979
AC_PINCTL_IN_EN | AC_PINCTL_VREF_100,
3981
unsigned int old_ctl, new_ctl;
3983
old_ctl = snd_hda_codec_read(codec, nid, 0,
3984
AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
3985
new_ctl = ctls[ucontrol->value.enumerated.item[0]];
3986
if (old_ctl != new_ctl) {
3988
snd_hda_codec_write_cache(codec, nid, 0,
3989
AC_VERB_SET_PIN_WIDGET_CONTROL,
3991
val = ucontrol->value.enumerated.item[0] >= 3 ?
3993
snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0,
4000
static int alc_test_pin_src_info(struct snd_kcontrol *kcontrol,
4001
struct snd_ctl_elem_info *uinfo)
4003
static char *texts[] = {
4004
"Front", "Surround", "CLFE", "Side"
4006
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
4008
uinfo->value.enumerated.items = 4;
4009
if (uinfo->value.enumerated.item >= 4)
4010
uinfo->value.enumerated.item = 3;
4011
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
4015
static int alc_test_pin_src_get(struct snd_kcontrol *kcontrol,
4016
struct snd_ctl_elem_value *ucontrol)
4018
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
4019
hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
4022
sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0);
4023
ucontrol->value.enumerated.item[0] = sel & 3;
4027
static int alc_test_pin_src_put(struct snd_kcontrol *kcontrol,
4028
struct snd_ctl_elem_value *ucontrol)
4030
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
4031
hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
4034
sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0) & 3;
4035
if (ucontrol->value.enumerated.item[0] != sel) {
4036
sel = ucontrol->value.enumerated.item[0] & 3;
4037
snd_hda_codec_write_cache(codec, nid, 0,
4038
AC_VERB_SET_CONNECT_SEL, sel);
4044
#define PIN_CTL_TEST(xname,nid) { \
4045
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
4047
.subdevice = HDA_SUBDEV_NID_FLAG | nid, \
4048
.info = alc_test_pin_ctl_info, \
4049
.get = alc_test_pin_ctl_get, \
4050
.put = alc_test_pin_ctl_put, \
4051
.private_value = nid \
4054
#define PIN_SRC_TEST(xname,nid) { \
4055
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
4057
.subdevice = HDA_SUBDEV_NID_FLAG | nid, \
4058
.info = alc_test_pin_src_info, \
4059
.get = alc_test_pin_src_get, \
4060
.put = alc_test_pin_src_put, \
4061
.private_value = nid \
4064
static struct snd_kcontrol_new alc880_test_mixer[] = {
4065
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
4066
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
4067
HDA_CODEC_VOLUME("CLFE Playback Volume", 0x0e, 0x0, HDA_OUTPUT),
4068
HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
4069
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
4070
HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
4071
HDA_BIND_MUTE("CLFE Playback Switch", 0x0e, 2, HDA_INPUT),
4072
HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
4073
PIN_CTL_TEST("Front Pin Mode", 0x14),
4074
PIN_CTL_TEST("Surround Pin Mode", 0x15),
4075
PIN_CTL_TEST("CLFE Pin Mode", 0x16),
4076
PIN_CTL_TEST("Side Pin Mode", 0x17),
4077
PIN_CTL_TEST("In-1 Pin Mode", 0x18),
4078
PIN_CTL_TEST("In-2 Pin Mode", 0x19),
4079
PIN_CTL_TEST("In-3 Pin Mode", 0x1a),
4080
PIN_CTL_TEST("In-4 Pin Mode", 0x1b),
4081
PIN_SRC_TEST("In-1 Pin Source", 0x18),
4082
PIN_SRC_TEST("In-2 Pin Source", 0x19),
4083
PIN_SRC_TEST("In-3 Pin Source", 0x1a),
4084
PIN_SRC_TEST("In-4 Pin Source", 0x1b),
4085
HDA_CODEC_VOLUME("In-1 Playback Volume", 0x0b, 0x0, HDA_INPUT),
4086
HDA_CODEC_MUTE("In-1 Playback Switch", 0x0b, 0x0, HDA_INPUT),
4087
HDA_CODEC_VOLUME("In-2 Playback Volume", 0x0b, 0x1, HDA_INPUT),
4088
HDA_CODEC_MUTE("In-2 Playback Switch", 0x0b, 0x1, HDA_INPUT),
4089
HDA_CODEC_VOLUME("In-3 Playback Volume", 0x0b, 0x2, HDA_INPUT),
4090
HDA_CODEC_MUTE("In-3 Playback Switch", 0x0b, 0x2, HDA_INPUT),
4091
HDA_CODEC_VOLUME("In-4 Playback Volume", 0x0b, 0x3, HDA_INPUT),
4092
HDA_CODEC_MUTE("In-4 Playback Switch", 0x0b, 0x3, HDA_INPUT),
4093
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x4, HDA_INPUT),
4094
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x4, HDA_INPUT),
4096
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
4097
.name = "Channel Mode",
4098
.info = alc_ch_mode_info,
4099
.get = alc_ch_mode_get,
4100
.put = alc_ch_mode_put,
4105
static struct hda_verb alc880_test_init_verbs[] = {
4106
/* Unmute inputs of 0x0c - 0x0f */
4107
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
4108
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
4109
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
4110
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
4111
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
4112
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
4113
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
4114
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
4115
/* Vol output for 0x0c-0x0f */
4116
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
4117
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
4118
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
4119
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
4120
/* Set output pins 0x14-0x17 */
4121
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
4122
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
4123
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
4124
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
4125
/* Unmute output pins 0x14-0x17 */
4126
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
4127
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
4128
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
4129
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
4130
/* Set input pins 0x18-0x1c */
4131
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
4132
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
4133
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
4134
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
4135
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
4136
/* Mute input pins 0x18-0x1b */
4137
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
4138
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
4139
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
4140
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
4142
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
4143
{0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
4144
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
4145
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
4146
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
4147
{0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
4148
/* Analog input/passthru */
4149
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
4150
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
4151
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
4152
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
4153
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
4161
static const char *alc880_models[ALC880_MODEL_LAST] = {
4162
[ALC880_3ST] = "3stack",
4163
[ALC880_TCL_S700] = "tcl",
4164
[ALC880_3ST_DIG] = "3stack-digout",
4165
[ALC880_CLEVO] = "clevo",
4166
[ALC880_5ST] = "5stack",
4167
[ALC880_5ST_DIG] = "5stack-digout",
4168
[ALC880_W810] = "w810",
4169
[ALC880_Z71V] = "z71v",
4170
[ALC880_6ST] = "6stack",
4171
[ALC880_6ST_DIG] = "6stack-digout",
4172
[ALC880_ASUS] = "asus",
4173
[ALC880_ASUS_W1V] = "asus-w1v",
4174
[ALC880_ASUS_DIG] = "asus-dig",
4175
[ALC880_ASUS_DIG2] = "asus-dig2",
4176
[ALC880_UNIWILL_DIG] = "uniwill",
4177
[ALC880_UNIWILL_P53] = "uniwill-p53",
4178
[ALC880_FUJITSU] = "fujitsu",
4179
[ALC880_F1734] = "F1734",
4181
[ALC880_LG_LW] = "lg-lw",
4182
[ALC880_MEDION_RIM] = "medion",
4183
#ifdef CONFIG_SND_DEBUG
4184
[ALC880_TEST] = "test",
4186
[ALC880_AUTO] = "auto",
4189
static struct snd_pci_quirk alc880_cfg_tbl[] = {
4190
SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_W810),
4191
SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_5ST_DIG),
4192
SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_6ST),
4193
SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_3ST_DIG),
4194
SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_6ST_DIG),
4195
SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_6ST_DIG),
4196
SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_6ST_DIG),
4197
SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG),
4198
SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST),
4199
SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_6ST_DIG),
4200
SND_PCI_QUIRK(0x103c, 0x2a09, "HP", ALC880_5ST),
4201
SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V),
4202
SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG),
4203
SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG),
4204
SND_PCI_QUIRK(0x1043, 0x1113, "ASUS", ALC880_ASUS_DIG),
4205
SND_PCI_QUIRK(0x1043, 0x1123, "ASUS", ALC880_ASUS_DIG),
4206
SND_PCI_QUIRK(0x1043, 0x1173, "ASUS", ALC880_ASUS_DIG),
4207
SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_Z71V),
4208
/* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */
4209
SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG),
4210
SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG),
4211
SND_PCI_QUIRK(0x1043, 0x814e, "ASUS P5GD1 w/SPDIF", ALC880_6ST_DIG),
4212
SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG),
4213
SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST),
4214
SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST),
4215
SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_ASUS), /* default ASUS */
4216
SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_3ST),
4217
SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_3ST),
4218
SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_5ST),
4219
SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_5ST),
4220
SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_5ST),
4221
SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_6ST_DIG),
4222
SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_6ST_DIG),
4223
SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_6ST_DIG),
4224
SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_6ST_DIG),
4225
SND_PCI_QUIRK(0x1558, 0x0520, "Clevo m520G", ALC880_CLEVO),
4226
SND_PCI_QUIRK(0x1558, 0x0660, "Clevo m655n", ALC880_CLEVO),
4227
SND_PCI_QUIRK(0x1558, 0x5401, "ASUS", ALC880_ASUS_DIG2),
4228
SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_5ST_DIG),
4229
SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_UNIWILL_DIG),
4230
SND_PCI_QUIRK(0x1584, 0x9054, "Uniwlll", ALC880_F1734),
4231
SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_UNIWILL),
4232
SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_UNIWILL_P53),
4233
SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_W810),
4234
SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_MEDION_RIM),
4235
SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_5ST_DIG),
4236
SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG),
4237
SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_F1734),
4238
SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FUJITSU),
4239
SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_F1734),
4240
SND_PCI_QUIRK(0x1734, 0x10b0, "Fujitsu", ALC880_FUJITSU),
4241
SND_PCI_QUIRK(0x1854, 0x0018, "LG LW20", ALC880_LG_LW),
4242
SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG),
4243
SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_LG),
4244
SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_LG_LW),
4245
SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_TCL_S700),
4246
SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_6ST_DIG), /* broken BIOS */
4247
SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_6ST_DIG),
4248
SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_5ST_DIG),
4249
SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_5ST_DIG),
4250
SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_5ST_DIG),
4251
SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_3ST_DIG),
4252
SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_5ST_DIG),
4253
SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_3ST_DIG),
4254
SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_3ST_DIG),
4255
SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_5ST_DIG),
4256
SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_5ST_DIG),
4257
SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_5ST_DIG),
4259
SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_3ST),
4260
SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_5ST_DIG),
4261
SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_6ST_DIG),
4266
* ALC880 codec presets
4268
static struct alc_config_preset alc880_presets[] = {
4270
.mixers = { alc880_three_stack_mixer },
4271
.init_verbs = { alc880_volume_init_verbs,
4272
alc880_pin_3stack_init_verbs },
4273
.num_dacs = ARRAY_SIZE(alc880_dac_nids),
4274
.dac_nids = alc880_dac_nids,
4275
.num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
4276
.channel_mode = alc880_threestack_modes,
4278
.input_mux = &alc880_capture_source,
4280
[ALC880_3ST_DIG] = {
4281
.mixers = { alc880_three_stack_mixer },
4282
.init_verbs = { alc880_volume_init_verbs,
4283
alc880_pin_3stack_init_verbs },
4284
.num_dacs = ARRAY_SIZE(alc880_dac_nids),
4285
.dac_nids = alc880_dac_nids,
4286
.dig_out_nid = ALC880_DIGOUT_NID,
4287
.num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
4288
.channel_mode = alc880_threestack_modes,
4290
.input_mux = &alc880_capture_source,
4292
[ALC880_TCL_S700] = {
4293
.mixers = { alc880_tcl_s700_mixer },
4294
.init_verbs = { alc880_volume_init_verbs,
4295
alc880_pin_tcl_S700_init_verbs,
4296
alc880_gpio2_init_verbs },
4297
.num_dacs = ARRAY_SIZE(alc880_dac_nids),
4298
.dac_nids = alc880_dac_nids,
4299
.adc_nids = alc880_adc_nids_alt, /* FIXME: correct? */
4300
.num_adc_nids = 1, /* single ADC */
4302
.num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
4303
.channel_mode = alc880_2_jack_modes,
4304
.input_mux = &alc880_capture_source,
4307
.mixers = { alc880_three_stack_mixer,
4308
alc880_five_stack_mixer},
4309
.init_verbs = { alc880_volume_init_verbs,
4310
alc880_pin_5stack_init_verbs },
4311
.num_dacs = ARRAY_SIZE(alc880_dac_nids),
4312
.dac_nids = alc880_dac_nids,
4313
.num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
4314
.channel_mode = alc880_fivestack_modes,
4315
.input_mux = &alc880_capture_source,
4317
[ALC880_5ST_DIG] = {
4318
.mixers = { alc880_three_stack_mixer,
4319
alc880_five_stack_mixer },
4320
.init_verbs = { alc880_volume_init_verbs,
4321
alc880_pin_5stack_init_verbs },
4322
.num_dacs = ARRAY_SIZE(alc880_dac_nids),
4323
.dac_nids = alc880_dac_nids,
4324
.dig_out_nid = ALC880_DIGOUT_NID,
4325
.num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
4326
.channel_mode = alc880_fivestack_modes,
4327
.input_mux = &alc880_capture_source,
4330
.mixers = { alc880_six_stack_mixer },
4331
.init_verbs = { alc880_volume_init_verbs,
4332
alc880_pin_6stack_init_verbs },
4333
.num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
4334
.dac_nids = alc880_6st_dac_nids,
4335
.num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
4336
.channel_mode = alc880_sixstack_modes,
4337
.input_mux = &alc880_6stack_capture_source,
4339
[ALC880_6ST_DIG] = {
4340
.mixers = { alc880_six_stack_mixer },
4341
.init_verbs = { alc880_volume_init_verbs,
4342
alc880_pin_6stack_init_verbs },
4343
.num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
4344
.dac_nids = alc880_6st_dac_nids,
4345
.dig_out_nid = ALC880_DIGOUT_NID,
4346
.num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
4347
.channel_mode = alc880_sixstack_modes,
4348
.input_mux = &alc880_6stack_capture_source,
4351
.mixers = { alc880_w810_base_mixer },
4352
.init_verbs = { alc880_volume_init_verbs,
4353
alc880_pin_w810_init_verbs,
4354
alc880_gpio2_init_verbs },
4355
.num_dacs = ARRAY_SIZE(alc880_w810_dac_nids),
4356
.dac_nids = alc880_w810_dac_nids,
4357
.dig_out_nid = ALC880_DIGOUT_NID,
4358
.num_channel_mode = ARRAY_SIZE(alc880_w810_modes),
4359
.channel_mode = alc880_w810_modes,
4360
.input_mux = &alc880_capture_source,
4363
.mixers = { alc880_z71v_mixer },
4364
.init_verbs = { alc880_volume_init_verbs,
4365
alc880_pin_z71v_init_verbs },
4366
.num_dacs = ARRAY_SIZE(alc880_z71v_dac_nids),
4367
.dac_nids = alc880_z71v_dac_nids,
4368
.dig_out_nid = ALC880_DIGOUT_NID,
4370
.num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
4371
.channel_mode = alc880_2_jack_modes,
4372
.input_mux = &alc880_capture_source,
4375
.mixers = { alc880_f1734_mixer },
4376
.init_verbs = { alc880_volume_init_verbs,
4377
alc880_pin_f1734_init_verbs },
4378
.num_dacs = ARRAY_SIZE(alc880_f1734_dac_nids),
4379
.dac_nids = alc880_f1734_dac_nids,
4381
.num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
4382
.channel_mode = alc880_2_jack_modes,
4383
.input_mux = &alc880_f1734_capture_source,
4384
.unsol_event = alc880_uniwill_p53_unsol_event,
4385
.setup = alc880_uniwill_p53_setup,
4386
.init_hook = alc_automute_amp,
4389
.mixers = { alc880_asus_mixer },
4390
.init_verbs = { alc880_volume_init_verbs,
4391
alc880_pin_asus_init_verbs,
4392
alc880_gpio1_init_verbs },
4393
.num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
4394
.dac_nids = alc880_asus_dac_nids,
4395
.num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
4396
.channel_mode = alc880_asus_modes,
4398
.input_mux = &alc880_capture_source,
4400
[ALC880_ASUS_DIG] = {
4401
.mixers = { alc880_asus_mixer },
4402
.init_verbs = { alc880_volume_init_verbs,
4403
alc880_pin_asus_init_verbs,
4404
alc880_gpio1_init_verbs },
4405
.num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
4406
.dac_nids = alc880_asus_dac_nids,
4407
.dig_out_nid = ALC880_DIGOUT_NID,
4408
.num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
4409
.channel_mode = alc880_asus_modes,
4411
.input_mux = &alc880_capture_source,
4413
[ALC880_ASUS_DIG2] = {
4414
.mixers = { alc880_asus_mixer },
4415
.init_verbs = { alc880_volume_init_verbs,
4416
alc880_pin_asus_init_verbs,
4417
alc880_gpio2_init_verbs }, /* use GPIO2 */
4418
.num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
4419
.dac_nids = alc880_asus_dac_nids,
4420
.dig_out_nid = ALC880_DIGOUT_NID,
4421
.num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
4422
.channel_mode = alc880_asus_modes,
4424
.input_mux = &alc880_capture_source,
4426
[ALC880_ASUS_W1V] = {
4427
.mixers = { alc880_asus_mixer, alc880_asus_w1v_mixer },
4428
.init_verbs = { alc880_volume_init_verbs,
4429
alc880_pin_asus_init_verbs,
4430
alc880_gpio1_init_verbs },
4431
.num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
4432
.dac_nids = alc880_asus_dac_nids,
4433
.dig_out_nid = ALC880_DIGOUT_NID,
4434
.num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
4435
.channel_mode = alc880_asus_modes,
4437
.input_mux = &alc880_capture_source,
4439
[ALC880_UNIWILL_DIG] = {
4440
.mixers = { alc880_asus_mixer },
4441
.init_verbs = { alc880_volume_init_verbs,
4442
alc880_pin_asus_init_verbs },
4443
.num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
4444
.dac_nids = alc880_asus_dac_nids,
4445
.dig_out_nid = ALC880_DIGOUT_NID,
4446
.num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
4447
.channel_mode = alc880_asus_modes,
4449
.input_mux = &alc880_capture_source,
4451
[ALC880_UNIWILL] = {
4452
.mixers = { alc880_uniwill_mixer },
4453
.init_verbs = { alc880_volume_init_verbs,
4454
alc880_uniwill_init_verbs },
4455
.num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
4456
.dac_nids = alc880_asus_dac_nids,
4457
.dig_out_nid = ALC880_DIGOUT_NID,
4458
.num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
4459
.channel_mode = alc880_threestack_modes,
4461
.input_mux = &alc880_capture_source,
4462
.unsol_event = alc880_uniwill_unsol_event,
4463
.setup = alc880_uniwill_setup,
4464
.init_hook = alc880_uniwill_init_hook,
4466
[ALC880_UNIWILL_P53] = {
4467
.mixers = { alc880_uniwill_p53_mixer },
4468
.init_verbs = { alc880_volume_init_verbs,
4469
alc880_uniwill_p53_init_verbs },
4470
.num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
4471
.dac_nids = alc880_asus_dac_nids,
4472
.num_channel_mode = ARRAY_SIZE(alc880_w810_modes),
4473
.channel_mode = alc880_threestack_modes,
4474
.input_mux = &alc880_capture_source,
4475
.unsol_event = alc880_uniwill_p53_unsol_event,
4476
.setup = alc880_uniwill_p53_setup,
4477
.init_hook = alc_automute_amp,
4479
[ALC880_FUJITSU] = {
4480
.mixers = { alc880_fujitsu_mixer },
4481
.init_verbs = { alc880_volume_init_verbs,
4482
alc880_uniwill_p53_init_verbs,
4483
alc880_beep_init_verbs },
4484
.num_dacs = ARRAY_SIZE(alc880_dac_nids),
4485
.dac_nids = alc880_dac_nids,
4486
.dig_out_nid = ALC880_DIGOUT_NID,
4487
.num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
4488
.channel_mode = alc880_2_jack_modes,
4489
.input_mux = &alc880_capture_source,
4490
.unsol_event = alc880_uniwill_p53_unsol_event,
4491
.setup = alc880_uniwill_p53_setup,
4492
.init_hook = alc_automute_amp,
4495
.mixers = { alc880_three_stack_mixer },
4496
.init_verbs = { alc880_volume_init_verbs,
4497
alc880_pin_clevo_init_verbs },
4498
.num_dacs = ARRAY_SIZE(alc880_dac_nids),
4499
.dac_nids = alc880_dac_nids,
4501
.num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
4502
.channel_mode = alc880_threestack_modes,
4504
.input_mux = &alc880_capture_source,
4507
.mixers = { alc880_lg_mixer },
4508
.init_verbs = { alc880_volume_init_verbs,
4509
alc880_lg_init_verbs },
4510
.num_dacs = ARRAY_SIZE(alc880_lg_dac_nids),
4511
.dac_nids = alc880_lg_dac_nids,
4512
.dig_out_nid = ALC880_DIGOUT_NID,
4513
.num_channel_mode = ARRAY_SIZE(alc880_lg_ch_modes),
4514
.channel_mode = alc880_lg_ch_modes,
4516
.input_mux = &alc880_lg_capture_source,
4517
.unsol_event = alc_automute_amp_unsol_event,
4518
.setup = alc880_lg_setup,
4519
.init_hook = alc_automute_amp,
4520
#ifdef CONFIG_SND_HDA_POWER_SAVE
4521
.loopbacks = alc880_lg_loopbacks,
4525
.mixers = { alc880_lg_lw_mixer },
4526
.init_verbs = { alc880_volume_init_verbs,
4527
alc880_lg_lw_init_verbs },
4528
.num_dacs = ARRAY_SIZE(alc880_dac_nids),
4529
.dac_nids = alc880_dac_nids,
4530
.dig_out_nid = ALC880_DIGOUT_NID,
4531
.num_channel_mode = ARRAY_SIZE(alc880_lg_lw_modes),
4532
.channel_mode = alc880_lg_lw_modes,
4533
.input_mux = &alc880_lg_lw_capture_source,
4534
.unsol_event = alc_automute_amp_unsol_event,
4535
.setup = alc880_lg_lw_setup,
4536
.init_hook = alc_automute_amp,
4538
[ALC880_MEDION_RIM] = {
4539
.mixers = { alc880_medion_rim_mixer },
4540
.init_verbs = { alc880_volume_init_verbs,
4541
alc880_medion_rim_init_verbs,
4542
alc_gpio2_init_verbs },
4543
.num_dacs = ARRAY_SIZE(alc880_dac_nids),
4544
.dac_nids = alc880_dac_nids,
4545
.dig_out_nid = ALC880_DIGOUT_NID,
4546
.num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
4547
.channel_mode = alc880_2_jack_modes,
4548
.input_mux = &alc880_medion_rim_capture_source,
4549
.unsol_event = alc880_medion_rim_unsol_event,
4550
.setup = alc880_medion_rim_setup,
4551
.init_hook = alc880_medion_rim_automute,
4553
#ifdef CONFIG_SND_DEBUG
4555
.mixers = { alc880_test_mixer },
4556
.init_verbs = { alc880_test_init_verbs },
4557
.num_dacs = ARRAY_SIZE(alc880_test_dac_nids),
4558
.dac_nids = alc880_test_dac_nids,
4559
.dig_out_nid = ALC880_DIGOUT_NID,
4560
.num_channel_mode = ARRAY_SIZE(alc880_test_modes),
4561
.channel_mode = alc880_test_modes,
4562
.input_mux = &alc880_test_capture_source,
4568
* Automatic parse of I/O pins from the BIOS configuration
4573
ALC_CTL_WIDGET_MUTE,
4576
static struct snd_kcontrol_new alc880_control_templates[] = {
4577
HDA_CODEC_VOLUME(NULL, 0, 0, 0),
4578
HDA_CODEC_MUTE(NULL, 0, 0, 0),
4579
HDA_BIND_MUTE(NULL, 0, 0, 0),
4582
/* add dynamic controls */
4583
static int add_control(struct alc_spec *spec, int type, const char *name,
4586
struct snd_kcontrol_new *knew;
4588
snd_array_init(&spec->kctls, sizeof(*knew), 32);
4589
knew = snd_array_new(&spec->kctls);
4592
*knew = alc880_control_templates[type];
4593
knew->name = kstrdup(name, GFP_KERNEL);
4596
if (get_amp_nid_(val))
4597
knew->subdevice = HDA_SUBDEV_AMP_FLAG;
4598
knew->private_value = val;
4602
static int add_control_with_pfx(struct alc_spec *spec, int type,
4603
const char *pfx, const char *dir,
4604
const char *sfx, unsigned long val)
4607
snprintf(name, sizeof(name), "%s %s %s", pfx, dir, sfx);
4608
return add_control(spec, type, name, val);
4611
#define add_pb_vol_ctrl(spec, type, pfx, val) \
4612
add_control_with_pfx(spec, type, pfx, "Playback", "Volume", val)
4613
#define add_pb_sw_ctrl(spec, type, pfx, val) \
4614
add_control_with_pfx(spec, type, pfx, "Playback", "Switch", val)
4616
#define alc880_is_fixed_pin(nid) ((nid) >= 0x14 && (nid) <= 0x17)
4617
#define alc880_fixed_pin_idx(nid) ((nid) - 0x14)
4618
#define alc880_is_multi_pin(nid) ((nid) >= 0x18)
4619
#define alc880_multi_pin_idx(nid) ((nid) - 0x18)
4620
#define alc880_idx_to_dac(nid) ((nid) + 0x02)
4621
#define alc880_dac_to_idx(nid) ((nid) - 0x02)
4622
#define alc880_idx_to_mixer(nid) ((nid) + 0x0c)
4623
#define alc880_idx_to_selector(nid) ((nid) + 0x10)
4624
#define ALC880_PIN_CD_NID 0x1c
4626
/* fill in the dac_nids table from the parsed pin configuration */
4627
static int alc880_auto_fill_dac_nids(struct alc_spec *spec,
4628
const struct auto_pin_cfg *cfg)
4634
memset(assigned, 0, sizeof(assigned));
4635
spec->multiout.dac_nids = spec->private_dac_nids;
4637
/* check the pins hardwired to audio widget */
4638
for (i = 0; i < cfg->line_outs; i++) {
4639
nid = cfg->line_out_pins[i];
4640
if (alc880_is_fixed_pin(nid)) {
4641
int idx = alc880_fixed_pin_idx(nid);
4642
spec->multiout.dac_nids[i] = alc880_idx_to_dac(idx);
4646
/* left pins can be connect to any audio widget */
4647
for (i = 0; i < cfg->line_outs; i++) {
4648
nid = cfg->line_out_pins[i];
4649
if (alc880_is_fixed_pin(nid))
4651
/* search for an empty channel */
4652
for (j = 0; j < cfg->line_outs; j++) {
4654
spec->multiout.dac_nids[i] =
4655
alc880_idx_to_dac(j);
4661
spec->multiout.num_dacs = cfg->line_outs;
4665
/* add playback controls from the parsed DAC table */
4666
static int alc880_auto_create_multi_out_ctls(struct alc_spec *spec,
4667
const struct auto_pin_cfg *cfg)
4669
static const char *chname[4] = {
4670
"Front", "Surround", NULL /*CLFE*/, "Side"
4675
for (i = 0; i < cfg->line_outs; i++) {
4676
if (!spec->multiout.dac_nids[i])
4678
nid = alc880_idx_to_mixer(alc880_dac_to_idx(spec->multiout.dac_nids[i]));
4681
err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL,
4683
HDA_COMPOSE_AMP_VAL(nid, 1, 0,
4687
err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL,
4689
HDA_COMPOSE_AMP_VAL(nid, 2, 0,
4693
err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE,
4695
HDA_COMPOSE_AMP_VAL(nid, 1, 2,
4699
err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE,
4701
HDA_COMPOSE_AMP_VAL(nid, 2, 2,
4707
if (cfg->line_outs == 1 &&
4708
cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)
4712
err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, pfx,
4713
HDA_COMPOSE_AMP_VAL(nid, 3, 0,
4717
err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE, pfx,
4718
HDA_COMPOSE_AMP_VAL(nid, 3, 2,
4727
/* add playback controls for speaker and HP outputs */
4728
static int alc880_auto_create_extra_out(struct alc_spec *spec, hda_nid_t pin,
4737
if (alc880_is_fixed_pin(pin)) {
4738
nid = alc880_idx_to_dac(alc880_fixed_pin_idx(pin));
4739
/* specify the DAC as the extra output */
4740
if (!spec->multiout.hp_nid)
4741
spec->multiout.hp_nid = nid;
4743
spec->multiout.extra_out_nid[0] = nid;
4744
/* control HP volume/switch on the output mixer amp */
4745
nid = alc880_idx_to_mixer(alc880_fixed_pin_idx(pin));
4746
err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, pfx,
4747
HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT));
4750
err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE, pfx,
4751
HDA_COMPOSE_AMP_VAL(nid, 3, 2, HDA_INPUT));
4754
} else if (alc880_is_multi_pin(pin)) {
4755
/* set manual connection */
4756
/* we have only a switch on HP-out PIN */
4757
err = add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx,
4758
HDA_COMPOSE_AMP_VAL(pin, 3, 0, HDA_OUTPUT));
4765
/* create input playback/capture controls for the given pin */
4766
static int new_analog_input(struct alc_spec *spec, hda_nid_t pin,
4767
const char *ctlname,
4768
int idx, hda_nid_t mix_nid)
4772
err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, ctlname,
4773
HDA_COMPOSE_AMP_VAL(mix_nid, 3, idx, HDA_INPUT));
4776
err = add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, ctlname,
4777
HDA_COMPOSE_AMP_VAL(mix_nid, 3, idx, HDA_INPUT));
4783
static int alc_is_input_pin(struct hda_codec *codec, hda_nid_t nid)
4785
unsigned int pincap = snd_hda_query_pin_caps(codec, nid);
4786
return (pincap & AC_PINCAP_IN) != 0;
4789
/* create playback/capture controls for input pins */
4790
static int alc_auto_create_input_ctls(struct hda_codec *codec,
4791
const struct auto_pin_cfg *cfg,
4793
hda_nid_t cap1, hda_nid_t cap2)
4795
struct alc_spec *spec = codec->spec;
4796
struct hda_input_mux *imux = &spec->private_imux[0];
4799
for (i = 0; i < AUTO_PIN_LAST; i++) {
4802
pin = cfg->input_pins[i];
4803
if (!alc_is_input_pin(codec, pin))
4807
idx = get_connection_index(codec, mixer, pin);
4809
err = new_analog_input(spec, pin,
4810
auto_pin_cfg_labels[i],
4819
idx = get_connection_index(codec, cap1, pin);
4820
if (idx < 0 && cap2)
4821
idx = get_connection_index(codec, cap2, pin);
4823
imux->items[imux->num_items].label =
4824
auto_pin_cfg_labels[i];
4825
imux->items[imux->num_items].index = idx;
4832
static int alc880_auto_create_input_ctls(struct hda_codec *codec,
4833
const struct auto_pin_cfg *cfg)
4835
return alc_auto_create_input_ctls(codec, cfg, 0x0b, 0x08, 0x09);
4838
static void alc_set_pin_output(struct hda_codec *codec, hda_nid_t nid,
4839
unsigned int pin_type)
4841
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4844
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
4848
static void alc880_auto_set_output_and_unmute(struct hda_codec *codec,
4849
hda_nid_t nid, int pin_type,
4852
alc_set_pin_output(codec, nid, pin_type);
4853
/* need the manual connection? */
4854
if (alc880_is_multi_pin(nid)) {
4855
struct alc_spec *spec = codec->spec;
4856
int idx = alc880_multi_pin_idx(nid);
4857
snd_hda_codec_write(codec, alc880_idx_to_selector(idx), 0,
4858
AC_VERB_SET_CONNECT_SEL,
4859
alc880_dac_to_idx(spec->multiout.dac_nids[dac_idx]));
4863
static int get_pin_type(int line_out_type)
4865
if (line_out_type == AUTO_PIN_HP_OUT)
4871
static void alc880_auto_init_multi_out(struct hda_codec *codec)
4873
struct alc_spec *spec = codec->spec;
4876
for (i = 0; i < spec->autocfg.line_outs; i++) {
4877
hda_nid_t nid = spec->autocfg.line_out_pins[i];
4878
int pin_type = get_pin_type(spec->autocfg.line_out_type);
4879
alc880_auto_set_output_and_unmute(codec, nid, pin_type, i);
4883
static void alc880_auto_init_extra_out(struct hda_codec *codec)
4885
struct alc_spec *spec = codec->spec;
4888
pin = spec->autocfg.speaker_pins[0];
4889
if (pin) /* connect to front */
4890
alc880_auto_set_output_and_unmute(codec, pin, PIN_OUT, 0);
4891
pin = spec->autocfg.hp_pins[0];
4892
if (pin) /* connect to front */
4893
alc880_auto_set_output_and_unmute(codec, pin, PIN_HP, 0);
4896
static void alc880_auto_init_analog_input(struct hda_codec *codec)
4898
struct alc_spec *spec = codec->spec;
4901
for (i = 0; i < AUTO_PIN_LAST; i++) {
4902
hda_nid_t nid = spec->autocfg.input_pins[i];
4903
if (alc_is_input_pin(codec, nid)) {
4904
alc_set_input_pin(codec, nid, i);
4905
if (nid != ALC880_PIN_CD_NID &&
4906
(get_wcaps(codec, nid) & AC_WCAP_OUT_AMP))
4907
snd_hda_codec_write(codec, nid, 0,
4908
AC_VERB_SET_AMP_GAIN_MUTE,
4914
static void alc880_auto_init_input_src(struct hda_codec *codec)
4916
struct alc_spec *spec = codec->spec;
4919
for (c = 0; c < spec->num_adc_nids; c++) {
4920
unsigned int mux_idx;
4921
const struct hda_input_mux *imux;
4922
mux_idx = c >= spec->num_mux_defs ? 0 : c;
4923
imux = &spec->input_mux[mux_idx];
4924
if (!imux->num_items && mux_idx > 0)
4925
imux = &spec->input_mux[0];
4927
snd_hda_codec_write(codec, spec->adc_nids[c], 0,
4928
AC_VERB_SET_CONNECT_SEL,
4929
imux->items[0].index);
4933
/* parse the BIOS configuration and set up the alc_spec */
4934
/* return 1 if successful, 0 if the proper config is not found,
4935
* or a negative error code
4937
static int alc880_parse_auto_config(struct hda_codec *codec)
4939
struct alc_spec *spec = codec->spec;
4941
static hda_nid_t alc880_ignore[] = { 0x1d, 0 };
4943
err = snd_hda_parse_pin_def_config(codec, &spec->autocfg,
4947
if (!spec->autocfg.line_outs)
4948
return 0; /* can't find valid BIOS pin config */
4950
err = alc880_auto_fill_dac_nids(spec, &spec->autocfg);
4953
err = alc880_auto_create_multi_out_ctls(spec, &spec->autocfg);
4956
err = alc880_auto_create_extra_out(spec,
4957
spec->autocfg.speaker_pins[0],
4961
err = alc880_auto_create_extra_out(spec, spec->autocfg.hp_pins[0],
4965
err = alc880_auto_create_input_ctls(codec, &spec->autocfg);
4969
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
4971
/* check multiple SPDIF-out (for recent codecs) */
4972
for (i = 0; i < spec->autocfg.dig_outs; i++) {
4974
err = snd_hda_get_connections(codec,
4975
spec->autocfg.dig_out_pins[i],
4980
spec->multiout.dig_out_nid = dig_nid;
4982
spec->multiout.slave_dig_outs = spec->slave_dig_outs;
4983
if (i >= ARRAY_SIZE(spec->slave_dig_outs) - 1)
4985
spec->slave_dig_outs[i - 1] = dig_nid;
4988
if (spec->autocfg.dig_in_pin)
4989
spec->dig_in_nid = ALC880_DIGIN_NID;
4991
if (spec->kctls.list)
4992
add_mixer(spec, spec->kctls.list);
4994
add_verb(spec, alc880_volume_init_verbs);
4996
spec->num_mux_defs = 1;
4997
spec->input_mux = &spec->private_imux[0];
4999
alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0);
5004
/* additional initialization for auto-configuration model */
5005
static void alc880_auto_init(struct hda_codec *codec)
5007
struct alc_spec *spec = codec->spec;
5008
alc880_auto_init_multi_out(codec);
5009
alc880_auto_init_extra_out(codec);
5010
alc880_auto_init_analog_input(codec);
5011
alc880_auto_init_input_src(codec);
5012
if (spec->unsol_event)
5013
alc_inithook(codec);
5016
/* check the ADC/MUX contains all input pins; some ADC/MUX contains only
5017
* one of two digital mic pins, e.g. on ALC272
5019
static void fixup_automic_adc(struct hda_codec *codec)
5021
struct alc_spec *spec = codec->spec;
5024
for (i = 0; i < spec->num_adc_nids; i++) {
5025
hda_nid_t cap = spec->capsrc_nids ?
5026
spec->capsrc_nids[i] : spec->adc_nids[i];
5029
iidx = get_connection_index(codec, cap, spec->int_mic.pin);
5032
eidx = get_connection_index(codec, cap, spec->ext_mic.pin);
5035
spec->int_mic.mux_idx = iidx;
5036
spec->ext_mic.mux_idx = eidx;
5037
if (spec->capsrc_nids)
5038
spec->capsrc_nids += i;
5039
spec->adc_nids += i;
5040
spec->num_adc_nids = 1;
5043
snd_printd(KERN_INFO "hda_codec: %s: "
5044
"No ADC/MUX containing both 0x%x and 0x%x pins\n",
5045
codec->chip_name, spec->int_mic.pin, spec->ext_mic.pin);
5046
spec->auto_mic = 0; /* disable auto-mic to be sure */
5049
/* choose the ADC/MUX containing the input pin and initialize the setup */
5050
static void fixup_single_adc(struct hda_codec *codec)
5052
struct alc_spec *spec = codec->spec;
5056
/* search for the input pin; there must be only one */
5057
for (i = 0; i < AUTO_PIN_LAST; i++) {
5058
if (spec->autocfg.input_pins[i]) {
5059
pin = spec->autocfg.input_pins[i];
5066
/* set the default connection to that pin */
5067
for (i = 0; i < spec->num_adc_nids; i++) {
5068
hda_nid_t cap = spec->capsrc_nids ?
5069
spec->capsrc_nids[i] : spec->adc_nids[i];
5072
idx = get_connection_index(codec, cap, pin);
5075
/* use only this ADC */
5076
if (spec->capsrc_nids)
5077
spec->capsrc_nids += i;
5078
spec->adc_nids += i;
5079
spec->num_adc_nids = 1;
5080
/* select or unmute this route */
5081
if (get_wcaps_type(get_wcaps(codec, cap)) == AC_WID_AUD_MIX) {
5082
snd_hda_codec_amp_stereo(codec, cap, HDA_INPUT, idx,
5085
snd_hda_codec_write_cache(codec, cap, 0,
5086
AC_VERB_SET_CONNECT_SEL, idx);
5092
static void set_capture_mixer(struct hda_codec *codec)
5094
struct alc_spec *spec = codec->spec;
5095
static struct snd_kcontrol_new *caps[2][3] = {
5096
{ alc_capture_mixer_nosrc1,
5097
alc_capture_mixer_nosrc2,
5098
alc_capture_mixer_nosrc3 },
5099
{ alc_capture_mixer1,
5101
alc_capture_mixer3 },
5103
if (spec->num_adc_nids > 0 && spec->num_adc_nids <= 3) {
5106
fixup_automic_adc(codec);
5107
else if (spec->input_mux) {
5108
if (spec->input_mux->num_items > 1)
5110
else if (spec->input_mux->num_items == 1)
5111
fixup_single_adc(codec);
5113
spec->cap_mixer = caps[mux][spec->num_adc_nids - 1];
5117
/* fill adc_nids (and capsrc_nids) containing all active input pins */
5118
static void fillup_priv_adc_nids(struct hda_codec *codec, hda_nid_t *nids,
5121
struct alc_spec *spec = codec->spec;
5123
hda_nid_t fallback_adc = 0, fallback_cap = 0;
5125
for (n = 0; n < num_nids; n++) {
5127
hda_nid_t conn[HDA_MAX_NUM_INPUTS];
5131
if (get_wcaps_type(get_wcaps(codec, adc)) != AC_WID_AUD_IN)
5134
nconns = snd_hda_get_connections(codec, cap, conn,
5138
nconns = snd_hda_get_connections(codec, cap, conn,
5143
if (!fallback_adc) {
5147
for (i = 0; i < AUTO_PIN_LAST; i++) {
5148
hda_nid_t nid = spec->autocfg.input_pins[i];
5151
for (j = 0; j < nconns; j++) {
5158
if (i >= AUTO_PIN_LAST) {
5159
int num_adcs = spec->num_adc_nids;
5160
spec->private_adc_nids[num_adcs] = adc;
5161
spec->private_capsrc_nids[num_adcs] = cap;
5162
spec->num_adc_nids++;
5163
spec->adc_nids = spec->private_adc_nids;
5165
spec->capsrc_nids = spec->private_capsrc_nids;
5168
if (!spec->num_adc_nids) {
5169
printk(KERN_WARNING "hda_codec: %s: no valid ADC found;"
5170
" using fallback 0x%x\n",
5171
codec->chip_name, fallback_adc);
5172
spec->private_adc_nids[0] = fallback_adc;
5173
spec->adc_nids = spec->private_adc_nids;
5174
if (fallback_adc != fallback_cap) {
5175
spec->private_capsrc_nids[0] = fallback_cap;
5176
spec->capsrc_nids = spec->private_adc_nids;
5181
#ifdef CONFIG_SND_HDA_INPUT_BEEP
5182
#define set_beep_amp(spec, nid, idx, dir) \
5183
((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
5185
static struct snd_pci_quirk beep_white_list[] = {
5186
SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
5187
SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
5191
static inline int has_cdefine_beep(struct hda_codec *codec)
5193
struct alc_spec *spec = codec->spec;
5194
const struct snd_pci_quirk *q;
5195
q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list);
5198
return spec->cdefine.enable_pcbeep;
5201
#define set_beep_amp(spec, nid, idx, dir) /* NOP */
5202
#define has_cdefine_beep(codec) 0
5206
* OK, here we have finally the patch for ALC880
5209
static int patch_alc880(struct hda_codec *codec)
5211
struct alc_spec *spec;
5215
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
5221
board_config = snd_hda_check_board_config(codec, ALC880_MODEL_LAST,
5224
if (board_config < 0) {
5225
printk(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n",
5227
board_config = ALC880_AUTO;
5230
if (board_config == ALC880_AUTO) {
5231
/* automatic parse from the BIOS config */
5232
err = alc880_parse_auto_config(codec);
5238
"hda_codec: Cannot set up configuration "
5239
"from BIOS. Using 3-stack mode...\n");
5240
board_config = ALC880_3ST;
5244
err = snd_hda_attach_beep_device(codec, 0x1);
5250
if (board_config != ALC880_AUTO)
5251
setup_preset(codec, &alc880_presets[board_config]);
5253
spec->stream_analog_playback = &alc880_pcm_analog_playback;
5254
spec->stream_analog_capture = &alc880_pcm_analog_capture;
5255
spec->stream_analog_alt_capture = &alc880_pcm_analog_alt_capture;
5257
spec->stream_digital_playback = &alc880_pcm_digital_playback;
5258
spec->stream_digital_capture = &alc880_pcm_digital_capture;
5260
if (!spec->adc_nids && spec->input_mux) {
5261
/* check whether NID 0x07 is valid */
5262
unsigned int wcap = get_wcaps(codec, alc880_adc_nids[0]);
5264
wcap = get_wcaps_type(wcap);
5265
if (wcap != AC_WID_AUD_IN) {
5266
spec->adc_nids = alc880_adc_nids_alt;
5267
spec->num_adc_nids = ARRAY_SIZE(alc880_adc_nids_alt);
5269
spec->adc_nids = alc880_adc_nids;
5270
spec->num_adc_nids = ARRAY_SIZE(alc880_adc_nids);
5273
set_capture_mixer(codec);
5274
set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
5276
spec->vmaster_nid = 0x0c;
5278
codec->patch_ops = alc_patch_ops;
5279
if (board_config == ALC880_AUTO)
5280
spec->init_hook = alc880_auto_init;
5281
#ifdef CONFIG_SND_HDA_POWER_SAVE
5282
if (!spec->loopback.amplist)
5283
spec->loopback.amplist = alc880_loopbacks;
5294
static hda_nid_t alc260_dac_nids[1] = {
5299
static hda_nid_t alc260_adc_nids[1] = {
5304
static hda_nid_t alc260_adc_nids_alt[1] = {
5309
/* NIDs used when simultaneous access to both ADCs makes sense. Note that
5310
* alc260_capture_mixer assumes ADC0 (nid 0x04) is the first ADC.
5312
static hda_nid_t alc260_dual_adc_nids[2] = {
5317
#define ALC260_DIGOUT_NID 0x03
5318
#define ALC260_DIGIN_NID 0x06
5320
static struct hda_input_mux alc260_capture_source = {
5324
{ "Front Mic", 0x1 },
5330
/* On Fujitsu S702x laptops capture only makes sense from Mic/LineIn jack,
5331
* headphone jack and the internal CD lines since these are the only pins at
5332
* which audio can appear. For flexibility, also allow the option of
5333
* recording the mixer output on the second ADC (ADC0 doesn't have a
5334
* connection to the mixer output).
5336
static struct hda_input_mux alc260_fujitsu_capture_sources[2] = {
5340
{ "Mic/Line", 0x0 },
5342
{ "Headphone", 0x2 },
5348
{ "Mic/Line", 0x0 },
5350
{ "Headphone", 0x2 },
5357
/* Acer TravelMate(/Extensa/Aspire) notebooks have similar configuration to
5358
* the Fujitsu S702x, but jacks are marked differently.
5360
static struct hda_input_mux alc260_acer_capture_sources[2] = {
5367
{ "Headphone", 0x5 },
5376
{ "Headphone", 0x6 },
5382
/* Maxdata Favorit 100XS */
5383
static struct hda_input_mux alc260_favorit100_capture_sources[2] = {
5387
{ "Line/Mic", 0x0 },
5394
{ "Line/Mic", 0x0 },
5402
* This is just place-holder, so there's something for alc_build_pcms to look
5403
* at when it calculates the maximum number of channels. ALC260 has no mixer
5404
* element which allows changing the channel mode, so the verb list is
5407
static struct hda_channel_mode alc260_modes[1] = {
5412
/* Mixer combinations
5414
* basic: base_output + input + pc_beep + capture
5415
* HP: base_output + input + capture_alt
5416
* HP_3013: hp_3013 + input + capture
5417
* fujitsu: fujitsu + capture
5418
* acer: acer + capture
5421
static struct snd_kcontrol_new alc260_base_output_mixer[] = {
5422
HDA_CODEC_VOLUME("Front Playback Volume", 0x08, 0x0, HDA_OUTPUT),
5423
HDA_BIND_MUTE("Front Playback Switch", 0x08, 2, HDA_INPUT),
5424
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x09, 0x0, HDA_OUTPUT),
5425
HDA_BIND_MUTE("Headphone Playback Switch", 0x09, 2, HDA_INPUT),
5426
HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT),
5427
HDA_BIND_MUTE_MONO("Mono Playback Switch", 0x0a, 1, 2, HDA_INPUT),
5431
static struct snd_kcontrol_new alc260_input_mixer[] = {
5432
HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT),
5433
HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT),
5434
HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT),
5435
HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT),
5436
HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT),
5437
HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT),
5438
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x07, 0x01, HDA_INPUT),
5439
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x07, 0x01, HDA_INPUT),
5443
/* update HP, line and mono out pins according to the master switch */
5444
static void alc260_hp_master_update(struct hda_codec *codec,
5445
hda_nid_t hp, hda_nid_t line,
5448
struct alc_spec *spec = codec->spec;
5449
unsigned int val = spec->master_sw ? PIN_HP : 0;
5450
/* change HP and line-out pins */
5451
snd_hda_codec_write(codec, hp, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5453
snd_hda_codec_write(codec, line, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5455
/* mono (speaker) depending on the HP jack sense */
5456
val = (val && !spec->jack_present) ? PIN_OUT : 0;
5457
snd_hda_codec_write(codec, mono, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5461
static int alc260_hp_master_sw_get(struct snd_kcontrol *kcontrol,
5462
struct snd_ctl_elem_value *ucontrol)
5464
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
5465
struct alc_spec *spec = codec->spec;
5466
*ucontrol->value.integer.value = spec->master_sw;
5470
static int alc260_hp_master_sw_put(struct snd_kcontrol *kcontrol,
5471
struct snd_ctl_elem_value *ucontrol)
5473
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
5474
struct alc_spec *spec = codec->spec;
5475
int val = !!*ucontrol->value.integer.value;
5476
hda_nid_t hp, line, mono;
5478
if (val == spec->master_sw)
5480
spec->master_sw = val;
5481
hp = (kcontrol->private_value >> 16) & 0xff;
5482
line = (kcontrol->private_value >> 8) & 0xff;
5483
mono = kcontrol->private_value & 0xff;
5484
alc260_hp_master_update(codec, hp, line, mono);
5488
static struct snd_kcontrol_new alc260_hp_output_mixer[] = {
5490
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
5491
.name = "Master Playback Switch",
5492
.subdevice = HDA_SUBDEV_NID_FLAG | 0x11,
5493
.info = snd_ctl_boolean_mono_info,
5494
.get = alc260_hp_master_sw_get,
5495
.put = alc260_hp_master_sw_put,
5496
.private_value = (0x0f << 16) | (0x10 << 8) | 0x11
5498
HDA_CODEC_VOLUME("Front Playback Volume", 0x08, 0x0, HDA_OUTPUT),
5499
HDA_BIND_MUTE("Front Playback Switch", 0x08, 2, HDA_INPUT),
5500
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x09, 0x0, HDA_OUTPUT),
5501
HDA_BIND_MUTE("Headphone Playback Switch", 0x09, 2, HDA_INPUT),
5502
HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0a, 1, 0x0,
5504
HDA_BIND_MUTE_MONO("Speaker Playback Switch", 0x0a, 1, 2, HDA_INPUT),
5508
static struct hda_verb alc260_hp_unsol_verbs[] = {
5509
{0x10, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
5513
static void alc260_hp_automute(struct hda_codec *codec)
5515
struct alc_spec *spec = codec->spec;
5517
spec->jack_present = snd_hda_jack_detect(codec, 0x10);
5518
alc260_hp_master_update(codec, 0x0f, 0x10, 0x11);
5521
static void alc260_hp_unsol_event(struct hda_codec *codec, unsigned int res)
5523
if ((res >> 26) == ALC880_HP_EVENT)
5524
alc260_hp_automute(codec);
5527
static struct snd_kcontrol_new alc260_hp_3013_mixer[] = {
5529
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
5530
.name = "Master Playback Switch",
5531
.subdevice = HDA_SUBDEV_NID_FLAG | 0x11,
5532
.info = snd_ctl_boolean_mono_info,
5533
.get = alc260_hp_master_sw_get,
5534
.put = alc260_hp_master_sw_put,
5535
.private_value = (0x15 << 16) | (0x10 << 8) | 0x11
5537
HDA_CODEC_VOLUME("Front Playback Volume", 0x09, 0x0, HDA_OUTPUT),
5538
HDA_CODEC_MUTE("Front Playback Switch", 0x10, 0x0, HDA_OUTPUT),
5539
HDA_CODEC_VOLUME("Aux-In Playback Volume", 0x07, 0x06, HDA_INPUT),
5540
HDA_CODEC_MUTE("Aux-In Playback Switch", 0x07, 0x06, HDA_INPUT),
5541
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x08, 0x0, HDA_OUTPUT),
5542
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
5543
HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT),
5544
HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x11, 1, 0x0, HDA_OUTPUT),
5548
static struct hda_bind_ctls alc260_dc7600_bind_master_vol = {
5549
.ops = &snd_hda_bind_vol,
5551
HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_OUTPUT),
5552
HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_OUTPUT),
5553
HDA_COMPOSE_AMP_VAL(0x0a, 3, 0, HDA_OUTPUT),
5558
static struct hda_bind_ctls alc260_dc7600_bind_switch = {
5559
.ops = &snd_hda_bind_sw,
5561
HDA_COMPOSE_AMP_VAL(0x11, 3, 0, HDA_OUTPUT),
5562
HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT),
5567
static struct snd_kcontrol_new alc260_hp_dc7600_mixer[] = {
5568
HDA_BIND_VOL("Master Playback Volume", &alc260_dc7600_bind_master_vol),
5569
HDA_BIND_SW("LineOut Playback Switch", &alc260_dc7600_bind_switch),
5570
HDA_CODEC_MUTE("Speaker Playback Switch", 0x0f, 0x0, HDA_OUTPUT),
5571
HDA_CODEC_MUTE("Headphone Playback Switch", 0x10, 0x0, HDA_OUTPUT),
5575
static struct hda_verb alc260_hp_3013_unsol_verbs[] = {
5576
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
5580
static void alc260_hp_3013_automute(struct hda_codec *codec)
5582
struct alc_spec *spec = codec->spec;
5584
spec->jack_present = snd_hda_jack_detect(codec, 0x15);
5585
alc260_hp_master_update(codec, 0x15, 0x10, 0x11);
5588
static void alc260_hp_3013_unsol_event(struct hda_codec *codec,
5591
if ((res >> 26) == ALC880_HP_EVENT)
5592
alc260_hp_3013_automute(codec);
5595
static void alc260_hp_3012_automute(struct hda_codec *codec)
5597
unsigned int bits = snd_hda_jack_detect(codec, 0x10) ? 0 : PIN_OUT;
5599
snd_hda_codec_write(codec, 0x0f, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5601
snd_hda_codec_write(codec, 0x11, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5603
snd_hda_codec_write(codec, 0x15, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5607
static void alc260_hp_3012_unsol_event(struct hda_codec *codec,
5610
if ((res >> 26) == ALC880_HP_EVENT)
5611
alc260_hp_3012_automute(codec);
5614
/* Fujitsu S702x series laptops. ALC260 pin usage: Mic/Line jack = 0x12,
5615
* HP jack = 0x14, CD audio = 0x16, internal speaker = 0x10.
5617
static struct snd_kcontrol_new alc260_fujitsu_mixer[] = {
5618
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x08, 0x0, HDA_OUTPUT),
5619
HDA_BIND_MUTE("Headphone Playback Switch", 0x08, 2, HDA_INPUT),
5620
ALC_PIN_MODE("Headphone Jack Mode", 0x14, ALC_PIN_DIR_INOUT),
5621
HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT),
5622
HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT),
5623
HDA_CODEC_VOLUME("Mic/Line Playback Volume", 0x07, 0x0, HDA_INPUT),
5624
HDA_CODEC_MUTE("Mic/Line Playback Switch", 0x07, 0x0, HDA_INPUT),
5625
ALC_PIN_MODE("Mic/Line Jack Mode", 0x12, ALC_PIN_DIR_IN),
5626
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x09, 0x0, HDA_OUTPUT),
5627
HDA_BIND_MUTE("Speaker Playback Switch", 0x09, 2, HDA_INPUT),
5631
/* Mixer for Acer TravelMate(/Extensa/Aspire) notebooks. Note that current
5632
* versions of the ALC260 don't act on requests to enable mic bias from NID
5633
* 0x0f (used to drive the headphone jack in these laptops). The ALC260
5634
* datasheet doesn't mention this restriction. At this stage it's not clear
5635
* whether this behaviour is intentional or is a hardware bug in chip
5636
* revisions available in early 2006. Therefore for now allow the
5637
* "Headphone Jack Mode" control to span all choices, but if it turns out
5638
* that the lack of mic bias for this NID is intentional we could change the
5639
* mode from ALC_PIN_DIR_INOUT to ALC_PIN_DIR_INOUT_NOMICBIAS.
5641
* In addition, Acer TravelMate(/Extensa/Aspire) notebooks in early 2006
5642
* don't appear to make the mic bias available from the "line" jack, even
5643
* though the NID used for this jack (0x14) can supply it. The theory is
5644
* that perhaps Acer have included blocking capacitors between the ALC260
5645
* and the output jack. If this turns out to be the case for all such
5646
* models the "Line Jack Mode" mode could be changed from ALC_PIN_DIR_INOUT
5647
* to ALC_PIN_DIR_INOUT_NOMICBIAS.
5649
* The C20x Tablet series have a mono internal speaker which is controlled
5650
* via the chip's Mono sum widget and pin complex, so include the necessary
5651
* controls for such models. On models without a "mono speaker" the control
5652
* won't do anything.
5654
static struct snd_kcontrol_new alc260_acer_mixer[] = {
5655
HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT),
5656
HDA_BIND_MUTE("Master Playback Switch", 0x08, 2, HDA_INPUT),
5657
ALC_PIN_MODE("Headphone Jack Mode", 0x0f, ALC_PIN_DIR_INOUT),
5658
HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0a, 1, 0x0,
5660
HDA_BIND_MUTE_MONO("Speaker Playback Switch", 0x0a, 1, 2,
5662
HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT),
5663
HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT),
5664
HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT),
5665
HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT),
5666
ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN),
5667
HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT),
5668
HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT),
5669
ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT),
5673
/* Maxdata Favorit 100XS: one output and one input (0x12) jack
5675
static struct snd_kcontrol_new alc260_favorit100_mixer[] = {
5676
HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT),
5677
HDA_BIND_MUTE("Master Playback Switch", 0x08, 2, HDA_INPUT),
5678
ALC_PIN_MODE("Output Jack Mode", 0x0f, ALC_PIN_DIR_INOUT),
5679
HDA_CODEC_VOLUME("Line/Mic Playback Volume", 0x07, 0x0, HDA_INPUT),
5680
HDA_CODEC_MUTE("Line/Mic Playback Switch", 0x07, 0x0, HDA_INPUT),
5681
ALC_PIN_MODE("Line/Mic Jack Mode", 0x12, ALC_PIN_DIR_IN),
5685
/* Packard bell V7900 ALC260 pin usage: HP = 0x0f, Mic jack = 0x12,
5686
* Line In jack = 0x14, CD audio = 0x16, pc beep = 0x17.
5688
static struct snd_kcontrol_new alc260_will_mixer[] = {
5689
HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT),
5690
HDA_BIND_MUTE("Master Playback Switch", 0x08, 0x2, HDA_INPUT),
5691
HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT),
5692
HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT),
5693
ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN),
5694
HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT),
5695
HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT),
5696
ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT),
5697
HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT),
5698
HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT),
5702
/* Replacer 672V ALC260 pin usage: Mic jack = 0x12,
5703
* Line In jack = 0x14, ATAPI Mic = 0x13, speaker = 0x0f.
5705
static struct snd_kcontrol_new alc260_replacer_672v_mixer[] = {
5706
HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT),
5707
HDA_BIND_MUTE("Master Playback Switch", 0x08, 0x2, HDA_INPUT),
5708
HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT),
5709
HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT),
5710
ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN),
5711
HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x07, 0x1, HDA_INPUT),
5712
HDA_CODEC_MUTE("ATATI Mic Playback Switch", 0x07, 0x1, HDA_INPUT),
5713
HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT),
5714
HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT),
5715
ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT),
5720
* initialization verbs
5722
static struct hda_verb alc260_init_verbs[] = {
5723
/* Line In pin widget for input */
5724
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
5725
/* CD pin widget for input */
5726
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
5727
/* Mic1 (rear panel) pin widget for input and vref at 80% */
5728
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
5729
/* Mic2 (front panel) pin widget for input and vref at 80% */
5730
{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
5731
/* LINE-2 is used for line-out in rear */
5732
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
5733
/* select line-out */
5734
{0x0e, AC_VERB_SET_CONNECT_SEL, 0x00},
5736
{0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
5738
{0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
5740
{0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
5741
/* mute capture amp left and right */
5742
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
5743
/* set connection select to line in (default select for this ADC) */
5744
{0x04, AC_VERB_SET_CONNECT_SEL, 0x02},
5745
/* mute capture amp left and right */
5746
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
5747
/* set connection select to line in (default select for this ADC) */
5748
{0x05, AC_VERB_SET_CONNECT_SEL, 0x02},
5749
/* set vol=0 Line-Out mixer amp left and right */
5750
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
5751
/* unmute pin widget amp left and right (no gain on this amp) */
5752
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
5753
/* set vol=0 HP mixer amp left and right */
5754
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
5755
/* unmute pin widget amp left and right (no gain on this amp) */
5756
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
5757
/* set vol=0 Mono mixer amp left and right */
5758
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
5759
/* unmute pin widget amp left and right (no gain on this amp) */
5760
{0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
5761
/* unmute LINE-2 out pin */
5762
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
5763
/* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
5766
/* mute analog inputs */
5767
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5768
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
5769
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
5770
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
5771
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
5772
/* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
5773
/* mute Front out path */
5774
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5775
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
5776
/* mute Headphone out path */
5777
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5778
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
5779
/* mute Mono out path */
5780
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5781
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
5785
#if 0 /* should be identical with alc260_init_verbs? */
5786
static struct hda_verb alc260_hp_init_verbs[] = {
5787
/* Headphone and output */
5788
{0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0},
5790
{0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
5791
/* Mic1 (rear panel) pin widget for input and vref at 80% */
5792
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
5793
/* Mic2 (front panel) pin widget for input and vref at 80% */
5794
{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
5795
/* Line In pin widget for input */
5796
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
5797
/* Line-2 pin widget for output */
5798
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
5799
/* CD pin widget for input */
5800
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
5801
/* unmute amp left and right */
5802
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
5803
/* set connection select to line in (default select for this ADC) */
5804
{0x04, AC_VERB_SET_CONNECT_SEL, 0x02},
5805
/* unmute Line-Out mixer amp left and right (volume = 0) */
5806
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
5807
/* mute pin widget amp left and right (no gain on this amp) */
5808
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0x0000},
5809
/* unmute HP mixer amp left and right (volume = 0) */
5810
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
5811
/* mute pin widget amp left and right (no gain on this amp) */
5812
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, 0x0000},
5813
/* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
5816
/* mute analog inputs */
5817
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5818
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
5819
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
5820
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
5821
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
5822
/* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
5823
/* Unmute Front out path */
5824
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
5825
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
5826
/* Unmute Headphone out path */
5827
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
5828
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
5829
/* Unmute Mono out path */
5830
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
5831
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
5836
static struct hda_verb alc260_hp_3013_init_verbs[] = {
5837
/* Line out and output */
5838
{0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
5840
{0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
5841
/* Mic1 (rear panel) pin widget for input and vref at 80% */
5842
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
5843
/* Mic2 (front panel) pin widget for input and vref at 80% */
5844
{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
5845
/* Line In pin widget for input */
5846
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
5847
/* Headphone pin widget for output */
5848
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0},
5849
/* CD pin widget for input */
5850
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
5851
/* unmute amp left and right */
5852
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
5853
/* set connection select to line in (default select for this ADC) */
5854
{0x04, AC_VERB_SET_CONNECT_SEL, 0x02},
5855
/* unmute Line-Out mixer amp left and right (volume = 0) */
5856
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
5857
/* mute pin widget amp left and right (no gain on this amp) */
5858
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0x0000},
5859
/* unmute HP mixer amp left and right (volume = 0) */
5860
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
5861
/* mute pin widget amp left and right (no gain on this amp) */
5862
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, 0x0000},
5863
/* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
5866
/* mute analog inputs */
5867
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5868
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
5869
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
5870
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
5871
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
5872
/* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
5873
/* Unmute Front out path */
5874
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
5875
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
5876
/* Unmute Headphone out path */
5877
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
5878
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
5879
/* Unmute Mono out path */
5880
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
5881
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
5885
/* Initialisation sequence for ALC260 as configured in Fujitsu S702x
5886
* laptops. ALC260 pin usage: Mic/Line jack = 0x12, HP jack = 0x14, CD
5887
* audio = 0x16, internal speaker = 0x10.
5889
static struct hda_verb alc260_fujitsu_init_verbs[] = {
5890
/* Disable all GPIOs */
5891
{0x01, AC_VERB_SET_GPIO_MASK, 0},
5892
/* Internal speaker is connected to headphone pin */
5893
{0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
5894
/* Headphone/Line-out jack connects to Line1 pin; make it an output */
5895
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
5896
/* Mic/Line-in jack is connected to mic1 pin, so make it an input */
5897
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
5898
/* Ensure all other unused pins are disabled and muted. */
5899
{0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
5900
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5901
{0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
5902
{0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5903
{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
5904
{0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5905
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
5906
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5908
/* Disable digital (SPDIF) pins */
5909
{0x03, AC_VERB_SET_DIGI_CONVERT_1, 0},
5910
{0x06, AC_VERB_SET_DIGI_CONVERT_1, 0},
5912
/* Ensure Line1 pin widget takes its input from the OUT1 sum bus
5913
* when acting as an output.
5915
{0x0d, AC_VERB_SET_CONNECT_SEL, 0},
5917
/* Start with output sum widgets muted and their output gains at min */
5918
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5919
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
5920
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
5921
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5922
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
5923
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
5924
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5925
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
5926
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
5928
/* Unmute HP pin widget amp left and right (no equiv mixer ctrl) */
5929
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
5930
/* Unmute Line1 pin widget output buffer since it starts as an output.
5931
* If the pin mode is changed by the user the pin mode control will
5932
* take care of enabling the pin's input/output buffers as needed.
5933
* Therefore there's no need to enable the input buffer at this
5936
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
5937
/* Unmute input buffer of pin widget used for Line-in (no equiv
5940
{0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
5942
/* Mute capture amp left and right */
5943
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5944
/* Set ADC connection select to match default mixer setting - line
5947
{0x04, AC_VERB_SET_CONNECT_SEL, 0x00},
5949
/* Do the same for the second ADC: mute capture input amp and
5950
* set ADC connection to line in (on mic1 pin)
5952
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5953
{0x05, AC_VERB_SET_CONNECT_SEL, 0x00},
5955
/* Mute all inputs to mixer widget (even unconnected ones) */
5956
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* mic1 pin */
5957
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* mic2 pin */
5958
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* line1 pin */
5959
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* line2 pin */
5960
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* CD pin */
5961
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, /* Beep-gen pin */
5962
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, /* Line-out pin */
5963
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, /* HP-pin pin */
5968
/* Initialisation sequence for ALC260 as configured in Acer TravelMate and
5969
* similar laptops (adapted from Fujitsu init verbs).
5971
static struct hda_verb alc260_acer_init_verbs[] = {
5972
/* On TravelMate laptops, GPIO 0 enables the internal speaker and
5973
* the headphone jack. Turn this on and rely on the standard mute
5974
* methods whenever the user wants to turn these outputs off.
5976
{0x01, AC_VERB_SET_GPIO_MASK, 0x01},
5977
{0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01},
5978
{0x01, AC_VERB_SET_GPIO_DATA, 0x01},
5979
/* Internal speaker/Headphone jack is connected to Line-out pin */
5980
{0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
5981
/* Internal microphone/Mic jack is connected to Mic1 pin */
5982
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
5983
/* Line In jack is connected to Line1 pin */
5984
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
5985
/* Some Acers (eg: C20x Tablets) use Mono pin for internal speaker */
5986
{0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
5987
/* Ensure all other unused pins are disabled and muted. */
5988
{0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
5989
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5990
{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
5991
{0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5992
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
5993
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
5994
/* Disable digital (SPDIF) pins */
5995
{0x03, AC_VERB_SET_DIGI_CONVERT_1, 0},
5996
{0x06, AC_VERB_SET_DIGI_CONVERT_1, 0},
5998
/* Ensure Mic1 and Line1 pin widgets take input from the OUT1 sum
5999
* bus when acting as outputs.
6001
{0x0b, AC_VERB_SET_CONNECT_SEL, 0},
6002
{0x0d, AC_VERB_SET_CONNECT_SEL, 0},
6004
/* Start with output sum widgets muted and their output gains at min */
6005
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6006
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
6007
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
6008
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6009
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
6010
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
6011
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6012
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
6013
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
6015
/* Unmute Line-out pin widget amp left and right
6016
* (no equiv mixer ctrl)
6018
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
6019
/* Unmute mono pin widget amp output (no equiv mixer ctrl) */
6020
{0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
6021
/* Unmute Mic1 and Line1 pin widget input buffers since they start as
6022
* inputs. If the pin mode is changed by the user the pin mode control
6023
* will take care of enabling the pin's input/output buffers as needed.
6024
* Therefore there's no need to enable the input buffer at this
6027
{0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
6028
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
6030
/* Mute capture amp left and right */
6031
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6032
/* Set ADC connection select to match default mixer setting - mic
6035
{0x04, AC_VERB_SET_CONNECT_SEL, 0x00},
6037
/* Do similar with the second ADC: mute capture input amp and
6038
* set ADC connection to mic to match ALSA's default state.
6040
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6041
{0x05, AC_VERB_SET_CONNECT_SEL, 0x00},
6043
/* Mute all inputs to mixer widget (even unconnected ones) */
6044
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* mic1 pin */
6045
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* mic2 pin */
6046
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* line1 pin */
6047
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* line2 pin */
6048
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* CD pin */
6049
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, /* Beep-gen pin */
6050
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, /* Line-out pin */
6051
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, /* HP-pin pin */
6056
/* Initialisation sequence for Maxdata Favorit 100XS
6057
* (adapted from Acer init verbs).
6059
static struct hda_verb alc260_favorit100_init_verbs[] = {
6060
/* GPIO 0 enables the output jack.
6061
* Turn this on and rely on the standard mute
6062
* methods whenever the user wants to turn these outputs off.
6064
{0x01, AC_VERB_SET_GPIO_MASK, 0x01},
6065
{0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01},
6066
{0x01, AC_VERB_SET_GPIO_DATA, 0x01},
6067
/* Line/Mic input jack is connected to Mic1 pin */
6068
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
6069
/* Ensure all other unused pins are disabled and muted. */
6070
{0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
6071
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6072
{0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
6073
{0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6074
{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
6075
{0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6076
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
6077
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6078
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
6079
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6080
/* Disable digital (SPDIF) pins */
6081
{0x03, AC_VERB_SET_DIGI_CONVERT_1, 0},
6082
{0x06, AC_VERB_SET_DIGI_CONVERT_1, 0},
6084
/* Ensure Mic1 and Line1 pin widgets take input from the OUT1 sum
6085
* bus when acting as outputs.
6087
{0x0b, AC_VERB_SET_CONNECT_SEL, 0},
6088
{0x0d, AC_VERB_SET_CONNECT_SEL, 0},
6090
/* Start with output sum widgets muted and their output gains at min */
6091
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6092
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
6093
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
6094
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6095
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
6096
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
6097
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6098
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
6099
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
6101
/* Unmute Line-out pin widget amp left and right
6102
* (no equiv mixer ctrl)
6104
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
6105
/* Unmute Mic1 and Line1 pin widget input buffers since they start as
6106
* inputs. If the pin mode is changed by the user the pin mode control
6107
* will take care of enabling the pin's input/output buffers as needed.
6108
* Therefore there's no need to enable the input buffer at this
6111
{0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
6113
/* Mute capture amp left and right */
6114
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6115
/* Set ADC connection select to match default mixer setting - mic
6118
{0x04, AC_VERB_SET_CONNECT_SEL, 0x00},
6120
/* Do similar with the second ADC: mute capture input amp and
6121
* set ADC connection to mic to match ALSA's default state.
6123
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6124
{0x05, AC_VERB_SET_CONNECT_SEL, 0x00},
6126
/* Mute all inputs to mixer widget (even unconnected ones) */
6127
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* mic1 pin */
6128
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* mic2 pin */
6129
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* line1 pin */
6130
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* line2 pin */
6131
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* CD pin */
6132
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, /* Beep-gen pin */
6133
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, /* Line-out pin */
6134
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, /* HP-pin pin */
6139
static struct hda_verb alc260_will_verbs[] = {
6140
{0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
6141
{0x0b, AC_VERB_SET_CONNECT_SEL, 0x00},
6142
{0x0d, AC_VERB_SET_CONNECT_SEL, 0x00},
6143
{0x0f, AC_VERB_SET_EAPD_BTLENABLE, 0x02},
6144
{0x1a, AC_VERB_SET_COEF_INDEX, 0x07},
6145
{0x1a, AC_VERB_SET_PROC_COEF, 0x3040},
6149
static struct hda_verb alc260_replacer_672v_verbs[] = {
6150
{0x0f, AC_VERB_SET_EAPD_BTLENABLE, 0x02},
6151
{0x1a, AC_VERB_SET_COEF_INDEX, 0x07},
6152
{0x1a, AC_VERB_SET_PROC_COEF, 0x3050},
6154
{0x01, AC_VERB_SET_GPIO_MASK, 0x01},
6155
{0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01},
6156
{0x01, AC_VERB_SET_GPIO_DATA, 0x00},
6158
{0x0f, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
6162
/* toggle speaker-output according to the hp-jack state */
6163
static void alc260_replacer_672v_automute(struct hda_codec *codec)
6165
unsigned int present;
6167
/* speaker --> GPIO Data 0, hp or spdif --> GPIO data 1 */
6168
present = snd_hda_jack_detect(codec, 0x0f);
6170
snd_hda_codec_write_cache(codec, 0x01, 0,
6171
AC_VERB_SET_GPIO_DATA, 1);
6172
snd_hda_codec_write_cache(codec, 0x0f, 0,
6173
AC_VERB_SET_PIN_WIDGET_CONTROL,
6176
snd_hda_codec_write_cache(codec, 0x01, 0,
6177
AC_VERB_SET_GPIO_DATA, 0);
6178
snd_hda_codec_write_cache(codec, 0x0f, 0,
6179
AC_VERB_SET_PIN_WIDGET_CONTROL,
6184
static void alc260_replacer_672v_unsol_event(struct hda_codec *codec,
6187
if ((res >> 26) == ALC880_HP_EVENT)
6188
alc260_replacer_672v_automute(codec);
6191
static struct hda_verb alc260_hp_dc7600_verbs[] = {
6192
{0x05, AC_VERB_SET_CONNECT_SEL, 0x01},
6193
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
6194
{0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
6195
{0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
6196
{0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
6197
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
6198
{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
6199
{0x10, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
6200
{0x11, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
6201
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
6205
/* Test configuration for debugging, modelled after the ALC880 test
6208
#ifdef CONFIG_SND_DEBUG
6209
static hda_nid_t alc260_test_dac_nids[1] = {
6212
static hda_nid_t alc260_test_adc_nids[2] = {
6215
/* For testing the ALC260, each input MUX needs its own definition since
6216
* the signal assignments are different. This assumes that the first ADC
6219
static struct hda_input_mux alc260_test_capture_sources[2] = {
6223
{ "MIC1 pin", 0x0 },
6224
{ "MIC2 pin", 0x1 },
6225
{ "LINE1 pin", 0x2 },
6226
{ "LINE2 pin", 0x3 },
6228
{ "LINE-OUT pin", 0x5 },
6229
{ "HP-OUT pin", 0x6 },
6235
{ "MIC1 pin", 0x0 },
6236
{ "MIC2 pin", 0x1 },
6237
{ "LINE1 pin", 0x2 },
6238
{ "LINE2 pin", 0x3 },
6241
{ "LINE-OUT pin", 0x6 },
6242
{ "HP-OUT pin", 0x7 },
6246
static struct snd_kcontrol_new alc260_test_mixer[] = {
6247
/* Output driver widgets */
6248
HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT),
6249
HDA_BIND_MUTE_MONO("Mono Playback Switch", 0x0a, 1, 2, HDA_INPUT),
6250
HDA_CODEC_VOLUME("LOUT2 Playback Volume", 0x09, 0x0, HDA_OUTPUT),
6251
HDA_BIND_MUTE("LOUT2 Playback Switch", 0x09, 2, HDA_INPUT),
6252
HDA_CODEC_VOLUME("LOUT1 Playback Volume", 0x08, 0x0, HDA_OUTPUT),
6253
HDA_BIND_MUTE("LOUT1 Playback Switch", 0x08, 2, HDA_INPUT),
6255
/* Modes for retasking pin widgets
6256
* Note: the ALC260 doesn't seem to act on requests to enable mic
6257
* bias from NIDs 0x0f and 0x10. The ALC260 datasheet doesn't
6258
* mention this restriction. At this stage it's not clear whether
6259
* this behaviour is intentional or is a hardware bug in chip
6260
* revisions available at least up until early 2006. Therefore for
6261
* now allow the "HP-OUT" and "LINE-OUT" Mode controls to span all
6262
* choices, but if it turns out that the lack of mic bias for these
6263
* NIDs is intentional we could change their modes from
6264
* ALC_PIN_DIR_INOUT to ALC_PIN_DIR_INOUT_NOMICBIAS.
6266
ALC_PIN_MODE("HP-OUT pin mode", 0x10, ALC_PIN_DIR_INOUT),
6267
ALC_PIN_MODE("LINE-OUT pin mode", 0x0f, ALC_PIN_DIR_INOUT),
6268
ALC_PIN_MODE("LINE2 pin mode", 0x15, ALC_PIN_DIR_INOUT),
6269
ALC_PIN_MODE("LINE1 pin mode", 0x14, ALC_PIN_DIR_INOUT),
6270
ALC_PIN_MODE("MIC2 pin mode", 0x13, ALC_PIN_DIR_INOUT),
6271
ALC_PIN_MODE("MIC1 pin mode", 0x12, ALC_PIN_DIR_INOUT),
6273
/* Loopback mixer controls */
6274
HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x07, 0x00, HDA_INPUT),
6275
HDA_CODEC_MUTE("MIC1 Playback Switch", 0x07, 0x00, HDA_INPUT),
6276
HDA_CODEC_VOLUME("MIC2 Playback Volume", 0x07, 0x01, HDA_INPUT),
6277
HDA_CODEC_MUTE("MIC2 Playback Switch", 0x07, 0x01, HDA_INPUT),
6278
HDA_CODEC_VOLUME("LINE1 Playback Volume", 0x07, 0x02, HDA_INPUT),
6279
HDA_CODEC_MUTE("LINE1 Playback Switch", 0x07, 0x02, HDA_INPUT),
6280
HDA_CODEC_VOLUME("LINE2 Playback Volume", 0x07, 0x03, HDA_INPUT),
6281
HDA_CODEC_MUTE("LINE2 Playback Switch", 0x07, 0x03, HDA_INPUT),
6282
HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT),
6283
HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT),
6284
HDA_CODEC_VOLUME("LINE-OUT loopback Playback Volume", 0x07, 0x06, HDA_INPUT),
6285
HDA_CODEC_MUTE("LINE-OUT loopback Playback Switch", 0x07, 0x06, HDA_INPUT),
6286
HDA_CODEC_VOLUME("HP-OUT loopback Playback Volume", 0x07, 0x7, HDA_INPUT),
6287
HDA_CODEC_MUTE("HP-OUT loopback Playback Switch", 0x07, 0x7, HDA_INPUT),
6289
/* Controls for GPIO pins, assuming they are configured as outputs */
6290
ALC_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
6291
ALC_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
6292
ALC_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
6293
ALC_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
6295
/* Switches to allow the digital IO pins to be enabled. The datasheet
6296
* is ambigious as to which NID is which; testing on laptops which
6297
* make this output available should provide clarification.
6299
ALC_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x03, 0x01),
6300
ALC_SPDIF_CTRL_SWITCH("SPDIF Capture Switch", 0x06, 0x01),
6302
/* A switch allowing EAPD to be enabled. Some laptops seem to use
6303
* this output to turn on an external amplifier.
6305
ALC_EAPD_CTRL_SWITCH("LINE-OUT EAPD Enable Switch", 0x0f, 0x02),
6306
ALC_EAPD_CTRL_SWITCH("HP-OUT EAPD Enable Switch", 0x10, 0x02),
6310
static struct hda_verb alc260_test_init_verbs[] = {
6311
/* Enable all GPIOs as outputs with an initial value of 0 */
6312
{0x01, AC_VERB_SET_GPIO_DIRECTION, 0x0f},
6313
{0x01, AC_VERB_SET_GPIO_DATA, 0x00},
6314
{0x01, AC_VERB_SET_GPIO_MASK, 0x0f},
6316
/* Enable retasking pins as output, initially without power amp */
6317
{0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
6318
{0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
6319
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
6320
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
6321
{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
6322
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
6324
/* Disable digital (SPDIF) pins initially, but users can enable
6325
* them via a mixer switch. In the case of SPDIF-out, this initverb
6326
* payload also sets the generation to 0, output to be in "consumer"
6327
* PCM format, copyright asserted, no pre-emphasis and no validity
6330
{0x03, AC_VERB_SET_DIGI_CONVERT_1, 0},
6331
{0x06, AC_VERB_SET_DIGI_CONVERT_1, 0},
6333
/* Ensure mic1, mic2, line1 and line2 pin widgets take input from the
6334
* OUT1 sum bus when acting as an output.
6336
{0x0b, AC_VERB_SET_CONNECT_SEL, 0},
6337
{0x0c, AC_VERB_SET_CONNECT_SEL, 0},
6338
{0x0d, AC_VERB_SET_CONNECT_SEL, 0},
6339
{0x0e, AC_VERB_SET_CONNECT_SEL, 0},
6341
/* Start with output sum widgets muted and their output gains at min */
6342
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6343
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
6344
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
6345
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6346
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
6347
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
6348
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6349
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
6350
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
6352
/* Unmute retasking pin widget output buffers since the default
6353
* state appears to be output. As the pin mode is changed by the
6354
* user the pin mode control will take care of enabling the pin's
6355
* input/output buffers as needed.
6357
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
6358
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
6359
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
6360
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
6361
{0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
6362
{0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
6363
/* Also unmute the mono-out pin widget */
6364
{0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
6366
/* Mute capture amp left and right */
6367
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6368
/* Set ADC connection select to match default mixer setting (mic1
6371
{0x04, AC_VERB_SET_CONNECT_SEL, 0x00},
6373
/* Do the same for the second ADC: mute capture input amp and
6374
* set ADC connection to mic1 pin
6376
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6377
{0x05, AC_VERB_SET_CONNECT_SEL, 0x00},
6379
/* Mute all inputs to mixer widget (even unconnected ones) */
6380
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* mic1 pin */
6381
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* mic2 pin */
6382
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* line1 pin */
6383
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* line2 pin */
6384
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* CD pin */
6385
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, /* Beep-gen pin */
6386
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, /* Line-out pin */
6387
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, /* HP-pin pin */
6393
#define alc260_pcm_analog_playback alc880_pcm_analog_alt_playback
6394
#define alc260_pcm_analog_capture alc880_pcm_analog_capture
6396
#define alc260_pcm_digital_playback alc880_pcm_digital_playback
6397
#define alc260_pcm_digital_capture alc880_pcm_digital_capture
6400
* for BIOS auto-configuration
6403
static int alc260_add_playback_controls(struct alc_spec *spec, hda_nid_t nid,
6404
const char *pfx, int *vol_bits)
6407
unsigned long vol_val, sw_val;
6410
if (nid >= 0x0f && nid < 0x11) {
6411
nid_vol = nid - 0x7;
6412
vol_val = HDA_COMPOSE_AMP_VAL(nid_vol, 3, 0, HDA_OUTPUT);
6413
sw_val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT);
6414
} else if (nid == 0x11) {
6415
nid_vol = nid - 0x7;
6416
vol_val = HDA_COMPOSE_AMP_VAL(nid_vol, 2, 0, HDA_OUTPUT);
6417
sw_val = HDA_COMPOSE_AMP_VAL(nid, 2, 0, HDA_OUTPUT);
6418
} else if (nid >= 0x12 && nid <= 0x15) {
6420
vol_val = HDA_COMPOSE_AMP_VAL(nid_vol, 3, 0, HDA_OUTPUT);
6421
sw_val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT);
6425
if (!(*vol_bits & (1 << nid_vol))) {
6426
/* first control for the volume widget */
6427
err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, pfx, vol_val);
6430
*vol_bits |= (1 << nid_vol);
6432
err = add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx, sw_val);
6438
/* add playback controls from the parsed DAC table */
6439
static int alc260_auto_create_multi_out_ctls(struct alc_spec *spec,
6440
const struct auto_pin_cfg *cfg)
6446
spec->multiout.num_dacs = 1;
6447
spec->multiout.dac_nids = spec->private_dac_nids;
6448
spec->multiout.dac_nids[0] = 0x02;
6450
nid = cfg->line_out_pins[0];
6453
if (!cfg->speaker_pins[0] && !cfg->hp_pins[0])
6455
else if (cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)
6459
err = alc260_add_playback_controls(spec, nid, pfx, &vols);
6464
nid = cfg->speaker_pins[0];
6466
err = alc260_add_playback_controls(spec, nid, "Speaker", &vols);
6471
nid = cfg->hp_pins[0];
6473
err = alc260_add_playback_controls(spec, nid, "Headphone",
6481
/* create playback/capture controls for input pins */
6482
static int alc260_auto_create_input_ctls(struct hda_codec *codec,
6483
const struct auto_pin_cfg *cfg)
6485
return alc_auto_create_input_ctls(codec, cfg, 0x07, 0x04, 0x05);
6488
static void alc260_auto_set_output_and_unmute(struct hda_codec *codec,
6489
hda_nid_t nid, int pin_type,
6492
alc_set_pin_output(codec, nid, pin_type);
6493
/* need the manual connection? */
6495
int idx = nid - 0x12;
6496
snd_hda_codec_write(codec, idx + 0x0b, 0,
6497
AC_VERB_SET_CONNECT_SEL, sel_idx);
6501
static void alc260_auto_init_multi_out(struct hda_codec *codec)
6503
struct alc_spec *spec = codec->spec;
6506
nid = spec->autocfg.line_out_pins[0];
6508
int pin_type = get_pin_type(spec->autocfg.line_out_type);
6509
alc260_auto_set_output_and_unmute(codec, nid, pin_type, 0);
6512
nid = spec->autocfg.speaker_pins[0];
6514
alc260_auto_set_output_and_unmute(codec, nid, PIN_OUT, 0);
6516
nid = spec->autocfg.hp_pins[0];
6518
alc260_auto_set_output_and_unmute(codec, nid, PIN_HP, 0);
6521
#define ALC260_PIN_CD_NID 0x16
6522
static void alc260_auto_init_analog_input(struct hda_codec *codec)
6524
struct alc_spec *spec = codec->spec;
6527
for (i = 0; i < AUTO_PIN_LAST; i++) {
6528
hda_nid_t nid = spec->autocfg.input_pins[i];
6530
alc_set_input_pin(codec, nid, i);
6531
if (nid != ALC260_PIN_CD_NID &&
6532
(get_wcaps(codec, nid) & AC_WCAP_OUT_AMP))
6533
snd_hda_codec_write(codec, nid, 0,
6534
AC_VERB_SET_AMP_GAIN_MUTE,
6540
#define alc260_auto_init_input_src alc880_auto_init_input_src
6543
* generic initialization of ADC, input mixers and output mixers
6545
static struct hda_verb alc260_volume_init_verbs[] = {
6547
* Unmute ADC0-1 and set the default input to mic-in
6549
{0x04, AC_VERB_SET_CONNECT_SEL, 0x00},
6550
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
6551
{0x05, AC_VERB_SET_CONNECT_SEL, 0x00},
6552
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
6554
/* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
6556
* Note: PASD motherboards uses the Line In 2 as the input for
6557
* front panel mic (mic 2)
6559
/* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
6560
/* mute analog inputs */
6561
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
6562
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
6563
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
6564
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
6565
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
6568
* Set up output mixers (0x08 - 0x0a)
6570
/* set vol=0 to output mixers */
6571
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
6572
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
6573
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
6574
/* set up input amps for analog loopback */
6575
/* Amp Indices: DAC = 0, mixer = 1 */
6576
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
6577
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
6578
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
6579
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
6580
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
6581
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
6586
static int alc260_parse_auto_config(struct hda_codec *codec)
6588
struct alc_spec *spec = codec->spec;
6590
static hda_nid_t alc260_ignore[] = { 0x17, 0 };
6592
err = snd_hda_parse_pin_def_config(codec, &spec->autocfg,
6596
err = alc260_auto_create_multi_out_ctls(spec, &spec->autocfg);
6599
if (!spec->kctls.list)
6600
return 0; /* can't find valid BIOS pin config */
6601
err = alc260_auto_create_input_ctls(codec, &spec->autocfg);
6605
spec->multiout.max_channels = 2;
6607
if (spec->autocfg.dig_outs)
6608
spec->multiout.dig_out_nid = ALC260_DIGOUT_NID;
6609
if (spec->kctls.list)
6610
add_mixer(spec, spec->kctls.list);
6612
add_verb(spec, alc260_volume_init_verbs);
6614
spec->num_mux_defs = 1;
6615
spec->input_mux = &spec->private_imux[0];
6617
alc_ssid_check(codec, 0x10, 0x15, 0x0f, 0);
6622
/* additional initialization for auto-configuration model */
6623
static void alc260_auto_init(struct hda_codec *codec)
6625
struct alc_spec *spec = codec->spec;
6626
alc260_auto_init_multi_out(codec);
6627
alc260_auto_init_analog_input(codec);
6628
alc260_auto_init_input_src(codec);
6629
if (spec->unsol_event)
6630
alc_inithook(codec);
6633
#ifdef CONFIG_SND_HDA_POWER_SAVE
6634
static struct hda_amp_list alc260_loopbacks[] = {
6635
{ 0x07, HDA_INPUT, 0 },
6636
{ 0x07, HDA_INPUT, 1 },
6637
{ 0x07, HDA_INPUT, 2 },
6638
{ 0x07, HDA_INPUT, 3 },
6639
{ 0x07, HDA_INPUT, 4 },
6645
* ALC260 configurations
6647
static const char *alc260_models[ALC260_MODEL_LAST] = {
6648
[ALC260_BASIC] = "basic",
6650
[ALC260_HP_3013] = "hp-3013",
6651
[ALC260_HP_DC7600] = "hp-dc7600",
6652
[ALC260_FUJITSU_S702X] = "fujitsu",
6653
[ALC260_ACER] = "acer",
6654
[ALC260_WILL] = "will",
6655
[ALC260_REPLACER_672V] = "replacer",
6656
[ALC260_FAVORIT100] = "favorit100",
6657
#ifdef CONFIG_SND_DEBUG
6658
[ALC260_TEST] = "test",
6660
[ALC260_AUTO] = "auto",
6663
static struct snd_pci_quirk alc260_cfg_tbl[] = {
6664
SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_ACER),
6665
SND_PCI_QUIRK(0x1025, 0x007f, "Acer", ALC260_WILL),
6666
SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER),
6667
SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FAVORIT100),
6668
SND_PCI_QUIRK(0x103c, 0x2808, "HP d5700", ALC260_HP_3013),
6669
SND_PCI_QUIRK(0x103c, 0x280a, "HP d5750", ALC260_AUTO), /* no quirk */
6670
SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013),
6671
SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP_3013),
6672
SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_DC7600),
6673
SND_PCI_QUIRK(0x103c, 0x3013, "HP", ALC260_HP_3013),
6674
SND_PCI_QUIRK(0x103c, 0x3014, "HP", ALC260_HP),
6675
SND_PCI_QUIRK(0x103c, 0x3015, "HP", ALC260_HP),
6676
SND_PCI_QUIRK(0x103c, 0x3016, "HP", ALC260_HP),
6677
SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_BASIC),
6678
SND_PCI_QUIRK(0x104d, 0x81cc, "Sony VAIO", ALC260_BASIC),
6679
SND_PCI_QUIRK(0x104d, 0x81cd, "Sony VAIO", ALC260_BASIC),
6680
SND_PCI_QUIRK(0x10cf, 0x1326, "Fujitsu S702X", ALC260_FUJITSU_S702X),
6681
SND_PCI_QUIRK(0x152d, 0x0729, "CTL U553W", ALC260_BASIC),
6682
SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_REPLACER_672V),
6683
SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_WILL),
6687
static struct alc_config_preset alc260_presets[] = {
6689
.mixers = { alc260_base_output_mixer,
6690
alc260_input_mixer },
6691
.init_verbs = { alc260_init_verbs },
6692
.num_dacs = ARRAY_SIZE(alc260_dac_nids),
6693
.dac_nids = alc260_dac_nids,
6694
.num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids),
6695
.adc_nids = alc260_dual_adc_nids,
6696
.num_channel_mode = ARRAY_SIZE(alc260_modes),
6697
.channel_mode = alc260_modes,
6698
.input_mux = &alc260_capture_source,
6701
.mixers = { alc260_hp_output_mixer,
6702
alc260_input_mixer },
6703
.init_verbs = { alc260_init_verbs,
6704
alc260_hp_unsol_verbs },
6705
.num_dacs = ARRAY_SIZE(alc260_dac_nids),
6706
.dac_nids = alc260_dac_nids,
6707
.num_adc_nids = ARRAY_SIZE(alc260_adc_nids_alt),
6708
.adc_nids = alc260_adc_nids_alt,
6709
.num_channel_mode = ARRAY_SIZE(alc260_modes),
6710
.channel_mode = alc260_modes,
6711
.input_mux = &alc260_capture_source,
6712
.unsol_event = alc260_hp_unsol_event,
6713
.init_hook = alc260_hp_automute,
6715
[ALC260_HP_DC7600] = {
6716
.mixers = { alc260_hp_dc7600_mixer,
6717
alc260_input_mixer },
6718
.init_verbs = { alc260_init_verbs,
6719
alc260_hp_dc7600_verbs },
6720
.num_dacs = ARRAY_SIZE(alc260_dac_nids),
6721
.dac_nids = alc260_dac_nids,
6722
.num_adc_nids = ARRAY_SIZE(alc260_adc_nids_alt),
6723
.adc_nids = alc260_adc_nids_alt,
6724
.num_channel_mode = ARRAY_SIZE(alc260_modes),
6725
.channel_mode = alc260_modes,
6726
.input_mux = &alc260_capture_source,
6727
.unsol_event = alc260_hp_3012_unsol_event,
6728
.init_hook = alc260_hp_3012_automute,
6730
[ALC260_HP_3013] = {
6731
.mixers = { alc260_hp_3013_mixer,
6732
alc260_input_mixer },
6733
.init_verbs = { alc260_hp_3013_init_verbs,
6734
alc260_hp_3013_unsol_verbs },
6735
.num_dacs = ARRAY_SIZE(alc260_dac_nids),
6736
.dac_nids = alc260_dac_nids,
6737
.num_adc_nids = ARRAY_SIZE(alc260_adc_nids_alt),
6738
.adc_nids = alc260_adc_nids_alt,
6739
.num_channel_mode = ARRAY_SIZE(alc260_modes),
6740
.channel_mode = alc260_modes,
6741
.input_mux = &alc260_capture_source,
6742
.unsol_event = alc260_hp_3013_unsol_event,
6743
.init_hook = alc260_hp_3013_automute,
6745
[ALC260_FUJITSU_S702X] = {
6746
.mixers = { alc260_fujitsu_mixer },
6747
.init_verbs = { alc260_fujitsu_init_verbs },
6748
.num_dacs = ARRAY_SIZE(alc260_dac_nids),
6749
.dac_nids = alc260_dac_nids,
6750
.num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids),
6751
.adc_nids = alc260_dual_adc_nids,
6752
.num_channel_mode = ARRAY_SIZE(alc260_modes),
6753
.channel_mode = alc260_modes,
6754
.num_mux_defs = ARRAY_SIZE(alc260_fujitsu_capture_sources),
6755
.input_mux = alc260_fujitsu_capture_sources,
6758
.mixers = { alc260_acer_mixer },
6759
.init_verbs = { alc260_acer_init_verbs },
6760
.num_dacs = ARRAY_SIZE(alc260_dac_nids),
6761
.dac_nids = alc260_dac_nids,
6762
.num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids),
6763
.adc_nids = alc260_dual_adc_nids,
6764
.num_channel_mode = ARRAY_SIZE(alc260_modes),
6765
.channel_mode = alc260_modes,
6766
.num_mux_defs = ARRAY_SIZE(alc260_acer_capture_sources),
6767
.input_mux = alc260_acer_capture_sources,
6769
[ALC260_FAVORIT100] = {
6770
.mixers = { alc260_favorit100_mixer },
6771
.init_verbs = { alc260_favorit100_init_verbs },
6772
.num_dacs = ARRAY_SIZE(alc260_dac_nids),
6773
.dac_nids = alc260_dac_nids,
6774
.num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids),
6775
.adc_nids = alc260_dual_adc_nids,
6776
.num_channel_mode = ARRAY_SIZE(alc260_modes),
6777
.channel_mode = alc260_modes,
6778
.num_mux_defs = ARRAY_SIZE(alc260_favorit100_capture_sources),
6779
.input_mux = alc260_favorit100_capture_sources,
6782
.mixers = { alc260_will_mixer },
6783
.init_verbs = { alc260_init_verbs, alc260_will_verbs },
6784
.num_dacs = ARRAY_SIZE(alc260_dac_nids),
6785
.dac_nids = alc260_dac_nids,
6786
.num_adc_nids = ARRAY_SIZE(alc260_adc_nids),
6787
.adc_nids = alc260_adc_nids,
6788
.dig_out_nid = ALC260_DIGOUT_NID,
6789
.num_channel_mode = ARRAY_SIZE(alc260_modes),
6790
.channel_mode = alc260_modes,
6791
.input_mux = &alc260_capture_source,
6793
[ALC260_REPLACER_672V] = {
6794
.mixers = { alc260_replacer_672v_mixer },
6795
.init_verbs = { alc260_init_verbs, alc260_replacer_672v_verbs },
6796
.num_dacs = ARRAY_SIZE(alc260_dac_nids),
6797
.dac_nids = alc260_dac_nids,
6798
.num_adc_nids = ARRAY_SIZE(alc260_adc_nids),
6799
.adc_nids = alc260_adc_nids,
6800
.dig_out_nid = ALC260_DIGOUT_NID,
6801
.num_channel_mode = ARRAY_SIZE(alc260_modes),
6802
.channel_mode = alc260_modes,
6803
.input_mux = &alc260_capture_source,
6804
.unsol_event = alc260_replacer_672v_unsol_event,
6805
.init_hook = alc260_replacer_672v_automute,
6807
#ifdef CONFIG_SND_DEBUG
6809
.mixers = { alc260_test_mixer },
6810
.init_verbs = { alc260_test_init_verbs },
6811
.num_dacs = ARRAY_SIZE(alc260_test_dac_nids),
6812
.dac_nids = alc260_test_dac_nids,
6813
.num_adc_nids = ARRAY_SIZE(alc260_test_adc_nids),
6814
.adc_nids = alc260_test_adc_nids,
6815
.num_channel_mode = ARRAY_SIZE(alc260_modes),
6816
.channel_mode = alc260_modes,
6817
.num_mux_defs = ARRAY_SIZE(alc260_test_capture_sources),
6818
.input_mux = alc260_test_capture_sources,
6823
static int patch_alc260(struct hda_codec *codec)
6825
struct alc_spec *spec;
6826
int err, board_config;
6828
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
6834
board_config = snd_hda_check_board_config(codec, ALC260_MODEL_LAST,
6837
if (board_config < 0) {
6838
snd_printd(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n",
6840
board_config = ALC260_AUTO;
6843
if (board_config == ALC260_AUTO) {
6844
/* automatic parse from the BIOS config */
6845
err = alc260_parse_auto_config(codec);
6851
"hda_codec: Cannot set up configuration "
6852
"from BIOS. Using base mode...\n");
6853
board_config = ALC260_BASIC;
6857
err = snd_hda_attach_beep_device(codec, 0x1);
6863
if (board_config != ALC260_AUTO)
6864
setup_preset(codec, &alc260_presets[board_config]);
6866
spec->stream_analog_playback = &alc260_pcm_analog_playback;
6867
spec->stream_analog_capture = &alc260_pcm_analog_capture;
6868
spec->stream_analog_alt_capture = &alc260_pcm_analog_capture;
6870
spec->stream_digital_playback = &alc260_pcm_digital_playback;
6871
spec->stream_digital_capture = &alc260_pcm_digital_capture;
6873
if (!spec->adc_nids && spec->input_mux) {
6874
/* check whether NID 0x04 is valid */
6875
unsigned int wcap = get_wcaps(codec, 0x04);
6876
wcap = get_wcaps_type(wcap);
6878
if (wcap != AC_WID_AUD_IN || spec->input_mux->num_items == 1) {
6879
spec->adc_nids = alc260_adc_nids_alt;
6880
spec->num_adc_nids = ARRAY_SIZE(alc260_adc_nids_alt);
6882
spec->adc_nids = alc260_adc_nids;
6883
spec->num_adc_nids = ARRAY_SIZE(alc260_adc_nids);
6886
set_capture_mixer(codec);
6887
set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
6889
spec->vmaster_nid = 0x08;
6891
codec->patch_ops = alc_patch_ops;
6892
if (board_config == ALC260_AUTO)
6893
spec->init_hook = alc260_auto_init;
6894
#ifdef CONFIG_SND_HDA_POWER_SAVE
6895
if (!spec->loopback.amplist)
6896
spec->loopback.amplist = alc260_loopbacks;
6904
* ALC882/883/885/888/889 support
6906
* ALC882 is almost identical with ALC880 but has cleaner and more flexible
6907
* configuration. Each pin widget can choose any input DACs and a mixer.
6908
* Each ADC is connected from a mixer of all inputs. This makes possible
6909
* 6-channel independent captures.
6911
* In addition, an independent DAC for the multi-playback (not used in this
6914
#define ALC882_DIGOUT_NID 0x06
6915
#define ALC882_DIGIN_NID 0x0a
6916
#define ALC883_DIGOUT_NID ALC882_DIGOUT_NID
6917
#define ALC883_DIGIN_NID ALC882_DIGIN_NID
6918
#define ALC1200_DIGOUT_NID 0x10
6921
static struct hda_channel_mode alc882_ch_modes[1] = {
6926
static hda_nid_t alc882_dac_nids[4] = {
6927
/* front, rear, clfe, rear_surr */
6928
0x02, 0x03, 0x04, 0x05
6930
#define alc883_dac_nids alc882_dac_nids
6933
#define alc882_adc_nids alc880_adc_nids
6934
#define alc882_adc_nids_alt alc880_adc_nids_alt
6935
#define alc883_adc_nids alc882_adc_nids_alt
6936
static hda_nid_t alc883_adc_nids_alt[1] = { 0x08 };
6937
static hda_nid_t alc883_adc_nids_rev[2] = { 0x09, 0x08 };
6938
#define alc889_adc_nids alc880_adc_nids
6940
static hda_nid_t alc882_capsrc_nids[3] = { 0x24, 0x23, 0x22 };
6941
static hda_nid_t alc882_capsrc_nids_alt[2] = { 0x23, 0x22 };
6942
#define alc883_capsrc_nids alc882_capsrc_nids_alt
6943
static hda_nid_t alc883_capsrc_nids_rev[2] = { 0x22, 0x23 };
6944
#define alc889_capsrc_nids alc882_capsrc_nids
6947
/* FIXME: should be a matrix-type input source selection */
6949
static struct hda_input_mux alc882_capture_source = {
6953
{ "Front Mic", 0x1 },
6959
#define alc883_capture_source alc882_capture_source
6961
static struct hda_input_mux alc889_capture_source = {
6964
{ "Front Mic", 0x0 },
6970
static struct hda_input_mux mb5_capture_source = {
6979
static struct hda_input_mux macmini3_capture_source = {
6987
static struct hda_input_mux alc883_3stack_6ch_intel = {
6991
{ "Front Mic", 0x0 },
6997
static struct hda_input_mux alc883_lenovo_101e_capture_source = {
7005
static struct hda_input_mux alc883_lenovo_nb0763_capture_source = {
7015
static struct hda_input_mux alc883_fujitsu_pi2515_capture_source = {
7023
static struct hda_input_mux alc883_lenovo_sky_capture_source = {
7027
{ "Front Mic", 0x1 },
7032
static struct hda_input_mux alc883_asus_eee1601_capture_source = {
7040
static struct hda_input_mux alc889A_mb31_capture_source = {
7044
/* Front Mic (0x01) unused */
7046
/* Line 2 (0x03) unused */
7047
/* CD (0x04) unused? */
7051
static struct hda_input_mux alc889A_imac91_capture_source = {
7055
{ "Line", 0x2 }, /* Not sure! */
7062
static struct hda_channel_mode alc883_3ST_2ch_modes[1] = {
7069
static struct hda_verb alc882_3ST_ch2_init[] = {
7070
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
7071
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
7072
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
7073
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
7080
static struct hda_verb alc882_3ST_ch4_init[] = {
7081
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
7082
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
7083
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7084
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7085
{ 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
7092
static struct hda_verb alc882_3ST_ch6_init[] = {
7093
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7094
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7095
{ 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
7096
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7097
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7098
{ 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
7102
static struct hda_channel_mode alc882_3ST_6ch_modes[3] = {
7103
{ 2, alc882_3ST_ch2_init },
7104
{ 4, alc882_3ST_ch4_init },
7105
{ 6, alc882_3ST_ch6_init },
7108
#define alc883_3ST_6ch_modes alc882_3ST_6ch_modes
7113
static struct hda_verb alc883_3ST_ch2_clevo_init[] = {
7114
{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
7115
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
7116
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
7117
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
7118
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
7125
static struct hda_verb alc883_3ST_ch4_clevo_init[] = {
7126
{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7127
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
7128
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
7129
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7130
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7131
{ 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
7138
static struct hda_verb alc883_3ST_ch6_clevo_init[] = {
7139
{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7140
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7141
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7142
{ 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
7143
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7144
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7145
{ 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
7149
static struct hda_channel_mode alc883_3ST_6ch_clevo_modes[3] = {
7150
{ 2, alc883_3ST_ch2_clevo_init },
7151
{ 4, alc883_3ST_ch4_clevo_init },
7152
{ 6, alc883_3ST_ch6_clevo_init },
7159
static struct hda_verb alc882_sixstack_ch6_init[] = {
7160
{ 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
7161
{ 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7162
{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7163
{ 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7170
static struct hda_verb alc882_sixstack_ch8_init[] = {
7171
{ 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7172
{ 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7173
{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7174
{ 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7178
static struct hda_channel_mode alc882_sixstack_modes[2] = {
7179
{ 6, alc882_sixstack_ch6_init },
7180
{ 8, alc882_sixstack_ch8_init },
7184
/* Macbook Air 2,1 */
7186
static struct hda_channel_mode alc885_mba21_ch_modes[1] = {
7191
* macbook pro ALC885 can switch LineIn to LineOut without losing Mic
7197
static struct hda_verb alc885_mbp_ch2_init[] = {
7198
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
7199
{ 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7200
{ 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7207
static struct hda_verb alc885_mbp_ch4_init[] = {
7208
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7209
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7210
{ 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
7211
{ 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7212
{ 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
7216
static struct hda_channel_mode alc885_mbp_4ch_modes[2] = {
7217
{ 2, alc885_mbp_ch2_init },
7218
{ 4, alc885_mbp_ch4_init },
7223
* Speakers/Woofer/HP = Front
7226
static struct hda_verb alc885_mb5_ch2_init[] = {
7227
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
7228
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7234
* Speakers/HP = Front
7238
static struct hda_verb alc885_mb5_ch6_init[] = {
7239
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7240
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7241
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
7245
static struct hda_channel_mode alc885_mb5_6ch_modes[2] = {
7246
{ 2, alc885_mb5_ch2_init },
7247
{ 6, alc885_mb5_ch6_init },
7250
#define alc885_macmini3_6ch_modes alc885_mb5_6ch_modes
7255
static struct hda_verb alc883_4ST_ch2_init[] = {
7256
{ 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7257
{ 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7258
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
7259
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
7260
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
7261
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
7268
static struct hda_verb alc883_4ST_ch4_init[] = {
7269
{ 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7270
{ 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7271
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
7272
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
7273
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7274
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7275
{ 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
7282
static struct hda_verb alc883_4ST_ch6_init[] = {
7283
{ 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7284
{ 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7285
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7286
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7287
{ 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
7288
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7289
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7290
{ 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
7297
static struct hda_verb alc883_4ST_ch8_init[] = {
7298
{ 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7299
{ 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7300
{ 0x17, AC_VERB_SET_CONNECT_SEL, 0x03 },
7301
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7302
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7303
{ 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
7304
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7305
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7306
{ 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
7310
static struct hda_channel_mode alc883_4ST_8ch_modes[4] = {
7311
{ 2, alc883_4ST_ch2_init },
7312
{ 4, alc883_4ST_ch4_init },
7313
{ 6, alc883_4ST_ch6_init },
7314
{ 8, alc883_4ST_ch8_init },
7321
static struct hda_verb alc883_3ST_ch2_intel_init[] = {
7322
{ 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
7323
{ 0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
7324
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
7325
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
7332
static struct hda_verb alc883_3ST_ch4_intel_init[] = {
7333
{ 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
7334
{ 0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
7335
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7336
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7337
{ 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
7344
static struct hda_verb alc883_3ST_ch6_intel_init[] = {
7345
{ 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7346
{ 0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7347
{ 0x19, AC_VERB_SET_CONNECT_SEL, 0x02 },
7348
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7349
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7350
{ 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
7354
static struct hda_channel_mode alc883_3ST_6ch_intel_modes[3] = {
7355
{ 2, alc883_3ST_ch2_intel_init },
7356
{ 4, alc883_3ST_ch4_intel_init },
7357
{ 6, alc883_3ST_ch6_intel_init },
7363
static struct hda_verb alc889_ch2_intel_init[] = {
7364
{ 0x14, AC_VERB_SET_CONNECT_SEL, 0x00 },
7365
{ 0x19, AC_VERB_SET_CONNECT_SEL, 0x00 },
7366
{ 0x16, AC_VERB_SET_CONNECT_SEL, 0x00 },
7367
{ 0x17, AC_VERB_SET_CONNECT_SEL, 0x00 },
7368
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
7369
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
7376
static struct hda_verb alc889_ch6_intel_init[] = {
7377
{ 0x14, AC_VERB_SET_CONNECT_SEL, 0x00 },
7378
{ 0x19, AC_VERB_SET_CONNECT_SEL, 0x01 },
7379
{ 0x16, AC_VERB_SET_CONNECT_SEL, 0x02 },
7380
{ 0x17, AC_VERB_SET_CONNECT_SEL, 0x03 },
7381
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
7382
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
7389
static struct hda_verb alc889_ch8_intel_init[] = {
7390
{ 0x14, AC_VERB_SET_CONNECT_SEL, 0x00 },
7391
{ 0x19, AC_VERB_SET_CONNECT_SEL, 0x01 },
7392
{ 0x16, AC_VERB_SET_CONNECT_SEL, 0x02 },
7393
{ 0x17, AC_VERB_SET_CONNECT_SEL, 0x03 },
7394
{ 0x1a, AC_VERB_SET_CONNECT_SEL, 0x03 },
7395
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7396
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
7400
static struct hda_channel_mode alc889_8ch_intel_modes[3] = {
7401
{ 2, alc889_ch2_intel_init },
7402
{ 6, alc889_ch6_intel_init },
7403
{ 8, alc889_ch8_intel_init },
7409
static struct hda_verb alc883_sixstack_ch6_init[] = {
7410
{ 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
7411
{ 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7412
{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7413
{ 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7420
static struct hda_verb alc883_sixstack_ch8_init[] = {
7421
{ 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7422
{ 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7423
{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7424
{ 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
7428
static struct hda_channel_mode alc883_sixstack_modes[2] = {
7429
{ 6, alc883_sixstack_ch6_init },
7430
{ 8, alc883_sixstack_ch8_init },
7434
/* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
7435
* Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
7437
static struct snd_kcontrol_new alc882_base_mixer[] = {
7438
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
7439
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
7440
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
7441
HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
7442
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
7443
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
7444
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
7445
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
7446
HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
7447
HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
7448
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
7449
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
7450
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
7451
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
7452
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
7453
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
7454
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
7455
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
7456
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
7457
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
7458
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
7462
/* Macbook Air 2,1 same control for HP and internal Speaker */
7464
static struct snd_kcontrol_new alc885_mba21_mixer[] = {
7465
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
7466
HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 0x02, HDA_OUTPUT),
7471
static struct snd_kcontrol_new alc885_mbp3_mixer[] = {
7472
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
7473
HDA_BIND_MUTE ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT),
7474
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0e, 0x00, HDA_OUTPUT),
7475
HDA_BIND_MUTE ("Headphone Playback Switch", 0x0e, 0x02, HDA_INPUT),
7476
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
7477
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
7478
HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
7479
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT),
7480
HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT),
7481
HDA_CODEC_VOLUME("Line Boost", 0x1a, 0x00, HDA_INPUT),
7482
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0x00, HDA_INPUT),
7486
static struct snd_kcontrol_new alc885_mb5_mixer[] = {
7487
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
7488
HDA_BIND_MUTE ("Front Playback Switch", 0x0c, 0x02, HDA_INPUT),
7489
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
7490
HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT),
7491
HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT),
7492
HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT),
7493
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0f, 0x00, HDA_OUTPUT),
7494
HDA_BIND_MUTE ("Headphone Playback Switch", 0x0f, 0x02, HDA_INPUT),
7495
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x07, HDA_INPUT),
7496
HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x07, HDA_INPUT),
7497
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
7498
HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
7499
HDA_CODEC_VOLUME("Line Boost", 0x15, 0x00, HDA_INPUT),
7500
HDA_CODEC_VOLUME("Mic Boost", 0x19, 0x00, HDA_INPUT),
7504
static struct snd_kcontrol_new alc885_macmini3_mixer[] = {
7505
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
7506
HDA_BIND_MUTE ("Front Playback Switch", 0x0c, 0x02, HDA_INPUT),
7507
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
7508
HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT),
7509
HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT),
7510
HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT),
7511
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0f, 0x00, HDA_OUTPUT),
7512
HDA_BIND_MUTE ("Headphone Playback Switch", 0x0f, 0x02, HDA_INPUT),
7513
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x07, HDA_INPUT),
7514
HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x07, HDA_INPUT),
7515
HDA_CODEC_VOLUME("Line Boost", 0x15, 0x00, HDA_INPUT),
7519
static struct snd_kcontrol_new alc885_imac91_mixer[] = {
7520
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
7521
HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT),
7526
static struct snd_kcontrol_new alc882_w2jc_mixer[] = {
7527
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
7528
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
7529
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
7530
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
7531
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
7532
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
7533
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
7534
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
7535
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
7539
static struct snd_kcontrol_new alc882_targa_mixer[] = {
7540
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
7541
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
7542
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
7543
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
7544
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
7545
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
7546
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
7547
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
7548
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
7549
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
7550
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
7551
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
7552
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
7556
/* Pin assignment: Front=0x14, HP = 0x15, Front = 0x16, ???
7557
* Front Mic=0x18, Line In = 0x1a, Line In = 0x1b, CD = 0x1c
7559
static struct snd_kcontrol_new alc882_asus_a7j_mixer[] = {
7560
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
7561
HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT),
7562
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
7563
HDA_CODEC_MUTE("Mobile Front Playback Switch", 0x16, 0x0, HDA_OUTPUT),
7564
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
7565
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
7566
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
7567
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
7568
HDA_CODEC_VOLUME("Mobile Line Playback Volume", 0x0b, 0x03, HDA_INPUT),
7569
HDA_CODEC_MUTE("Mobile Line Playback Switch", 0x0b, 0x03, HDA_INPUT),
7570
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
7571
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
7572
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
7576
static struct snd_kcontrol_new alc882_asus_a7m_mixer[] = {
7577
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
7578
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
7579
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
7580
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
7581
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
7582
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
7583
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
7584
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
7585
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
7586
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
7590
static struct snd_kcontrol_new alc882_chmode_mixer[] = {
7592
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7593
.name = "Channel Mode",
7594
.info = alc_ch_mode_info,
7595
.get = alc_ch_mode_get,
7596
.put = alc_ch_mode_put,
7601
static struct hda_verb alc882_base_init_verbs[] = {
7602
/* Front mixer: unmute input/output amp left and right (volume = 0) */
7603
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7604
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7606
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7607
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7609
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7610
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7612
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7613
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7615
/* Front Pin: output 0 (0x0c) */
7616
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7617
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7618
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
7619
/* Rear Pin: output 1 (0x0d) */
7620
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7621
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7622
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
7623
/* CLFE Pin: output 2 (0x0e) */
7624
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7625
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7626
{0x16, AC_VERB_SET_CONNECT_SEL, 0x02},
7627
/* Side Pin: output 3 (0x0f) */
7628
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7629
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7630
{0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
7631
/* Mic (rear) pin: input vref at 80% */
7632
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
7633
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7634
/* Front Mic pin: input vref at 80% */
7635
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
7636
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7637
/* Line In pin: input */
7638
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
7639
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7640
/* Line-2 In: Headphone output (output 0 - 0x0c) */
7641
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
7642
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7643
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
7644
/* CD pin widget for input */
7645
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
7647
/* FIXME: use matrix-type input source selection */
7648
/* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
7650
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7652
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7653
/* ADC2: mute amp left and right */
7654
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7655
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
7656
/* ADC3: mute amp left and right */
7657
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7658
{0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
7663
static struct hda_verb alc882_adc1_init_verbs[] = {
7664
/* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
7665
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7666
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7667
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7668
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7669
/* ADC1: mute amp left and right */
7670
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7671
{0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
7675
static struct hda_verb alc882_eapd_verbs[] = {
7676
/* change to EAPD mode */
7677
{0x20, AC_VERB_SET_COEF_INDEX, 0x07},
7678
{0x20, AC_VERB_SET_PROC_COEF, 0x3060},
7682
static struct hda_verb alc889_eapd_verbs[] = {
7683
{0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
7684
{0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
7688
static struct hda_verb alc_hp15_unsol_verbs[] = {
7689
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
7690
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
7694
static struct hda_verb alc885_init_verbs[] = {
7695
/* Front mixer: unmute input/output amp left and right (volume = 0) */
7696
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7697
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
7699
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7700
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
7702
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7703
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
7705
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7706
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
7708
/* Front HP Pin: output 0 (0x0c) */
7709
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
7710
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7711
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
7712
/* Front Pin: output 0 (0x0c) */
7713
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7714
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7715
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
7716
/* Rear Pin: output 1 (0x0d) */
7717
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7718
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7719
{0x19, AC_VERB_SET_CONNECT_SEL, 0x01},
7720
/* CLFE Pin: output 2 (0x0e) */
7721
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7722
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7723
{0x16, AC_VERB_SET_CONNECT_SEL, 0x02},
7724
/* Side Pin: output 3 (0x0f) */
7725
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7726
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7727
{0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
7728
/* Mic (rear) pin: input vref at 80% */
7729
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
7730
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7731
/* Front Mic pin: input vref at 80% */
7732
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
7733
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7734
/* Line In pin: input */
7735
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
7736
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7738
/* Mixer elements: 0x18, , 0x1a, 0x1b */
7740
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7742
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7744
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7745
/* ADC2: mute amp left and right */
7746
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7747
/* ADC3: mute amp left and right */
7748
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7753
static struct hda_verb alc885_init_input_verbs[] = {
7754
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7755
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
7756
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)},
7761
/* Unmute Selector 24h and set the default input to front mic */
7762
static struct hda_verb alc889_init_input_verbs[] = {
7763
{0x24, AC_VERB_SET_CONNECT_SEL, 0x00},
7764
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7769
#define alc883_init_verbs alc882_base_init_verbs
7772
static struct snd_kcontrol_new alc882_macpro_mixer[] = {
7773
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
7774
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
7775
HDA_CODEC_MUTE("Headphone Playback Switch", 0x18, 0x0, HDA_OUTPUT),
7776
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT),
7777
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT),
7778
/* FIXME: this looks suspicious...
7779
HDA_CODEC_VOLUME("Beep Playback Volume", 0x0b, 0x02, HDA_INPUT),
7780
HDA_CODEC_MUTE("Beep Playback Switch", 0x0b, 0x02, HDA_INPUT),
7785
static struct hda_verb alc882_macpro_init_verbs[] = {
7786
/* Front mixer: unmute input/output amp left and right (volume = 0) */
7787
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7788
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7789
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7790
/* Front Pin: output 0 (0x0c) */
7791
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7792
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7793
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
7794
/* Front Mic pin: input vref at 80% */
7795
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
7796
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7797
/* Speaker: output */
7798
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7799
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7800
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x04},
7801
/* Headphone output (output 0 - 0x0c) */
7802
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
7803
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7804
{0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
7806
/* FIXME: use matrix-type input source selection */
7807
/* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
7808
/* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
7809
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7810
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7811
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7812
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7814
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7815
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7816
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7817
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7819
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7820
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7821
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7822
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7823
/* ADC1: mute amp left and right */
7824
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7825
{0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
7826
/* ADC2: mute amp left and right */
7827
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7828
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
7829
/* ADC3: mute amp left and right */
7830
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7831
{0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
7837
static struct hda_verb alc885_mb5_init_verbs[] = {
7839
{0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7840
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7841
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7842
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7844
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7845
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7846
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7847
/* Surround mixer */
7848
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7849
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7850
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7852
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7853
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7854
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7856
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7857
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7858
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7859
/* Front Pin (0x0c) */
7860
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
7861
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7862
{0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
7863
/* LFE Pin (0x0e) */
7864
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
7865
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7866
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x02},
7868
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7869
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7870
{0x14, AC_VERB_SET_CONNECT_SEL, 0x03},
7871
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
7872
/* Front Mic pin: input vref at 80% */
7873
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
7874
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7876
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
7877
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7879
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0x1)},
7880
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0x7)},
7881
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0x4)},
7886
static struct hda_verb alc885_macmini3_init_verbs[] = {
7888
{0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7889
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7890
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7891
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7893
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7894
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7895
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7896
/* Surround mixer */
7897
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7898
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7899
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7901
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7902
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7903
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7905
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7906
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7907
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7908
/* Front Pin (0x0c) */
7909
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
7910
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7911
{0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
7912
/* LFE Pin (0x0e) */
7913
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
7914
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7915
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x02},
7917
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7918
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7919
{0x14, AC_VERB_SET_CONNECT_SEL, 0x03},
7920
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
7922
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
7923
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7925
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
7926
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7927
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7928
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7933
static struct hda_verb alc885_mba21_init_verbs[] = {
7934
/*Internal and HP Speaker Mixer*/
7935
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7936
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7937
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
7938
/*Internal Speaker Pin (0x0c)*/
7939
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) },
7940
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7941
{0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
7942
/* HP Pin: output 0 (0x0e) */
7943
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4},
7944
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7945
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
7946
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, (ALC880_HP_EVENT | AC_USRSP_EN)},
7947
/* Line in (is hp when jack connected)*/
7948
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_VREF_50},
7949
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7955
/* Macbook Pro rev3 */
7956
static struct hda_verb alc885_mbp3_init_verbs[] = {
7957
/* Front mixer: unmute input/output amp left and right (volume = 0) */
7958
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7959
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7960
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7962
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7963
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7964
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7966
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7967
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
7968
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
7969
/* Front Pin: output 0 (0x0c) */
7970
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7971
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7972
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
7973
/* HP Pin: output 0 (0x0e) */
7974
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4},
7975
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7976
{0x15, AC_VERB_SET_CONNECT_SEL, 0x02},
7977
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
7978
/* Mic (rear) pin: input vref at 80% */
7979
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
7980
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7981
/* Front Mic pin: input vref at 80% */
7982
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
7983
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7984
/* Line In pin: use output 1 when in LineOut mode */
7985
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
7986
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7987
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x01},
7989
/* FIXME: use matrix-type input source selection */
7990
/* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
7991
/* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
7992
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7993
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7994
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
7995
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
7997
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7998
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
7999
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
8000
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
8002
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8003
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
8004
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
8005
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
8006
/* ADC1: mute amp left and right */
8007
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
8008
{0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
8009
/* ADC2: mute amp left and right */
8010
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
8011
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
8012
/* ADC3: mute amp left and right */
8013
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
8014
{0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
8020
static struct hda_verb alc885_imac91_init_verbs[] = {
8021
/* Internal Speaker Pin (0x0c) */
8022
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) },
8023
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
8024
{0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
8025
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) },
8026
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
8027
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
8029
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8030
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
8031
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
8032
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, (ALC880_HP_EVENT | AC_USRSP_EN)},
8034
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_VREF_50},
8035
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
8036
/* Front Mic pin: input vref at 80% */
8037
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
8038
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
8040
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
8041
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
8042
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
8043
/* Line-Out mixer: unmute input/output amp left and right (volume = 0) */
8044
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
8045
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
8046
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
8047
/* 0x24 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In */
8048
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8049
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
8050
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
8051
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
8052
/* 0x23 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In */
8053
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8054
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
8055
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
8056
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
8057
/* 0x22 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In */
8058
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8059
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
8060
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
8061
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
8062
/* 0x07 [Audio Input] wcaps 0x10011b: Stereo Amp-In */
8063
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
8064
{0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
8065
/* 0x08 [Audio Input] wcaps 0x10011b: Stereo Amp-In */
8066
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
8067
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
8068
/* 0x09 [Audio Input] wcaps 0x10011b: Stereo Amp-In */
8069
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
8070
{0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
8074
/* iMac 24 mixer. */
8075
static struct snd_kcontrol_new alc885_imac24_mixer[] = {
8076
HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
8077
HDA_CODEC_MUTE("Master Playback Switch", 0x0c, 0x00, HDA_INPUT),
8081
/* iMac 24 init verbs. */
8082
static struct hda_verb alc885_imac24_init_verbs[] = {
8083
/* Internal speakers: output 0 (0x0c) */
8084
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8085
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
8086
{0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
8087
/* Internal speakers: output 0 (0x0c) */
8088
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8089
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
8090
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
8091
/* Headphone: output 0 (0x0c) */
8092
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8093
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
8094
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
8095
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8096
/* Front Mic: input vref at 80% */
8097
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
8098
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
8102
/* Toggle speaker-output according to the hp-jack state */
8103
static void alc885_imac24_setup(struct hda_codec *codec)
8105
struct alc_spec *spec = codec->spec;
8107
spec->autocfg.hp_pins[0] = 0x14;
8108
spec->autocfg.speaker_pins[0] = 0x18;
8109
spec->autocfg.speaker_pins[1] = 0x1a;
8112
#define alc885_mb5_setup alc885_imac24_setup
8113
#define alc885_macmini3_setup alc885_imac24_setup
8115
/* Macbook Air 2,1 */
8116
static void alc885_mba21_setup(struct hda_codec *codec)
8118
struct alc_spec *spec = codec->spec;
8120
spec->autocfg.hp_pins[0] = 0x14;
8121
spec->autocfg.speaker_pins[0] = 0x18;
8126
static void alc885_mbp3_setup(struct hda_codec *codec)
8128
struct alc_spec *spec = codec->spec;
8130
spec->autocfg.hp_pins[0] = 0x15;
8131
spec->autocfg.speaker_pins[0] = 0x14;
8134
static void alc885_imac91_setup(struct hda_codec *codec)
8136
struct alc_spec *spec = codec->spec;
8138
spec->autocfg.hp_pins[0] = 0x14;
8139
spec->autocfg.speaker_pins[0] = 0x18;
8140
spec->autocfg.speaker_pins[1] = 0x1a;
8143
static struct hda_verb alc882_targa_verbs[] = {
8144
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8145
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
8147
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8148
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8150
{0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
8151
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */
8152
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
8154
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8158
/* toggle speaker-output according to the hp-jack state */
8159
static void alc882_targa_automute(struct hda_codec *codec)
8161
struct alc_spec *spec = codec->spec;
8162
alc_automute_amp(codec);
8163
snd_hda_codec_write_cache(codec, 1, 0, AC_VERB_SET_GPIO_DATA,
8164
spec->jack_present ? 1 : 3);
8167
static void alc882_targa_setup(struct hda_codec *codec)
8169
struct alc_spec *spec = codec->spec;
8171
spec->autocfg.hp_pins[0] = 0x14;
8172
spec->autocfg.speaker_pins[0] = 0x1b;
8175
static void alc882_targa_unsol_event(struct hda_codec *codec, unsigned int res)
8177
if ((res >> 26) == ALC880_HP_EVENT)
8178
alc882_targa_automute(codec);
8181
static struct hda_verb alc882_asus_a7j_verbs[] = {
8182
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8183
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
8185
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8186
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8187
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8189
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */
8190
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
8191
{0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */
8193
{0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
8194
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */
8195
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
8199
static struct hda_verb alc882_asus_a7m_verbs[] = {
8200
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8201
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
8203
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8204
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8205
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8207
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */
8208
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
8209
{0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */
8211
{0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
8212
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */
8213
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
8217
static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted)
8219
unsigned int gpiostate, gpiomask, gpiodir;
8221
gpiostate = snd_hda_codec_read(codec, codec->afg, 0,
8222
AC_VERB_GET_GPIO_DATA, 0);
8225
gpiostate |= (1 << pin);
8227
gpiostate &= ~(1 << pin);
8229
gpiomask = snd_hda_codec_read(codec, codec->afg, 0,
8230
AC_VERB_GET_GPIO_MASK, 0);
8231
gpiomask |= (1 << pin);
8233
gpiodir = snd_hda_codec_read(codec, codec->afg, 0,
8234
AC_VERB_GET_GPIO_DIRECTION, 0);
8235
gpiodir |= (1 << pin);
8238
snd_hda_codec_write(codec, codec->afg, 0,
8239
AC_VERB_SET_GPIO_MASK, gpiomask);
8240
snd_hda_codec_write(codec, codec->afg, 0,
8241
AC_VERB_SET_GPIO_DIRECTION, gpiodir);
8245
snd_hda_codec_write(codec, codec->afg, 0,
8246
AC_VERB_SET_GPIO_DATA, gpiostate);
8249
/* set up GPIO at initialization */
8250
static void alc885_macpro_init_hook(struct hda_codec *codec)
8252
alc882_gpio_mute(codec, 0, 0);
8253
alc882_gpio_mute(codec, 1, 0);
8256
/* set up GPIO and update auto-muting at initialization */
8257
static void alc885_imac24_init_hook(struct hda_codec *codec)
8259
alc885_macpro_init_hook(codec);
8260
alc_automute_amp(codec);
8264
* generic initialization of ADC, input mixers and output mixers
8266
static struct hda_verb alc883_auto_init_verbs[] = {
8268
* Unmute ADC0-2 and set the default input to mic-in
8270
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
8271
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8272
{0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
8273
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8276
* Set up output mixers (0x0c - 0x0f)
8278
/* set vol=0 to output mixers */
8279
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
8280
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
8281
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
8282
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
8283
/* set up input amps for analog loopback */
8284
/* Amp Indices: DAC = 0, mixer = 1 */
8285
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8286
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
8287
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8288
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
8289
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8290
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
8291
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8292
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
8293
{0x26, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8294
{0x26, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
8296
/* FIXME: use matrix-type input source selection */
8297
/* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
8299
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8301
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8305
/* 2ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:front) */
8306
static struct hda_verb alc889A_mb31_ch2_init[] = {
8307
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP as front */
8308
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Subwoofer on */
8309
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* Line as input */
8310
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Line off */
8314
/* 4ch mode (Speaker:front, Subwoofer:CLFE, Line:CLFE, Headphones:front) */
8315
static struct hda_verb alc889A_mb31_ch4_init[] = {
8316
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP as front */
8317
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Subwoofer on */
8318
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, /* Line as output */
8319
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Line on */
8323
/* 5ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:rear) */
8324
static struct hda_verb alc889A_mb31_ch5_init[] = {
8325
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, /* HP as rear */
8326
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Subwoofer on */
8327
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* Line as input */
8328
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Line off */
8332
/* 6ch mode (Speaker:front, Subwoofer:off, Line:CLFE, Headphones:Rear) */
8333
static struct hda_verb alc889A_mb31_ch6_init[] = {
8334
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, /* HP as front */
8335
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Subwoofer off */
8336
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, /* Line as output */
8337
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Line on */
8341
static struct hda_channel_mode alc889A_mb31_6ch_modes[4] = {
8342
{ 2, alc889A_mb31_ch2_init },
8343
{ 4, alc889A_mb31_ch4_init },
8344
{ 5, alc889A_mb31_ch5_init },
8345
{ 6, alc889A_mb31_ch6_init },
8348
static struct hda_verb alc883_medion_eapd_verbs[] = {
8349
/* eanable EAPD on medion laptop */
8350
{0x20, AC_VERB_SET_COEF_INDEX, 0x07},
8351
{0x20, AC_VERB_SET_PROC_COEF, 0x3070},
8355
#define alc883_base_mixer alc882_base_mixer
8357
static struct snd_kcontrol_new alc883_mitac_mixer[] = {
8358
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8359
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8360
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
8361
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
8362
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
8363
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
8364
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
8365
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8366
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
8367
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8368
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
8369
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
8370
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
8374
static struct snd_kcontrol_new alc883_clevo_m720_mixer[] = {
8375
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8376
HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
8377
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
8378
HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
8379
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8380
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
8381
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8382
HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
8383
HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT),
8384
HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
8388
static struct snd_kcontrol_new alc883_2ch_fujitsu_pi2515_mixer[] = {
8389
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8390
HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
8391
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
8392
HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
8393
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8394
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
8395
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8396
HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
8397
HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT),
8398
HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
8402
static struct snd_kcontrol_new alc883_3ST_2ch_mixer[] = {
8403
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8404
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8405
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
8406
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
8407
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
8408
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
8409
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
8410
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8411
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
8412
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8413
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
8414
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
8415
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
8419
static struct snd_kcontrol_new alc883_3ST_6ch_mixer[] = {
8420
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8421
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8422
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
8423
HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
8424
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
8425
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
8426
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
8427
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
8428
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
8429
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
8430
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
8431
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
8432
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
8433
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8434
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
8435
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8436
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
8437
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
8438
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
8442
static struct snd_kcontrol_new alc883_3ST_6ch_intel_mixer[] = {
8443
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8444
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8445
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
8446
HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
8447
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
8449
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
8450
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
8451
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
8452
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
8453
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
8454
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
8455
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
8456
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
8457
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
8458
HDA_CODEC_VOLUME("Mic Boost", 0x19, 0, HDA_INPUT),
8459
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
8460
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8461
HDA_CODEC_VOLUME("Front Mic Boost", 0x18, 0, HDA_INPUT),
8462
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8466
static struct snd_kcontrol_new alc885_8ch_intel_mixer[] = {
8467
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8468
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8469
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
8470
HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
8471
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
8473
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
8474
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
8475
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
8476
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
8477
HDA_BIND_MUTE("Speaker Playback Switch", 0x0f, 2, HDA_INPUT),
8478
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
8479
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
8480
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
8481
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x3, HDA_INPUT),
8482
HDA_CODEC_VOLUME("Mic Boost", 0x1b, 0, HDA_INPUT),
8483
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x3, HDA_INPUT),
8484
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8485
HDA_CODEC_VOLUME("Front Mic Boost", 0x18, 0, HDA_INPUT),
8486
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8490
static struct snd_kcontrol_new alc883_fivestack_mixer[] = {
8491
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8492
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8493
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
8494
HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
8495
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
8496
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
8497
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
8498
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
8499
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
8500
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
8501
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
8502
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
8503
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
8504
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8505
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
8506
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8507
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
8508
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
8509
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
8513
static struct snd_kcontrol_new alc883_targa_mixer[] = {
8514
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8515
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8516
HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
8517
HDA_CODEC_MUTE("Speaker Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
8518
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
8519
HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
8520
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
8521
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
8522
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
8523
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
8524
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
8525
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
8526
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
8527
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
8528
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8529
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
8530
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8534
static struct snd_kcontrol_new alc883_targa_2ch_mixer[] = {
8535
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8536
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8537
HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
8538
HDA_CODEC_MUTE("Speaker Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
8539
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
8540
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
8541
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8542
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
8543
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8544
HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
8545
HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT),
8546
HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
8550
static struct snd_kcontrol_new alc883_targa_8ch_mixer[] = {
8551
HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
8552
HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
8553
HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
8554
HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT),
8555
HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
8559
static struct snd_kcontrol_new alc883_lenovo_101e_2ch_mixer[] = {
8560
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8561
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8562
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
8563
HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
8564
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
8565
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
8566
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
8567
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
8571
static struct snd_kcontrol_new alc883_lenovo_nb0763_mixer[] = {
8572
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8573
HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 2, HDA_INPUT),
8574
HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
8575
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
8576
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
8577
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8578
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8579
HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
8580
HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
8584
static struct snd_kcontrol_new alc883_medion_md2_mixer[] = {
8585
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8586
HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
8587
HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT),
8588
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
8589
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
8590
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8591
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8592
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
8593
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
8597
static struct snd_kcontrol_new alc883_medion_wim2160_mixer[] = {
8598
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8599
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8600
HDA_CODEC_MUTE("Speaker Playback Switch", 0x15, 0x0, HDA_OUTPUT),
8601
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x0, HDA_OUTPUT),
8602
HDA_CODEC_VOLUME("Line Playback Volume", 0x08, 0x0, HDA_INPUT),
8603
HDA_CODEC_MUTE("Line Playback Switch", 0x08, 0x0, HDA_INPUT),
8607
static struct hda_verb alc883_medion_wim2160_verbs[] = {
8608
/* Unmute front mixer */
8609
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8610
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
8612
/* Set speaker pin to front mixer */
8613
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
8615
/* Init headphone pin */
8616
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8617
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
8618
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
8619
{0x1a, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8624
/* toggle speaker-output according to the hp-jack state */
8625
static void alc883_medion_wim2160_setup(struct hda_codec *codec)
8627
struct alc_spec *spec = codec->spec;
8629
spec->autocfg.hp_pins[0] = 0x1a;
8630
spec->autocfg.speaker_pins[0] = 0x15;
8633
static struct snd_kcontrol_new alc883_acer_aspire_mixer[] = {
8634
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8635
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8636
HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
8637
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
8638
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
8639
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8640
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
8641
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8645
static struct snd_kcontrol_new alc888_acer_aspire_6530_mixer[] = {
8646
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8647
HDA_CODEC_VOLUME("LFE Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
8648
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
8649
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
8650
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
8651
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
8652
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8653
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
8654
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8658
static struct snd_kcontrol_new alc888_lenovo_sky_mixer[] = {
8659
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8660
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8661
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0e, 0x0, HDA_OUTPUT),
8662
HDA_BIND_MUTE("Surround Playback Switch", 0x0e, 2, HDA_INPUT),
8663
HDA_CODEC_VOLUME_MONO("Center Playback Volume",
8664
0x0d, 1, 0x0, HDA_OUTPUT),
8665
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT),
8666
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT),
8667
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT),
8668
HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
8669
HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
8670
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
8671
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
8672
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
8673
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
8674
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8675
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
8676
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8677
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
8678
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
8679
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
8683
static struct snd_kcontrol_new alc889A_mb31_mixer[] = {
8685
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
8686
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 0x02, HDA_INPUT),
8687
HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
8688
HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT),
8689
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x00,
8691
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x02, HDA_INPUT),
8692
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x00, HDA_OUTPUT),
8693
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x02, HDA_INPUT),
8694
/* Output switches */
8695
HDA_CODEC_MUTE("Enable Speaker", 0x14, 0x00, HDA_OUTPUT),
8696
HDA_CODEC_MUTE("Enable Headphones", 0x15, 0x00, HDA_OUTPUT),
8697
HDA_CODEC_MUTE_MONO("Enable LFE", 0x16, 2, 0x00, HDA_OUTPUT),
8699
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0x00, HDA_INPUT),
8700
HDA_CODEC_VOLUME("Line Boost", 0x1a, 0x00, HDA_INPUT),
8702
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT),
8703
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT),
8704
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
8705
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
8709
static struct snd_kcontrol_new alc883_vaiott_mixer[] = {
8710
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8711
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8712
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
8713
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
8714
HDA_CODEC_VOLUME("Mic Boost", 0x19, 0, HDA_INPUT),
8715
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
8719
static struct hda_bind_ctls alc883_bind_cap_vol = {
8720
.ops = &snd_hda_bind_vol,
8722
HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT),
8723
HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT),
8728
static struct hda_bind_ctls alc883_bind_cap_switch = {
8729
.ops = &snd_hda_bind_sw,
8731
HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT),
8732
HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT),
8737
static struct snd_kcontrol_new alc883_asus_eee1601_mixer[] = {
8738
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8739
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8740
HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
8741
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
8742
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
8743
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
8744
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
8745
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
8749
static struct snd_kcontrol_new alc883_asus_eee1601_cap_mixer[] = {
8750
HDA_BIND_VOL("Capture Volume", &alc883_bind_cap_vol),
8751
HDA_BIND_SW("Capture Switch", &alc883_bind_cap_switch),
8753
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
8754
/* .name = "Capture Source", */
8755
.name = "Input Source",
8757
.info = alc_mux_enum_info,
8758
.get = alc_mux_enum_get,
8759
.put = alc_mux_enum_put,
8764
static struct snd_kcontrol_new alc883_chmode_mixer[] = {
8766
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
8767
.name = "Channel Mode",
8768
.info = alc_ch_mode_info,
8769
.get = alc_ch_mode_get,
8770
.put = alc_ch_mode_put,
8775
/* toggle speaker-output according to the hp-jack state */
8776
static void alc883_mitac_setup(struct hda_codec *codec)
8778
struct alc_spec *spec = codec->spec;
8780
spec->autocfg.hp_pins[0] = 0x15;
8781
spec->autocfg.speaker_pins[0] = 0x14;
8782
spec->autocfg.speaker_pins[1] = 0x17;
8785
/* auto-toggle front mic */
8787
static void alc883_mitac_mic_automute(struct hda_codec *codec)
8789
unsigned char bits = snd_hda_jack_detect(codec, 0x18) ? HDA_AMP_MUTE : 0;
8791
snd_hda_codec_amp_stereo(codec, 0x0b, HDA_INPUT, 1, HDA_AMP_MUTE, bits);
8795
static struct hda_verb alc883_mitac_verbs[] = {
8797
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
8798
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8800
{0x17, AC_VERB_SET_CONNECT_SEL, 0x02},
8801
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8803
/* enable unsolicited event */
8804
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8805
/* {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_MIC_EVENT | AC_USRSP_EN}, */
8810
static struct hda_verb alc883_clevo_m540r_verbs[] = {
8812
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
8813
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8815
/*{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},*/
8817
/* enable unsolicited event */
8819
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8820
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_MIC_EVENT | AC_USRSP_EN},
8826
static struct hda_verb alc883_clevo_m720_verbs[] = {
8828
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
8829
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8831
{0x14, AC_VERB_SET_CONNECT_SEL, 0x01},
8832
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8834
/* enable unsolicited event */
8835
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8836
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_MIC_EVENT | AC_USRSP_EN},
8841
static struct hda_verb alc883_2ch_fujitsu_pi2515_verbs[] = {
8843
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
8844
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8846
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
8847
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8849
/* enable unsolicited event */
8850
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8855
static struct hda_verb alc883_targa_verbs[] = {
8856
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8857
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
8859
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8860
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8862
/* Connect Line-Out side jack (SPDIF) to Side */
8863
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8864
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
8865
{0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
8866
/* Connect Mic jack to CLFE */
8867
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8868
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
8869
{0x18, AC_VERB_SET_CONNECT_SEL, 0x02},
8870
/* Connect Line-in jack to Surround */
8871
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8872
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
8873
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x01},
8874
/* Connect HP out jack to Front */
8875
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8876
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
8877
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
8879
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8884
static struct hda_verb alc883_lenovo_101e_verbs[] = {
8885
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
8886
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_FRONT_EVENT|AC_USRSP_EN},
8887
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT|AC_USRSP_EN},
8891
static struct hda_verb alc883_lenovo_nb0763_verbs[] = {
8892
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
8893
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8894
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8895
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8899
static struct hda_verb alc888_lenovo_ms7195_verbs[] = {
8900
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8901
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
8902
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
8903
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_FRONT_EVENT | AC_USRSP_EN},
8904
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8908
static struct hda_verb alc883_haier_w66_verbs[] = {
8909
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8910
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
8912
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8914
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
8915
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8916
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8917
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8921
static struct hda_verb alc888_lenovo_sky_verbs[] = {
8922
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8923
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
8924
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8925
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8926
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8927
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
8928
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
8929
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8933
static struct hda_verb alc888_6st_dell_verbs[] = {
8934
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8938
static struct hda_verb alc883_vaiott_verbs[] = {
8940
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
8941
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8943
/* enable unsolicited event */
8944
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8949
static void alc888_3st_hp_setup(struct hda_codec *codec)
8951
struct alc_spec *spec = codec->spec;
8953
spec->autocfg.hp_pins[0] = 0x1b;
8954
spec->autocfg.speaker_pins[0] = 0x14;
8955
spec->autocfg.speaker_pins[1] = 0x16;
8956
spec->autocfg.speaker_pins[2] = 0x18;
8959
static struct hda_verb alc888_3st_hp_verbs[] = {
8960
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front: output 0 (0x0c) */
8961
{0x16, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Rear : output 1 (0x0d) */
8962
{0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* CLFE : output 2 (0x0e) */
8963
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8970
static struct hda_verb alc888_3st_hp_2ch_init[] = {
8971
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
8972
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
8973
{ 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
8974
{ 0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
8981
static struct hda_verb alc888_3st_hp_4ch_init[] = {
8982
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
8983
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
8984
{ 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
8985
{ 0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
8986
{ 0x16, AC_VERB_SET_CONNECT_SEL, 0x01 },
8993
static struct hda_verb alc888_3st_hp_6ch_init[] = {
8994
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
8995
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
8996
{ 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
8997
{ 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
8998
{ 0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
8999
{ 0x16, AC_VERB_SET_CONNECT_SEL, 0x01 },
9003
static struct hda_channel_mode alc888_3st_hp_modes[3] = {
9004
{ 2, alc888_3st_hp_2ch_init },
9005
{ 4, alc888_3st_hp_4ch_init },
9006
{ 6, alc888_3st_hp_6ch_init },
9009
/* toggle front-jack and RCA according to the hp-jack state */
9010
static void alc888_lenovo_ms7195_front_automute(struct hda_codec *codec)
9012
unsigned int present = snd_hda_jack_detect(codec, 0x1b);
9014
snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
9015
HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
9016
snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
9017
HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
9020
/* toggle RCA according to the front-jack state */
9021
static void alc888_lenovo_ms7195_rca_automute(struct hda_codec *codec)
9023
unsigned int present = snd_hda_jack_detect(codec, 0x14);
9025
snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
9026
HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
9029
static void alc883_lenovo_ms7195_unsol_event(struct hda_codec *codec,
9032
if ((res >> 26) == ALC880_HP_EVENT)
9033
alc888_lenovo_ms7195_front_automute(codec);
9034
if ((res >> 26) == ALC880_FRONT_EVENT)
9035
alc888_lenovo_ms7195_rca_automute(codec);
9038
static struct hda_verb alc883_medion_md2_verbs[] = {
9039
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
9040
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
9042
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
9044
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
9048
/* toggle speaker-output according to the hp-jack state */
9049
static void alc883_medion_md2_setup(struct hda_codec *codec)
9051
struct alc_spec *spec = codec->spec;
9053
spec->autocfg.hp_pins[0] = 0x14;
9054
spec->autocfg.speaker_pins[0] = 0x15;
9057
/* toggle speaker-output according to the hp-jack state */
9058
#define alc883_targa_init_hook alc882_targa_init_hook
9059
#define alc883_targa_unsol_event alc882_targa_unsol_event
9061
static void alc883_clevo_m720_mic_automute(struct hda_codec *codec)
9063
unsigned int present;
9065
present = snd_hda_jack_detect(codec, 0x18);
9066
snd_hda_codec_amp_stereo(codec, 0x0b, HDA_INPUT, 1,
9067
HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
9070
static void alc883_clevo_m720_setup(struct hda_codec *codec)
9072
struct alc_spec *spec = codec->spec;
9074
spec->autocfg.hp_pins[0] = 0x15;
9075
spec->autocfg.speaker_pins[0] = 0x14;
9078
static void alc883_clevo_m720_init_hook(struct hda_codec *codec)
9080
alc_automute_amp(codec);
9081
alc883_clevo_m720_mic_automute(codec);
9084
static void alc883_clevo_m720_unsol_event(struct hda_codec *codec,
9087
switch (res >> 26) {
9088
case ALC880_MIC_EVENT:
9089
alc883_clevo_m720_mic_automute(codec);
9092
alc_automute_amp_unsol_event(codec, res);
9097
/* toggle speaker-output according to the hp-jack state */
9098
static void alc883_2ch_fujitsu_pi2515_setup(struct hda_codec *codec)
9100
struct alc_spec *spec = codec->spec;
9102
spec->autocfg.hp_pins[0] = 0x14;
9103
spec->autocfg.speaker_pins[0] = 0x15;
9106
static void alc883_haier_w66_setup(struct hda_codec *codec)
9108
struct alc_spec *spec = codec->spec;
9110
spec->autocfg.hp_pins[0] = 0x1b;
9111
spec->autocfg.speaker_pins[0] = 0x14;
9114
static void alc883_lenovo_101e_ispeaker_automute(struct hda_codec *codec)
9116
int bits = snd_hda_jack_detect(codec, 0x14) ? HDA_AMP_MUTE : 0;
9118
snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
9119
HDA_AMP_MUTE, bits);
9122
static void alc883_lenovo_101e_all_automute(struct hda_codec *codec)
9124
int bits = snd_hda_jack_detect(codec, 0x1b) ? HDA_AMP_MUTE : 0;
9126
snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
9127
HDA_AMP_MUTE, bits);
9128
snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
9129
HDA_AMP_MUTE, bits);
9132
static void alc883_lenovo_101e_unsol_event(struct hda_codec *codec,
9135
if ((res >> 26) == ALC880_HP_EVENT)
9136
alc883_lenovo_101e_all_automute(codec);
9137
if ((res >> 26) == ALC880_FRONT_EVENT)
9138
alc883_lenovo_101e_ispeaker_automute(codec);
9141
/* toggle speaker-output according to the hp-jack state */
9142
static void alc883_acer_aspire_setup(struct hda_codec *codec)
9144
struct alc_spec *spec = codec->spec;
9146
spec->autocfg.hp_pins[0] = 0x14;
9147
spec->autocfg.speaker_pins[0] = 0x15;
9148
spec->autocfg.speaker_pins[1] = 0x16;
9151
static struct hda_verb alc883_acer_eapd_verbs[] = {
9152
/* HP Pin: output 0 (0x0c) */
9153
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
9154
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
9155
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
9156
/* Front Pin: output 0 (0x0c) */
9157
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
9158
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
9159
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
9160
{0x16, AC_VERB_SET_CONNECT_SEL, 0x00},
9161
/* eanable EAPD on medion laptop */
9162
{0x20, AC_VERB_SET_COEF_INDEX, 0x07},
9163
{0x20, AC_VERB_SET_PROC_COEF, 0x3050},
9164
/* enable unsolicited event */
9165
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
9169
static struct hda_verb alc888_acer_aspire_7730G_verbs[] = {
9170
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
9171
{0x17, AC_VERB_SET_CONNECT_SEL, 0x02},
9172
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
9176
static void alc888_6st_dell_setup(struct hda_codec *codec)
9178
struct alc_spec *spec = codec->spec;
9180
spec->autocfg.hp_pins[0] = 0x1b;
9181
spec->autocfg.speaker_pins[0] = 0x14;
9182
spec->autocfg.speaker_pins[1] = 0x15;
9183
spec->autocfg.speaker_pins[2] = 0x16;
9184
spec->autocfg.speaker_pins[3] = 0x17;
9187
static void alc888_lenovo_sky_setup(struct hda_codec *codec)
9189
struct alc_spec *spec = codec->spec;
9191
spec->autocfg.hp_pins[0] = 0x1b;
9192
spec->autocfg.speaker_pins[0] = 0x14;
9193
spec->autocfg.speaker_pins[1] = 0x15;
9194
spec->autocfg.speaker_pins[2] = 0x16;
9195
spec->autocfg.speaker_pins[3] = 0x17;
9196
spec->autocfg.speaker_pins[4] = 0x1a;
9199
static void alc883_vaiott_setup(struct hda_codec *codec)
9201
struct alc_spec *spec = codec->spec;
9203
spec->autocfg.hp_pins[0] = 0x15;
9204
spec->autocfg.speaker_pins[0] = 0x14;
9205
spec->autocfg.speaker_pins[1] = 0x17;
9208
static struct hda_verb alc888_asus_m90v_verbs[] = {
9209
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
9210
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
9211
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
9212
/* enable unsolicited event */
9213
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
9214
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_MIC_EVENT | AC_USRSP_EN},
9218
static void alc883_mode2_setup(struct hda_codec *codec)
9220
struct alc_spec *spec = codec->spec;
9222
spec->autocfg.hp_pins[0] = 0x1b;
9223
spec->autocfg.speaker_pins[0] = 0x14;
9224
spec->autocfg.speaker_pins[1] = 0x15;
9225
spec->autocfg.speaker_pins[2] = 0x16;
9226
spec->ext_mic.pin = 0x18;
9227
spec->int_mic.pin = 0x19;
9228
spec->ext_mic.mux_idx = 0;
9229
spec->int_mic.mux_idx = 1;
9233
static struct hda_verb alc888_asus_eee1601_verbs[] = {
9234
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
9235
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
9236
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
9237
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
9238
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
9239
{0x20, AC_VERB_SET_COEF_INDEX, 0x0b},
9240
{0x20, AC_VERB_SET_PROC_COEF, 0x0838},
9241
/* enable unsolicited event */
9242
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
9246
static void alc883_eee1601_inithook(struct hda_codec *codec)
9248
struct alc_spec *spec = codec->spec;
9250
spec->autocfg.hp_pins[0] = 0x14;
9251
spec->autocfg.speaker_pins[0] = 0x1b;
9252
alc_automute_pin(codec);
9255
static struct hda_verb alc889A_mb31_verbs[] = {
9256
/* Init rear pin (used as headphone output) */
9257
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4}, /* Apple Headphones */
9258
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Connect to front */
9259
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
9260
/* Init line pin (used as output in 4ch and 6ch mode) */
9261
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x02}, /* Connect to CLFE */
9262
/* Init line 2 pin (used as headphone out by default) */
9263
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* Use as input */
9264
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Mute output */
9268
/* Mute speakers according to the headphone jack state */
9269
static void alc889A_mb31_automute(struct hda_codec *codec)
9271
unsigned int present;
9273
/* Mute only in 2ch or 4ch mode */
9274
if (snd_hda_codec_read(codec, 0x15, 0, AC_VERB_GET_CONNECT_SEL, 0)
9276
present = snd_hda_jack_detect(codec, 0x15);
9277
snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
9278
HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
9279
snd_hda_codec_amp_stereo(codec, 0x16, HDA_OUTPUT, 0,
9280
HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
9284
static void alc889A_mb31_unsol_event(struct hda_codec *codec, unsigned int res)
9286
if ((res >> 26) == ALC880_HP_EVENT)
9287
alc889A_mb31_automute(codec);
9291
#ifdef CONFIG_SND_HDA_POWER_SAVE
9292
#define alc882_loopbacks alc880_loopbacks
9295
/* pcm configuration: identical with ALC880 */
9296
#define alc882_pcm_analog_playback alc880_pcm_analog_playback
9297
#define alc882_pcm_analog_capture alc880_pcm_analog_capture
9298
#define alc882_pcm_digital_playback alc880_pcm_digital_playback
9299
#define alc882_pcm_digital_capture alc880_pcm_digital_capture
9301
static hda_nid_t alc883_slave_dig_outs[] = {
9302
ALC1200_DIGOUT_NID, 0,
9305
static hda_nid_t alc1200_slave_dig_outs[] = {
9306
ALC883_DIGOUT_NID, 0,
9310
* configuration and preset
9312
static const char *alc882_models[ALC882_MODEL_LAST] = {
9313
[ALC882_3ST_DIG] = "3stack-dig",
9314
[ALC882_6ST_DIG] = "6stack-dig",
9315
[ALC882_ARIMA] = "arima",
9316
[ALC882_W2JC] = "w2jc",
9317
[ALC882_TARGA] = "targa",
9318
[ALC882_ASUS_A7J] = "asus-a7j",
9319
[ALC882_ASUS_A7M] = "asus-a7m",
9320
[ALC885_MACPRO] = "macpro",
9321
[ALC885_MB5] = "mb5",
9322
[ALC885_MACMINI3] = "macmini3",
9323
[ALC885_MBA21] = "mba21",
9324
[ALC885_MBP3] = "mbp3",
9325
[ALC885_IMAC24] = "imac24",
9326
[ALC885_IMAC91] = "imac91",
9327
[ALC883_3ST_2ch_DIG] = "3stack-2ch-dig",
9328
[ALC883_3ST_6ch_DIG] = "3stack-6ch-dig",
9329
[ALC883_3ST_6ch] = "3stack-6ch",
9330
[ALC883_6ST_DIG] = "alc883-6stack-dig",
9331
[ALC883_TARGA_DIG] = "targa-dig",
9332
[ALC883_TARGA_2ch_DIG] = "targa-2ch-dig",
9333
[ALC883_TARGA_8ch_DIG] = "targa-8ch-dig",
9334
[ALC883_ACER] = "acer",
9335
[ALC883_ACER_ASPIRE] = "acer-aspire",
9336
[ALC888_ACER_ASPIRE_4930G] = "acer-aspire-4930g",
9337
[ALC888_ACER_ASPIRE_6530G] = "acer-aspire-6530g",
9338
[ALC888_ACER_ASPIRE_8930G] = "acer-aspire-8930g",
9339
[ALC888_ACER_ASPIRE_7730G] = "acer-aspire-7730g",
9340
[ALC883_MEDION] = "medion",
9341
[ALC883_MEDION_MD2] = "medion-md2",
9342
[ALC883_MEDION_WIM2160] = "medion-wim2160",
9343
[ALC883_LAPTOP_EAPD] = "laptop-eapd",
9344
[ALC883_LENOVO_101E_2ch] = "lenovo-101e",
9345
[ALC883_LENOVO_NB0763] = "lenovo-nb0763",
9346
[ALC888_LENOVO_MS7195_DIG] = "lenovo-ms7195-dig",
9347
[ALC888_LENOVO_SKY] = "lenovo-sky",
9348
[ALC883_HAIER_W66] = "haier-w66",
9349
[ALC888_3ST_HP] = "3stack-hp",
9350
[ALC888_6ST_DELL] = "6stack-dell",
9351
[ALC883_MITAC] = "mitac",
9352
[ALC883_CLEVO_M540R] = "clevo-m540r",
9353
[ALC883_CLEVO_M720] = "clevo-m720",
9354
[ALC883_FUJITSU_PI2515] = "fujitsu-pi2515",
9355
[ALC888_FUJITSU_XA3530] = "fujitsu-xa3530",
9356
[ALC883_3ST_6ch_INTEL] = "3stack-6ch-intel",
9357
[ALC889A_INTEL] = "intel-alc889a",
9358
[ALC889_INTEL] = "intel-x58",
9359
[ALC1200_ASUS_P5Q] = "asus-p5q",
9360
[ALC889A_MB31] = "mb31",
9361
[ALC883_SONY_VAIO_TT] = "sony-vaio-tt",
9362
[ALC882_AUTO] = "auto",
9365
static struct snd_pci_quirk alc882_cfg_tbl[] = {
9366
SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG),
9368
SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE),
9369
SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_ACER_ASPIRE),
9370
SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_ACER_ASPIRE),
9371
SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE),
9372
SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE),
9373
SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE),
9374
SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
9375
ALC888_ACER_ASPIRE_4930G),
9376
SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
9377
ALC888_ACER_ASPIRE_4930G),
9378
SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
9379
ALC888_ACER_ASPIRE_8930G),
9380
SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
9381
ALC888_ACER_ASPIRE_8930G),
9382
SND_PCI_QUIRK(0x1025, 0x0157, "Acer X3200", ALC882_AUTO),
9383
SND_PCI_QUIRK(0x1025, 0x0158, "Acer AX1700-U3700A", ALC882_AUTO),
9384
SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
9385
ALC888_ACER_ASPIRE_6530G),
9386
SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
9387
ALC888_ACER_ASPIRE_6530G),
9388
SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
9389
ALC888_ACER_ASPIRE_7730G),
9390
/* default Acer -- disabled as it causes more problems.
9391
* model=auto should work fine now
9393
/* SND_PCI_QUIRK_VENDOR(0x1025, "Acer laptop", ALC883_ACER), */
9395
SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL),
9397
SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG),
9398
SND_PCI_QUIRK(0x103c, 0x2a4f, "HP Samba", ALC888_3ST_HP),
9399
SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP),
9400
SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG),
9401
SND_PCI_QUIRK(0x103c, 0x2a66, "HP Acacia", ALC888_3ST_HP),
9402
SND_PCI_QUIRK(0x103c, 0x2a72, "HP Educ.ar", ALC888_3ST_HP),
9404
SND_PCI_QUIRK(0x1043, 0x060d, "Asus A7J", ALC882_ASUS_A7J),
9405
SND_PCI_QUIRK(0x1043, 0x1243, "Asus A7J", ALC882_ASUS_A7J),
9406
SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_ASUS_A7M),
9407
SND_PCI_QUIRK(0x1043, 0x1873, "Asus M90V", ALC888_ASUS_M90V),
9408
SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC),
9409
SND_PCI_QUIRK(0x1043, 0x817f, "Asus P5LD2", ALC882_6ST_DIG),
9410
SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG),
9411
SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG),
9412
SND_PCI_QUIRK(0x1043, 0x8284, "Asus Z37E", ALC883_6ST_DIG),
9413
SND_PCI_QUIRK(0x1043, 0x82fe, "Asus P5Q-EM HDMI", ALC1200_ASUS_P5Q),
9414
SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_ASUS_EEE1601),
9416
SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC883_SONY_VAIO_TT),
9417
SND_PCI_QUIRK(0x105b, 0x0ce8, "Foxconn P35AX-S", ALC883_6ST_DIG),
9418
SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG),
9419
SND_PCI_QUIRK(0x1071, 0x8227, "Mitac 82801H", ALC883_MITAC),
9420
SND_PCI_QUIRK(0x1071, 0x8253, "Mitac 8252d", ALC883_MITAC),
9421
SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD),
9422
SND_PCI_QUIRK(0x10f1, 0x2350, "TYAN-S2350", ALC888_6ST_DELL),
9423
SND_PCI_QUIRK(0x108e, 0x534d, NULL, ALC883_3ST_6ch),
9424
SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte P35 DS3R", ALC882_6ST_DIG),
9426
SND_PCI_QUIRK(0x1462, 0x0349, "MSI", ALC883_TARGA_2ch_DIG),
9427
SND_PCI_QUIRK(0x1462, 0x040d, "MSI", ALC883_TARGA_2ch_DIG),
9428
SND_PCI_QUIRK(0x1462, 0x0579, "MSI", ALC883_TARGA_2ch_DIG),
9429
SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /* MSI-1049 T8 */
9430
SND_PCI_QUIRK(0x1462, 0x2fb3, "MSI", ALC882_AUTO),
9431
SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG),
9432
SND_PCI_QUIRK(0x1462, 0x3729, "MSI S420", ALC883_TARGA_DIG),
9433
SND_PCI_QUIRK(0x1462, 0x3783, "NEC S970", ALC883_TARGA_DIG),
9434
SND_PCI_QUIRK(0x1462, 0x3b7f, "MSI", ALC883_TARGA_2ch_DIG),
9435
SND_PCI_QUIRK(0x1462, 0x3ef9, "MSI", ALC883_TARGA_DIG),
9436
SND_PCI_QUIRK(0x1462, 0x3fc1, "MSI", ALC883_TARGA_DIG),
9437
SND_PCI_QUIRK(0x1462, 0x3fc3, "MSI", ALC883_TARGA_DIG),
9438
SND_PCI_QUIRK(0x1462, 0x3fcc, "MSI", ALC883_TARGA_DIG),
9439
SND_PCI_QUIRK(0x1462, 0x3fdf, "MSI", ALC883_TARGA_DIG),
9440
SND_PCI_QUIRK(0x1462, 0x42cd, "MSI", ALC883_TARGA_DIG),
9441
SND_PCI_QUIRK(0x1462, 0x4314, "MSI", ALC883_TARGA_DIG),
9442
SND_PCI_QUIRK(0x1462, 0x4319, "MSI", ALC883_TARGA_DIG),
9443
SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG),
9444
SND_PCI_QUIRK(0x1462, 0x4570, "MSI Wind Top AE2220", ALC883_TARGA_DIG),
9445
SND_PCI_QUIRK(0x1462, 0x6510, "MSI GX620", ALC883_TARGA_8ch_DIG),
9446
SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC883_6ST_DIG),
9447
SND_PCI_QUIRK(0x1462, 0x7187, "MSI", ALC883_6ST_DIG),
9448
SND_PCI_QUIRK(0x1462, 0x7250, "MSI", ALC883_6ST_DIG),
9449
SND_PCI_QUIRK(0x1462, 0x7260, "MSI 7260", ALC883_TARGA_DIG),
9450
SND_PCI_QUIRK(0x1462, 0x7267, "MSI", ALC883_3ST_6ch_DIG),
9451
SND_PCI_QUIRK(0x1462, 0x7280, "MSI", ALC883_6ST_DIG),
9452
SND_PCI_QUIRK(0x1462, 0x7327, "MSI", ALC883_6ST_DIG),
9453
SND_PCI_QUIRK(0x1462, 0x7350, "MSI", ALC883_6ST_DIG),
9454
SND_PCI_QUIRK(0x1462, 0x7437, "MSI NetOn AP1900", ALC883_TARGA_DIG),
9455
SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG),
9456
SND_PCI_QUIRK(0x1462, 0xaa08, "MSI", ALC883_TARGA_2ch_DIG),
9458
SND_PCI_QUIRK(0x147b, 0x1083, "Abit IP35-PRO", ALC883_6ST_DIG),
9459
SND_PCI_QUIRK(0x1558, 0x0571, "Clevo laptop M570U", ALC883_3ST_6ch_DIG),
9460
SND_PCI_QUIRK(0x1558, 0x0721, "Clevo laptop M720R", ALC883_CLEVO_M720),
9461
SND_PCI_QUIRK(0x1558, 0x0722, "Clevo laptop M720SR", ALC883_CLEVO_M720),
9462
SND_PCI_QUIRK(0x1558, 0x5409, "Clevo laptop M540R", ALC883_CLEVO_M540R),
9463
SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC883_LAPTOP_EAPD),
9464
SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch),
9465
/* SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA), */
9466
SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION),
9467
SND_PCI_QUIRK_MASK(0x1734, 0xfff0, 0x1100, "FSC AMILO Xi/Pi25xx",
9468
ALC883_FUJITSU_PI2515),
9469
SND_PCI_QUIRK_MASK(0x1734, 0xfff0, 0x1130, "Fujitsu AMILO Xa35xx",
9470
ALC888_FUJITSU_XA3530),
9471
SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch),
9472
SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763),
9473
SND_PCI_QUIRK(0x17aa, 0x3bfc, "Lenovo NB0763", ALC883_LENOVO_NB0763),
9474
SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763),
9475
SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY),
9476
SND_PCI_QUIRK(0x17c0, 0x4085, "MEDION MD96630", ALC888_LENOVO_MS7195_DIG),
9477
SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG),
9478
SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66),
9480
SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL),
9481
SND_PCI_QUIRK(0x8086, 0x0002, "DG33FBC", ALC883_3ST_6ch_INTEL),
9482
SND_PCI_QUIRK(0x8086, 0x2503, "82801H", ALC883_MITAC),
9483
SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_INTEL),
9484
SND_PCI_QUIRK(0x8086, 0x0021, "Intel IbexPeak", ALC889A_INTEL),
9485
SND_PCI_QUIRK(0x8086, 0x3b56, "Intel IbexPeak", ALC889A_INTEL),
9486
SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC882_6ST_DIG),
9491
/* codec SSID table for Intel Mac */
9492
static struct snd_pci_quirk alc882_ssid_cfg_tbl[] = {
9493
SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC885_MBP3),
9494
SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC885_MBP3),
9495
SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC885_MBP3),
9496
SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC885_MACPRO),
9497
SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_IMAC24),
9498
SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_IMAC24),
9499
SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC885_MBP3),
9500
SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889A_MB31),
9501
SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_ASUS_A7M),
9502
SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC885_MBP3),
9503
SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC885_MBA21),
9504
SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889A_MB31),
9505
SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3),
9506
SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24),
9507
SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC885_IMAC91),
9508
SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5),
9509
SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC885_MB5),
9510
/* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2,
9511
* so apparently no perfect solution yet
9513
SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC885_MB5),
9514
SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC885_MB5),
9515
SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC885_MACMINI3),
9519
static struct alc_config_preset alc882_presets[] = {
9520
[ALC882_3ST_DIG] = {
9521
.mixers = { alc882_base_mixer },
9522
.init_verbs = { alc882_base_init_verbs,
9523
alc882_adc1_init_verbs },
9524
.num_dacs = ARRAY_SIZE(alc882_dac_nids),
9525
.dac_nids = alc882_dac_nids,
9526
.dig_out_nid = ALC882_DIGOUT_NID,
9527
.dig_in_nid = ALC882_DIGIN_NID,
9528
.num_channel_mode = ARRAY_SIZE(alc882_ch_modes),
9529
.channel_mode = alc882_ch_modes,
9531
.input_mux = &alc882_capture_source,
9533
[ALC882_6ST_DIG] = {
9534
.mixers = { alc882_base_mixer, alc882_chmode_mixer },
9535
.init_verbs = { alc882_base_init_verbs,
9536
alc882_adc1_init_verbs },
9537
.num_dacs = ARRAY_SIZE(alc882_dac_nids),
9538
.dac_nids = alc882_dac_nids,
9539
.dig_out_nid = ALC882_DIGOUT_NID,
9540
.dig_in_nid = ALC882_DIGIN_NID,
9541
.num_channel_mode = ARRAY_SIZE(alc882_sixstack_modes),
9542
.channel_mode = alc882_sixstack_modes,
9543
.input_mux = &alc882_capture_source,
9546
.mixers = { alc882_base_mixer, alc882_chmode_mixer },
9547
.init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
9548
alc882_eapd_verbs },
9549
.num_dacs = ARRAY_SIZE(alc882_dac_nids),
9550
.dac_nids = alc882_dac_nids,
9551
.num_channel_mode = ARRAY_SIZE(alc882_sixstack_modes),
9552
.channel_mode = alc882_sixstack_modes,
9553
.input_mux = &alc882_capture_source,
9556
.mixers = { alc882_w2jc_mixer, alc882_chmode_mixer },
9557
.init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
9558
alc882_eapd_verbs, alc880_gpio1_init_verbs },
9559
.num_dacs = ARRAY_SIZE(alc882_dac_nids),
9560
.dac_nids = alc882_dac_nids,
9561
.num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
9562
.channel_mode = alc880_threestack_modes,
9564
.input_mux = &alc882_capture_source,
9565
.dig_out_nid = ALC882_DIGOUT_NID,
9568
.mixers = { alc885_mba21_mixer },
9569
.init_verbs = { alc885_mba21_init_verbs, alc880_gpio1_init_verbs },
9571
.dac_nids = alc882_dac_nids,
9572
.channel_mode = alc885_mba21_ch_modes,
9573
.num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes),
9574
.input_mux = &alc882_capture_source,
9575
.unsol_event = alc_automute_amp_unsol_event,
9576
.setup = alc885_mba21_setup,
9577
.init_hook = alc_automute_amp,
9580
.mixers = { alc885_mbp3_mixer, alc882_chmode_mixer },
9581
.init_verbs = { alc885_mbp3_init_verbs,
9582
alc880_gpio1_init_verbs },
9584
.dac_nids = alc882_dac_nids,
9586
.channel_mode = alc885_mbp_4ch_modes,
9587
.num_channel_mode = ARRAY_SIZE(alc885_mbp_4ch_modes),
9588
.input_mux = &alc882_capture_source,
9589
.dig_out_nid = ALC882_DIGOUT_NID,
9590
.dig_in_nid = ALC882_DIGIN_NID,
9591
.unsol_event = alc_automute_amp_unsol_event,
9592
.setup = alc885_mbp3_setup,
9593
.init_hook = alc_automute_amp,
9596
.mixers = { alc885_mb5_mixer, alc882_chmode_mixer },
9597
.init_verbs = { alc885_mb5_init_verbs,
9598
alc880_gpio1_init_verbs },
9599
.num_dacs = ARRAY_SIZE(alc882_dac_nids),
9600
.dac_nids = alc882_dac_nids,
9601
.channel_mode = alc885_mb5_6ch_modes,
9602
.num_channel_mode = ARRAY_SIZE(alc885_mb5_6ch_modes),
9603
.input_mux = &mb5_capture_source,
9604
.dig_out_nid = ALC882_DIGOUT_NID,
9605
.dig_in_nid = ALC882_DIGIN_NID,
9606
.unsol_event = alc_automute_amp_unsol_event,
9607
.setup = alc885_mb5_setup,
9608
.init_hook = alc_automute_amp,
9610
[ALC885_MACMINI3] = {
9611
.mixers = { alc885_macmini3_mixer, alc882_chmode_mixer },
9612
.init_verbs = { alc885_macmini3_init_verbs,
9613
alc880_gpio1_init_verbs },
9614
.num_dacs = ARRAY_SIZE(alc882_dac_nids),
9615
.dac_nids = alc882_dac_nids,
9616
.channel_mode = alc885_macmini3_6ch_modes,
9617
.num_channel_mode = ARRAY_SIZE(alc885_macmini3_6ch_modes),
9618
.input_mux = &macmini3_capture_source,
9619
.dig_out_nid = ALC882_DIGOUT_NID,
9620
.dig_in_nid = ALC882_DIGIN_NID,
9621
.unsol_event = alc_automute_amp_unsol_event,
9622
.setup = alc885_macmini3_setup,
9623
.init_hook = alc_automute_amp,
9626
.mixers = { alc882_macpro_mixer },
9627
.init_verbs = { alc882_macpro_init_verbs },
9628
.num_dacs = ARRAY_SIZE(alc882_dac_nids),
9629
.dac_nids = alc882_dac_nids,
9630
.dig_out_nid = ALC882_DIGOUT_NID,
9631
.dig_in_nid = ALC882_DIGIN_NID,
9632
.num_channel_mode = ARRAY_SIZE(alc882_ch_modes),
9633
.channel_mode = alc882_ch_modes,
9634
.input_mux = &alc882_capture_source,
9635
.init_hook = alc885_macpro_init_hook,
9638
.mixers = { alc885_imac24_mixer },
9639
.init_verbs = { alc885_imac24_init_verbs },
9640
.num_dacs = ARRAY_SIZE(alc882_dac_nids),
9641
.dac_nids = alc882_dac_nids,
9642
.dig_out_nid = ALC882_DIGOUT_NID,
9643
.dig_in_nid = ALC882_DIGIN_NID,
9644
.num_channel_mode = ARRAY_SIZE(alc882_ch_modes),
9645
.channel_mode = alc882_ch_modes,
9646
.input_mux = &alc882_capture_source,
9647
.unsol_event = alc_automute_amp_unsol_event,
9648
.setup = alc885_imac24_setup,
9649
.init_hook = alc885_imac24_init_hook,
9652
.mixers = {alc885_imac91_mixer},
9653
.init_verbs = { alc885_imac91_init_verbs,
9654
alc880_gpio1_init_verbs },
9655
.num_dacs = ARRAY_SIZE(alc882_dac_nids),
9656
.dac_nids = alc882_dac_nids,
9657
.channel_mode = alc885_mba21_ch_modes,
9658
.num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes),
9659
.input_mux = &alc889A_imac91_capture_source,
9660
.dig_out_nid = ALC882_DIGOUT_NID,
9661
.dig_in_nid = ALC882_DIGIN_NID,
9662
.unsol_event = alc_automute_amp_unsol_event,
9663
.setup = alc885_imac91_setup,
9664
.init_hook = alc_automute_amp,
9667
.mixers = { alc882_targa_mixer, alc882_chmode_mixer },
9668
.init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
9669
alc880_gpio3_init_verbs, alc882_targa_verbs},
9670
.num_dacs = ARRAY_SIZE(alc882_dac_nids),
9671
.dac_nids = alc882_dac_nids,
9672
.dig_out_nid = ALC882_DIGOUT_NID,
9673
.num_adc_nids = ARRAY_SIZE(alc882_adc_nids),
9674
.adc_nids = alc882_adc_nids,
9675
.capsrc_nids = alc882_capsrc_nids,
9676
.num_channel_mode = ARRAY_SIZE(alc882_3ST_6ch_modes),
9677
.channel_mode = alc882_3ST_6ch_modes,
9679
.input_mux = &alc882_capture_source,
9680
.unsol_event = alc882_targa_unsol_event,
9681
.setup = alc882_targa_setup,
9682
.init_hook = alc882_targa_automute,
9684
[ALC882_ASUS_A7J] = {
9685
.mixers = { alc882_asus_a7j_mixer, alc882_chmode_mixer },
9686
.init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
9687
alc882_asus_a7j_verbs},
9688
.num_dacs = ARRAY_SIZE(alc882_dac_nids),
9689
.dac_nids = alc882_dac_nids,
9690
.dig_out_nid = ALC882_DIGOUT_NID,
9691
.num_adc_nids = ARRAY_SIZE(alc882_adc_nids),
9692
.adc_nids = alc882_adc_nids,
9693
.capsrc_nids = alc882_capsrc_nids,
9694
.num_channel_mode = ARRAY_SIZE(alc882_3ST_6ch_modes),
9695
.channel_mode = alc882_3ST_6ch_modes,
9697
.input_mux = &alc882_capture_source,
9699
[ALC882_ASUS_A7M] = {
9700
.mixers = { alc882_asus_a7m_mixer, alc882_chmode_mixer },
9701
.init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
9702
alc882_eapd_verbs, alc880_gpio1_init_verbs,
9703
alc882_asus_a7m_verbs },
9704
.num_dacs = ARRAY_SIZE(alc882_dac_nids),
9705
.dac_nids = alc882_dac_nids,
9706
.dig_out_nid = ALC882_DIGOUT_NID,
9707
.num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
9708
.channel_mode = alc880_threestack_modes,
9710
.input_mux = &alc882_capture_source,
9712
[ALC883_3ST_2ch_DIG] = {
9713
.mixers = { alc883_3ST_2ch_mixer },
9714
.init_verbs = { alc883_init_verbs },
9715
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9716
.dac_nids = alc883_dac_nids,
9717
.dig_out_nid = ALC883_DIGOUT_NID,
9718
.dig_in_nid = ALC883_DIGIN_NID,
9719
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
9720
.channel_mode = alc883_3ST_2ch_modes,
9721
.input_mux = &alc883_capture_source,
9723
[ALC883_3ST_6ch_DIG] = {
9724
.mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
9725
.init_verbs = { alc883_init_verbs },
9726
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9727
.dac_nids = alc883_dac_nids,
9728
.dig_out_nid = ALC883_DIGOUT_NID,
9729
.dig_in_nid = ALC883_DIGIN_NID,
9730
.num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
9731
.channel_mode = alc883_3ST_6ch_modes,
9733
.input_mux = &alc883_capture_source,
9735
[ALC883_3ST_6ch] = {
9736
.mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
9737
.init_verbs = { alc883_init_verbs },
9738
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9739
.dac_nids = alc883_dac_nids,
9740
.num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
9741
.channel_mode = alc883_3ST_6ch_modes,
9743
.input_mux = &alc883_capture_source,
9745
[ALC883_3ST_6ch_INTEL] = {
9746
.mixers = { alc883_3ST_6ch_intel_mixer, alc883_chmode_mixer },
9747
.init_verbs = { alc883_init_verbs },
9748
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9749
.dac_nids = alc883_dac_nids,
9750
.dig_out_nid = ALC883_DIGOUT_NID,
9751
.dig_in_nid = ALC883_DIGIN_NID,
9752
.slave_dig_outs = alc883_slave_dig_outs,
9753
.num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_intel_modes),
9754
.channel_mode = alc883_3ST_6ch_intel_modes,
9756
.input_mux = &alc883_3stack_6ch_intel,
9759
.mixers = { alc885_8ch_intel_mixer, alc883_chmode_mixer },
9760
.init_verbs = { alc885_init_verbs, alc885_init_input_verbs,
9761
alc_hp15_unsol_verbs },
9762
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9763
.dac_nids = alc883_dac_nids,
9764
.num_adc_nids = ARRAY_SIZE(alc889_adc_nids),
9765
.adc_nids = alc889_adc_nids,
9766
.dig_out_nid = ALC883_DIGOUT_NID,
9767
.dig_in_nid = ALC883_DIGIN_NID,
9768
.slave_dig_outs = alc883_slave_dig_outs,
9769
.num_channel_mode = ARRAY_SIZE(alc889_8ch_intel_modes),
9770
.channel_mode = alc889_8ch_intel_modes,
9771
.capsrc_nids = alc889_capsrc_nids,
9772
.input_mux = &alc889_capture_source,
9773
.setup = alc889_automute_setup,
9774
.init_hook = alc_automute_amp,
9775
.unsol_event = alc_automute_amp_unsol_event,
9779
.mixers = { alc885_8ch_intel_mixer, alc883_chmode_mixer },
9780
.init_verbs = { alc885_init_verbs, alc889_init_input_verbs,
9781
alc889_eapd_verbs, alc_hp15_unsol_verbs},
9782
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9783
.dac_nids = alc883_dac_nids,
9784
.num_adc_nids = ARRAY_SIZE(alc889_adc_nids),
9785
.adc_nids = alc889_adc_nids,
9786
.dig_out_nid = ALC883_DIGOUT_NID,
9787
.dig_in_nid = ALC883_DIGIN_NID,
9788
.slave_dig_outs = alc883_slave_dig_outs,
9789
.num_channel_mode = ARRAY_SIZE(alc889_8ch_intel_modes),
9790
.channel_mode = alc889_8ch_intel_modes,
9791
.capsrc_nids = alc889_capsrc_nids,
9792
.input_mux = &alc889_capture_source,
9793
.setup = alc889_automute_setup,
9794
.init_hook = alc889_intel_init_hook,
9795
.unsol_event = alc_automute_amp_unsol_event,
9798
[ALC883_6ST_DIG] = {
9799
.mixers = { alc883_base_mixer, alc883_chmode_mixer },
9800
.init_verbs = { alc883_init_verbs },
9801
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9802
.dac_nids = alc883_dac_nids,
9803
.dig_out_nid = ALC883_DIGOUT_NID,
9804
.dig_in_nid = ALC883_DIGIN_NID,
9805
.num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
9806
.channel_mode = alc883_sixstack_modes,
9807
.input_mux = &alc883_capture_source,
9809
[ALC883_TARGA_DIG] = {
9810
.mixers = { alc883_targa_mixer, alc883_chmode_mixer },
9811
.init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
9812
alc883_targa_verbs},
9813
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9814
.dac_nids = alc883_dac_nids,
9815
.dig_out_nid = ALC883_DIGOUT_NID,
9816
.num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
9817
.channel_mode = alc883_3ST_6ch_modes,
9819
.input_mux = &alc883_capture_source,
9820
.unsol_event = alc883_targa_unsol_event,
9821
.setup = alc882_targa_setup,
9822
.init_hook = alc882_targa_automute,
9824
[ALC883_TARGA_2ch_DIG] = {
9825
.mixers = { alc883_targa_2ch_mixer},
9826
.init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
9827
alc883_targa_verbs},
9828
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9829
.dac_nids = alc883_dac_nids,
9830
.adc_nids = alc883_adc_nids_alt,
9831
.num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt),
9832
.capsrc_nids = alc883_capsrc_nids,
9833
.dig_out_nid = ALC883_DIGOUT_NID,
9834
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
9835
.channel_mode = alc883_3ST_2ch_modes,
9836
.input_mux = &alc883_capture_source,
9837
.unsol_event = alc883_targa_unsol_event,
9838
.setup = alc882_targa_setup,
9839
.init_hook = alc882_targa_automute,
9841
[ALC883_TARGA_8ch_DIG] = {
9842
.mixers = { alc883_targa_mixer, alc883_targa_8ch_mixer,
9843
alc883_chmode_mixer },
9844
.init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
9845
alc883_targa_verbs },
9846
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9847
.dac_nids = alc883_dac_nids,
9848
.num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
9849
.adc_nids = alc883_adc_nids_rev,
9850
.capsrc_nids = alc883_capsrc_nids_rev,
9851
.dig_out_nid = ALC883_DIGOUT_NID,
9852
.dig_in_nid = ALC883_DIGIN_NID,
9853
.num_channel_mode = ARRAY_SIZE(alc883_4ST_8ch_modes),
9854
.channel_mode = alc883_4ST_8ch_modes,
9856
.input_mux = &alc883_capture_source,
9857
.unsol_event = alc883_targa_unsol_event,
9858
.setup = alc882_targa_setup,
9859
.init_hook = alc882_targa_automute,
9862
.mixers = { alc883_base_mixer },
9863
/* On TravelMate laptops, GPIO 0 enables the internal speaker
9864
* and the headphone jack. Turn this on and rely on the
9865
* standard mute methods whenever the user wants to turn
9866
* these outputs off.
9868
.init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs },
9869
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9870
.dac_nids = alc883_dac_nids,
9871
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
9872
.channel_mode = alc883_3ST_2ch_modes,
9873
.input_mux = &alc883_capture_source,
9875
[ALC883_ACER_ASPIRE] = {
9876
.mixers = { alc883_acer_aspire_mixer },
9877
.init_verbs = { alc883_init_verbs, alc883_acer_eapd_verbs },
9878
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9879
.dac_nids = alc883_dac_nids,
9880
.dig_out_nid = ALC883_DIGOUT_NID,
9881
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
9882
.channel_mode = alc883_3ST_2ch_modes,
9883
.input_mux = &alc883_capture_source,
9884
.unsol_event = alc_automute_amp_unsol_event,
9885
.setup = alc883_acer_aspire_setup,
9886
.init_hook = alc_automute_amp,
9888
[ALC888_ACER_ASPIRE_4930G] = {
9889
.mixers = { alc888_base_mixer,
9890
alc883_chmode_mixer },
9891
.init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
9892
alc888_acer_aspire_4930g_verbs },
9893
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9894
.dac_nids = alc883_dac_nids,
9895
.num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
9896
.adc_nids = alc883_adc_nids_rev,
9897
.capsrc_nids = alc883_capsrc_nids_rev,
9898
.dig_out_nid = ALC883_DIGOUT_NID,
9899
.num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
9900
.channel_mode = alc883_3ST_6ch_modes,
9902
.const_channel_count = 6,
9904
ARRAY_SIZE(alc888_2_capture_sources),
9905
.input_mux = alc888_2_capture_sources,
9906
.unsol_event = alc_automute_amp_unsol_event,
9907
.setup = alc888_acer_aspire_4930g_setup,
9908
.init_hook = alc_automute_amp,
9910
[ALC888_ACER_ASPIRE_6530G] = {
9911
.mixers = { alc888_acer_aspire_6530_mixer },
9912
.init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
9913
alc888_acer_aspire_6530g_verbs },
9914
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9915
.dac_nids = alc883_dac_nids,
9916
.num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
9917
.adc_nids = alc883_adc_nids_rev,
9918
.capsrc_nids = alc883_capsrc_nids_rev,
9919
.dig_out_nid = ALC883_DIGOUT_NID,
9920
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
9921
.channel_mode = alc883_3ST_2ch_modes,
9923
ARRAY_SIZE(alc888_2_capture_sources),
9924
.input_mux = alc888_acer_aspire_6530_sources,
9925
.unsol_event = alc_automute_amp_unsol_event,
9926
.setup = alc888_acer_aspire_6530g_setup,
9927
.init_hook = alc_automute_amp,
9929
[ALC888_ACER_ASPIRE_8930G] = {
9930
.mixers = { alc889_acer_aspire_8930g_mixer,
9931
alc883_chmode_mixer },
9932
.init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
9933
alc889_acer_aspire_8930g_verbs,
9935
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9936
.dac_nids = alc883_dac_nids,
9937
.num_adc_nids = ARRAY_SIZE(alc889_adc_nids),
9938
.adc_nids = alc889_adc_nids,
9939
.capsrc_nids = alc889_capsrc_nids,
9940
.dig_out_nid = ALC883_DIGOUT_NID,
9941
.num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
9942
.channel_mode = alc883_3ST_6ch_modes,
9944
.const_channel_count = 6,
9946
ARRAY_SIZE(alc889_capture_sources),
9947
.input_mux = alc889_capture_sources,
9948
.unsol_event = alc_automute_amp_unsol_event,
9949
.setup = alc889_acer_aspire_8930g_setup,
9950
.init_hook = alc_automute_amp,
9951
#ifdef CONFIG_SND_HDA_POWER_SAVE
9952
.power_hook = alc_power_eapd,
9955
[ALC888_ACER_ASPIRE_7730G] = {
9956
.mixers = { alc883_3ST_6ch_mixer,
9957
alc883_chmode_mixer },
9958
.init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
9959
alc888_acer_aspire_7730G_verbs },
9960
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9961
.dac_nids = alc883_dac_nids,
9962
.num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
9963
.adc_nids = alc883_adc_nids_rev,
9964
.capsrc_nids = alc883_capsrc_nids_rev,
9965
.dig_out_nid = ALC883_DIGOUT_NID,
9966
.num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
9967
.channel_mode = alc883_3ST_6ch_modes,
9969
.const_channel_count = 6,
9970
.input_mux = &alc883_capture_source,
9971
.unsol_event = alc_automute_amp_unsol_event,
9972
.setup = alc888_acer_aspire_6530g_setup,
9973
.init_hook = alc_automute_amp,
9976
.mixers = { alc883_fivestack_mixer,
9977
alc883_chmode_mixer },
9978
.init_verbs = { alc883_init_verbs,
9979
alc883_medion_eapd_verbs },
9980
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9981
.dac_nids = alc883_dac_nids,
9982
.adc_nids = alc883_adc_nids_alt,
9983
.num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt),
9984
.capsrc_nids = alc883_capsrc_nids,
9985
.num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
9986
.channel_mode = alc883_sixstack_modes,
9987
.input_mux = &alc883_capture_source,
9989
[ALC883_MEDION_MD2] = {
9990
.mixers = { alc883_medion_md2_mixer},
9991
.init_verbs = { alc883_init_verbs, alc883_medion_md2_verbs},
9992
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
9993
.dac_nids = alc883_dac_nids,
9994
.dig_out_nid = ALC883_DIGOUT_NID,
9995
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
9996
.channel_mode = alc883_3ST_2ch_modes,
9997
.input_mux = &alc883_capture_source,
9998
.unsol_event = alc_automute_amp_unsol_event,
9999
.setup = alc883_medion_md2_setup,
10000
.init_hook = alc_automute_amp,
10002
[ALC883_MEDION_WIM2160] = {
10003
.mixers = { alc883_medion_wim2160_mixer },
10004
.init_verbs = { alc883_init_verbs, alc883_medion_wim2160_verbs },
10005
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10006
.dac_nids = alc883_dac_nids,
10007
.dig_out_nid = ALC883_DIGOUT_NID,
10008
.num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
10009
.adc_nids = alc883_adc_nids,
10010
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
10011
.channel_mode = alc883_3ST_2ch_modes,
10012
.input_mux = &alc883_capture_source,
10013
.unsol_event = alc_automute_amp_unsol_event,
10014
.setup = alc883_medion_wim2160_setup,
10015
.init_hook = alc_automute_amp,
10017
[ALC883_LAPTOP_EAPD] = {
10018
.mixers = { alc883_base_mixer },
10019
.init_verbs = { alc883_init_verbs, alc882_eapd_verbs },
10020
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10021
.dac_nids = alc883_dac_nids,
10022
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
10023
.channel_mode = alc883_3ST_2ch_modes,
10024
.input_mux = &alc883_capture_source,
10026
[ALC883_CLEVO_M540R] = {
10027
.mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
10028
.init_verbs = { alc883_init_verbs, alc883_clevo_m540r_verbs },
10029
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10030
.dac_nids = alc883_dac_nids,
10031
.dig_out_nid = ALC883_DIGOUT_NID,
10032
.dig_in_nid = ALC883_DIGIN_NID,
10033
.num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_clevo_modes),
10034
.channel_mode = alc883_3ST_6ch_clevo_modes,
10036
.input_mux = &alc883_capture_source,
10037
/* This machine has the hardware HP auto-muting, thus
10038
* we need no software mute via unsol event
10041
[ALC883_CLEVO_M720] = {
10042
.mixers = { alc883_clevo_m720_mixer },
10043
.init_verbs = { alc883_init_verbs, alc883_clevo_m720_verbs },
10044
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10045
.dac_nids = alc883_dac_nids,
10046
.dig_out_nid = ALC883_DIGOUT_NID,
10047
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
10048
.channel_mode = alc883_3ST_2ch_modes,
10049
.input_mux = &alc883_capture_source,
10050
.unsol_event = alc883_clevo_m720_unsol_event,
10051
.setup = alc883_clevo_m720_setup,
10052
.init_hook = alc883_clevo_m720_init_hook,
10054
[ALC883_LENOVO_101E_2ch] = {
10055
.mixers = { alc883_lenovo_101e_2ch_mixer},
10056
.init_verbs = { alc883_init_verbs, alc883_lenovo_101e_verbs},
10057
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10058
.dac_nids = alc883_dac_nids,
10059
.adc_nids = alc883_adc_nids_alt,
10060
.num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt),
10061
.capsrc_nids = alc883_capsrc_nids,
10062
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
10063
.channel_mode = alc883_3ST_2ch_modes,
10064
.input_mux = &alc883_lenovo_101e_capture_source,
10065
.unsol_event = alc883_lenovo_101e_unsol_event,
10066
.init_hook = alc883_lenovo_101e_all_automute,
10068
[ALC883_LENOVO_NB0763] = {
10069
.mixers = { alc883_lenovo_nb0763_mixer },
10070
.init_verbs = { alc883_init_verbs, alc883_lenovo_nb0763_verbs},
10071
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10072
.dac_nids = alc883_dac_nids,
10073
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
10074
.channel_mode = alc883_3ST_2ch_modes,
10076
.input_mux = &alc883_lenovo_nb0763_capture_source,
10077
.unsol_event = alc_automute_amp_unsol_event,
10078
.setup = alc883_medion_md2_setup,
10079
.init_hook = alc_automute_amp,
10081
[ALC888_LENOVO_MS7195_DIG] = {
10082
.mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
10083
.init_verbs = { alc883_init_verbs, alc888_lenovo_ms7195_verbs},
10084
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10085
.dac_nids = alc883_dac_nids,
10086
.dig_out_nid = ALC883_DIGOUT_NID,
10087
.num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
10088
.channel_mode = alc883_3ST_6ch_modes,
10090
.input_mux = &alc883_capture_source,
10091
.unsol_event = alc883_lenovo_ms7195_unsol_event,
10092
.init_hook = alc888_lenovo_ms7195_front_automute,
10094
[ALC883_HAIER_W66] = {
10095
.mixers = { alc883_targa_2ch_mixer},
10096
.init_verbs = { alc883_init_verbs, alc883_haier_w66_verbs},
10097
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10098
.dac_nids = alc883_dac_nids,
10099
.dig_out_nid = ALC883_DIGOUT_NID,
10100
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
10101
.channel_mode = alc883_3ST_2ch_modes,
10102
.input_mux = &alc883_capture_source,
10103
.unsol_event = alc_automute_amp_unsol_event,
10104
.setup = alc883_haier_w66_setup,
10105
.init_hook = alc_automute_amp,
10107
[ALC888_3ST_HP] = {
10108
.mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
10109
.init_verbs = { alc883_init_verbs, alc888_3st_hp_verbs },
10110
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10111
.dac_nids = alc883_dac_nids,
10112
.num_channel_mode = ARRAY_SIZE(alc888_3st_hp_modes),
10113
.channel_mode = alc888_3st_hp_modes,
10115
.input_mux = &alc883_capture_source,
10116
.unsol_event = alc_automute_amp_unsol_event,
10117
.setup = alc888_3st_hp_setup,
10118
.init_hook = alc_automute_amp,
10120
[ALC888_6ST_DELL] = {
10121
.mixers = { alc883_base_mixer, alc883_chmode_mixer },
10122
.init_verbs = { alc883_init_verbs, alc888_6st_dell_verbs },
10123
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10124
.dac_nids = alc883_dac_nids,
10125
.dig_out_nid = ALC883_DIGOUT_NID,
10126
.dig_in_nid = ALC883_DIGIN_NID,
10127
.num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
10128
.channel_mode = alc883_sixstack_modes,
10129
.input_mux = &alc883_capture_source,
10130
.unsol_event = alc_automute_amp_unsol_event,
10131
.setup = alc888_6st_dell_setup,
10132
.init_hook = alc_automute_amp,
10135
.mixers = { alc883_mitac_mixer },
10136
.init_verbs = { alc883_init_verbs, alc883_mitac_verbs },
10137
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10138
.dac_nids = alc883_dac_nids,
10139
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
10140
.channel_mode = alc883_3ST_2ch_modes,
10141
.input_mux = &alc883_capture_source,
10142
.unsol_event = alc_automute_amp_unsol_event,
10143
.setup = alc883_mitac_setup,
10144
.init_hook = alc_automute_amp,
10146
[ALC883_FUJITSU_PI2515] = {
10147
.mixers = { alc883_2ch_fujitsu_pi2515_mixer },
10148
.init_verbs = { alc883_init_verbs,
10149
alc883_2ch_fujitsu_pi2515_verbs},
10150
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10151
.dac_nids = alc883_dac_nids,
10152
.dig_out_nid = ALC883_DIGOUT_NID,
10153
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
10154
.channel_mode = alc883_3ST_2ch_modes,
10155
.input_mux = &alc883_fujitsu_pi2515_capture_source,
10156
.unsol_event = alc_automute_amp_unsol_event,
10157
.setup = alc883_2ch_fujitsu_pi2515_setup,
10158
.init_hook = alc_automute_amp,
10160
[ALC888_FUJITSU_XA3530] = {
10161
.mixers = { alc888_base_mixer, alc883_chmode_mixer },
10162
.init_verbs = { alc883_init_verbs,
10163
alc888_fujitsu_xa3530_verbs },
10164
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10165
.dac_nids = alc883_dac_nids,
10166
.num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
10167
.adc_nids = alc883_adc_nids_rev,
10168
.capsrc_nids = alc883_capsrc_nids_rev,
10169
.dig_out_nid = ALC883_DIGOUT_NID,
10170
.num_channel_mode = ARRAY_SIZE(alc888_4ST_8ch_intel_modes),
10171
.channel_mode = alc888_4ST_8ch_intel_modes,
10173
ARRAY_SIZE(alc888_2_capture_sources),
10174
.input_mux = alc888_2_capture_sources,
10175
.unsol_event = alc_automute_amp_unsol_event,
10176
.setup = alc888_fujitsu_xa3530_setup,
10177
.init_hook = alc_automute_amp,
10179
[ALC888_LENOVO_SKY] = {
10180
.mixers = { alc888_lenovo_sky_mixer, alc883_chmode_mixer },
10181
.init_verbs = { alc883_init_verbs, alc888_lenovo_sky_verbs},
10182
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10183
.dac_nids = alc883_dac_nids,
10184
.dig_out_nid = ALC883_DIGOUT_NID,
10185
.num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
10186
.channel_mode = alc883_sixstack_modes,
10188
.input_mux = &alc883_lenovo_sky_capture_source,
10189
.unsol_event = alc_automute_amp_unsol_event,
10190
.setup = alc888_lenovo_sky_setup,
10191
.init_hook = alc_automute_amp,
10193
[ALC888_ASUS_M90V] = {
10194
.mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
10195
.init_verbs = { alc883_init_verbs, alc888_asus_m90v_verbs },
10196
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10197
.dac_nids = alc883_dac_nids,
10198
.dig_out_nid = ALC883_DIGOUT_NID,
10199
.dig_in_nid = ALC883_DIGIN_NID,
10200
.num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
10201
.channel_mode = alc883_3ST_6ch_modes,
10203
.input_mux = &alc883_fujitsu_pi2515_capture_source,
10204
.unsol_event = alc_sku_unsol_event,
10205
.setup = alc883_mode2_setup,
10206
.init_hook = alc_inithook,
10208
[ALC888_ASUS_EEE1601] = {
10209
.mixers = { alc883_asus_eee1601_mixer },
10210
.cap_mixer = alc883_asus_eee1601_cap_mixer,
10211
.init_verbs = { alc883_init_verbs, alc888_asus_eee1601_verbs },
10212
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10213
.dac_nids = alc883_dac_nids,
10214
.dig_out_nid = ALC883_DIGOUT_NID,
10215
.dig_in_nid = ALC883_DIGIN_NID,
10216
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
10217
.channel_mode = alc883_3ST_2ch_modes,
10219
.input_mux = &alc883_asus_eee1601_capture_source,
10220
.unsol_event = alc_sku_unsol_event,
10221
.init_hook = alc883_eee1601_inithook,
10223
[ALC1200_ASUS_P5Q] = {
10224
.mixers = { alc883_base_mixer, alc883_chmode_mixer },
10225
.init_verbs = { alc883_init_verbs },
10226
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10227
.dac_nids = alc883_dac_nids,
10228
.dig_out_nid = ALC1200_DIGOUT_NID,
10229
.dig_in_nid = ALC883_DIGIN_NID,
10230
.slave_dig_outs = alc1200_slave_dig_outs,
10231
.num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
10232
.channel_mode = alc883_sixstack_modes,
10233
.input_mux = &alc883_capture_source,
10236
.mixers = { alc889A_mb31_mixer, alc883_chmode_mixer},
10237
.init_verbs = { alc883_init_verbs, alc889A_mb31_verbs,
10238
alc880_gpio1_init_verbs },
10239
.adc_nids = alc883_adc_nids,
10240
.num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
10241
.capsrc_nids = alc883_capsrc_nids,
10242
.dac_nids = alc883_dac_nids,
10243
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10244
.channel_mode = alc889A_mb31_6ch_modes,
10245
.num_channel_mode = ARRAY_SIZE(alc889A_mb31_6ch_modes),
10246
.input_mux = &alc889A_mb31_capture_source,
10247
.dig_out_nid = ALC883_DIGOUT_NID,
10248
.unsol_event = alc889A_mb31_unsol_event,
10249
.init_hook = alc889A_mb31_automute,
10251
[ALC883_SONY_VAIO_TT] = {
10252
.mixers = { alc883_vaiott_mixer },
10253
.init_verbs = { alc883_init_verbs, alc883_vaiott_verbs },
10254
.num_dacs = ARRAY_SIZE(alc883_dac_nids),
10255
.dac_nids = alc883_dac_nids,
10256
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
10257
.channel_mode = alc883_3ST_2ch_modes,
10258
.input_mux = &alc883_capture_source,
10259
.unsol_event = alc_automute_amp_unsol_event,
10260
.setup = alc883_vaiott_setup,
10261
.init_hook = alc_automute_amp,
10270
PINFIX_ABIT_AW9D_MAX
10273
static struct alc_pincfg alc882_abit_aw9d_pinfix[] = {
10274
{ 0x15, 0x01080104 }, /* side */
10275
{ 0x16, 0x01011012 }, /* rear */
10276
{ 0x17, 0x01016011 }, /* clfe */
10280
static const struct alc_fixup alc882_fixups[] = {
10281
[PINFIX_ABIT_AW9D_MAX] = {
10282
.pins = alc882_abit_aw9d_pinfix
10286
static struct snd_pci_quirk alc882_fixup_tbl[] = {
10287
SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX),
10292
* BIOS auto configuration
10294
static int alc882_auto_create_input_ctls(struct hda_codec *codec,
10295
const struct auto_pin_cfg *cfg)
10297
return alc_auto_create_input_ctls(codec, cfg, 0x0b, 0x23, 0x22);
10300
static void alc882_auto_set_output_and_unmute(struct hda_codec *codec,
10301
hda_nid_t nid, int pin_type,
10306
/* set as output */
10307
alc_set_pin_output(codec, nid, pin_type);
10311
else if (dac >= 0x02 && dac <= 0x05)
10315
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, idx);
10318
static void alc882_auto_init_multi_out(struct hda_codec *codec)
10320
struct alc_spec *spec = codec->spec;
10323
for (i = 0; i <= HDA_SIDE; i++) {
10324
hda_nid_t nid = spec->autocfg.line_out_pins[i];
10325
int pin_type = get_pin_type(spec->autocfg.line_out_type);
10327
alc882_auto_set_output_and_unmute(codec, nid, pin_type,
10328
spec->multiout.dac_nids[i]);
10332
static void alc882_auto_init_hp_out(struct hda_codec *codec)
10334
struct alc_spec *spec = codec->spec;
10335
hda_nid_t pin, dac;
10337
pin = spec->autocfg.hp_pins[0];
10339
dac = spec->multiout.hp_nid;
10341
dac = spec->multiout.dac_nids[0]; /* to front */
10342
alc882_auto_set_output_and_unmute(codec, pin, PIN_HP, dac);
10344
pin = spec->autocfg.speaker_pins[0];
10346
dac = spec->multiout.extra_out_nid[0];
10348
dac = spec->multiout.dac_nids[0]; /* to front */
10349
alc882_auto_set_output_and_unmute(codec, pin, PIN_OUT, dac);
10353
static void alc882_auto_init_analog_input(struct hda_codec *codec)
10355
struct alc_spec *spec = codec->spec;
10358
for (i = 0; i < AUTO_PIN_LAST; i++) {
10359
hda_nid_t nid = spec->autocfg.input_pins[i];
10362
alc_set_input_pin(codec, nid, i);
10363
if (get_wcaps(codec, nid) & AC_WCAP_OUT_AMP)
10364
snd_hda_codec_write(codec, nid, 0,
10365
AC_VERB_SET_AMP_GAIN_MUTE,
10370
static void alc882_auto_init_input_src(struct hda_codec *codec)
10372
struct alc_spec *spec = codec->spec;
10375
for (c = 0; c < spec->num_adc_nids; c++) {
10376
hda_nid_t conn_list[HDA_MAX_NUM_INPUTS];
10377
hda_nid_t nid = spec->capsrc_nids[c];
10378
unsigned int mux_idx;
10379
const struct hda_input_mux *imux;
10380
int conns, mute, idx, item;
10382
conns = snd_hda_get_connections(codec, nid, conn_list,
10383
ARRAY_SIZE(conn_list));
10386
mux_idx = c >= spec->num_mux_defs ? 0 : c;
10387
imux = &spec->input_mux[mux_idx];
10388
if (!imux->num_items && mux_idx > 0)
10389
imux = &spec->input_mux[0];
10390
for (idx = 0; idx < conns; idx++) {
10391
/* if the current connection is the selected one,
10392
* unmute it as default - otherwise mute it
10394
mute = AMP_IN_MUTE(idx);
10395
for (item = 0; item < imux->num_items; item++) {
10396
if (imux->items[item].index == idx) {
10397
if (spec->cur_mux[c] == item)
10398
mute = AMP_IN_UNMUTE(idx);
10402
/* check if we have a selector or mixer
10403
* we could check for the widget type instead, but
10404
* just check for Amp-In presence (in case of mixer
10405
* without amp-in there is something wrong, this
10406
* function shouldn't be used or capsrc nid is wrong)
10408
if (get_wcaps(codec, nid) & AC_WCAP_IN_AMP)
10409
snd_hda_codec_write(codec, nid, 0,
10410
AC_VERB_SET_AMP_GAIN_MUTE,
10412
else if (mute != AMP_IN_MUTE(idx))
10413
snd_hda_codec_write(codec, nid, 0,
10414
AC_VERB_SET_CONNECT_SEL,
10420
/* add mic boosts if needed */
10421
static int alc_auto_add_mic_boost(struct hda_codec *codec)
10423
struct alc_spec *spec = codec->spec;
10427
nid = spec->autocfg.input_pins[AUTO_PIN_MIC];
10428
if (nid && (get_wcaps(codec, nid) & AC_WCAP_IN_AMP)) {
10429
err = add_control(spec, ALC_CTL_WIDGET_VOL,
10431
HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT));
10435
nid = spec->autocfg.input_pins[AUTO_PIN_FRONT_MIC];
10436
if (nid && (get_wcaps(codec, nid) & AC_WCAP_IN_AMP)) {
10437
err = add_control(spec, ALC_CTL_WIDGET_VOL,
10439
HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT));
10446
/* almost identical with ALC880 parser... */
10447
static int alc882_parse_auto_config(struct hda_codec *codec)
10449
struct alc_spec *spec = codec->spec;
10450
static hda_nid_t alc882_ignore[] = { 0x1d, 0 };
10453
err = snd_hda_parse_pin_def_config(codec, &spec->autocfg,
10457
if (!spec->autocfg.line_outs)
10458
return 0; /* can't find valid BIOS pin config */
10460
err = alc880_auto_fill_dac_nids(spec, &spec->autocfg);
10463
err = alc880_auto_create_multi_out_ctls(spec, &spec->autocfg);
10466
err = alc880_auto_create_extra_out(spec, spec->autocfg.hp_pins[0],
10470
err = alc880_auto_create_extra_out(spec,
10471
spec->autocfg.speaker_pins[0],
10475
err = alc882_auto_create_input_ctls(codec, &spec->autocfg);
10479
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
10481
/* check multiple SPDIF-out (for recent codecs) */
10482
for (i = 0; i < spec->autocfg.dig_outs; i++) {
10484
err = snd_hda_get_connections(codec,
10485
spec->autocfg.dig_out_pins[i],
10490
spec->multiout.dig_out_nid = dig_nid;
10492
spec->multiout.slave_dig_outs = spec->slave_dig_outs;
10493
if (i >= ARRAY_SIZE(spec->slave_dig_outs) - 1)
10495
spec->slave_dig_outs[i - 1] = dig_nid;
10498
if (spec->autocfg.dig_in_pin)
10499
spec->dig_in_nid = ALC880_DIGIN_NID;
10501
if (spec->kctls.list)
10502
add_mixer(spec, spec->kctls.list);
10504
add_verb(spec, alc883_auto_init_verbs);
10505
/* if ADC 0x07 is available, initialize it, too */
10506
if (get_wcaps_type(get_wcaps(codec, 0x07)) == AC_WID_AUD_IN)
10507
add_verb(spec, alc882_adc1_init_verbs);
10509
spec->num_mux_defs = 1;
10510
spec->input_mux = &spec->private_imux[0];
10512
alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0);
10514
err = alc_auto_add_mic_boost(codec);
10518
return 1; /* config found */
10521
/* additional initialization for auto-configuration model */
10522
static void alc882_auto_init(struct hda_codec *codec)
10524
struct alc_spec *spec = codec->spec;
10525
alc882_auto_init_multi_out(codec);
10526
alc882_auto_init_hp_out(codec);
10527
alc882_auto_init_analog_input(codec);
10528
alc882_auto_init_input_src(codec);
10529
if (spec->unsol_event)
10530
alc_inithook(codec);
10533
static int patch_alc882(struct hda_codec *codec)
10535
struct alc_spec *spec;
10536
int err, board_config;
10538
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
10542
codec->spec = spec;
10544
alc_auto_parse_customize_define(codec);
10546
switch (codec->vendor_id) {
10551
/* ALC883 and variants */
10552
alc_fix_pll_init(codec, 0x20, 0x0a, 10);
10556
board_config = snd_hda_check_board_config(codec, ALC882_MODEL_LAST,
10560
if (board_config < 0 || board_config >= ALC882_MODEL_LAST)
10561
board_config = snd_hda_check_board_codec_sid_config(codec,
10562
ALC882_MODEL_LAST, alc882_models, alc882_ssid_cfg_tbl);
10564
if (board_config < 0 || board_config >= ALC882_MODEL_LAST) {
10565
printk(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n",
10567
board_config = ALC882_AUTO;
10570
if (board_config == ALC882_AUTO)
10571
alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 1);
10573
if (board_config == ALC882_AUTO) {
10574
/* automatic parse from the BIOS config */
10575
err = alc882_parse_auto_config(codec);
10581
"hda_codec: Cannot set up configuration "
10582
"from BIOS. Using base mode...\n");
10583
board_config = ALC882_3ST_DIG;
10587
if (has_cdefine_beep(codec)) {
10588
err = snd_hda_attach_beep_device(codec, 0x1);
10595
if (board_config != ALC882_AUTO)
10596
setup_preset(codec, &alc882_presets[board_config]);
10598
spec->stream_analog_playback = &alc882_pcm_analog_playback;
10599
spec->stream_analog_capture = &alc882_pcm_analog_capture;
10600
/* FIXME: setup DAC5 */
10601
/*spec->stream_analog_alt_playback = &alc880_pcm_analog_alt_playback;*/
10602
spec->stream_analog_alt_capture = &alc880_pcm_analog_alt_capture;
10604
spec->stream_digital_playback = &alc882_pcm_digital_playback;
10605
spec->stream_digital_capture = &alc882_pcm_digital_capture;
10607
if (!spec->adc_nids && spec->input_mux) {
10609
spec->num_adc_nids = 0;
10610
for (i = 0; i < ARRAY_SIZE(alc882_adc_nids); i++) {
10611
const struct hda_input_mux *imux = spec->input_mux;
10613
hda_nid_t items[16];
10614
hda_nid_t nid = alc882_adc_nids[i];
10615
unsigned int wcap = get_wcaps(codec, nid);
10617
wcap = get_wcaps_type(wcap);
10618
if (wcap != AC_WID_AUD_IN)
10620
spec->private_adc_nids[spec->num_adc_nids] = nid;
10621
err = snd_hda_get_connections(codec, nid, &cap, 1);
10624
err = snd_hda_get_connections(codec, cap, items,
10625
ARRAY_SIZE(items));
10628
for (j = 0; j < imux->num_items; j++)
10629
if (imux->items[j].index >= err)
10631
if (j < imux->num_items)
10633
spec->private_capsrc_nids[spec->num_adc_nids] = cap;
10634
spec->num_adc_nids++;
10636
spec->adc_nids = spec->private_adc_nids;
10637
spec->capsrc_nids = spec->private_capsrc_nids;
10640
set_capture_mixer(codec);
10642
if (has_cdefine_beep(codec))
10643
set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10645
if (board_config == ALC882_AUTO)
10646
alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 0);
10648
spec->vmaster_nid = 0x0c;
10650
codec->patch_ops = alc_patch_ops;
10651
if (board_config == ALC882_AUTO)
10652
spec->init_hook = alc882_auto_init;
10653
#ifdef CONFIG_SND_HDA_POWER_SAVE
10654
if (!spec->loopback.amplist)
10655
spec->loopback.amplist = alc882_loopbacks;
10666
#define ALC262_DIGOUT_NID ALC880_DIGOUT_NID
10667
#define ALC262_DIGIN_NID ALC880_DIGIN_NID
10669
#define alc262_dac_nids alc260_dac_nids
10670
#define alc262_adc_nids alc882_adc_nids
10671
#define alc262_adc_nids_alt alc882_adc_nids_alt
10672
#define alc262_capsrc_nids alc882_capsrc_nids
10673
#define alc262_capsrc_nids_alt alc882_capsrc_nids_alt
10675
#define alc262_modes alc260_modes
10676
#define alc262_capture_source alc882_capture_source
10678
static hda_nid_t alc262_dmic_adc_nids[1] = {
10683
static hda_nid_t alc262_dmic_capsrc_nids[1] = { 0x22 };
10685
static struct snd_kcontrol_new alc262_base_mixer[] = {
10686
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
10687
HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT),
10688
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
10689
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
10690
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
10691
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
10692
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
10693
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
10694
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
10695
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
10696
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
10697
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
10698
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0D, 0x0, HDA_OUTPUT),
10699
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
10700
HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
10701
HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x16, 2, 0x0, HDA_OUTPUT),
10705
/* update HP, line and mono-out pins according to the master switch */
10706
static void alc262_hp_master_update(struct hda_codec *codec)
10708
struct alc_spec *spec = codec->spec;
10709
int val = spec->master_sw;
10711
/* HP & line-out */
10712
snd_hda_codec_write_cache(codec, 0x1b, 0,
10713
AC_VERB_SET_PIN_WIDGET_CONTROL,
10715
snd_hda_codec_write_cache(codec, 0x15, 0,
10716
AC_VERB_SET_PIN_WIDGET_CONTROL,
10718
/* mono (speaker) depending on the HP jack sense */
10719
val = val && !spec->jack_present;
10720
snd_hda_codec_write_cache(codec, 0x16, 0,
10721
AC_VERB_SET_PIN_WIDGET_CONTROL,
10722
val ? PIN_OUT : 0);
10725
static void alc262_hp_bpc_automute(struct hda_codec *codec)
10727
struct alc_spec *spec = codec->spec;
10729
spec->jack_present = snd_hda_jack_detect(codec, 0x1b);
10730
alc262_hp_master_update(codec);
10733
static void alc262_hp_bpc_unsol_event(struct hda_codec *codec, unsigned int res)
10735
if ((res >> 26) != ALC880_HP_EVENT)
10737
alc262_hp_bpc_automute(codec);
10740
static void alc262_hp_wildwest_automute(struct hda_codec *codec)
10742
struct alc_spec *spec = codec->spec;
10744
spec->jack_present = snd_hda_jack_detect(codec, 0x15);
10745
alc262_hp_master_update(codec);
10748
static void alc262_hp_wildwest_unsol_event(struct hda_codec *codec,
10751
if ((res >> 26) != ALC880_HP_EVENT)
10753
alc262_hp_wildwest_automute(codec);
10756
#define alc262_hp_master_sw_get alc260_hp_master_sw_get
10758
static int alc262_hp_master_sw_put(struct snd_kcontrol *kcontrol,
10759
struct snd_ctl_elem_value *ucontrol)
10761
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
10762
struct alc_spec *spec = codec->spec;
10763
int val = !!*ucontrol->value.integer.value;
10765
if (val == spec->master_sw)
10767
spec->master_sw = val;
10768
alc262_hp_master_update(codec);
10772
#define ALC262_HP_MASTER_SWITCH \
10774
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
10775
.name = "Master Playback Switch", \
10776
.info = snd_ctl_boolean_mono_info, \
10777
.get = alc262_hp_master_sw_get, \
10778
.put = alc262_hp_master_sw_put, \
10781
.iface = NID_MAPPING, \
10782
.name = "Master Playback Switch", \
10783
.private_value = 0x15 | (0x16 << 8) | (0x1b << 16), \
10787
static struct snd_kcontrol_new alc262_HP_BPC_mixer[] = {
10788
ALC262_HP_MASTER_SWITCH,
10789
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
10790
HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT),
10791
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
10792
HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0e, 2, 0x0,
10794
HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x16, 2, 0x0,
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),
10802
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
10803
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
10804
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
10805
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
10806
HDA_CODEC_VOLUME("AUX IN Playback Volume", 0x0b, 0x06, HDA_INPUT),
10807
HDA_CODEC_MUTE("AUX IN Playback Switch", 0x0b, 0x06, HDA_INPUT),
10811
static struct snd_kcontrol_new alc262_HP_BPC_WildWest_mixer[] = {
10812
ALC262_HP_MASTER_SWITCH,
10813
HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
10814
HDA_CODEC_MUTE("Front Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
10815
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
10816
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
10817
HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0e, 2, 0x0,
10819
HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x16, 2, 0x0,
10821
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x02, HDA_INPUT),
10822
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x02, HDA_INPUT),
10823
HDA_CODEC_VOLUME("Front Mic Boost", 0x1a, 0, HDA_INPUT),
10824
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT),
10825
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT),
10826
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
10827
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
10831
static struct snd_kcontrol_new alc262_HP_BPC_WildWest_option_mixer[] = {
10832
HDA_CODEC_VOLUME("Rear Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
10833
HDA_CODEC_MUTE("Rear Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
10834
HDA_CODEC_VOLUME("Rear Mic Boost", 0x18, 0, HDA_INPUT),
10838
/* mute/unmute internal speaker according to the hp jack and mute state */
10839
static void alc262_hp_t5735_setup(struct hda_codec *codec)
10841
struct alc_spec *spec = codec->spec;
10843
spec->autocfg.hp_pins[0] = 0x15;
10844
spec->autocfg.speaker_pins[0] = 0x14;
10847
static struct snd_kcontrol_new alc262_hp_t5735_mixer[] = {
10848
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
10849
HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
10850
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
10851
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
10852
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
10853
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
10854
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
10858
static struct hda_verb alc262_hp_t5735_verbs[] = {
10859
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
10860
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
10862
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
10866
static struct snd_kcontrol_new alc262_hp_rp5700_mixer[] = {
10867
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
10868
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
10869
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0e, 0x0, HDA_OUTPUT),
10870
HDA_CODEC_MUTE("Speaker Playback Switch", 0x16, 0x0, HDA_OUTPUT),
10871
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT),
10872
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT),
10876
static struct hda_verb alc262_hp_rp5700_verbs[] = {
10877
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
10878
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
10879
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
10880
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
10881
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
10882
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
10883
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
10884
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
10885
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x00 << 8))},
10886
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x00 << 8))},
10890
static struct hda_input_mux alc262_hp_rp5700_capture_source = {
10897
/* bind hp and internal speaker mute (with plug check) as master switch */
10898
static void alc262_hippo_master_update(struct hda_codec *codec)
10900
struct alc_spec *spec = codec->spec;
10901
hda_nid_t hp_nid = spec->autocfg.hp_pins[0];
10902
hda_nid_t line_nid = spec->autocfg.line_out_pins[0];
10903
hda_nid_t speaker_nid = spec->autocfg.speaker_pins[0];
10907
mute = spec->master_sw ? 0 : HDA_AMP_MUTE;
10908
snd_hda_codec_amp_stereo(codec, hp_nid, HDA_OUTPUT, 0,
10909
HDA_AMP_MUTE, mute);
10910
/* mute internal speaker per jack sense */
10911
if (spec->jack_present)
10912
mute = HDA_AMP_MUTE;
10914
snd_hda_codec_amp_stereo(codec, line_nid, HDA_OUTPUT, 0,
10915
HDA_AMP_MUTE, mute);
10916
if (speaker_nid && speaker_nid != line_nid)
10917
snd_hda_codec_amp_stereo(codec, speaker_nid, HDA_OUTPUT, 0,
10918
HDA_AMP_MUTE, mute);
10921
#define alc262_hippo_master_sw_get alc262_hp_master_sw_get
10923
static int alc262_hippo_master_sw_put(struct snd_kcontrol *kcontrol,
10924
struct snd_ctl_elem_value *ucontrol)
10926
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
10927
struct alc_spec *spec = codec->spec;
10928
int val = !!*ucontrol->value.integer.value;
10930
if (val == spec->master_sw)
10932
spec->master_sw = val;
10933
alc262_hippo_master_update(codec);
10937
#define ALC262_HIPPO_MASTER_SWITCH \
10939
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
10940
.name = "Master Playback Switch", \
10941
.info = snd_ctl_boolean_mono_info, \
10942
.get = alc262_hippo_master_sw_get, \
10943
.put = alc262_hippo_master_sw_put, \
10946
.iface = NID_MAPPING, \
10947
.name = "Master Playback Switch", \
10948
.subdevice = SUBDEV_HP(0) | (SUBDEV_LINE(0) << 8) | \
10949
(SUBDEV_SPEAKER(0) << 16), \
10952
static struct snd_kcontrol_new alc262_hippo_mixer[] = {
10953
ALC262_HIPPO_MASTER_SWITCH,
10954
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
10955
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
10956
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
10957
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
10958
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
10959
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
10960
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
10961
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
10962
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
10963
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
10964
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
10965
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
10969
static struct snd_kcontrol_new alc262_hippo1_mixer[] = {
10970
HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
10971
ALC262_HIPPO_MASTER_SWITCH,
10972
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
10973
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
10974
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
10975
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
10976
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
10977
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
10978
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
10979
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
10980
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
10981
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
10985
/* mute/unmute internal speaker according to the hp jack and mute state */
10986
static void alc262_hippo_automute(struct hda_codec *codec)
10988
struct alc_spec *spec = codec->spec;
10989
hda_nid_t hp_nid = spec->autocfg.hp_pins[0];
10991
spec->jack_present = snd_hda_jack_detect(codec, hp_nid);
10992
alc262_hippo_master_update(codec);
10995
static void alc262_hippo_unsol_event(struct hda_codec *codec, unsigned int res)
10997
if ((res >> 26) != ALC880_HP_EVENT)
10999
alc262_hippo_automute(codec);
11002
static void alc262_hippo_setup(struct hda_codec *codec)
11004
struct alc_spec *spec = codec->spec;
11006
spec->autocfg.hp_pins[0] = 0x15;
11007
spec->autocfg.speaker_pins[0] = 0x14;
11010
static void alc262_hippo1_setup(struct hda_codec *codec)
11012
struct alc_spec *spec = codec->spec;
11014
spec->autocfg.hp_pins[0] = 0x1b;
11015
spec->autocfg.speaker_pins[0] = 0x14;
11019
static struct snd_kcontrol_new alc262_sony_mixer[] = {
11020
HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
11021
ALC262_HIPPO_MASTER_SWITCH,
11022
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
11023
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
11024
HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
11025
HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
11029
static struct snd_kcontrol_new alc262_benq_t31_mixer[] = {
11030
HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
11031
ALC262_HIPPO_MASTER_SWITCH,
11032
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
11033
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
11034
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
11035
HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
11036
HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
11040
static struct snd_kcontrol_new alc262_tyan_mixer[] = {
11041
HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
11042
HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT),
11043
HDA_CODEC_VOLUME("Aux Playback Volume", 0x0b, 0x06, HDA_INPUT),
11044
HDA_CODEC_MUTE("Aux Playback Switch", 0x0b, 0x06, HDA_INPUT),
11045
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
11046
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
11047
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
11048
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
11049
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
11050
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
11051
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
11052
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
11056
static struct hda_verb alc262_tyan_verbs[] = {
11057
/* Headphone automute */
11058
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
11059
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
11060
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
11062
/* P11 AUX_IN, white 4-pin connector */
11063
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
11064
{0x14, AC_VERB_SET_CONFIG_DEFAULT_BYTES_1, 0xe1},
11065
{0x14, AC_VERB_SET_CONFIG_DEFAULT_BYTES_2, 0x93},
11066
{0x14, AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0x19},
11071
/* unsolicited event for HP jack sensing */
11072
static void alc262_tyan_setup(struct hda_codec *codec)
11074
struct alc_spec *spec = codec->spec;
11076
spec->autocfg.hp_pins[0] = 0x1b;
11077
spec->autocfg.speaker_pins[0] = 0x15;
11081
#define alc262_capture_mixer alc882_capture_mixer
11082
#define alc262_capture_alt_mixer alc882_capture_alt_mixer
11085
* generic initialization of ADC, input mixers and output mixers
11087
static struct hda_verb alc262_init_verbs[] = {
11089
* Unmute ADC0-2 and set the default input to mic-in
11091
{0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
11092
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11093
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
11094
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11095
{0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
11096
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11098
/* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
11100
* Note: PASD motherboards uses the Line In 2 as the input for
11101
* front panel mic (mic 2)
11103
/* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
11104
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
11105
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
11106
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
11107
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
11108
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
11111
* Set up output mixers (0x0c - 0x0e)
11113
/* set vol=0 to output mixers */
11114
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
11115
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
11116
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
11117
/* set up input amps for analog loopback */
11118
/* Amp Indices: DAC = 0, mixer = 1 */
11119
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11120
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
11121
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11122
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
11123
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11124
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
11126
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
11127
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0},
11128
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
11129
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
11130
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
11131
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
11133
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0x0000},
11134
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0x0000},
11135
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, 0x0000},
11136
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, 0x0000},
11137
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, 0x0000},
11139
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
11140
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
11142
/* FIXME: use matrix-type input source selection */
11143
/* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
11144
/* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
11145
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
11146
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x03 << 8))},
11147
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x02 << 8))},
11148
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x04 << 8))},
11150
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
11151
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x03 << 8))},
11152
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x02 << 8))},
11153
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x04 << 8))},
11155
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
11156
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x03 << 8))},
11157
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x02 << 8))},
11158
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x04 << 8))},
11163
static struct hda_verb alc262_eapd_verbs[] = {
11164
{0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
11165
{0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
11169
static struct hda_verb alc262_hippo1_unsol_verbs[] = {
11170
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0},
11171
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
11172
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, 0x0000},
11174
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
11175
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
11179
static struct hda_verb alc262_sony_unsol_verbs[] = {
11180
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0},
11181
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
11182
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, // Front Mic
11184
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
11185
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
11189
static struct snd_kcontrol_new alc262_toshiba_s06_mixer[] = {
11190
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
11191
HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
11192
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
11193
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
11194
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
11198
static struct hda_verb alc262_toshiba_s06_verbs[] = {
11199
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
11200
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
11201
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
11202
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
11203
{0x22, AC_VERB_SET_CONNECT_SEL, 0x09},
11204
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
11205
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
11206
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
11210
static void alc262_toshiba_s06_setup(struct hda_codec *codec)
11212
struct alc_spec *spec = codec->spec;
11214
spec->autocfg.hp_pins[0] = 0x15;
11215
spec->autocfg.speaker_pins[0] = 0x14;
11216
spec->ext_mic.pin = 0x18;
11217
spec->ext_mic.mux_idx = 0;
11218
spec->int_mic.pin = 0x12;
11219
spec->int_mic.mux_idx = 9;
11220
spec->auto_mic = 1;
11226
* 0x16 = internal speaker
11227
* 0x18 = external mic
11230
static struct snd_kcontrol_new alc262_nec_mixer[] = {
11231
HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
11232
HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x16, 0, 0x0, HDA_OUTPUT),
11234
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
11235
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
11236
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
11238
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
11239
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
11243
static struct hda_verb alc262_nec_verbs[] = {
11244
/* Unmute Speaker */
11245
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
11248
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
11249
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
11251
/* External mic to headphone */
11252
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
11253
/* External mic to speaker */
11254
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
11260
* 0x14 = headphone/spdif-out, 0x15 = internal speaker,
11261
* 0x1b = port replicator headphone out
11264
#define ALC_HP_EVENT 0x37
11266
static struct hda_verb alc262_fujitsu_unsol_verbs[] = {
11267
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
11268
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
11269
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
11270
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
11274
static struct hda_verb alc262_lenovo_3000_unsol_verbs[] = {
11275
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
11276
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
11280
static struct hda_verb alc262_lenovo_3000_init_verbs[] = {
11281
/* Front Mic pin: input vref at 50% */
11282
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
11283
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
11287
static struct hda_input_mux alc262_fujitsu_capture_source = {
11291
{ "Int Mic", 0x1 },
11296
static struct hda_input_mux alc262_HP_capture_source = {
11300
{ "Front Mic", 0x1 },
11307
static struct hda_input_mux alc262_HP_D7000_capture_source = {
11311
{ "Front Mic", 0x2 },
11317
/* mute/unmute internal speaker according to the hp jacks and mute state */
11318
static void alc262_fujitsu_automute(struct hda_codec *codec, int force)
11320
struct alc_spec *spec = codec->spec;
11323
if (force || !spec->sense_updated) {
11324
spec->jack_present = snd_hda_jack_detect(codec, 0x14) ||
11325
snd_hda_jack_detect(codec, 0x1b);
11326
spec->sense_updated = 1;
11328
/* unmute internal speaker only if both HPs are unplugged and
11329
* master switch is on
11331
if (spec->jack_present)
11332
mute = HDA_AMP_MUTE;
11334
mute = snd_hda_codec_amp_read(codec, 0x14, 0, HDA_OUTPUT, 0);
11335
snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
11336
HDA_AMP_MUTE, mute);
11339
/* unsolicited event for HP jack sensing */
11340
static void alc262_fujitsu_unsol_event(struct hda_codec *codec,
11343
if ((res >> 26) != ALC_HP_EVENT)
11345
alc262_fujitsu_automute(codec, 1);
11348
static void alc262_fujitsu_init_hook(struct hda_codec *codec)
11350
alc262_fujitsu_automute(codec, 1);
11353
/* bind volumes of both NID 0x0c and 0x0d */
11354
static struct hda_bind_ctls alc262_fujitsu_bind_master_vol = {
11355
.ops = &snd_hda_bind_vol,
11357
HDA_COMPOSE_AMP_VAL(0x0c, 3, 0, HDA_OUTPUT),
11358
HDA_COMPOSE_AMP_VAL(0x0d, 3, 0, HDA_OUTPUT),
11363
/* mute/unmute internal speaker according to the hp jack and mute state */
11364
static void alc262_lenovo_3000_automute(struct hda_codec *codec, int force)
11366
struct alc_spec *spec = codec->spec;
11369
if (force || !spec->sense_updated) {
11370
spec->jack_present = snd_hda_jack_detect(codec, 0x1b);
11371
spec->sense_updated = 1;
11373
if (spec->jack_present) {
11374
/* mute internal speaker */
11375
snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
11376
HDA_AMP_MUTE, HDA_AMP_MUTE);
11377
snd_hda_codec_amp_stereo(codec, 0x16, HDA_OUTPUT, 0,
11378
HDA_AMP_MUTE, HDA_AMP_MUTE);
11380
/* unmute internal speaker if necessary */
11381
mute = snd_hda_codec_amp_read(codec, 0x1b, 0, HDA_OUTPUT, 0);
11382
snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
11383
HDA_AMP_MUTE, mute);
11384
snd_hda_codec_amp_stereo(codec, 0x16, HDA_OUTPUT, 0,
11385
HDA_AMP_MUTE, mute);
11389
/* unsolicited event for HP jack sensing */
11390
static void alc262_lenovo_3000_unsol_event(struct hda_codec *codec,
11393
if ((res >> 26) != ALC_HP_EVENT)
11395
alc262_lenovo_3000_automute(codec, 1);
11398
static int amp_stereo_mute_update(struct hda_codec *codec, hda_nid_t nid,
11399
int dir, int idx, long *valp)
11403
for (i = 0; i < 2; i++, valp++)
11404
change |= snd_hda_codec_amp_update(codec, nid, i, dir, idx,
11406
*valp ? 0 : HDA_AMP_MUTE);
11410
/* bind hp and internal speaker mute (with plug check) */
11411
static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol,
11412
struct snd_ctl_elem_value *ucontrol)
11414
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
11415
long *valp = ucontrol->value.integer.value;
11418
change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp);
11419
change |= amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp);
11421
alc262_fujitsu_automute(codec, 0);
11425
static struct snd_kcontrol_new alc262_fujitsu_mixer[] = {
11426
HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol),
11428
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
11429
.name = "Master Playback Switch",
11430
.subdevice = HDA_SUBDEV_AMP_FLAG,
11431
.info = snd_hda_mixer_amp_switch_info,
11432
.get = snd_hda_mixer_amp_switch_get,
11433
.put = alc262_fujitsu_master_sw_put,
11434
.private_value = HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
11437
.iface = NID_MAPPING,
11438
.name = "Master Playback Switch",
11439
.private_value = 0x1b,
11441
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
11442
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
11443
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
11444
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
11445
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
11446
HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT),
11447
HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
11448
HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
11452
/* bind hp and internal speaker mute (with plug check) */
11453
static int alc262_lenovo_3000_master_sw_put(struct snd_kcontrol *kcontrol,
11454
struct snd_ctl_elem_value *ucontrol)
11456
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
11457
long *valp = ucontrol->value.integer.value;
11460
change = amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp);
11462
alc262_lenovo_3000_automute(codec, 0);
11466
static struct snd_kcontrol_new alc262_lenovo_3000_mixer[] = {
11467
HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol),
11469
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
11470
.name = "Master Playback Switch",
11471
.subdevice = HDA_SUBDEV_AMP_FLAG,
11472
.info = snd_hda_mixer_amp_switch_info,
11473
.get = snd_hda_mixer_amp_switch_get,
11474
.put = alc262_lenovo_3000_master_sw_put,
11475
.private_value = HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_OUTPUT),
11477
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
11478
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
11479
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
11480
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
11481
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
11482
HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT),
11483
HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
11484
HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
11488
static struct snd_kcontrol_new alc262_toshiba_rx1_mixer[] = {
11489
HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol),
11490
ALC262_HIPPO_MASTER_SWITCH,
11491
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
11492
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
11493
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
11494
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
11495
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
11496
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
11500
/* additional init verbs for Benq laptops */
11501
static struct hda_verb alc262_EAPD_verbs[] = {
11502
{0x20, AC_VERB_SET_COEF_INDEX, 0x07},
11503
{0x20, AC_VERB_SET_PROC_COEF, 0x3070},
11507
static struct hda_verb alc262_benq_t31_EAPD_verbs[] = {
11508
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
11509
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
11511
{0x20, AC_VERB_SET_COEF_INDEX, 0x07},
11512
{0x20, AC_VERB_SET_PROC_COEF, 0x3050},
11516
/* Samsung Q1 Ultra Vista model setup */
11517
static struct snd_kcontrol_new alc262_ultra_mixer[] = {
11518
HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
11519
HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT),
11520
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
11521
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
11522
HDA_CODEC_VOLUME("Mic Boost", 0x19, 0, HDA_INPUT),
11523
HDA_CODEC_VOLUME("Headphone Mic Boost", 0x15, 0, HDA_INPUT),
11527
static struct hda_verb alc262_ultra_verbs[] = {
11529
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
11530
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
11531
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
11533
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
11534
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
11535
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11536
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
11538
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
11539
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
11540
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11541
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
11542
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
11544
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
11545
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
11546
/* ADC, choose mic */
11547
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
11548
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
11549
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
11550
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
11551
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
11552
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
11553
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)},
11554
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
11555
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
11556
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(8)},
11560
/* mute/unmute internal speaker according to the hp jack and mute state */
11561
static void alc262_ultra_automute(struct hda_codec *codec)
11563
struct alc_spec *spec = codec->spec;
11567
/* auto-mute only when HP is used as HP */
11568
if (!spec->cur_mux[0]) {
11569
spec->jack_present = snd_hda_jack_detect(codec, 0x15);
11570
if (spec->jack_present)
11571
mute = HDA_AMP_MUTE;
11573
/* mute/unmute internal speaker */
11574
snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
11575
HDA_AMP_MUTE, mute);
11576
/* mute/unmute HP */
11577
snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
11578
HDA_AMP_MUTE, mute ? 0 : HDA_AMP_MUTE);
11581
/* unsolicited event for HP jack sensing */
11582
static void alc262_ultra_unsol_event(struct hda_codec *codec,
11585
if ((res >> 26) != ALC880_HP_EVENT)
11587
alc262_ultra_automute(codec);
11590
static struct hda_input_mux alc262_ultra_capture_source = {
11594
{ "Headphone", 0x7 },
11598
static int alc262_ultra_mux_enum_put(struct snd_kcontrol *kcontrol,
11599
struct snd_ctl_elem_value *ucontrol)
11601
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
11602
struct alc_spec *spec = codec->spec;
11605
ret = alc_mux_enum_put(kcontrol, ucontrol);
11608
/* reprogram the HP pin as mic or HP according to the input source */
11609
snd_hda_codec_write_cache(codec, 0x15, 0,
11610
AC_VERB_SET_PIN_WIDGET_CONTROL,
11611
spec->cur_mux[0] ? PIN_VREF80 : PIN_HP);
11612
alc262_ultra_automute(codec); /* mute/unmute HP */
11616
static struct snd_kcontrol_new alc262_ultra_capture_mixer[] = {
11617
HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT),
11618
HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT),
11620
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
11621
.name = "Capture Source",
11622
.info = alc_mux_enum_info,
11623
.get = alc_mux_enum_get,
11624
.put = alc262_ultra_mux_enum_put,
11627
.iface = NID_MAPPING,
11628
.name = "Capture Source",
11629
.private_value = 0x15,
11634
/* We use two mixers depending on the output pin; 0x16 is a mono output
11635
* and thus it's bound with a different mixer.
11636
* This function returns which mixer amp should be used.
11638
static int alc262_check_volbit(hda_nid_t nid)
11642
else if (nid == 0x16)
11648
static int alc262_add_out_vol_ctl(struct alc_spec *spec, hda_nid_t nid,
11649
const char *pfx, int *vbits)
11654
vbit = alc262_check_volbit(nid);
11657
if (*vbits & vbit) /* a volume control for this mixer already there */
11661
val = HDA_COMPOSE_AMP_VAL(0x0e, 2, 0, HDA_OUTPUT);
11663
val = HDA_COMPOSE_AMP_VAL(0x0c, 3, 0, HDA_OUTPUT);
11664
return add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, pfx, val);
11667
static int alc262_add_out_sw_ctl(struct alc_spec *spec, hda_nid_t nid,
11675
val = HDA_COMPOSE_AMP_VAL(nid, 2, 0, HDA_OUTPUT);
11677
val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT);
11678
return add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx, val);
11681
/* add playback controls from the parsed DAC table */
11682
static int alc262_auto_create_multi_out_ctls(struct alc_spec *spec,
11683
const struct auto_pin_cfg *cfg)
11689
spec->multiout.num_dacs = 1; /* only use one dac */
11690
spec->multiout.dac_nids = spec->private_dac_nids;
11691
spec->multiout.dac_nids[0] = 2;
11693
if (!cfg->speaker_pins[0] && !cfg->hp_pins[0])
11695
else if (cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)
11699
err = alc262_add_out_sw_ctl(spec, cfg->line_out_pins[0], pfx);
11702
err = alc262_add_out_sw_ctl(spec, cfg->speaker_pins[0], "Speaker");
11705
err = alc262_add_out_sw_ctl(spec, cfg->hp_pins[0], "Headphone");
11709
vbits = alc262_check_volbit(cfg->line_out_pins[0]) |
11710
alc262_check_volbit(cfg->speaker_pins[0]) |
11711
alc262_check_volbit(cfg->hp_pins[0]);
11712
if (vbits == 1 || vbits == 2)
11713
pfx = "Master"; /* only one mixer is used */
11714
else if (cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)
11719
err = alc262_add_out_vol_ctl(spec, cfg->line_out_pins[0], pfx, &vbits);
11722
err = alc262_add_out_vol_ctl(spec, cfg->speaker_pins[0], "Speaker",
11726
err = alc262_add_out_vol_ctl(spec, cfg->hp_pins[0], "Headphone",
11733
#define alc262_auto_create_input_ctls \
11734
alc882_auto_create_input_ctls
11737
* generic initialization of ADC, input mixers and output mixers
11739
static struct hda_verb alc262_volume_init_verbs[] = {
11741
* Unmute ADC0-2 and set the default input to mic-in
11743
{0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
11744
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11745
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
11746
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11747
{0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
11748
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11750
/* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
11752
* Note: PASD motherboards uses the Line In 2 as the input for
11753
* front panel mic (mic 2)
11755
/* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
11756
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
11757
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
11758
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
11759
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
11760
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
11763
* Set up output mixers (0x0c - 0x0f)
11765
/* set vol=0 to output mixers */
11766
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
11767
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
11768
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
11770
/* set up input amps for analog loopback */
11771
/* Amp Indices: DAC = 0, mixer = 1 */
11772
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11773
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
11774
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11775
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
11776
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11777
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
11779
/* FIXME: use matrix-type input source selection */
11780
/* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
11781
/* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
11782
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
11783
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x03 << 8))},
11784
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x02 << 8))},
11785
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x04 << 8))},
11787
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
11788
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x03 << 8))},
11789
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x02 << 8))},
11790
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x04 << 8))},
11792
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
11793
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x03 << 8))},
11794
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x02 << 8))},
11795
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x04 << 8))},
11800
static struct hda_verb alc262_HP_BPC_init_verbs[] = {
11802
* Unmute ADC0-2 and set the default input to mic-in
11804
{0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
11805
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11806
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
11807
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11808
{0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
11809
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11811
/* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
11813
* Note: PASD motherboards uses the Line In 2 as the input for
11814
* front panel mic (mic 2)
11816
/* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
11817
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
11818
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
11819
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
11820
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
11821
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
11822
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)},
11823
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
11826
* Set up output mixers (0x0c - 0x0e)
11828
/* set vol=0 to output mixers */
11829
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
11830
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
11831
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
11833
/* set up input amps for analog loopback */
11834
/* Amp Indices: DAC = 0, mixer = 1 */
11835
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11836
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
11837
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11838
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
11839
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11840
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
11842
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
11843
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
11844
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
11846
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
11847
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
11849
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
11850
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
11852
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
11853
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
11854
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
11855
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
11856
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
11858
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000 },
11859
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000 },
11860
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000 },
11861
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000 },
11862
{0x1c, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000 },
11863
{0x1d, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000 },
11866
/* FIXME: use matrix-type input source selection */
11867
/* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 0b, 12 */
11868
/* Input mixer1: only unmute Mic */
11869
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
11870
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x01 << 8))},
11871
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x02 << 8))},
11872
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x03 << 8))},
11873
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x04 << 8))},
11874
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x05 << 8))},
11875
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x06 << 8))},
11876
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x07 << 8))},
11877
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x08 << 8))},
11879
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
11880
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x01 << 8))},
11881
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x02 << 8))},
11882
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x03 << 8))},
11883
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x04 << 8))},
11884
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x05 << 8))},
11885
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x06 << 8))},
11886
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x07 << 8))},
11887
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x08 << 8))},
11889
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
11890
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x01 << 8))},
11891
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x02 << 8))},
11892
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x03 << 8))},
11893
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x04 << 8))},
11894
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x05 << 8))},
11895
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x06 << 8))},
11896
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x07 << 8))},
11897
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x08 << 8))},
11899
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
11904
static struct hda_verb alc262_HP_BPC_WildWest_init_verbs[] = {
11906
* Unmute ADC0-2 and set the default input to mic-in
11908
{0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
11909
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11910
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
11911
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11912
{0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
11913
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11915
/* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
11917
* Note: PASD motherboards uses the Line In 2 as the input for front
11918
* panel mic (mic 2)
11920
/* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
11921
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
11922
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
11923
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
11924
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
11925
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
11926
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)},
11927
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
11928
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
11930
* Set up output mixers (0x0c - 0x0e)
11932
/* set vol=0 to output mixers */
11933
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
11934
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
11935
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
11937
/* set up input amps for analog loopback */
11938
/* Amp Indices: DAC = 0, mixer = 1 */
11939
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11940
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
11941
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11942
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
11943
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11944
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
11947
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP }, /* HP */
11948
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, /* Mono */
11949
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, /* rear MIC */
11950
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, /* Line in */
11951
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, /* Front MIC */
11952
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, /* Line out */
11953
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, /* CD in */
11955
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
11956
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
11958
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
11959
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
11961
/* {0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0x7023 }, */
11962
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000 },
11963
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000 },
11964
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, 0x7023 },
11965
{0x1c, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000 },
11966
{0x1d, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000 },
11968
/* FIXME: use matrix-type input source selection */
11969
/* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
11970
/* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
11971
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))}, /*rear MIC*/
11972
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))}, /*Line in*/
11973
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x02 << 8))}, /*F MIC*/
11974
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x03 << 8))}, /*Front*/
11975
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x04 << 8))}, /*CD*/
11976
/* {0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x06 << 8))}, */
11977
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x07 << 8))}, /*HP*/
11979
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
11980
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
11981
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x02 << 8))},
11982
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x03 << 8))},
11983
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x04 << 8))},
11984
/* {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x06 << 8))}, */
11985
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x07 << 8))},
11987
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
11988
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
11989
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x02 << 8))},
11990
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x03 << 8))},
11991
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x04 << 8))},
11992
/* {0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x06 << 8))}, */
11993
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x07 << 8))},
11995
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
12000
static struct hda_verb alc262_toshiba_rx1_unsol_verbs[] = {
12002
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, /* Front Speaker */
12003
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
12004
{0x14, AC_VERB_SET_CONNECT_SEL, 0x01},
12006
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, /* MIC jack */
12007
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, /* Front MIC */
12008
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) },
12009
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) },
12011
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP }, /* HP jack */
12012
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
12013
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
12018
#ifdef CONFIG_SND_HDA_POWER_SAVE
12019
#define alc262_loopbacks alc880_loopbacks
12022
/* pcm configuration: identical with ALC880 */
12023
#define alc262_pcm_analog_playback alc880_pcm_analog_playback
12024
#define alc262_pcm_analog_capture alc880_pcm_analog_capture
12025
#define alc262_pcm_digital_playback alc880_pcm_digital_playback
12026
#define alc262_pcm_digital_capture alc880_pcm_digital_capture
12029
* BIOS auto configuration
12031
static int alc262_parse_auto_config(struct hda_codec *codec)
12033
struct alc_spec *spec = codec->spec;
12035
static hda_nid_t alc262_ignore[] = { 0x1d, 0 };
12037
err = snd_hda_parse_pin_def_config(codec, &spec->autocfg,
12041
if (!spec->autocfg.line_outs) {
12042
if (spec->autocfg.dig_outs || spec->autocfg.dig_in_pin) {
12043
spec->multiout.max_channels = 2;
12044
spec->no_analog = 1;
12047
return 0; /* can't find valid BIOS pin config */
12049
err = alc262_auto_create_multi_out_ctls(spec, &spec->autocfg);
12052
err = alc262_auto_create_input_ctls(codec, &spec->autocfg);
12056
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
12059
if (spec->autocfg.dig_outs) {
12060
spec->multiout.dig_out_nid = ALC262_DIGOUT_NID;
12061
spec->dig_out_type = spec->autocfg.dig_out_type[0];
12063
if (spec->autocfg.dig_in_pin)
12064
spec->dig_in_nid = ALC262_DIGIN_NID;
12066
if (spec->kctls.list)
12067
add_mixer(spec, spec->kctls.list);
12069
add_verb(spec, alc262_volume_init_verbs);
12070
spec->num_mux_defs = 1;
12071
spec->input_mux = &spec->private_imux[0];
12073
err = alc_auto_add_mic_boost(codec);
12077
alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0);
12082
#define alc262_auto_init_multi_out alc882_auto_init_multi_out
12083
#define alc262_auto_init_hp_out alc882_auto_init_hp_out
12084
#define alc262_auto_init_analog_input alc882_auto_init_analog_input
12085
#define alc262_auto_init_input_src alc882_auto_init_input_src
12088
/* init callback for auto-configuration model -- overriding the default init */
12089
static void alc262_auto_init(struct hda_codec *codec)
12091
struct alc_spec *spec = codec->spec;
12092
alc262_auto_init_multi_out(codec);
12093
alc262_auto_init_hp_out(codec);
12094
alc262_auto_init_analog_input(codec);
12095
alc262_auto_init_input_src(codec);
12096
if (spec->unsol_event)
12097
alc_inithook(codec);
12101
* configuration and preset
12103
static const char *alc262_models[ALC262_MODEL_LAST] = {
12104
[ALC262_BASIC] = "basic",
12105
[ALC262_HIPPO] = "hippo",
12106
[ALC262_HIPPO_1] = "hippo_1",
12107
[ALC262_FUJITSU] = "fujitsu",
12108
[ALC262_HP_BPC] = "hp-bpc",
12109
[ALC262_HP_BPC_D7000_WL]= "hp-bpc-d7000",
12110
[ALC262_HP_TC_T5735] = "hp-tc-t5735",
12111
[ALC262_HP_RP5700] = "hp-rp5700",
12112
[ALC262_BENQ_ED8] = "benq",
12113
[ALC262_BENQ_T31] = "benq-t31",
12114
[ALC262_SONY_ASSAMD] = "sony-assamd",
12115
[ALC262_TOSHIBA_S06] = "toshiba-s06",
12116
[ALC262_TOSHIBA_RX1] = "toshiba-rx1",
12117
[ALC262_ULTRA] = "ultra",
12118
[ALC262_LENOVO_3000] = "lenovo-3000",
12119
[ALC262_NEC] = "nec",
12120
[ALC262_TYAN] = "tyan",
12121
[ALC262_AUTO] = "auto",
12124
static struct snd_pci_quirk alc262_cfg_tbl[] = {
12125
SND_PCI_QUIRK(0x1002, 0x437b, "Hippo", ALC262_HIPPO),
12126
SND_PCI_QUIRK(0x1033, 0x8895, "NEC Versa S9100", ALC262_NEC),
12127
SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1200, "HP xw series",
12129
SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1300, "HP xw series",
12131
SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series",
12133
SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL),
12134
SND_PCI_QUIRK(0x103c, 0x2801, "HP D7000", ALC262_HP_BPC_D7000_WF),
12135
SND_PCI_QUIRK(0x103c, 0x2802, "HP D7000", ALC262_HP_BPC_D7000_WL),
12136
SND_PCI_QUIRK(0x103c, 0x2803, "HP D7000", ALC262_HP_BPC_D7000_WF),
12137
SND_PCI_QUIRK(0x103c, 0x2804, "HP D7000", ALC262_HP_BPC_D7000_WL),
12138
SND_PCI_QUIRK(0x103c, 0x2805, "HP D7000", ALC262_HP_BPC_D7000_WF),
12139
SND_PCI_QUIRK(0x103c, 0x2806, "HP D7000", ALC262_HP_BPC_D7000_WL),
12140
SND_PCI_QUIRK(0x103c, 0x2807, "HP D7000", ALC262_HP_BPC_D7000_WF),
12141
SND_PCI_QUIRK(0x103c, 0x280c, "HP xw4400", ALC262_HP_BPC),
12142
SND_PCI_QUIRK(0x103c, 0x3014, "HP xw6400", ALC262_HP_BPC),
12143
SND_PCI_QUIRK(0x103c, 0x3015, "HP xw8400", ALC262_HP_BPC),
12144
SND_PCI_QUIRK(0x103c, 0x302f, "HP Thin Client T5735",
12145
ALC262_HP_TC_T5735),
12146
SND_PCI_QUIRK(0x103c, 0x2817, "HP RP5700", ALC262_HP_RP5700),
12147
SND_PCI_QUIRK(0x104d, 0x1f00, "Sony ASSAMD", ALC262_SONY_ASSAMD),
12148
SND_PCI_QUIRK(0x104d, 0x8203, "Sony UX-90", ALC262_HIPPO),
12149
SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD),
12150
SND_PCI_QUIRK(0x104d, 0x9016, "Sony VAIO", ALC262_AUTO), /* dig-only */
12151
SND_PCI_QUIRK(0x104d, 0x9025, "Sony VAIO Z21MN", ALC262_TOSHIBA_S06),
12152
SND_PCI_QUIRK(0x104d, 0x9035, "Sony VAIO VGN-FW170J", ALC262_AUTO),
12153
SND_PCI_QUIRK(0x104d, 0x9047, "Sony VAIO Type G", ALC262_AUTO),
12154
#if 0 /* disable the quirk since model=auto works better in recent versions */
12155
SND_PCI_QUIRK_MASK(0x104d, 0xff00, 0x9000, "Sony VAIO",
12156
ALC262_SONY_ASSAMD),
12158
SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1",
12159
ALC262_TOSHIBA_RX1),
12160
SND_PCI_QUIRK(0x1179, 0xff7b, "Toshiba S06", ALC262_TOSHIBA_S06),
12161
SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU),
12162
SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU),
12163
SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_TYAN),
12164
SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc032, "Samsung Q1",
12166
SND_PCI_QUIRK(0x144d, 0xc510, "Samsung Q45", ALC262_HIPPO),
12167
SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000 y410", ALC262_LENOVO_3000),
12168
SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8),
12169
SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_BENQ_T31),
12170
SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1),
12174
static struct alc_config_preset alc262_presets[] = {
12176
.mixers = { alc262_base_mixer },
12177
.init_verbs = { alc262_init_verbs },
12178
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12179
.dac_nids = alc262_dac_nids,
12181
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12182
.channel_mode = alc262_modes,
12183
.input_mux = &alc262_capture_source,
12186
.mixers = { alc262_hippo_mixer },
12187
.init_verbs = { alc262_init_verbs, alc_hp15_unsol_verbs},
12188
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12189
.dac_nids = alc262_dac_nids,
12191
.dig_out_nid = ALC262_DIGOUT_NID,
12192
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12193
.channel_mode = alc262_modes,
12194
.input_mux = &alc262_capture_source,
12195
.unsol_event = alc262_hippo_unsol_event,
12196
.setup = alc262_hippo_setup,
12197
.init_hook = alc262_hippo_automute,
12199
[ALC262_HIPPO_1] = {
12200
.mixers = { alc262_hippo1_mixer },
12201
.init_verbs = { alc262_init_verbs, alc262_hippo1_unsol_verbs},
12202
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12203
.dac_nids = alc262_dac_nids,
12205
.dig_out_nid = ALC262_DIGOUT_NID,
12206
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12207
.channel_mode = alc262_modes,
12208
.input_mux = &alc262_capture_source,
12209
.unsol_event = alc262_hippo_unsol_event,
12210
.setup = alc262_hippo1_setup,
12211
.init_hook = alc262_hippo_automute,
12213
[ALC262_FUJITSU] = {
12214
.mixers = { alc262_fujitsu_mixer },
12215
.init_verbs = { alc262_init_verbs, alc262_EAPD_verbs,
12216
alc262_fujitsu_unsol_verbs },
12217
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12218
.dac_nids = alc262_dac_nids,
12220
.dig_out_nid = ALC262_DIGOUT_NID,
12221
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12222
.channel_mode = alc262_modes,
12223
.input_mux = &alc262_fujitsu_capture_source,
12224
.unsol_event = alc262_fujitsu_unsol_event,
12225
.init_hook = alc262_fujitsu_init_hook,
12227
[ALC262_HP_BPC] = {
12228
.mixers = { alc262_HP_BPC_mixer },
12229
.init_verbs = { alc262_HP_BPC_init_verbs },
12230
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12231
.dac_nids = alc262_dac_nids,
12233
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12234
.channel_mode = alc262_modes,
12235
.input_mux = &alc262_HP_capture_source,
12236
.unsol_event = alc262_hp_bpc_unsol_event,
12237
.init_hook = alc262_hp_bpc_automute,
12239
[ALC262_HP_BPC_D7000_WF] = {
12240
.mixers = { alc262_HP_BPC_WildWest_mixer },
12241
.init_verbs = { alc262_HP_BPC_WildWest_init_verbs },
12242
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12243
.dac_nids = alc262_dac_nids,
12245
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12246
.channel_mode = alc262_modes,
12247
.input_mux = &alc262_HP_D7000_capture_source,
12248
.unsol_event = alc262_hp_wildwest_unsol_event,
12249
.init_hook = alc262_hp_wildwest_automute,
12251
[ALC262_HP_BPC_D7000_WL] = {
12252
.mixers = { alc262_HP_BPC_WildWest_mixer,
12253
alc262_HP_BPC_WildWest_option_mixer },
12254
.init_verbs = { alc262_HP_BPC_WildWest_init_verbs },
12255
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12256
.dac_nids = alc262_dac_nids,
12258
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12259
.channel_mode = alc262_modes,
12260
.input_mux = &alc262_HP_D7000_capture_source,
12261
.unsol_event = alc262_hp_wildwest_unsol_event,
12262
.init_hook = alc262_hp_wildwest_automute,
12264
[ALC262_HP_TC_T5735] = {
12265
.mixers = { alc262_hp_t5735_mixer },
12266
.init_verbs = { alc262_init_verbs, alc262_hp_t5735_verbs },
12267
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12268
.dac_nids = alc262_dac_nids,
12270
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12271
.channel_mode = alc262_modes,
12272
.input_mux = &alc262_capture_source,
12273
.unsol_event = alc_sku_unsol_event,
12274
.setup = alc262_hp_t5735_setup,
12275
.init_hook = alc_inithook,
12277
[ALC262_HP_RP5700] = {
12278
.mixers = { alc262_hp_rp5700_mixer },
12279
.init_verbs = { alc262_init_verbs, alc262_hp_rp5700_verbs },
12280
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12281
.dac_nids = alc262_dac_nids,
12282
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12283
.channel_mode = alc262_modes,
12284
.input_mux = &alc262_hp_rp5700_capture_source,
12286
[ALC262_BENQ_ED8] = {
12287
.mixers = { alc262_base_mixer },
12288
.init_verbs = { alc262_init_verbs, alc262_EAPD_verbs },
12289
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12290
.dac_nids = alc262_dac_nids,
12292
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12293
.channel_mode = alc262_modes,
12294
.input_mux = &alc262_capture_source,
12296
[ALC262_SONY_ASSAMD] = {
12297
.mixers = { alc262_sony_mixer },
12298
.init_verbs = { alc262_init_verbs, alc262_sony_unsol_verbs},
12299
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12300
.dac_nids = alc262_dac_nids,
12302
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12303
.channel_mode = alc262_modes,
12304
.input_mux = &alc262_capture_source,
12305
.unsol_event = alc262_hippo_unsol_event,
12306
.setup = alc262_hippo_setup,
12307
.init_hook = alc262_hippo_automute,
12309
[ALC262_BENQ_T31] = {
12310
.mixers = { alc262_benq_t31_mixer },
12311
.init_verbs = { alc262_init_verbs, alc262_benq_t31_EAPD_verbs,
12312
alc_hp15_unsol_verbs },
12313
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12314
.dac_nids = alc262_dac_nids,
12316
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12317
.channel_mode = alc262_modes,
12318
.input_mux = &alc262_capture_source,
12319
.unsol_event = alc262_hippo_unsol_event,
12320
.setup = alc262_hippo_setup,
12321
.init_hook = alc262_hippo_automute,
12324
.mixers = { alc262_ultra_mixer },
12325
.cap_mixer = alc262_ultra_capture_mixer,
12326
.init_verbs = { alc262_ultra_verbs },
12327
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12328
.dac_nids = alc262_dac_nids,
12329
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12330
.channel_mode = alc262_modes,
12331
.input_mux = &alc262_ultra_capture_source,
12332
.adc_nids = alc262_adc_nids, /* ADC0 */
12333
.capsrc_nids = alc262_capsrc_nids,
12334
.num_adc_nids = 1, /* single ADC */
12335
.unsol_event = alc262_ultra_unsol_event,
12336
.init_hook = alc262_ultra_automute,
12338
[ALC262_LENOVO_3000] = {
12339
.mixers = { alc262_lenovo_3000_mixer },
12340
.init_verbs = { alc262_init_verbs, alc262_EAPD_verbs,
12341
alc262_lenovo_3000_unsol_verbs,
12342
alc262_lenovo_3000_init_verbs },
12343
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12344
.dac_nids = alc262_dac_nids,
12346
.dig_out_nid = ALC262_DIGOUT_NID,
12347
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12348
.channel_mode = alc262_modes,
12349
.input_mux = &alc262_fujitsu_capture_source,
12350
.unsol_event = alc262_lenovo_3000_unsol_event,
12353
.mixers = { alc262_nec_mixer },
12354
.init_verbs = { alc262_nec_verbs },
12355
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12356
.dac_nids = alc262_dac_nids,
12358
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12359
.channel_mode = alc262_modes,
12360
.input_mux = &alc262_capture_source,
12362
[ALC262_TOSHIBA_S06] = {
12363
.mixers = { alc262_toshiba_s06_mixer },
12364
.init_verbs = { alc262_init_verbs, alc262_toshiba_s06_verbs,
12365
alc262_eapd_verbs },
12366
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12367
.capsrc_nids = alc262_dmic_capsrc_nids,
12368
.dac_nids = alc262_dac_nids,
12369
.adc_nids = alc262_dmic_adc_nids, /* ADC0 */
12370
.num_adc_nids = 1, /* single ADC */
12371
.dig_out_nid = ALC262_DIGOUT_NID,
12372
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12373
.channel_mode = alc262_modes,
12374
.unsol_event = alc_sku_unsol_event,
12375
.setup = alc262_toshiba_s06_setup,
12376
.init_hook = alc_inithook,
12378
[ALC262_TOSHIBA_RX1] = {
12379
.mixers = { alc262_toshiba_rx1_mixer },
12380
.init_verbs = { alc262_init_verbs, alc262_toshiba_rx1_unsol_verbs },
12381
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12382
.dac_nids = alc262_dac_nids,
12384
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12385
.channel_mode = alc262_modes,
12386
.input_mux = &alc262_capture_source,
12387
.unsol_event = alc262_hippo_unsol_event,
12388
.setup = alc262_hippo_setup,
12389
.init_hook = alc262_hippo_automute,
12392
.mixers = { alc262_tyan_mixer },
12393
.init_verbs = { alc262_init_verbs, alc262_tyan_verbs},
12394
.num_dacs = ARRAY_SIZE(alc262_dac_nids),
12395
.dac_nids = alc262_dac_nids,
12397
.dig_out_nid = ALC262_DIGOUT_NID,
12398
.num_channel_mode = ARRAY_SIZE(alc262_modes),
12399
.channel_mode = alc262_modes,
12400
.input_mux = &alc262_capture_source,
12401
.unsol_event = alc_automute_amp_unsol_event,
12402
.setup = alc262_tyan_setup,
12403
.init_hook = alc_automute_amp,
12407
static int patch_alc262(struct hda_codec *codec)
12409
struct alc_spec *spec;
12413
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
12417
codec->spec = spec;
12419
/* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
12424
snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_COEF_INDEX, 7);
12425
tmp = snd_hda_codec_read(codec, 0x20, 0, AC_VERB_GET_PROC_COEF, 0);
12426
snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_COEF_INDEX, 7);
12427
snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PROC_COEF, tmp | 0x80);
12430
alc_auto_parse_customize_define(codec);
12432
alc_fix_pll_init(codec, 0x20, 0x0a, 10);
12434
board_config = snd_hda_check_board_config(codec, ALC262_MODEL_LAST,
12438
if (board_config < 0) {
12439
printk(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n",
12441
board_config = ALC262_AUTO;
12444
if (board_config == ALC262_AUTO) {
12445
/* automatic parse from the BIOS config */
12446
err = alc262_parse_auto_config(codec);
12452
"hda_codec: Cannot set up configuration "
12453
"from BIOS. Using base mode...\n");
12454
board_config = ALC262_BASIC;
12458
if (!spec->no_analog && has_cdefine_beep(codec)) {
12459
err = snd_hda_attach_beep_device(codec, 0x1);
12466
if (board_config != ALC262_AUTO)
12467
setup_preset(codec, &alc262_presets[board_config]);
12469
spec->stream_analog_playback = &alc262_pcm_analog_playback;
12470
spec->stream_analog_capture = &alc262_pcm_analog_capture;
12472
spec->stream_digital_playback = &alc262_pcm_digital_playback;
12473
spec->stream_digital_capture = &alc262_pcm_digital_capture;
12475
if (!spec->adc_nids && spec->input_mux) {
12477
/* check whether the digital-mic has to be supported */
12478
for (i = 0; i < spec->input_mux->num_items; i++) {
12479
if (spec->input_mux->items[i].index >= 9)
12482
if (i < spec->input_mux->num_items) {
12483
/* use only ADC0 */
12484
spec->adc_nids = alc262_dmic_adc_nids;
12485
spec->num_adc_nids = 1;
12486
spec->capsrc_nids = alc262_dmic_capsrc_nids;
12488
/* all analog inputs */
12489
/* check whether NID 0x07 is valid */
12490
unsigned int wcap = get_wcaps(codec, 0x07);
12493
wcap = get_wcaps_type(wcap);
12494
if (wcap != AC_WID_AUD_IN) {
12495
spec->adc_nids = alc262_adc_nids_alt;
12496
spec->num_adc_nids =
12497
ARRAY_SIZE(alc262_adc_nids_alt);
12498
spec->capsrc_nids = alc262_capsrc_nids_alt;
12500
spec->adc_nids = alc262_adc_nids;
12501
spec->num_adc_nids =
12502
ARRAY_SIZE(alc262_adc_nids);
12503
spec->capsrc_nids = alc262_capsrc_nids;
12507
if (!spec->cap_mixer && !spec->no_analog)
12508
set_capture_mixer(codec);
12509
if (!spec->no_analog && has_cdefine_beep(codec))
12510
set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
12512
spec->vmaster_nid = 0x0c;
12514
codec->patch_ops = alc_patch_ops;
12515
if (board_config == ALC262_AUTO)
12516
spec->init_hook = alc262_auto_init;
12517
#ifdef CONFIG_SND_HDA_POWER_SAVE
12518
if (!spec->loopback.amplist)
12519
spec->loopback.amplist = alc262_loopbacks;
12526
* ALC268 channel source setting (2 channel)
12528
#define ALC268_DIGOUT_NID ALC880_DIGOUT_NID
12529
#define alc268_modes alc260_modes
12531
static hda_nid_t alc268_dac_nids[2] = {
12536
static hda_nid_t alc268_adc_nids[2] = {
12541
static hda_nid_t alc268_adc_nids_alt[1] = {
12546
static hda_nid_t alc268_capsrc_nids[2] = { 0x23, 0x24 };
12548
static struct snd_kcontrol_new alc268_base_mixer[] = {
12549
/* output mixer control */
12550
HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT),
12551
HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT),
12552
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT),
12553
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
12554
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
12555
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
12556
HDA_CODEC_VOLUME("Line In Boost", 0x1a, 0, HDA_INPUT),
12560
static struct snd_kcontrol_new alc268_toshiba_mixer[] = {
12561
/* output mixer control */
12562
HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT),
12563
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT),
12564
ALC262_HIPPO_MASTER_SWITCH,
12565
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
12566
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
12567
HDA_CODEC_VOLUME("Line In Boost", 0x1a, 0, HDA_INPUT),
12571
/* bind Beep switches of both NID 0x0f and 0x10 */
12572
static struct hda_bind_ctls alc268_bind_beep_sw = {
12573
.ops = &snd_hda_bind_sw,
12575
HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT),
12576
HDA_COMPOSE_AMP_VAL(0x10, 3, 1, HDA_INPUT),
12581
static struct snd_kcontrol_new alc268_beep_mixer[] = {
12582
HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
12583
HDA_BIND_SW("Beep Playback Switch", &alc268_bind_beep_sw),
12587
static struct hda_verb alc268_eapd_verbs[] = {
12588
{0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
12589
{0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
12593
/* Toshiba specific */
12594
static struct hda_verb alc268_toshiba_verbs[] = {
12595
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
12599
/* Acer specific */
12600
/* bind volumes of both NID 0x02 and 0x03 */
12601
static struct hda_bind_ctls alc268_acer_bind_master_vol = {
12602
.ops = &snd_hda_bind_vol,
12604
HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT),
12605
HDA_COMPOSE_AMP_VAL(0x03, 3, 0, HDA_OUTPUT),
12610
/* mute/unmute internal speaker according to the hp jack and mute state */
12611
static void alc268_acer_automute(struct hda_codec *codec, int force)
12613
struct alc_spec *spec = codec->spec;
12616
if (force || !spec->sense_updated) {
12617
spec->jack_present = snd_hda_jack_detect(codec, 0x14);
12618
spec->sense_updated = 1;
12620
if (spec->jack_present)
12621
mute = HDA_AMP_MUTE; /* mute internal speaker */
12622
else /* unmute internal speaker if necessary */
12623
mute = snd_hda_codec_amp_read(codec, 0x14, 0, HDA_OUTPUT, 0);
12624
snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
12625
HDA_AMP_MUTE, mute);
12629
/* bind hp and internal speaker mute (with plug check) */
12630
static int alc268_acer_master_sw_put(struct snd_kcontrol *kcontrol,
12631
struct snd_ctl_elem_value *ucontrol)
12633
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
12634
long *valp = ucontrol->value.integer.value;
12637
change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp);
12639
alc268_acer_automute(codec, 0);
12643
static struct snd_kcontrol_new alc268_acer_aspire_one_mixer[] = {
12644
/* output mixer control */
12645
HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol),
12647
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
12648
.name = "Master Playback Switch",
12649
.subdevice = HDA_SUBDEV_AMP_FLAG,
12650
.info = snd_hda_mixer_amp_switch_info,
12651
.get = snd_hda_mixer_amp_switch_get,
12652
.put = alc268_acer_master_sw_put,
12653
.private_value = HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
12655
HDA_CODEC_VOLUME("Mic Boost Capture Volume", 0x18, 0, HDA_INPUT),
12659
static struct snd_kcontrol_new alc268_acer_mixer[] = {
12660
/* output mixer control */
12661
HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol),
12663
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
12664
.name = "Master Playback Switch",
12665
.subdevice = HDA_SUBDEV_AMP_FLAG,
12666
.info = snd_hda_mixer_amp_switch_info,
12667
.get = snd_hda_mixer_amp_switch_get,
12668
.put = alc268_acer_master_sw_put,
12669
.private_value = HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
12671
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
12672
HDA_CODEC_VOLUME("Internal Mic Boost", 0x19, 0, HDA_INPUT),
12673
HDA_CODEC_VOLUME("Line In Boost", 0x1a, 0, HDA_INPUT),
12677
static struct snd_kcontrol_new alc268_acer_dmic_mixer[] = {
12678
/* output mixer control */
12679
HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol),
12681
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
12682
.name = "Master Playback Switch",
12683
.subdevice = HDA_SUBDEV_AMP_FLAG,
12684
.info = snd_hda_mixer_amp_switch_info,
12685
.get = snd_hda_mixer_amp_switch_get,
12686
.put = alc268_acer_master_sw_put,
12687
.private_value = HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
12689
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
12690
HDA_CODEC_VOLUME("Line In Boost", 0x1a, 0, HDA_INPUT),
12694
static struct hda_verb alc268_acer_aspire_one_verbs[] = {
12695
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
12696
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
12697
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
12698
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
12699
{0x23, AC_VERB_SET_CONNECT_SEL, 0x06},
12700
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, 0xa017},
12704
static struct hda_verb alc268_acer_verbs[] = {
12705
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* internal dmic? */
12706
{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
12707
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
12708
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
12709
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
12710
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
12711
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
12715
/* unsolicited event for HP jack sensing */
12716
#define alc268_toshiba_unsol_event alc262_hippo_unsol_event
12717
#define alc268_toshiba_setup alc262_hippo_setup
12718
#define alc268_toshiba_automute alc262_hippo_automute
12720
static void alc268_acer_unsol_event(struct hda_codec *codec,
12723
if ((res >> 26) != ALC880_HP_EVENT)
12725
alc268_acer_automute(codec, 1);
12728
static void alc268_acer_init_hook(struct hda_codec *codec)
12730
alc268_acer_automute(codec, 1);
12733
/* toggle speaker-output according to the hp-jack state */
12734
static void alc268_aspire_one_speaker_automute(struct hda_codec *codec)
12736
unsigned int present;
12737
unsigned char bits;
12739
present = snd_hda_jack_detect(codec, 0x15);
12740
bits = present ? HDA_AMP_MUTE : 0;
12741
snd_hda_codec_amp_stereo(codec, 0x0f, HDA_INPUT, 0,
12742
HDA_AMP_MUTE, bits);
12743
snd_hda_codec_amp_stereo(codec, 0x0f, HDA_INPUT, 1,
12744
HDA_AMP_MUTE, bits);
12747
static void alc268_acer_lc_unsol_event(struct hda_codec *codec,
12750
switch (res >> 26) {
12751
case ALC880_HP_EVENT:
12752
alc268_aspire_one_speaker_automute(codec);
12754
case ALC880_MIC_EVENT:
12755
alc_mic_automute(codec);
12760
static void alc268_acer_lc_setup(struct hda_codec *codec)
12762
struct alc_spec *spec = codec->spec;
12763
spec->ext_mic.pin = 0x18;
12764
spec->ext_mic.mux_idx = 0;
12765
spec->int_mic.pin = 0x12;
12766
spec->int_mic.mux_idx = 6;
12767
spec->auto_mic = 1;
12770
static void alc268_acer_lc_init_hook(struct hda_codec *codec)
12772
alc268_aspire_one_speaker_automute(codec);
12773
alc_mic_automute(codec);
12776
static struct snd_kcontrol_new alc268_dell_mixer[] = {
12777
/* output mixer control */
12778
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT),
12779
HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
12780
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
12781
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
12782
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
12783
HDA_CODEC_VOLUME("Internal Mic Boost", 0x19, 0, HDA_INPUT),
12787
static struct hda_verb alc268_dell_verbs[] = {
12788
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
12789
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
12790
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
12791
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_MIC_EVENT | AC_USRSP_EN},
12795
/* mute/unmute internal speaker according to the hp jack and mute state */
12796
static void alc268_dell_setup(struct hda_codec *codec)
12798
struct alc_spec *spec = codec->spec;
12800
spec->autocfg.hp_pins[0] = 0x15;
12801
spec->autocfg.speaker_pins[0] = 0x14;
12802
spec->ext_mic.pin = 0x18;
12803
spec->ext_mic.mux_idx = 0;
12804
spec->int_mic.pin = 0x19;
12805
spec->int_mic.mux_idx = 1;
12806
spec->auto_mic = 1;
12809
static struct snd_kcontrol_new alc267_quanta_il1_mixer[] = {
12810
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x2, 0x0, HDA_OUTPUT),
12811
HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
12812
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT),
12813
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
12814
HDA_CODEC_VOLUME("Mic Capture Volume", 0x23, 0x0, HDA_OUTPUT),
12815
HDA_BIND_MUTE("Mic Capture Switch", 0x23, 2, HDA_OUTPUT),
12816
HDA_CODEC_VOLUME("Ext Mic Boost", 0x18, 0, HDA_INPUT),
12817
HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT),
12821
static struct hda_verb alc267_quanta_il1_verbs[] = {
12822
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
12823
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_MIC_EVENT | AC_USRSP_EN},
12827
static void alc267_quanta_il1_setup(struct hda_codec *codec)
12829
struct alc_spec *spec = codec->spec;
12830
spec->autocfg.hp_pins[0] = 0x15;
12831
spec->autocfg.speaker_pins[0] = 0x14;
12832
spec->ext_mic.pin = 0x18;
12833
spec->ext_mic.mux_idx = 0;
12834
spec->int_mic.pin = 0x19;
12835
spec->int_mic.mux_idx = 1;
12836
spec->auto_mic = 1;
12840
* generic initialization of ADC, input mixers and output mixers
12842
static struct hda_verb alc268_base_init_verbs[] = {
12843
/* Unmute DAC0-1 and set vol = 0 */
12844
{0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
12845
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
12848
* Set up output mixers (0x0c - 0x0e)
12850
/* set vol=0 to output mixers */
12851
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
12852
{0x0e, AC_VERB_SET_CONNECT_SEL, 0x00},
12854
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
12855
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
12857
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
12858
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0},
12859
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
12860
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
12861
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
12862
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
12863
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
12864
{0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
12866
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
12867
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
12868
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
12869
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
12870
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
12872
/* set PCBEEP vol = 0, mute connections */
12873
{0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
12874
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
12875
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
12877
/* Unmute Selector 23h,24h and set the default input to mic-in */
12879
{0x23, AC_VERB_SET_CONNECT_SEL, 0x00},
12880
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
12881
{0x24, AC_VERB_SET_CONNECT_SEL, 0x00},
12882
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
12888
* generic initialization of ADC, input mixers and output mixers
12890
static struct hda_verb alc268_volume_init_verbs[] = {
12891
/* set output DAC */
12892
{0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
12893
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
12895
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
12896
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
12897
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
12898
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
12899
{0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
12901
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
12902
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
12903
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
12905
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
12906
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
12908
/* set PCBEEP vol = 0, mute connections */
12909
{0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
12910
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
12911
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
12916
static struct snd_kcontrol_new alc268_capture_nosrc_mixer[] = {
12917
HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT),
12918
HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT),
12922
static struct snd_kcontrol_new alc268_capture_alt_mixer[] = {
12923
HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT),
12924
HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT),
12929
static struct snd_kcontrol_new alc268_capture_mixer[] = {
12930
HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT),
12931
HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT),
12932
HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x24, 0x0, HDA_OUTPUT),
12933
HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x24, 0x0, HDA_OUTPUT),
12938
static struct hda_input_mux alc268_capture_source = {
12942
{ "Front Mic", 0x1 },
12948
static struct hda_input_mux alc268_acer_capture_source = {
12952
{ "Internal Mic", 0x1 },
12957
static struct hda_input_mux alc268_acer_dmic_capture_source = {
12961
{ "Internal Mic", 0x6 },
12966
#ifdef CONFIG_SND_DEBUG
12967
static struct snd_kcontrol_new alc268_test_mixer[] = {
12968
/* Volume widgets */
12969
HDA_CODEC_VOLUME("LOUT1 Playback Volume", 0x02, 0x0, HDA_OUTPUT),
12970
HDA_CODEC_VOLUME("LOUT2 Playback Volume", 0x03, 0x0, HDA_OUTPUT),
12971
HDA_BIND_MUTE_MONO("Mono sum Playback Switch", 0x0e, 1, 2, HDA_INPUT),
12972
HDA_BIND_MUTE("LINE-OUT sum Playback Switch", 0x0f, 2, HDA_INPUT),
12973
HDA_BIND_MUTE("HP-OUT sum Playback Switch", 0x10, 2, HDA_INPUT),
12974
HDA_BIND_MUTE("LINE-OUT Playback Switch", 0x14, 2, HDA_OUTPUT),
12975
HDA_BIND_MUTE("HP-OUT Playback Switch", 0x15, 2, HDA_OUTPUT),
12976
HDA_BIND_MUTE("Mono Playback Switch", 0x16, 2, HDA_OUTPUT),
12977
HDA_CODEC_VOLUME("MIC1 Capture Volume", 0x18, 0x0, HDA_INPUT),
12978
HDA_BIND_MUTE("MIC1 Capture Switch", 0x18, 2, HDA_OUTPUT),
12979
HDA_CODEC_VOLUME("MIC2 Capture Volume", 0x19, 0x0, HDA_INPUT),
12980
HDA_CODEC_VOLUME("LINE1 Capture Volume", 0x1a, 0x0, HDA_INPUT),
12981
HDA_BIND_MUTE("LINE1 Capture Switch", 0x1a, 2, HDA_OUTPUT),
12982
/* The below appears problematic on some hardwares */
12983
/*HDA_CODEC_VOLUME("PCBEEP Playback Volume", 0x1d, 0x0, HDA_INPUT),*/
12984
HDA_CODEC_VOLUME("PCM-IN1 Capture Volume", 0x23, 0x0, HDA_OUTPUT),
12985
HDA_BIND_MUTE("PCM-IN1 Capture Switch", 0x23, 2, HDA_OUTPUT),
12986
HDA_CODEC_VOLUME("PCM-IN2 Capture Volume", 0x24, 0x0, HDA_OUTPUT),
12987
HDA_BIND_MUTE("PCM-IN2 Capture Switch", 0x24, 2, HDA_OUTPUT),
12989
/* Modes for retasking pin widgets */
12990
ALC_PIN_MODE("LINE-OUT pin mode", 0x14, ALC_PIN_DIR_INOUT),
12991
ALC_PIN_MODE("HP-OUT pin mode", 0x15, ALC_PIN_DIR_INOUT),
12992
ALC_PIN_MODE("MIC1 pin mode", 0x18, ALC_PIN_DIR_INOUT),
12993
ALC_PIN_MODE("LINE1 pin mode", 0x1a, ALC_PIN_DIR_INOUT),
12995
/* Controls for GPIO pins, assuming they are configured as outputs */
12996
ALC_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
12997
ALC_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
12998
ALC_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
12999
ALC_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
13001
/* Switches to allow the digital SPDIF output pin to be enabled.
13002
* The ALC268 does not have an SPDIF input.
13004
ALC_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x06, 0x01),
13006
/* A switch allowing EAPD to be enabled. Some laptops seem to use
13007
* this output to turn on an external amplifier.
13009
ALC_EAPD_CTRL_SWITCH("LINE-OUT EAPD Enable Switch", 0x0f, 0x02),
13010
ALC_EAPD_CTRL_SWITCH("HP-OUT EAPD Enable Switch", 0x10, 0x02),
13016
/* create input playback/capture controls for the given pin */
13017
static int alc268_new_analog_output(struct alc_spec *spec, hda_nid_t nid,
13018
const char *ctlname, int idx)
13029
case 0x1a: /* ALC259/269 only */
13030
case 0x1b: /* ALC259/269 only */
13031
case 0x21: /* ALC269vb has this pin, too */
13037
if (spec->multiout.dac_nids[0] != dac &&
13038
spec->multiout.dac_nids[1] != dac) {
13039
err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, ctlname,
13040
HDA_COMPOSE_AMP_VAL(dac, 3, idx,
13044
spec->multiout.dac_nids[spec->multiout.num_dacs++] = dac;
13048
err = add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, ctlname,
13049
HDA_COMPOSE_AMP_VAL(nid, 3, idx, HDA_OUTPUT));
13051
err = add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, ctlname,
13052
HDA_COMPOSE_AMP_VAL(nid, 2, idx, HDA_OUTPUT));
13058
/* add playback controls from the parsed DAC table */
13059
static int alc268_auto_create_multi_out_ctls(struct alc_spec *spec,
13060
const struct auto_pin_cfg *cfg)
13065
spec->multiout.dac_nids = spec->private_dac_nids;
13067
nid = cfg->line_out_pins[0];
13070
if (cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)
13074
err = alc268_new_analog_output(spec, nid, name, 0);
13079
nid = cfg->speaker_pins[0];
13081
err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, "Speaker",
13082
HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT));
13086
err = alc268_new_analog_output(spec, nid, "Speaker", 0);
13090
nid = cfg->hp_pins[0];
13092
err = alc268_new_analog_output(spec, nid, "Headphone", 0);
13097
nid = cfg->line_out_pins[1] | cfg->line_out_pins[2];
13099
err = add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, "Mono",
13100
HDA_COMPOSE_AMP_VAL(nid, 2, 0, HDA_OUTPUT));
13107
/* create playback/capture controls for input pins */
13108
static int alc268_auto_create_input_ctls(struct hda_codec *codec,
13109
const struct auto_pin_cfg *cfg)
13111
return alc_auto_create_input_ctls(codec, cfg, 0, 0x23, 0x24);
13114
static void alc268_auto_set_output_and_unmute(struct hda_codec *codec,
13115
hda_nid_t nid, int pin_type)
13119
alc_set_pin_output(codec, nid, pin_type);
13120
if (nid == 0x14 || nid == 0x16)
13124
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, idx);
13127
static void alc268_auto_init_multi_out(struct hda_codec *codec)
13129
struct alc_spec *spec = codec->spec;
13130
hda_nid_t nid = spec->autocfg.line_out_pins[0];
13132
int pin_type = get_pin_type(spec->autocfg.line_out_type);
13133
alc268_auto_set_output_and_unmute(codec, nid, pin_type);
13137
static void alc268_auto_init_hp_out(struct hda_codec *codec)
13139
struct alc_spec *spec = codec->spec;
13142
pin = spec->autocfg.hp_pins[0];
13144
alc268_auto_set_output_and_unmute(codec, pin, PIN_HP);
13145
pin = spec->autocfg.speaker_pins[0];
13147
alc268_auto_set_output_and_unmute(codec, pin, PIN_OUT);
13150
static void alc268_auto_init_mono_speaker_out(struct hda_codec *codec)
13152
struct alc_spec *spec = codec->spec;
13153
hda_nid_t speaker_nid = spec->autocfg.speaker_pins[0];
13154
hda_nid_t hp_nid = spec->autocfg.hp_pins[0];
13155
hda_nid_t line_nid = spec->autocfg.line_out_pins[0];
13156
unsigned int dac_vol1, dac_vol2;
13158
if (line_nid == 0x1d || speaker_nid == 0x1d) {
13159
snd_hda_codec_write(codec, speaker_nid, 0,
13160
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
13161
/* mute mixer inputs from 0x1d */
13162
snd_hda_codec_write(codec, 0x0f, 0,
13163
AC_VERB_SET_AMP_GAIN_MUTE,
13165
snd_hda_codec_write(codec, 0x10, 0,
13166
AC_VERB_SET_AMP_GAIN_MUTE,
13169
/* unmute mixer inputs from 0x1d */
13170
snd_hda_codec_write(codec, 0x0f, 0,
13171
AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1));
13172
snd_hda_codec_write(codec, 0x10, 0,
13173
AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1));
13176
dac_vol1 = dac_vol2 = 0xb000 | 0x40; /* set max volume */
13177
if (line_nid == 0x14)
13178
dac_vol2 = AMP_OUT_ZERO;
13179
else if (line_nid == 0x15)
13180
dac_vol1 = AMP_OUT_ZERO;
13181
if (hp_nid == 0x14)
13182
dac_vol2 = AMP_OUT_ZERO;
13183
else if (hp_nid == 0x15)
13184
dac_vol1 = AMP_OUT_ZERO;
13185
if (line_nid != 0x16 || hp_nid != 0x16 ||
13186
spec->autocfg.line_out_pins[1] != 0x16 ||
13187
spec->autocfg.line_out_pins[2] != 0x16)
13188
dac_vol1 = dac_vol2 = AMP_OUT_ZERO;
13190
snd_hda_codec_write(codec, 0x02, 0,
13191
AC_VERB_SET_AMP_GAIN_MUTE, dac_vol1);
13192
snd_hda_codec_write(codec, 0x03, 0,
13193
AC_VERB_SET_AMP_GAIN_MUTE, dac_vol2);
13196
/* pcm configuration: identical with ALC880 */
13197
#define alc268_pcm_analog_playback alc880_pcm_analog_playback
13198
#define alc268_pcm_analog_capture alc880_pcm_analog_capture
13199
#define alc268_pcm_analog_alt_capture alc880_pcm_analog_alt_capture
13200
#define alc268_pcm_digital_playback alc880_pcm_digital_playback
13203
* BIOS auto configuration
13205
static int alc268_parse_auto_config(struct hda_codec *codec)
13207
struct alc_spec *spec = codec->spec;
13209
static hda_nid_t alc268_ignore[] = { 0 };
13211
err = snd_hda_parse_pin_def_config(codec, &spec->autocfg,
13215
if (!spec->autocfg.line_outs) {
13216
if (spec->autocfg.dig_outs || spec->autocfg.dig_in_pin) {
13217
spec->multiout.max_channels = 2;
13218
spec->no_analog = 1;
13221
return 0; /* can't find valid BIOS pin config */
13223
err = alc268_auto_create_multi_out_ctls(spec, &spec->autocfg);
13226
err = alc268_auto_create_input_ctls(codec, &spec->autocfg);
13230
spec->multiout.max_channels = 2;
13233
/* digital only support output */
13234
if (spec->autocfg.dig_outs) {
13235
spec->multiout.dig_out_nid = ALC268_DIGOUT_NID;
13236
spec->dig_out_type = spec->autocfg.dig_out_type[0];
13238
if (spec->kctls.list)
13239
add_mixer(spec, spec->kctls.list);
13241
if (!spec->no_analog && spec->autocfg.speaker_pins[0] != 0x1d)
13242
add_mixer(spec, alc268_beep_mixer);
13244
add_verb(spec, alc268_volume_init_verbs);
13245
spec->num_mux_defs = 2;
13246
spec->input_mux = &spec->private_imux[0];
13248
err = alc_auto_add_mic_boost(codec);
13252
alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0);
13257
#define alc268_auto_init_analog_input alc882_auto_init_analog_input
13259
/* init callback for auto-configuration model -- overriding the default init */
13260
static void alc268_auto_init(struct hda_codec *codec)
13262
struct alc_spec *spec = codec->spec;
13263
alc268_auto_init_multi_out(codec);
13264
alc268_auto_init_hp_out(codec);
13265
alc268_auto_init_mono_speaker_out(codec);
13266
alc268_auto_init_analog_input(codec);
13267
if (spec->unsol_event)
13268
alc_inithook(codec);
13272
* configuration and preset
13274
static const char *alc268_models[ALC268_MODEL_LAST] = {
13275
[ALC267_QUANTA_IL1] = "quanta-il1",
13276
[ALC268_3ST] = "3stack",
13277
[ALC268_TOSHIBA] = "toshiba",
13278
[ALC268_ACER] = "acer",
13279
[ALC268_ACER_DMIC] = "acer-dmic",
13280
[ALC268_ACER_ASPIRE_ONE] = "acer-aspire",
13281
[ALC268_DELL] = "dell",
13282
[ALC268_ZEPTO] = "zepto",
13283
#ifdef CONFIG_SND_DEBUG
13284
[ALC268_TEST] = "test",
13286
[ALC268_AUTO] = "auto",
13289
static struct snd_pci_quirk alc268_cfg_tbl[] = {
13290
SND_PCI_QUIRK(0x1025, 0x011e, "Acer Aspire 5720z", ALC268_ACER),
13291
SND_PCI_QUIRK(0x1025, 0x0126, "Acer", ALC268_ACER),
13292
SND_PCI_QUIRK(0x1025, 0x012e, "Acer Aspire 5310", ALC268_ACER),
13293
SND_PCI_QUIRK(0x1025, 0x0130, "Acer Extensa 5210", ALC268_ACER),
13294
SND_PCI_QUIRK(0x1025, 0x0136, "Acer Aspire 5315", ALC268_ACER),
13295
SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One",
13296
ALC268_ACER_ASPIRE_ONE),
13297
SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL),
13298
SND_PCI_QUIRK_MASK(0x1028, 0xfff0, 0x02b0,
13299
"Dell Inspiron Mini9/Vostro A90", ALC268_DELL),
13300
/* almost compatible with toshiba but with optional digital outs;
13301
* auto-probing seems working fine
13303
SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x3000, "HP TX25xx series",
13305
SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST),
13306
SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO),
13307
SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA),
13308
SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER),
13309
SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1),
13313
/* Toshiba laptops have no unique PCI SSID but only codec SSID */
13314
static struct snd_pci_quirk alc268_ssid_cfg_tbl[] = {
13315
SND_PCI_QUIRK(0x1179, 0xff0a, "TOSHIBA X-200", ALC268_AUTO),
13316
SND_PCI_QUIRK(0x1179, 0xff0e, "TOSHIBA X-200 HDMI", ALC268_AUTO),
13317
SND_PCI_QUIRK_MASK(0x1179, 0xff00, 0xff00, "TOSHIBA A/Lx05",
13322
static struct alc_config_preset alc268_presets[] = {
13323
[ALC267_QUANTA_IL1] = {
13324
.mixers = { alc267_quanta_il1_mixer, alc268_beep_mixer,
13325
alc268_capture_nosrc_mixer },
13326
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
13327
alc267_quanta_il1_verbs },
13328
.num_dacs = ARRAY_SIZE(alc268_dac_nids),
13329
.dac_nids = alc268_dac_nids,
13330
.num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
13331
.adc_nids = alc268_adc_nids_alt,
13333
.num_channel_mode = ARRAY_SIZE(alc268_modes),
13334
.channel_mode = alc268_modes,
13335
.unsol_event = alc_sku_unsol_event,
13336
.setup = alc267_quanta_il1_setup,
13337
.init_hook = alc_inithook,
13340
.mixers = { alc268_base_mixer, alc268_capture_alt_mixer,
13341
alc268_beep_mixer },
13342
.init_verbs = { alc268_base_init_verbs },
13343
.num_dacs = ARRAY_SIZE(alc268_dac_nids),
13344
.dac_nids = alc268_dac_nids,
13345
.num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
13346
.adc_nids = alc268_adc_nids_alt,
13347
.capsrc_nids = alc268_capsrc_nids,
13349
.dig_out_nid = ALC268_DIGOUT_NID,
13350
.num_channel_mode = ARRAY_SIZE(alc268_modes),
13351
.channel_mode = alc268_modes,
13352
.input_mux = &alc268_capture_source,
13354
[ALC268_TOSHIBA] = {
13355
.mixers = { alc268_toshiba_mixer, alc268_capture_alt_mixer,
13356
alc268_beep_mixer },
13357
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
13358
alc268_toshiba_verbs },
13359
.num_dacs = ARRAY_SIZE(alc268_dac_nids),
13360
.dac_nids = alc268_dac_nids,
13361
.num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
13362
.adc_nids = alc268_adc_nids_alt,
13363
.capsrc_nids = alc268_capsrc_nids,
13365
.num_channel_mode = ARRAY_SIZE(alc268_modes),
13366
.channel_mode = alc268_modes,
13367
.input_mux = &alc268_capture_source,
13368
.unsol_event = alc268_toshiba_unsol_event,
13369
.setup = alc268_toshiba_setup,
13370
.init_hook = alc268_toshiba_automute,
13373
.mixers = { alc268_acer_mixer, alc268_capture_alt_mixer,
13374
alc268_beep_mixer },
13375
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
13376
alc268_acer_verbs },
13377
.num_dacs = ARRAY_SIZE(alc268_dac_nids),
13378
.dac_nids = alc268_dac_nids,
13379
.num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
13380
.adc_nids = alc268_adc_nids_alt,
13381
.capsrc_nids = alc268_capsrc_nids,
13383
.num_channel_mode = ARRAY_SIZE(alc268_modes),
13384
.channel_mode = alc268_modes,
13385
.input_mux = &alc268_acer_capture_source,
13386
.unsol_event = alc268_acer_unsol_event,
13387
.init_hook = alc268_acer_init_hook,
13389
[ALC268_ACER_DMIC] = {
13390
.mixers = { alc268_acer_dmic_mixer, alc268_capture_alt_mixer,
13391
alc268_beep_mixer },
13392
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
13393
alc268_acer_verbs },
13394
.num_dacs = ARRAY_SIZE(alc268_dac_nids),
13395
.dac_nids = alc268_dac_nids,
13396
.num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
13397
.adc_nids = alc268_adc_nids_alt,
13398
.capsrc_nids = alc268_capsrc_nids,
13400
.num_channel_mode = ARRAY_SIZE(alc268_modes),
13401
.channel_mode = alc268_modes,
13402
.input_mux = &alc268_acer_dmic_capture_source,
13403
.unsol_event = alc268_acer_unsol_event,
13404
.init_hook = alc268_acer_init_hook,
13406
[ALC268_ACER_ASPIRE_ONE] = {
13407
.mixers = { alc268_acer_aspire_one_mixer,
13409
alc268_capture_nosrc_mixer },
13410
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
13411
alc268_acer_aspire_one_verbs },
13412
.num_dacs = ARRAY_SIZE(alc268_dac_nids),
13413
.dac_nids = alc268_dac_nids,
13414
.num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
13415
.adc_nids = alc268_adc_nids_alt,
13416
.capsrc_nids = alc268_capsrc_nids,
13418
.num_channel_mode = ARRAY_SIZE(alc268_modes),
13419
.channel_mode = alc268_modes,
13420
.unsol_event = alc268_acer_lc_unsol_event,
13421
.setup = alc268_acer_lc_setup,
13422
.init_hook = alc268_acer_lc_init_hook,
13425
.mixers = { alc268_dell_mixer, alc268_beep_mixer,
13426
alc268_capture_nosrc_mixer },
13427
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
13428
alc268_dell_verbs },
13429
.num_dacs = ARRAY_SIZE(alc268_dac_nids),
13430
.dac_nids = alc268_dac_nids,
13431
.num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
13432
.adc_nids = alc268_adc_nids_alt,
13433
.capsrc_nids = alc268_capsrc_nids,
13435
.num_channel_mode = ARRAY_SIZE(alc268_modes),
13436
.channel_mode = alc268_modes,
13437
.unsol_event = alc_sku_unsol_event,
13438
.setup = alc268_dell_setup,
13439
.init_hook = alc_inithook,
13442
.mixers = { alc268_base_mixer, alc268_capture_alt_mixer,
13443
alc268_beep_mixer },
13444
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
13445
alc268_toshiba_verbs },
13446
.num_dacs = ARRAY_SIZE(alc268_dac_nids),
13447
.dac_nids = alc268_dac_nids,
13448
.num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
13449
.adc_nids = alc268_adc_nids_alt,
13450
.capsrc_nids = alc268_capsrc_nids,
13452
.dig_out_nid = ALC268_DIGOUT_NID,
13453
.num_channel_mode = ARRAY_SIZE(alc268_modes),
13454
.channel_mode = alc268_modes,
13455
.input_mux = &alc268_capture_source,
13456
.setup = alc268_toshiba_setup,
13457
.init_hook = alc268_toshiba_automute,
13459
#ifdef CONFIG_SND_DEBUG
13461
.mixers = { alc268_test_mixer, alc268_capture_mixer },
13462
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
13463
alc268_volume_init_verbs },
13464
.num_dacs = ARRAY_SIZE(alc268_dac_nids),
13465
.dac_nids = alc268_dac_nids,
13466
.num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
13467
.adc_nids = alc268_adc_nids_alt,
13468
.capsrc_nids = alc268_capsrc_nids,
13470
.dig_out_nid = ALC268_DIGOUT_NID,
13471
.num_channel_mode = ARRAY_SIZE(alc268_modes),
13472
.channel_mode = alc268_modes,
13473
.input_mux = &alc268_capture_source,
13478
static int patch_alc268(struct hda_codec *codec)
13480
struct alc_spec *spec;
13482
int i, has_beep, err;
13484
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
13488
codec->spec = spec;
13490
board_config = snd_hda_check_board_config(codec, ALC268_MODEL_LAST,
13494
if (board_config < 0 || board_config >= ALC268_MODEL_LAST)
13495
board_config = snd_hda_check_board_codec_sid_config(codec,
13496
ALC268_MODEL_LAST, alc268_models, alc268_ssid_cfg_tbl);
13498
if (board_config < 0 || board_config >= ALC268_MODEL_LAST) {
13499
printk(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n",
13501
board_config = ALC268_AUTO;
13504
if (board_config == ALC268_AUTO) {
13505
/* automatic parse from the BIOS config */
13506
err = alc268_parse_auto_config(codec);
13512
"hda_codec: Cannot set up configuration "
13513
"from BIOS. Using base mode...\n");
13514
board_config = ALC268_3ST;
13518
if (board_config != ALC268_AUTO)
13519
setup_preset(codec, &alc268_presets[board_config]);
13521
spec->stream_analog_playback = &alc268_pcm_analog_playback;
13522
spec->stream_analog_capture = &alc268_pcm_analog_capture;
13523
spec->stream_analog_alt_capture = &alc268_pcm_analog_alt_capture;
13525
spec->stream_digital_playback = &alc268_pcm_digital_playback;
13528
for (i = 0; i < spec->num_mixers; i++) {
13529
if (spec->mixers[i] == alc268_beep_mixer) {
13536
err = snd_hda_attach_beep_device(codec, 0x1);
13541
if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
13542
/* override the amp caps for beep generator */
13543
snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
13544
(0x0c << AC_AMPCAP_OFFSET_SHIFT) |
13545
(0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
13546
(0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
13547
(0 << AC_AMPCAP_MUTE_SHIFT));
13550
if (!spec->no_analog && !spec->adc_nids && spec->input_mux) {
13551
/* check whether NID 0x07 is valid */
13552
unsigned int wcap = get_wcaps(codec, 0x07);
13555
spec->capsrc_nids = alc268_capsrc_nids;
13557
wcap = get_wcaps_type(wcap);
13558
if (spec->auto_mic ||
13559
wcap != AC_WID_AUD_IN || spec->input_mux->num_items == 1) {
13560
spec->adc_nids = alc268_adc_nids_alt;
13561
spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt);
13562
if (spec->auto_mic)
13563
fixup_automic_adc(codec);
13564
if (spec->auto_mic || spec->input_mux->num_items == 1)
13565
add_mixer(spec, alc268_capture_nosrc_mixer);
13567
add_mixer(spec, alc268_capture_alt_mixer);
13569
spec->adc_nids = alc268_adc_nids;
13570
spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids);
13571
add_mixer(spec, alc268_capture_mixer);
13573
/* set default input source */
13574
for (i = 0; i < spec->num_adc_nids; i++)
13575
snd_hda_codec_write_cache(codec, alc268_capsrc_nids[i],
13576
0, AC_VERB_SET_CONNECT_SEL,
13577
i < spec->num_mux_defs ?
13578
spec->input_mux[i].items[0].index :
13579
spec->input_mux->items[0].index);
13582
spec->vmaster_nid = 0x02;
13584
codec->patch_ops = alc_patch_ops;
13585
if (board_config == ALC268_AUTO)
13586
spec->init_hook = alc268_auto_init;
13592
* ALC269 channel source setting (2 channel)
13594
#define ALC269_DIGOUT_NID ALC880_DIGOUT_NID
13596
#define alc269_dac_nids alc260_dac_nids
13598
static hda_nid_t alc269_adc_nids[1] = {
13603
static hda_nid_t alc269_capsrc_nids[1] = {
13607
static hda_nid_t alc269vb_adc_nids[1] = {
13612
static hda_nid_t alc269vb_capsrc_nids[1] = {
13616
static hda_nid_t alc269_adc_candidates[] = {
13620
#define alc269_modes alc260_modes
13621
#define alc269_capture_source alc880_lg_lw_capture_source
13623
static struct snd_kcontrol_new alc269_base_mixer[] = {
13624
HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT),
13625
HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT),
13626
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
13627
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
13628
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
13629
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
13630
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
13631
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
13632
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
13633
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
13634
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
13635
HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x16, 2, 0x0, HDA_OUTPUT),
13639
static struct snd_kcontrol_new alc269_quanta_fl1_mixer[] = {
13640
/* output mixer control */
13641
HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol),
13643
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
13644
.name = "Master Playback Switch",
13645
.subdevice = HDA_SUBDEV_AMP_FLAG,
13646
.info = snd_hda_mixer_amp_switch_info,
13647
.get = snd_hda_mixer_amp_switch_get,
13648
.put = alc268_acer_master_sw_put,
13649
.private_value = HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
13651
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
13652
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
13653
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
13654
HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
13655
HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
13656
HDA_CODEC_VOLUME("Internal Mic Boost", 0x19, 0, HDA_INPUT),
13660
static struct snd_kcontrol_new alc269_lifebook_mixer[] = {
13661
/* output mixer control */
13662
HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol),
13664
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
13665
.name = "Master Playback Switch",
13666
.subdevice = HDA_SUBDEV_AMP_FLAG,
13667
.info = snd_hda_mixer_amp_switch_info,
13668
.get = snd_hda_mixer_amp_switch_get,
13669
.put = alc268_acer_master_sw_put,
13670
.private_value = HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
13672
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
13673
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
13674
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
13675
HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
13676
HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
13677
HDA_CODEC_VOLUME("Internal Mic Boost", 0x19, 0, HDA_INPUT),
13678
HDA_CODEC_VOLUME("Dock Mic Playback Volume", 0x0b, 0x03, HDA_INPUT),
13679
HDA_CODEC_MUTE("Dock Mic Playback Switch", 0x0b, 0x03, HDA_INPUT),
13680
HDA_CODEC_VOLUME("Dock Mic Boost", 0x1b, 0, HDA_INPUT),
13684
static struct snd_kcontrol_new alc269_laptop_mixer[] = {
13685
HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
13686
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT),
13687
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
13688
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
13692
static struct snd_kcontrol_new alc269vb_laptop_mixer[] = {
13693
HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
13694
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT),
13695
HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT),
13696
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
13700
/* capture mixer elements */
13701
static struct snd_kcontrol_new alc269_laptop_analog_capture_mixer[] = {
13702
HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
13703
HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
13704
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
13705
HDA_CODEC_VOLUME("IntMic Boost", 0x19, 0, HDA_INPUT),
13709
static struct snd_kcontrol_new alc269_laptop_digital_capture_mixer[] = {
13710
HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
13711
HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
13712
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
13716
static struct snd_kcontrol_new alc269vb_laptop_analog_capture_mixer[] = {
13717
HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),
13718
HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),
13719
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
13720
HDA_CODEC_VOLUME("IntMic Boost", 0x19, 0, HDA_INPUT),
13724
static struct snd_kcontrol_new alc269vb_laptop_digital_capture_mixer[] = {
13725
HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),
13726
HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),
13727
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
13732
#define alc269_fujitsu_mixer alc269_laptop_mixer
13734
static struct hda_verb alc269_quanta_fl1_verbs[] = {
13735
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
13736
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
13737
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
13738
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
13739
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
13740
{0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
13744
static struct hda_verb alc269_lifebook_verbs[] = {
13745
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
13746
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x01},
13747
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
13748
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
13749
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
13750
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
13751
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
13752
{0x1a, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
13753
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
13754
{0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
13758
/* toggle speaker-output according to the hp-jack state */
13759
static void alc269_quanta_fl1_speaker_automute(struct hda_codec *codec)
13761
unsigned int present;
13762
unsigned char bits;
13764
present = snd_hda_jack_detect(codec, 0x15);
13765
bits = present ? HDA_AMP_MUTE : 0;
13766
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
13767
HDA_AMP_MUTE, bits);
13768
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
13769
HDA_AMP_MUTE, bits);
13771
snd_hda_codec_write(codec, 0x20, 0,
13772
AC_VERB_SET_COEF_INDEX, 0x0c);
13773
snd_hda_codec_write(codec, 0x20, 0,
13774
AC_VERB_SET_PROC_COEF, 0x680);
13776
snd_hda_codec_write(codec, 0x20, 0,
13777
AC_VERB_SET_COEF_INDEX, 0x0c);
13778
snd_hda_codec_write(codec, 0x20, 0,
13779
AC_VERB_SET_PROC_COEF, 0x480);
13782
/* toggle speaker-output according to the hp-jacks state */
13783
static void alc269_lifebook_speaker_automute(struct hda_codec *codec)
13785
unsigned int present;
13786
unsigned char bits;
13788
/* Check laptop headphone socket */
13789
present = snd_hda_jack_detect(codec, 0x15);
13791
/* Check port replicator headphone socket */
13792
present |= snd_hda_jack_detect(codec, 0x1a);
13794
bits = present ? HDA_AMP_MUTE : 0;
13795
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
13796
HDA_AMP_MUTE, bits);
13797
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
13798
HDA_AMP_MUTE, bits);
13800
snd_hda_codec_write(codec, 0x20, 0,
13801
AC_VERB_SET_COEF_INDEX, 0x0c);
13802
snd_hda_codec_write(codec, 0x20, 0,
13803
AC_VERB_SET_PROC_COEF, 0x680);
13805
snd_hda_codec_write(codec, 0x20, 0,
13806
AC_VERB_SET_COEF_INDEX, 0x0c);
13807
snd_hda_codec_write(codec, 0x20, 0,
13808
AC_VERB_SET_PROC_COEF, 0x480);
13811
static void alc269_lifebook_mic_autoswitch(struct hda_codec *codec)
13813
unsigned int present_laptop;
13814
unsigned int present_dock;
13816
present_laptop = snd_hda_jack_detect(codec, 0x18);
13817
present_dock = snd_hda_jack_detect(codec, 0x1b);
13819
/* Laptop mic port overrides dock mic port, design decision */
13821
snd_hda_codec_write(codec, 0x23, 0,
13822
AC_VERB_SET_CONNECT_SEL, 0x3);
13823
if (present_laptop)
13824
snd_hda_codec_write(codec, 0x23, 0,
13825
AC_VERB_SET_CONNECT_SEL, 0x0);
13826
if (!present_dock && !present_laptop)
13827
snd_hda_codec_write(codec, 0x23, 0,
13828
AC_VERB_SET_CONNECT_SEL, 0x1);
13831
static void alc269_quanta_fl1_unsol_event(struct hda_codec *codec,
13834
switch (res >> 26) {
13835
case ALC880_HP_EVENT:
13836
alc269_quanta_fl1_speaker_automute(codec);
13838
case ALC880_MIC_EVENT:
13839
alc_mic_automute(codec);
13844
static void alc269_lifebook_unsol_event(struct hda_codec *codec,
13847
if ((res >> 26) == ALC880_HP_EVENT)
13848
alc269_lifebook_speaker_automute(codec);
13849
if ((res >> 26) == ALC880_MIC_EVENT)
13850
alc269_lifebook_mic_autoswitch(codec);
13853
static void alc269_quanta_fl1_setup(struct hda_codec *codec)
13855
struct alc_spec *spec = codec->spec;
13856
spec->autocfg.hp_pins[0] = 0x15;
13857
spec->autocfg.speaker_pins[0] = 0x14;
13858
spec->ext_mic.pin = 0x18;
13859
spec->ext_mic.mux_idx = 0;
13860
spec->int_mic.pin = 0x19;
13861
spec->int_mic.mux_idx = 1;
13862
spec->auto_mic = 1;
13865
static void alc269_quanta_fl1_init_hook(struct hda_codec *codec)
13867
alc269_quanta_fl1_speaker_automute(codec);
13868
alc_mic_automute(codec);
13871
static void alc269_lifebook_init_hook(struct hda_codec *codec)
13873
alc269_lifebook_speaker_automute(codec);
13874
alc269_lifebook_mic_autoswitch(codec);
13877
static struct hda_verb alc269_laptop_dmic_init_verbs[] = {
13878
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
13879
{0x23, AC_VERB_SET_CONNECT_SEL, 0x05},
13880
{0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 },
13881
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x7019 | (0x00 << 8))},
13882
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
13883
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
13884
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
13888
static struct hda_verb alc269_laptop_amic_init_verbs[] = {
13889
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
13890
{0x23, AC_VERB_SET_CONNECT_SEL, 0x01},
13891
{0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 },
13892
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x701b | (0x00 << 8))},
13893
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
13894
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
13898
static struct hda_verb alc269vb_laptop_dmic_init_verbs[] = {
13899
{0x21, AC_VERB_SET_CONNECT_SEL, 0x01},
13900
{0x22, AC_VERB_SET_CONNECT_SEL, 0x06},
13901
{0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 },
13902
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, (0x7019 | (0x00 << 8))},
13903
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
13904
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
13905
{0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
13909
static struct hda_verb alc269vb_laptop_amic_init_verbs[] = {
13910
{0x21, AC_VERB_SET_CONNECT_SEL, 0x01},
13911
{0x22, AC_VERB_SET_CONNECT_SEL, 0x01},
13912
{0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 },
13913
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, (0x7019 | (0x00 << 8))},
13914
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
13915
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
13916
{0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
13920
/* toggle speaker-output according to the hp-jack state */
13921
static void alc269_speaker_automute(struct hda_codec *codec)
13923
struct alc_spec *spec = codec->spec;
13924
unsigned int nid = spec->autocfg.hp_pins[0];
13925
unsigned int present;
13926
unsigned char bits;
13928
present = snd_hda_jack_detect(codec, nid);
13929
bits = present ? HDA_AMP_MUTE : 0;
13930
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
13931
HDA_AMP_MUTE, bits);
13932
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
13933
HDA_AMP_MUTE, bits);
13936
/* unsolicited event for HP jack sensing */
13937
static void alc269_laptop_unsol_event(struct hda_codec *codec,
13940
switch (res >> 26) {
13941
case ALC880_HP_EVENT:
13942
alc269_speaker_automute(codec);
13944
case ALC880_MIC_EVENT:
13945
alc_mic_automute(codec);
13950
static void alc269_laptop_amic_setup(struct hda_codec *codec)
13952
struct alc_spec *spec = codec->spec;
13953
spec->autocfg.hp_pins[0] = 0x15;
13954
spec->autocfg.speaker_pins[0] = 0x14;
13955
spec->ext_mic.pin = 0x18;
13956
spec->ext_mic.mux_idx = 0;
13957
spec->int_mic.pin = 0x19;
13958
spec->int_mic.mux_idx = 1;
13959
spec->auto_mic = 1;
13962
static void alc269_laptop_dmic_setup(struct hda_codec *codec)
13964
struct alc_spec *spec = codec->spec;
13965
spec->autocfg.hp_pins[0] = 0x15;
13966
spec->autocfg.speaker_pins[0] = 0x14;
13967
spec->ext_mic.pin = 0x18;
13968
spec->ext_mic.mux_idx = 0;
13969
spec->int_mic.pin = 0x12;
13970
spec->int_mic.mux_idx = 5;
13971
spec->auto_mic = 1;
13974
static void alc269vb_laptop_amic_setup(struct hda_codec *codec)
13976
struct alc_spec *spec = codec->spec;
13977
spec->autocfg.hp_pins[0] = 0x21;
13978
spec->autocfg.speaker_pins[0] = 0x14;
13979
spec->ext_mic.pin = 0x18;
13980
spec->ext_mic.mux_idx = 0;
13981
spec->int_mic.pin = 0x19;
13982
spec->int_mic.mux_idx = 1;
13983
spec->auto_mic = 1;
13986
static void alc269vb_laptop_dmic_setup(struct hda_codec *codec)
13988
struct alc_spec *spec = codec->spec;
13989
spec->autocfg.hp_pins[0] = 0x21;
13990
spec->autocfg.speaker_pins[0] = 0x14;
13991
spec->ext_mic.pin = 0x18;
13992
spec->ext_mic.mux_idx = 0;
13993
spec->int_mic.pin = 0x12;
13994
spec->int_mic.mux_idx = 6;
13995
spec->auto_mic = 1;
13998
static void alc269_laptop_inithook(struct hda_codec *codec)
14000
alc269_speaker_automute(codec);
14001
alc_mic_automute(codec);
14005
* generic initialization of ADC, input mixers and output mixers
14007
static struct hda_verb alc269_init_verbs[] = {
14009
* Unmute ADC0 and set the default input to mic-in
14011
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14014
* Set up output mixers (0x02 - 0x03)
14016
/* set vol=0 to output mixers */
14017
{0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
14018
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
14020
/* set up input amps for analog loopback */
14021
/* Amp Indices: DAC = 0, mixer = 1 */
14022
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14023
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14024
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14025
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14026
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14027
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14029
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
14030
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
14031
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
14032
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
14033
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
14034
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
14035
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
14037
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14038
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14040
/* FIXME: use Mux-type input source selection */
14041
/* Mixer elements: 0x18, 19, 1a, 1b, 1d, 0b */
14042
/* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
14043
{0x23, AC_VERB_SET_CONNECT_SEL, 0x00},
14046
{0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
14050
static struct hda_verb alc269vb_init_verbs[] = {
14052
* Unmute ADC0 and set the default input to mic-in
14054
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14057
* Set up output mixers (0x02 - 0x03)
14059
/* set vol=0 to output mixers */
14060
{0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
14061
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
14063
/* set up input amps for analog loopback */
14064
/* Amp Indices: DAC = 0, mixer = 1 */
14065
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14066
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14067
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14068
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14069
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14070
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14072
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
14073
{0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
14074
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
14075
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
14076
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
14077
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
14078
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
14080
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14081
{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14083
/* FIXME: use Mux-type input source selection */
14084
/* Mixer elements: 0x18, 19, 1a, 1b, 1d, 0b */
14085
/* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
14086
{0x22, AC_VERB_SET_CONNECT_SEL, 0x00},
14089
{0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
14093
#define alc269_auto_create_multi_out_ctls \
14094
alc268_auto_create_multi_out_ctls
14095
#define alc269_auto_create_input_ctls \
14096
alc268_auto_create_input_ctls
14098
#ifdef CONFIG_SND_HDA_POWER_SAVE
14099
#define alc269_loopbacks alc880_loopbacks
14102
/* pcm configuration: identical with ALC880 */
14103
#define alc269_pcm_analog_playback alc880_pcm_analog_playback
14104
#define alc269_pcm_analog_capture alc880_pcm_analog_capture
14105
#define alc269_pcm_digital_playback alc880_pcm_digital_playback
14106
#define alc269_pcm_digital_capture alc880_pcm_digital_capture
14108
static struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
14112
.rates = SNDRV_PCM_RATE_44100, /* fixed rate */
14113
/* NID is set in alc_build_pcms */
14115
.open = alc880_playback_pcm_open,
14116
.prepare = alc880_playback_pcm_prepare,
14117
.cleanup = alc880_playback_pcm_cleanup
14121
static struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
14125
.rates = SNDRV_PCM_RATE_44100, /* fixed rate */
14126
/* NID is set in alc_build_pcms */
14129
#ifdef CONFIG_SND_HDA_POWER_SAVE
14130
static int alc269_mic2_for_mute_led(struct hda_codec *codec)
14132
switch (codec->subsystem_id) {
14139
static int alc269_mic2_mute_check_ps(struct hda_codec *codec, hda_nid_t nid)
14141
/* update mute-LED according to the speaker mute state */
14142
if (nid == 0x01 || nid == 0x14) {
14144
if (snd_hda_codec_amp_read(codec, 0x14, 0, HDA_OUTPUT, 0) &
14149
/* mic2 vref pin is used for mute LED control */
14150
snd_hda_codec_update_cache(codec, 0x19, 0,
14151
AC_VERB_SET_PIN_WIDGET_CONTROL,
14154
return alc_check_power_status(codec, nid);
14156
#endif /* CONFIG_SND_HDA_POWER_SAVE */
14159
* BIOS auto configuration
14161
static int alc269_parse_auto_config(struct hda_codec *codec)
14163
struct alc_spec *spec = codec->spec;
14165
static hda_nid_t alc269_ignore[] = { 0x1d, 0 };
14167
err = snd_hda_parse_pin_def_config(codec, &spec->autocfg,
14172
err = alc269_auto_create_multi_out_ctls(spec, &spec->autocfg);
14175
err = alc269_auto_create_input_ctls(codec, &spec->autocfg);
14179
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
14181
if (spec->autocfg.dig_outs)
14182
spec->multiout.dig_out_nid = ALC269_DIGOUT_NID;
14184
if (spec->kctls.list)
14185
add_mixer(spec, spec->kctls.list);
14187
if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010) {
14188
add_verb(spec, alc269vb_init_verbs);
14189
alc_ssid_check(codec, 0, 0x1b, 0x14, 0x21);
14191
add_verb(spec, alc269_init_verbs);
14192
alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0);
14195
spec->num_mux_defs = 1;
14196
spec->input_mux = &spec->private_imux[0];
14197
fillup_priv_adc_nids(codec, alc269_adc_candidates,
14198
sizeof(alc269_adc_candidates));
14200
/* set default input source */
14201
snd_hda_codec_write_cache(codec, spec->capsrc_nids[0],
14202
0, AC_VERB_SET_CONNECT_SEL,
14203
spec->input_mux->items[0].index);
14205
err = alc_auto_add_mic_boost(codec);
14209
if (!spec->cap_mixer && !spec->no_analog)
14210
set_capture_mixer(codec);
14215
#define alc269_auto_init_multi_out alc268_auto_init_multi_out
14216
#define alc269_auto_init_hp_out alc268_auto_init_hp_out
14217
#define alc269_auto_init_analog_input alc882_auto_init_analog_input
14220
/* init callback for auto-configuration model -- overriding the default init */
14221
static void alc269_auto_init(struct hda_codec *codec)
14223
struct alc_spec *spec = codec->spec;
14224
alc269_auto_init_multi_out(codec);
14225
alc269_auto_init_hp_out(codec);
14226
alc269_auto_init_analog_input(codec);
14227
if (spec->unsol_event)
14228
alc_inithook(codec);
14232
ALC269_FIXUP_SONY_VAIO,
14233
ALC269_FIXUP_DELL_M101Z,
14236
static const struct hda_verb alc269_sony_vaio_fixup_verbs[] = {
14237
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD},
14241
static const struct alc_fixup alc269_fixups[] = {
14242
[ALC269_FIXUP_SONY_VAIO] = {
14243
.verbs = alc269_sony_vaio_fixup_verbs
14245
[ALC269_FIXUP_DELL_M101Z] = {
14246
.verbs = (const struct hda_verb[]) {
14247
/* Enables internal speaker */
14248
{0x20, AC_VERB_SET_COEF_INDEX, 13},
14249
{0x20, AC_VERB_SET_PROC_COEF, 0x4040},
14255
static struct snd_pci_quirk alc269_fixup_tbl[] = {
14256
SND_PCI_QUIRK(0x104d, 0x9071, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
14257
SND_PCI_QUIRK(0x104d, 0x9077, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
14258
SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
14264
* configuration and preset
14266
static const char *alc269_models[ALC269_MODEL_LAST] = {
14267
[ALC269_BASIC] = "basic",
14268
[ALC269_QUANTA_FL1] = "quanta",
14269
[ALC269_AMIC] = "laptop-amic",
14270
[ALC269_DMIC] = "laptop-dmic",
14271
[ALC269_FUJITSU] = "fujitsu",
14272
[ALC269_LIFEBOOK] = "lifebook",
14273
[ALC269_AUTO] = "auto",
14276
static struct snd_pci_quirk alc269_cfg_tbl[] = {
14277
SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1),
14278
SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
14280
SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269VB_AMIC),
14281
SND_PCI_QUIRK(0x1043, 0x1113, "ASUS N63Jn", ALC269VB_AMIC),
14282
SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269VB_AMIC),
14283
SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_AMIC),
14284
SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269VB_AMIC),
14285
SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269VB_AMIC),
14286
SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269VB_AMIC),
14287
SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269VB_AMIC),
14288
SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_AMIC),
14289
SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82Jv", ALC269_AMIC),
14290
SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_AMIC),
14291
SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_AMIC),
14292
SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_AMIC),
14293
SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_AMIC),
14294
SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_AMIC),
14295
SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_AMIC),
14296
SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_AMIC),
14297
SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_AMIC),
14298
SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_AMIC),
14299
SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_AMIC),
14300
SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_AMIC),
14301
SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_AMIC),
14302
SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_AMIC),
14303
SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_AMIC),
14304
SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_AMIC),
14305
SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_AMIC),
14306
SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_AMIC),
14307
SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_AMIC),
14308
SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_AMIC),
14309
SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_AMIC),
14310
SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_AMIC),
14311
SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_DMIC),
14312
SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_AMIC),
14313
SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_AMIC),
14314
SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_AMIC),
14315
SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_AMIC),
14316
SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901",
14318
SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101",
14320
SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_DMIC),
14321
SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_DMIC),
14322
SND_PCI_QUIRK(0x104d, 0x9071, "Sony VAIO", ALC269_AUTO),
14323
SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK),
14324
SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_DMIC),
14325
SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU),
14326
SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_AMIC),
14327
SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_AMIC),
14328
SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_DMIC),
14329
SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_DMIC),
14333
static struct alc_config_preset alc269_presets[] = {
14335
.mixers = { alc269_base_mixer },
14336
.init_verbs = { alc269_init_verbs },
14337
.num_dacs = ARRAY_SIZE(alc269_dac_nids),
14338
.dac_nids = alc269_dac_nids,
14340
.num_channel_mode = ARRAY_SIZE(alc269_modes),
14341
.channel_mode = alc269_modes,
14342
.input_mux = &alc269_capture_source,
14344
[ALC269_QUANTA_FL1] = {
14345
.mixers = { alc269_quanta_fl1_mixer },
14346
.init_verbs = { alc269_init_verbs, alc269_quanta_fl1_verbs },
14347
.num_dacs = ARRAY_SIZE(alc269_dac_nids),
14348
.dac_nids = alc269_dac_nids,
14350
.num_channel_mode = ARRAY_SIZE(alc269_modes),
14351
.channel_mode = alc269_modes,
14352
.input_mux = &alc269_capture_source,
14353
.unsol_event = alc269_quanta_fl1_unsol_event,
14354
.setup = alc269_quanta_fl1_setup,
14355
.init_hook = alc269_quanta_fl1_init_hook,
14358
.mixers = { alc269_laptop_mixer },
14359
.cap_mixer = alc269_laptop_analog_capture_mixer,
14360
.init_verbs = { alc269_init_verbs,
14361
alc269_laptop_amic_init_verbs },
14362
.num_dacs = ARRAY_SIZE(alc269_dac_nids),
14363
.dac_nids = alc269_dac_nids,
14365
.num_channel_mode = ARRAY_SIZE(alc269_modes),
14366
.channel_mode = alc269_modes,
14367
.unsol_event = alc269_laptop_unsol_event,
14368
.setup = alc269_laptop_amic_setup,
14369
.init_hook = alc269_laptop_inithook,
14372
.mixers = { alc269_laptop_mixer },
14373
.cap_mixer = alc269_laptop_digital_capture_mixer,
14374
.init_verbs = { alc269_init_verbs,
14375
alc269_laptop_dmic_init_verbs },
14376
.num_dacs = ARRAY_SIZE(alc269_dac_nids),
14377
.dac_nids = alc269_dac_nids,
14379
.num_channel_mode = ARRAY_SIZE(alc269_modes),
14380
.channel_mode = alc269_modes,
14381
.unsol_event = alc269_laptop_unsol_event,
14382
.setup = alc269_laptop_dmic_setup,
14383
.init_hook = alc269_laptop_inithook,
14385
[ALC269VB_AMIC] = {
14386
.mixers = { alc269vb_laptop_mixer },
14387
.cap_mixer = alc269vb_laptop_analog_capture_mixer,
14388
.init_verbs = { alc269vb_init_verbs,
14389
alc269vb_laptop_amic_init_verbs },
14390
.num_dacs = ARRAY_SIZE(alc269_dac_nids),
14391
.dac_nids = alc269_dac_nids,
14393
.num_channel_mode = ARRAY_SIZE(alc269_modes),
14394
.channel_mode = alc269_modes,
14395
.unsol_event = alc269_laptop_unsol_event,
14396
.setup = alc269vb_laptop_amic_setup,
14397
.init_hook = alc269_laptop_inithook,
14399
[ALC269VB_DMIC] = {
14400
.mixers = { alc269vb_laptop_mixer },
14401
.cap_mixer = alc269vb_laptop_digital_capture_mixer,
14402
.init_verbs = { alc269vb_init_verbs,
14403
alc269vb_laptop_dmic_init_verbs },
14404
.num_dacs = ARRAY_SIZE(alc269_dac_nids),
14405
.dac_nids = alc269_dac_nids,
14407
.num_channel_mode = ARRAY_SIZE(alc269_modes),
14408
.channel_mode = alc269_modes,
14409
.unsol_event = alc269_laptop_unsol_event,
14410
.setup = alc269vb_laptop_dmic_setup,
14411
.init_hook = alc269_laptop_inithook,
14413
[ALC269_FUJITSU] = {
14414
.mixers = { alc269_fujitsu_mixer },
14415
.cap_mixer = alc269_laptop_digital_capture_mixer,
14416
.init_verbs = { alc269_init_verbs,
14417
alc269_laptop_dmic_init_verbs },
14418
.num_dacs = ARRAY_SIZE(alc269_dac_nids),
14419
.dac_nids = alc269_dac_nids,
14421
.num_channel_mode = ARRAY_SIZE(alc269_modes),
14422
.channel_mode = alc269_modes,
14423
.unsol_event = alc269_laptop_unsol_event,
14424
.setup = alc269_laptop_dmic_setup,
14425
.init_hook = alc269_laptop_inithook,
14427
[ALC269_LIFEBOOK] = {
14428
.mixers = { alc269_lifebook_mixer },
14429
.init_verbs = { alc269_init_verbs, alc269_lifebook_verbs },
14430
.num_dacs = ARRAY_SIZE(alc269_dac_nids),
14431
.dac_nids = alc269_dac_nids,
14433
.num_channel_mode = ARRAY_SIZE(alc269_modes),
14434
.channel_mode = alc269_modes,
14435
.input_mux = &alc269_capture_source,
14436
.unsol_event = alc269_lifebook_unsol_event,
14437
.init_hook = alc269_lifebook_init_hook,
14441
static int patch_alc269(struct hda_codec *codec)
14443
struct alc_spec *spec;
14446
int is_alc269vb = 0;
14448
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
14452
codec->spec = spec;
14454
alc_auto_parse_customize_define(codec);
14456
if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010){
14457
if (codec->bus->pci->subsystem_vendor == 0x1025 &&
14458
spec->cdefine.platform_type == 1)
14459
alc_codec_rename(codec, "ALC271X");
14461
alc_codec_rename(codec, "ALC259");
14464
alc_fix_pll_init(codec, 0x20, 0x04, 15);
14466
board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST,
14470
if (board_config < 0) {
14471
printk(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n",
14473
board_config = ALC269_AUTO;
14476
if (board_config == ALC269_AUTO)
14477
alc_pick_fixup(codec, alc269_fixup_tbl, alc269_fixups, 1);
14479
if (board_config == ALC269_AUTO) {
14480
/* automatic parse from the BIOS config */
14481
err = alc269_parse_auto_config(codec);
14487
"hda_codec: Cannot set up configuration "
14488
"from BIOS. Using base mode...\n");
14489
board_config = ALC269_BASIC;
14493
if (has_cdefine_beep(codec)) {
14494
err = snd_hda_attach_beep_device(codec, 0x1);
14501
if (board_config != ALC269_AUTO)
14502
setup_preset(codec, &alc269_presets[board_config]);
14504
if (board_config == ALC269_QUANTA_FL1) {
14505
/* Due to a hardware problem on Lenovo Ideadpad, we need to
14506
* fix the sample rate of analog I/O to 44.1kHz
14508
spec->stream_analog_playback = &alc269_44k_pcm_analog_playback;
14509
spec->stream_analog_capture = &alc269_44k_pcm_analog_capture;
14511
spec->stream_analog_playback = &alc269_pcm_analog_playback;
14512
spec->stream_analog_capture = &alc269_pcm_analog_capture;
14514
spec->stream_digital_playback = &alc269_pcm_digital_playback;
14515
spec->stream_digital_capture = &alc269_pcm_digital_capture;
14517
if (!spec->adc_nids) { /* wasn't filled automatically? use default */
14518
if (!is_alc269vb) {
14519
spec->adc_nids = alc269_adc_nids;
14520
spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids);
14521
spec->capsrc_nids = alc269_capsrc_nids;
14523
spec->adc_nids = alc269vb_adc_nids;
14524
spec->num_adc_nids = ARRAY_SIZE(alc269vb_adc_nids);
14525
spec->capsrc_nids = alc269vb_capsrc_nids;
14529
if (!spec->cap_mixer)
14530
set_capture_mixer(codec);
14531
if (has_cdefine_beep(codec))
14532
set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
14534
if (board_config == ALC269_AUTO)
14535
alc_pick_fixup(codec, alc269_fixup_tbl, alc269_fixups, 0);
14537
spec->vmaster_nid = 0x02;
14539
codec->patch_ops = alc_patch_ops;
14540
if (board_config == ALC269_AUTO)
14541
spec->init_hook = alc269_auto_init;
14542
#ifdef CONFIG_SND_HDA_POWER_SAVE
14543
if (!spec->loopback.amplist)
14544
spec->loopback.amplist = alc269_loopbacks;
14545
if (alc269_mic2_for_mute_led(codec))
14546
codec->patch_ops.check_power_status = alc269_mic2_mute_check_ps;
14553
* ALC861 channel source setting (2/6 channel selection for 3-stack)
14557
* set the path ways for 2 channel output
14558
* need to set the codec line out and mic 1 pin widgets to inputs
14560
static struct hda_verb alc861_threestack_ch2_init[] = {
14561
/* set pin widget 1Ah (line in) for input */
14562
{ 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20 },
14563
/* set pin widget 18h (mic1/2) for input, for mic also enable
14566
{ 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
14568
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb00c },
14570
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8)) }, /*mic*/
14571
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x02 << 8)) }, /*line-in*/
14577
* need to set the codec line out and mic 1 pin widgets to outputs
14579
static struct hda_verb alc861_threestack_ch6_init[] = {
14580
/* set pin widget 1Ah (line in) for output (Back Surround)*/
14581
{ 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
14582
/* set pin widget 18h (mic1) for output (CLFE)*/
14583
{ 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
14585
{ 0x0c, AC_VERB_SET_CONNECT_SEL, 0x00 },
14586
{ 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00 },
14588
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080 },
14590
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x01 << 8)) }, /*mic*/
14591
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x02 << 8)) }, /*line in*/
14596
static struct hda_channel_mode alc861_threestack_modes[2] = {
14597
{ 2, alc861_threestack_ch2_init },
14598
{ 6, alc861_threestack_ch6_init },
14600
/* Set mic1 as input and unmute the mixer */
14601
static struct hda_verb alc861_uniwill_m31_ch2_init[] = {
14602
{ 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
14603
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x01 << 8)) }, /*mic*/
14606
/* Set mic1 as output and mute mixer */
14607
static struct hda_verb alc861_uniwill_m31_ch4_init[] = {
14608
{ 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
14609
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8)) }, /*mic*/
14613
static struct hda_channel_mode alc861_uniwill_m31_modes[2] = {
14614
{ 2, alc861_uniwill_m31_ch2_init },
14615
{ 4, alc861_uniwill_m31_ch4_init },
14618
/* Set mic1 and line-in as input and unmute the mixer */
14619
static struct hda_verb alc861_asus_ch2_init[] = {
14620
/* set pin widget 1Ah (line in) for input */
14621
{ 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20 },
14622
/* set pin widget 18h (mic1/2) for input, for mic also enable
14625
{ 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
14627
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb00c },
14629
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8)) }, /*mic*/
14630
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x02 << 8)) }, /*line-in*/
14634
/* Set mic1 nad line-in as output and mute mixer */
14635
static struct hda_verb alc861_asus_ch6_init[] = {
14636
/* set pin widget 1Ah (line in) for output (Back Surround)*/
14637
{ 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
14638
/* { 0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, */
14639
/* set pin widget 18h (mic1) for output (CLFE)*/
14640
{ 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
14641
/* { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE }, */
14642
{ 0x0c, AC_VERB_SET_CONNECT_SEL, 0x00 },
14643
{ 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00 },
14645
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080 },
14647
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x01 << 8)) }, /*mic*/
14648
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x02 << 8)) }, /*line in*/
14653
static struct hda_channel_mode alc861_asus_modes[2] = {
14654
{ 2, alc861_asus_ch2_init },
14655
{ 6, alc861_asus_ch6_init },
14660
static struct snd_kcontrol_new alc861_base_mixer[] = {
14661
/* output mixer control */
14662
HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT),
14663
HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT),
14664
HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT),
14665
HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT),
14666
HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT),
14668
/*Input mixer control */
14669
/* HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT),
14670
HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT), */
14671
HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT),
14672
HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT),
14673
HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT),
14674
HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT),
14675
HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT),
14676
HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT),
14677
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT),
14678
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT),
14683
static struct snd_kcontrol_new alc861_3ST_mixer[] = {
14684
/* output mixer control */
14685
HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT),
14686
HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT),
14687
HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT),
14688
HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT),
14689
/*HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT), */
14691
/* Input mixer control */
14692
/* HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT),
14693
HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT), */
14694
HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT),
14695
HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT),
14696
HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT),
14697
HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT),
14698
HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT),
14699
HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT),
14700
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT),
14701
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT),
14704
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
14705
.name = "Channel Mode",
14706
.info = alc_ch_mode_info,
14707
.get = alc_ch_mode_get,
14708
.put = alc_ch_mode_put,
14709
.private_value = ARRAY_SIZE(alc861_threestack_modes),
14714
static struct snd_kcontrol_new alc861_toshiba_mixer[] = {
14715
/* output mixer control */
14716
HDA_CODEC_MUTE("Master Playback Switch", 0x03, 0x0, HDA_OUTPUT),
14717
HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT),
14718
HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT),
14723
static struct snd_kcontrol_new alc861_uniwill_m31_mixer[] = {
14724
/* output mixer control */
14725
HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT),
14726
HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT),
14727
HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT),
14728
HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT),
14729
/*HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT), */
14731
/* Input mixer control */
14732
/* HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT),
14733
HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT), */
14734
HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT),
14735
HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT),
14736
HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT),
14737
HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT),
14738
HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT),
14739
HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT),
14740
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT),
14741
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_INPUT),
14744
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
14745
.name = "Channel Mode",
14746
.info = alc_ch_mode_info,
14747
.get = alc_ch_mode_get,
14748
.put = alc_ch_mode_put,
14749
.private_value = ARRAY_SIZE(alc861_uniwill_m31_modes),
14754
static struct snd_kcontrol_new alc861_asus_mixer[] = {
14755
/* output mixer control */
14756
HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT),
14757
HDA_CODEC_MUTE("Surround Playback Switch", 0x06, 0x0, HDA_OUTPUT),
14758
HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x05, 1, 0x0, HDA_OUTPUT),
14759
HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x05, 2, 0x0, HDA_OUTPUT),
14760
HDA_CODEC_MUTE("Side Playback Switch", 0x04, 0x0, HDA_OUTPUT),
14762
/* Input mixer control */
14763
HDA_CODEC_VOLUME("Input Playback Volume", 0x15, 0x0, HDA_OUTPUT),
14764
HDA_CODEC_MUTE("Input Playback Switch", 0x15, 0x0, HDA_OUTPUT),
14765
HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT),
14766
HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT),
14767
HDA_CODEC_VOLUME("Line Playback Volume", 0x15, 0x02, HDA_INPUT),
14768
HDA_CODEC_MUTE("Line Playback Switch", 0x15, 0x02, HDA_INPUT),
14769
HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT),
14770
HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT),
14771
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x10, 0x01, HDA_OUTPUT),
14772
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x03, HDA_OUTPUT),
14775
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
14776
.name = "Channel Mode",
14777
.info = alc_ch_mode_info,
14778
.get = alc_ch_mode_get,
14779
.put = alc_ch_mode_put,
14780
.private_value = ARRAY_SIZE(alc861_asus_modes),
14785
/* additional mixer */
14786
static struct snd_kcontrol_new alc861_asus_laptop_mixer[] = {
14787
HDA_CODEC_VOLUME("CD Playback Volume", 0x15, 0x0, HDA_INPUT),
14788
HDA_CODEC_MUTE("CD Playback Switch", 0x15, 0x0, HDA_INPUT),
14793
* generic initialization of ADC, input mixers and output mixers
14795
static struct hda_verb alc861_base_init_verbs[] = {
14797
* Unmute ADC0 and set the default input to mic-in
14799
/* port-A for surround (rear panel) */
14800
{ 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
14801
{ 0x0e, AC_VERB_SET_CONNECT_SEL, 0x00 },
14802
/* port-B for mic-in (rear panel) with vref */
14803
{ 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
14804
/* port-C for line-in (rear panel) */
14805
{ 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20 },
14806
/* port-D for Front */
14807
{ 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
14808
{ 0x0b, AC_VERB_SET_CONNECT_SEL, 0x00 },
14809
/* port-E for HP out (front panel) */
14810
{ 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
14811
/* route front PCM to HP */
14812
{ 0x0f, AC_VERB_SET_CONNECT_SEL, 0x00 },
14813
/* port-F for mic-in (front panel) with vref */
14814
{ 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
14815
/* port-G for CLFE (rear panel) */
14816
{ 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
14817
{ 0x1f, AC_VERB_SET_CONNECT_SEL, 0x00 },
14818
/* port-H for side (rear panel) */
14819
{ 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
14820
{ 0x20, AC_VERB_SET_CONNECT_SEL, 0x00 },
14822
{ 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20 },
14823
/* route front mic to ADC1*/
14824
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
14825
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14827
/* Unmute DAC0~3 & spdif out*/
14828
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14829
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14830
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14831
{0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14832
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14834
/* Unmute Mixer 14 (mic) 1c (Line in)*/
14835
{0x014, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14836
{0x014, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14837
{0x01c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14838
{0x01c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14840
/* Unmute Stereo Mixer 15 */
14841
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14842
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14843
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
14844
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb00c}, /* Output 0~12 step */
14846
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14847
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14848
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14849
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14850
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14851
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14852
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14853
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14854
/* hp used DAC 3 (Front) */
14855
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)},
14856
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
14861
static struct hda_verb alc861_threestack_init_verbs[] = {
14863
* Unmute ADC0 and set the default input to mic-in
14865
/* port-A for surround (rear panel) */
14866
{ 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
14867
/* port-B for mic-in (rear panel) with vref */
14868
{ 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
14869
/* port-C for line-in (rear panel) */
14870
{ 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20 },
14871
/* port-D for Front */
14872
{ 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
14873
{ 0x0b, AC_VERB_SET_CONNECT_SEL, 0x00 },
14874
/* port-E for HP out (front panel) */
14875
{ 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
14876
/* route front PCM to HP */
14877
{ 0x0f, AC_VERB_SET_CONNECT_SEL, 0x00 },
14878
/* port-F for mic-in (front panel) with vref */
14879
{ 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
14880
/* port-G for CLFE (rear panel) */
14881
{ 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
14882
/* port-H for side (rear panel) */
14883
{ 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
14885
{ 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20 },
14886
/* route front mic to ADC1*/
14887
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
14888
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14889
/* Unmute DAC0~3 & spdif out*/
14890
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14891
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14892
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14893
{0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14894
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14896
/* Unmute Mixer 14 (mic) 1c (Line in)*/
14897
{0x014, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14898
{0x014, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14899
{0x01c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14900
{0x01c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14902
/* Unmute Stereo Mixer 15 */
14903
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14904
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14905
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
14906
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb00c}, /* Output 0~12 step */
14908
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14909
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14910
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14911
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14912
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14913
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14914
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14915
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14916
/* hp used DAC 3 (Front) */
14917
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)},
14918
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
14922
static struct hda_verb alc861_uniwill_m31_init_verbs[] = {
14924
* Unmute ADC0 and set the default input to mic-in
14926
/* port-A for surround (rear panel) */
14927
{ 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
14928
/* port-B for mic-in (rear panel) with vref */
14929
{ 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
14930
/* port-C for line-in (rear panel) */
14931
{ 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20 },
14932
/* port-D for Front */
14933
{ 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
14934
{ 0x0b, AC_VERB_SET_CONNECT_SEL, 0x00 },
14935
/* port-E for HP out (front panel) */
14936
/* this has to be set to VREF80 */
14937
{ 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
14938
/* route front PCM to HP */
14939
{ 0x0f, AC_VERB_SET_CONNECT_SEL, 0x00 },
14940
/* port-F for mic-in (front panel) with vref */
14941
{ 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
14942
/* port-G for CLFE (rear panel) */
14943
{ 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
14944
/* port-H for side (rear panel) */
14945
{ 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
14947
{ 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20 },
14948
/* route front mic to ADC1*/
14949
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
14950
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14951
/* Unmute DAC0~3 & spdif out*/
14952
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14953
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14954
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14955
{0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14956
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
14958
/* Unmute Mixer 14 (mic) 1c (Line in)*/
14959
{0x014, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14960
{0x014, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14961
{0x01c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14962
{0x01c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14964
/* Unmute Stereo Mixer 15 */
14965
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14966
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14967
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
14968
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb00c}, /* Output 0~12 step */
14970
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14971
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14972
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14973
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14974
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14975
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14976
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
14977
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
14978
/* hp used DAC 3 (Front) */
14979
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)},
14980
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
14984
static struct hda_verb alc861_asus_init_verbs[] = {
14986
* Unmute ADC0 and set the default input to mic-in
14988
/* port-A for surround (rear panel)
14989
* according to codec#0 this is the HP jack
14991
{ 0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, /* was 0x00 */
14992
/* route front PCM to HP */
14993
{ 0x0e, AC_VERB_SET_CONNECT_SEL, 0x01 },
14994
/* port-B for mic-in (rear panel) with vref */
14995
{ 0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
14996
/* port-C for line-in (rear panel) */
14997
{ 0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20 },
14998
/* port-D for Front */
14999
{ 0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
15000
{ 0x0b, AC_VERB_SET_CONNECT_SEL, 0x00 },
15001
/* port-E for HP out (front panel) */
15002
/* this has to be set to VREF80 */
15003
{ 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
15004
/* route front PCM to HP */
15005
{ 0x0f, AC_VERB_SET_CONNECT_SEL, 0x00 },
15006
/* port-F for mic-in (front panel) with vref */
15007
{ 0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
15008
/* port-G for CLFE (rear panel) */
15009
{ 0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
15010
/* port-H for side (rear panel) */
15011
{ 0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40 },
15013
{ 0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20 },
15014
/* route front mic to ADC1*/
15015
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
15016
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
15017
/* Unmute DAC0~3 & spdif out*/
15018
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
15019
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
15020
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
15021
{0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
15022
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
15023
/* Unmute Mixer 14 (mic) 1c (Line in)*/
15024
{0x014, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
15025
{0x014, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
15026
{0x01c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
15027
{0x01c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
15029
/* Unmute Stereo Mixer 15 */
15030
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
15031
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
15032
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
15033
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb00c}, /* Output 0~12 step */
15035
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
15036
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
15037
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
15038
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
15039
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
15040
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
15041
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
15042
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
15043
/* hp used DAC 3 (Front) */
15044
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)},
15045
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
15049
/* additional init verbs for ASUS laptops */
15050
static struct hda_verb alc861_asus_laptop_init_verbs[] = {
15051
{ 0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x45 }, /* HP-out */
15052
{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2) }, /* mute line-in */
15057
* generic initialization of ADC, input mixers and output mixers
15059
static struct hda_verb alc861_auto_init_verbs[] = {
15061
* Unmute ADC0 and set the default input to mic-in
15063
/* {0x08, AC_VERB_SET_CONNECT_SEL, 0x00}, */
15064
{0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
15066
/* Unmute DAC0~3 & spdif out*/
15067
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
15068
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
15069
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
15070
{0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
15071
{0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
15073
/* Unmute Mixer 14 (mic) 1c (Line in)*/
15074
{0x014, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
15075
{0x014, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
15076
{0x01c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
15077
{0x01c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
15079
/* Unmute Stereo Mixer 15 */
15080
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
15081
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
15082
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
15083
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb00c},
15085
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
15086
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
15087
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
15088
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
15089
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
15090
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
15091
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
15092
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
15094
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
15095
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
15096
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
15097
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
15098
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
15099
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
15100
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
15101
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
15103
{0x08, AC_VERB_SET_CONNECT_SEL, 0x00}, /* set Mic 1 */
15108
static struct hda_verb alc861_toshiba_init_verbs[] = {
15109
{0x0f, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
15114
/* toggle speaker-output according to the hp-jack state */
15115
static void alc861_toshiba_automute(struct hda_codec *codec)
15117
unsigned int present = snd_hda_jack_detect(codec, 0x0f);
15119
snd_hda_codec_amp_stereo(codec, 0x16, HDA_INPUT, 0,
15120
HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
15121
snd_hda_codec_amp_stereo(codec, 0x1a, HDA_INPUT, 3,
15122
HDA_AMP_MUTE, present ? 0 : HDA_AMP_MUTE);
15125
static void alc861_toshiba_unsol_event(struct hda_codec *codec,
15128
if ((res >> 26) == ALC880_HP_EVENT)
15129
alc861_toshiba_automute(codec);
15132
/* pcm configuration: identical with ALC880 */
15133
#define alc861_pcm_analog_playback alc880_pcm_analog_playback
15134
#define alc861_pcm_analog_capture alc880_pcm_analog_capture
15135
#define alc861_pcm_digital_playback alc880_pcm_digital_playback
15136
#define alc861_pcm_digital_capture alc880_pcm_digital_capture
15139
#define ALC861_DIGOUT_NID 0x07
15141
static struct hda_channel_mode alc861_8ch_modes[1] = {
15145
static hda_nid_t alc861_dac_nids[4] = {
15146
/* front, surround, clfe, side */
15147
0x03, 0x06, 0x05, 0x04
15150
static hda_nid_t alc660_dac_nids[3] = {
15151
/* front, clfe, surround */
15155
static hda_nid_t alc861_adc_nids[1] = {
15160
static struct hda_input_mux alc861_capture_source = {
15164
{ "Front Mic", 0x3 },
15171
static hda_nid_t alc861_look_for_dac(struct hda_codec *codec, hda_nid_t pin)
15173
struct alc_spec *spec = codec->spec;
15174
hda_nid_t mix, srcs[5];
15177
if (snd_hda_get_connections(codec, pin, &mix, 1) != 1)
15179
num = snd_hda_get_connections(codec, mix, srcs, ARRAY_SIZE(srcs));
15182
for (i = 0; i < num; i++) {
15184
type = get_wcaps_type(get_wcaps(codec, srcs[i]));
15185
if (type != AC_WID_AUD_OUT)
15187
for (j = 0; j < spec->multiout.num_dacs; j++)
15188
if (spec->multiout.dac_nids[j] == srcs[i])
15190
if (j >= spec->multiout.num_dacs)
15196
/* fill in the dac_nids table from the parsed pin configuration */
15197
static int alc861_auto_fill_dac_nids(struct hda_codec *codec,
15198
const struct auto_pin_cfg *cfg)
15200
struct alc_spec *spec = codec->spec;
15202
hda_nid_t nid, dac;
15204
spec->multiout.dac_nids = spec->private_dac_nids;
15205
for (i = 0; i < cfg->line_outs; i++) {
15206
nid = cfg->line_out_pins[i];
15207
dac = alc861_look_for_dac(codec, nid);
15210
spec->multiout.dac_nids[spec->multiout.num_dacs++] = dac;
15215
static int alc861_create_out_sw(struct hda_codec *codec, const char *pfx,
15216
hda_nid_t nid, unsigned int chs)
15218
return add_pb_sw_ctrl(codec->spec, ALC_CTL_WIDGET_MUTE, pfx,
15219
HDA_COMPOSE_AMP_VAL(nid, chs, 0, HDA_OUTPUT));
15222
/* add playback controls from the parsed DAC table */
15223
static int alc861_auto_create_multi_out_ctls(struct hda_codec *codec,
15224
const struct auto_pin_cfg *cfg)
15226
struct alc_spec *spec = codec->spec;
15227
static const char *chname[4] = {
15228
"Front", "Surround", NULL /*CLFE*/, "Side"
15233
if (cfg->line_outs == 1) {
15234
const char *pfx = NULL;
15237
else if (cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)
15240
nid = spec->multiout.dac_nids[0];
15241
return alc861_create_out_sw(codec, pfx, nid, 3);
15245
for (i = 0; i < cfg->line_outs; i++) {
15246
nid = spec->multiout.dac_nids[i];
15251
err = alc861_create_out_sw(codec, "Center", nid, 1);
15254
err = alc861_create_out_sw(codec, "LFE", nid, 2);
15258
err = alc861_create_out_sw(codec, chname[i], nid, 3);
15266
static int alc861_auto_create_hp_ctls(struct hda_codec *codec, hda_nid_t pin)
15268
struct alc_spec *spec = codec->spec;
15275
if ((pin >= 0x0b && pin <= 0x10) || pin == 0x1f || pin == 0x20) {
15276
nid = alc861_look_for_dac(codec, pin);
15278
err = alc861_create_out_sw(codec, "Headphone", nid, 3);
15281
spec->multiout.hp_nid = nid;
15287
/* create playback/capture controls for input pins */
15288
static int alc861_auto_create_input_ctls(struct hda_codec *codec,
15289
const struct auto_pin_cfg *cfg)
15291
return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x08, 0);
15294
static void alc861_auto_set_output_and_unmute(struct hda_codec *codec,
15296
int pin_type, hda_nid_t dac)
15298
hda_nid_t mix, srcs[5];
15301
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
15303
snd_hda_codec_write(codec, dac, 0, AC_VERB_SET_AMP_GAIN_MUTE,
15305
if (snd_hda_get_connections(codec, nid, &mix, 1) != 1)
15307
num = snd_hda_get_connections(codec, mix, srcs, ARRAY_SIZE(srcs));
15310
for (i = 0; i < num; i++) {
15312
if (srcs[i] == dac || srcs[i] == 0x15)
15313
mute = AMP_IN_UNMUTE(i);
15315
mute = AMP_IN_MUTE(i);
15316
snd_hda_codec_write(codec, mix, 0, AC_VERB_SET_AMP_GAIN_MUTE,
15321
static void alc861_auto_init_multi_out(struct hda_codec *codec)
15323
struct alc_spec *spec = codec->spec;
15326
for (i = 0; i < spec->autocfg.line_outs; i++) {
15327
hda_nid_t nid = spec->autocfg.line_out_pins[i];
15328
int pin_type = get_pin_type(spec->autocfg.line_out_type);
15330
alc861_auto_set_output_and_unmute(codec, nid, pin_type,
15331
spec->multiout.dac_nids[i]);
15335
static void alc861_auto_init_hp_out(struct hda_codec *codec)
15337
struct alc_spec *spec = codec->spec;
15339
if (spec->autocfg.hp_outs)
15340
alc861_auto_set_output_and_unmute(codec,
15341
spec->autocfg.hp_pins[0],
15343
spec->multiout.hp_nid);
15344
if (spec->autocfg.speaker_outs)
15345
alc861_auto_set_output_and_unmute(codec,
15346
spec->autocfg.speaker_pins[0],
15348
spec->multiout.dac_nids[0]);
15351
static void alc861_auto_init_analog_input(struct hda_codec *codec)
15353
struct alc_spec *spec = codec->spec;
15356
for (i = 0; i < AUTO_PIN_LAST; i++) {
15357
hda_nid_t nid = spec->autocfg.input_pins[i];
15358
if (nid >= 0x0c && nid <= 0x11)
15359
alc_set_input_pin(codec, nid, i);
15363
/* parse the BIOS configuration and set up the alc_spec */
15364
/* return 1 if successful, 0 if the proper config is not found,
15365
* or a negative error code
15367
static int alc861_parse_auto_config(struct hda_codec *codec)
15369
struct alc_spec *spec = codec->spec;
15371
static hda_nid_t alc861_ignore[] = { 0x1d, 0 };
15373
err = snd_hda_parse_pin_def_config(codec, &spec->autocfg,
15377
if (!spec->autocfg.line_outs)
15378
return 0; /* can't find valid BIOS pin config */
15380
err = alc861_auto_fill_dac_nids(codec, &spec->autocfg);
15383
err = alc861_auto_create_multi_out_ctls(codec, &spec->autocfg);
15386
err = alc861_auto_create_hp_ctls(codec, spec->autocfg.hp_pins[0]);
15389
err = alc861_auto_create_input_ctls(codec, &spec->autocfg);
15393
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
15395
if (spec->autocfg.dig_outs)
15396
spec->multiout.dig_out_nid = ALC861_DIGOUT_NID;
15398
if (spec->kctls.list)
15399
add_mixer(spec, spec->kctls.list);
15401
add_verb(spec, alc861_auto_init_verbs);
15403
spec->num_mux_defs = 1;
15404
spec->input_mux = &spec->private_imux[0];
15406
spec->adc_nids = alc861_adc_nids;
15407
spec->num_adc_nids = ARRAY_SIZE(alc861_adc_nids);
15408
set_capture_mixer(codec);
15410
alc_ssid_check(codec, 0x0e, 0x0f, 0x0b, 0);
15415
/* additional initialization for auto-configuration model */
15416
static void alc861_auto_init(struct hda_codec *codec)
15418
struct alc_spec *spec = codec->spec;
15419
alc861_auto_init_multi_out(codec);
15420
alc861_auto_init_hp_out(codec);
15421
alc861_auto_init_analog_input(codec);
15422
if (spec->unsol_event)
15423
alc_inithook(codec);
15426
#ifdef CONFIG_SND_HDA_POWER_SAVE
15427
static struct hda_amp_list alc861_loopbacks[] = {
15428
{ 0x15, HDA_INPUT, 0 },
15429
{ 0x15, HDA_INPUT, 1 },
15430
{ 0x15, HDA_INPUT, 2 },
15431
{ 0x15, HDA_INPUT, 3 },
15438
* configuration and preset
15440
static const char *alc861_models[ALC861_MODEL_LAST] = {
15441
[ALC861_3ST] = "3stack",
15442
[ALC660_3ST] = "3stack-660",
15443
[ALC861_3ST_DIG] = "3stack-dig",
15444
[ALC861_6ST_DIG] = "6stack-dig",
15445
[ALC861_UNIWILL_M31] = "uniwill-m31",
15446
[ALC861_TOSHIBA] = "toshiba",
15447
[ALC861_ASUS] = "asus",
15448
[ALC861_ASUS_LAPTOP] = "asus-laptop",
15449
[ALC861_AUTO] = "auto",
15452
static struct snd_pci_quirk alc861_cfg_tbl[] = {
15453
SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC861_3ST),
15454
SND_PCI_QUIRK(0x1043, 0x1335, "ASUS F2/3", ALC861_ASUS_LAPTOP),
15455
SND_PCI_QUIRK(0x1043, 0x1338, "ASUS F2/3", ALC861_ASUS_LAPTOP),
15456
SND_PCI_QUIRK(0x1043, 0x1393, "ASUS", ALC861_ASUS),
15457
SND_PCI_QUIRK(0x1043, 0x13d7, "ASUS A9rp", ALC861_ASUS_LAPTOP),
15458
SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS P1-AH2", ALC861_3ST_DIG),
15459
SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba", ALC861_TOSHIBA),
15460
/* FIXME: the entry below breaks Toshiba A100 (model=auto works!)
15461
* Any other models that need this preset?
15463
/* SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba", ALC861_TOSHIBA), */
15464
SND_PCI_QUIRK(0x1462, 0x7254, "HP dx2200 (MSI MS-7254)", ALC861_3ST),
15465
SND_PCI_QUIRK(0x1462, 0x7297, "HP dx2250 (MSI MS-7297)", ALC861_3ST),
15466
SND_PCI_QUIRK(0x1584, 0x2b01, "Uniwill X40AIx", ALC861_UNIWILL_M31),
15467
SND_PCI_QUIRK(0x1584, 0x9072, "Uniwill m31", ALC861_UNIWILL_M31),
15468
SND_PCI_QUIRK(0x1584, 0x9075, "Airis Praxis N1212", ALC861_ASUS_LAPTOP),
15469
/* FIXME: the below seems conflict */
15470
/* SND_PCI_QUIRK(0x1584, 0x9075, "Uniwill", ALC861_UNIWILL_M31), */
15471
SND_PCI_QUIRK(0x1849, 0x0660, "Asrock 939SLI32", ALC660_3ST),
15472
SND_PCI_QUIRK(0x8086, 0xd600, "Intel", ALC861_3ST),
15476
static struct alc_config_preset alc861_presets[] = {
15478
.mixers = { alc861_3ST_mixer },
15479
.init_verbs = { alc861_threestack_init_verbs },
15480
.num_dacs = ARRAY_SIZE(alc861_dac_nids),
15481
.dac_nids = alc861_dac_nids,
15482
.num_channel_mode = ARRAY_SIZE(alc861_threestack_modes),
15483
.channel_mode = alc861_threestack_modes,
15485
.num_adc_nids = ARRAY_SIZE(alc861_adc_nids),
15486
.adc_nids = alc861_adc_nids,
15487
.input_mux = &alc861_capture_source,
15489
[ALC861_3ST_DIG] = {
15490
.mixers = { alc861_base_mixer },
15491
.init_verbs = { alc861_threestack_init_verbs },
15492
.num_dacs = ARRAY_SIZE(alc861_dac_nids),
15493
.dac_nids = alc861_dac_nids,
15494
.dig_out_nid = ALC861_DIGOUT_NID,
15495
.num_channel_mode = ARRAY_SIZE(alc861_threestack_modes),
15496
.channel_mode = alc861_threestack_modes,
15498
.num_adc_nids = ARRAY_SIZE(alc861_adc_nids),
15499
.adc_nids = alc861_adc_nids,
15500
.input_mux = &alc861_capture_source,
15502
[ALC861_6ST_DIG] = {
15503
.mixers = { alc861_base_mixer },
15504
.init_verbs = { alc861_base_init_verbs },
15505
.num_dacs = ARRAY_SIZE(alc861_dac_nids),
15506
.dac_nids = alc861_dac_nids,
15507
.dig_out_nid = ALC861_DIGOUT_NID,
15508
.num_channel_mode = ARRAY_SIZE(alc861_8ch_modes),
15509
.channel_mode = alc861_8ch_modes,
15510
.num_adc_nids = ARRAY_SIZE(alc861_adc_nids),
15511
.adc_nids = alc861_adc_nids,
15512
.input_mux = &alc861_capture_source,
15515
.mixers = { alc861_3ST_mixer },
15516
.init_verbs = { alc861_threestack_init_verbs },
15517
.num_dacs = ARRAY_SIZE(alc660_dac_nids),
15518
.dac_nids = alc660_dac_nids,
15519
.num_channel_mode = ARRAY_SIZE(alc861_threestack_modes),
15520
.channel_mode = alc861_threestack_modes,
15522
.num_adc_nids = ARRAY_SIZE(alc861_adc_nids),
15523
.adc_nids = alc861_adc_nids,
15524
.input_mux = &alc861_capture_source,
15526
[ALC861_UNIWILL_M31] = {
15527
.mixers = { alc861_uniwill_m31_mixer },
15528
.init_verbs = { alc861_uniwill_m31_init_verbs },
15529
.num_dacs = ARRAY_SIZE(alc861_dac_nids),
15530
.dac_nids = alc861_dac_nids,
15531
.dig_out_nid = ALC861_DIGOUT_NID,
15532
.num_channel_mode = ARRAY_SIZE(alc861_uniwill_m31_modes),
15533
.channel_mode = alc861_uniwill_m31_modes,
15535
.num_adc_nids = ARRAY_SIZE(alc861_adc_nids),
15536
.adc_nids = alc861_adc_nids,
15537
.input_mux = &alc861_capture_source,
15539
[ALC861_TOSHIBA] = {
15540
.mixers = { alc861_toshiba_mixer },
15541
.init_verbs = { alc861_base_init_verbs,
15542
alc861_toshiba_init_verbs },
15543
.num_dacs = ARRAY_SIZE(alc861_dac_nids),
15544
.dac_nids = alc861_dac_nids,
15545
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
15546
.channel_mode = alc883_3ST_2ch_modes,
15547
.num_adc_nids = ARRAY_SIZE(alc861_adc_nids),
15548
.adc_nids = alc861_adc_nids,
15549
.input_mux = &alc861_capture_source,
15550
.unsol_event = alc861_toshiba_unsol_event,
15551
.init_hook = alc861_toshiba_automute,
15554
.mixers = { alc861_asus_mixer },
15555
.init_verbs = { alc861_asus_init_verbs },
15556
.num_dacs = ARRAY_SIZE(alc861_dac_nids),
15557
.dac_nids = alc861_dac_nids,
15558
.dig_out_nid = ALC861_DIGOUT_NID,
15559
.num_channel_mode = ARRAY_SIZE(alc861_asus_modes),
15560
.channel_mode = alc861_asus_modes,
15563
.num_adc_nids = ARRAY_SIZE(alc861_adc_nids),
15564
.adc_nids = alc861_adc_nids,
15565
.input_mux = &alc861_capture_source,
15567
[ALC861_ASUS_LAPTOP] = {
15568
.mixers = { alc861_toshiba_mixer, alc861_asus_laptop_mixer },
15569
.init_verbs = { alc861_asus_init_verbs,
15570
alc861_asus_laptop_init_verbs },
15571
.num_dacs = ARRAY_SIZE(alc861_dac_nids),
15572
.dac_nids = alc861_dac_nids,
15573
.dig_out_nid = ALC861_DIGOUT_NID,
15574
.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
15575
.channel_mode = alc883_3ST_2ch_modes,
15577
.num_adc_nids = ARRAY_SIZE(alc861_adc_nids),
15578
.adc_nids = alc861_adc_nids,
15579
.input_mux = &alc861_capture_source,
15583
/* Pin config fixes */
15585
PINFIX_FSC_AMILO_PI1505,
15588
static struct alc_pincfg alc861_fsc_amilo_pi1505_pinfix[] = {
15589
{ 0x0b, 0x0221101f }, /* HP */
15590
{ 0x0f, 0x90170310 }, /* speaker */
15594
static const struct alc_fixup alc861_fixups[] = {
15595
[PINFIX_FSC_AMILO_PI1505] = {
15596
.pins = alc861_fsc_amilo_pi1505_pinfix
15600
static struct snd_pci_quirk alc861_fixup_tbl[] = {
15601
SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", PINFIX_FSC_AMILO_PI1505),
15605
static int patch_alc861(struct hda_codec *codec)
15607
struct alc_spec *spec;
15611
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
15615
codec->spec = spec;
15617
board_config = snd_hda_check_board_config(codec, ALC861_MODEL_LAST,
15621
if (board_config < 0) {
15622
printk(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n",
15624
board_config = ALC861_AUTO;
15627
if (board_config == ALC861_AUTO)
15628
alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 1);
15630
if (board_config == ALC861_AUTO) {
15631
/* automatic parse from the BIOS config */
15632
err = alc861_parse_auto_config(codec);
15638
"hda_codec: Cannot set up configuration "
15639
"from BIOS. Using base mode...\n");
15640
board_config = ALC861_3ST_DIG;
15644
err = snd_hda_attach_beep_device(codec, 0x23);
15650
if (board_config != ALC861_AUTO)
15651
setup_preset(codec, &alc861_presets[board_config]);
15653
spec->stream_analog_playback = &alc861_pcm_analog_playback;
15654
spec->stream_analog_capture = &alc861_pcm_analog_capture;
15656
spec->stream_digital_playback = &alc861_pcm_digital_playback;
15657
spec->stream_digital_capture = &alc861_pcm_digital_capture;
15659
if (!spec->cap_mixer)
15660
set_capture_mixer(codec);
15661
set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
15663
spec->vmaster_nid = 0x03;
15665
if (board_config == ALC861_AUTO)
15666
alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 0);
15668
codec->patch_ops = alc_patch_ops;
15669
if (board_config == ALC861_AUTO) {
15670
spec->init_hook = alc861_auto_init;
15671
#ifdef CONFIG_SND_HDA_POWER_SAVE
15672
spec->power_hook = alc_power_eapd;
15675
#ifdef CONFIG_SND_HDA_POWER_SAVE
15676
if (!spec->loopback.amplist)
15677
spec->loopback.amplist = alc861_loopbacks;
15684
* ALC861-VD support
15688
* In addition, an independent DAC
15690
#define ALC861VD_DIGOUT_NID 0x06
15692
static hda_nid_t alc861vd_dac_nids[4] = {
15693
/* front, surr, clfe, side surr */
15694
0x02, 0x03, 0x04, 0x05
15697
/* dac_nids for ALC660vd are in a different order - according to
15698
* Realtek's driver.
15699
* This should probably result in a different mixer for 6stack models
15700
* of ALC660vd codecs, but for now there is only 3stack mixer
15701
* - and it is the same as in 861vd.
15702
* adc_nids in ALC660vd are (is) the same as in 861vd
15704
static hda_nid_t alc660vd_dac_nids[3] = {
15705
/* front, rear, clfe, rear_surr */
15709
static hda_nid_t alc861vd_adc_nids[1] = {
15714
static hda_nid_t alc861vd_capsrc_nids[1] = { 0x22 };
15717
/* FIXME: should be a matrix-type input source selection */
15718
static struct hda_input_mux alc861vd_capture_source = {
15722
{ "Front Mic", 0x1 },
15728
static struct hda_input_mux alc861vd_dallas_capture_source = {
15731
{ "Ext Mic", 0x0 },
15732
{ "Int Mic", 0x1 },
15736
static struct hda_input_mux alc861vd_hp_capture_source = {
15739
{ "Front Mic", 0x0 },
15740
{ "ATAPI Mic", 0x1 },
15747
static struct hda_channel_mode alc861vd_3stack_2ch_modes[1] = {
15754
static struct hda_verb alc861vd_6stack_ch6_init[] = {
15755
{ 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
15756
{ 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
15757
{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
15758
{ 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
15765
static struct hda_verb alc861vd_6stack_ch8_init[] = {
15766
{ 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
15767
{ 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
15768
{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
15769
{ 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
15773
static struct hda_channel_mode alc861vd_6stack_modes[2] = {
15774
{ 6, alc861vd_6stack_ch6_init },
15775
{ 8, alc861vd_6stack_ch8_init },
15778
static struct snd_kcontrol_new alc861vd_chmode_mixer[] = {
15780
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
15781
.name = "Channel Mode",
15782
.info = alc_ch_mode_info,
15783
.get = alc_ch_mode_get,
15784
.put = alc_ch_mode_put,
15789
/* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
15790
* Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
15792
static struct snd_kcontrol_new alc861vd_6st_mixer[] = {
15793
HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT),
15794
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
15796
HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT),
15797
HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
15799
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0,
15801
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0,
15803
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
15804
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
15806
HDA_CODEC_VOLUME("Side Playback Volume", 0x05, 0x0, HDA_OUTPUT),
15807
HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
15809
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
15811
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
15812
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
15813
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
15815
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
15816
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
15817
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
15819
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
15820
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
15822
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
15823
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
15828
static struct snd_kcontrol_new alc861vd_3st_mixer[] = {
15829
HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT),
15830
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
15832
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
15834
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
15835
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
15836
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
15838
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
15839
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
15840
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
15842
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
15843
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
15845
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
15846
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
15851
static struct snd_kcontrol_new alc861vd_lenovo_mixer[] = {
15852
HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT),
15853
/*HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),*/
15854
HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT),
15856
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
15858
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
15859
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
15860
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
15862
HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
15863
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
15864
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
15866
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
15867
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
15872
/* Pin assignment: Speaker=0x14, HP = 0x15,
15873
* Ext Mic=0x18, Int Mic = 0x19, CD = 0x1c, PC Beep = 0x1d
15875
static struct snd_kcontrol_new alc861vd_dallas_mixer[] = {
15876
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT),
15877
HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 2, HDA_INPUT),
15878
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
15879
HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT),
15880
HDA_CODEC_VOLUME("Ext Mic Boost", 0x18, 0, HDA_INPUT),
15881
HDA_CODEC_VOLUME("Ext Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
15882
HDA_CODEC_MUTE("Ext Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
15883
HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT),
15884
HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
15885
HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
15889
/* Pin assignment: Speaker=0x14, Line-out = 0x15,
15890
* Front Mic=0x18, ATAPI Mic = 0x19,
15892
static struct snd_kcontrol_new alc861vd_hp_mixer[] = {
15893
HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT),
15894
HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
15895
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
15896
HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT),
15897
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
15898
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
15899
HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
15900
HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
15906
* generic initialization of ADC, input mixers and output mixers
15908
static struct hda_verb alc861vd_volume_init_verbs[] = {
15910
* Unmute ADC0 and set the default input to mic-in
15912
{0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
15913
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
15915
/* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of
15916
* the analog-loopback mixer widget
15918
/* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
15919
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
15920
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
15921
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
15922
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
15923
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
15925
/* Capture mixer: unmute Mic, F-Mic, Line, CD inputs */
15926
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
15927
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
15928
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
15929
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)},
15932
* Set up output mixers (0x02 - 0x05)
15934
/* set vol=0 to output mixers */
15935
{0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
15936
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
15937
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
15938
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
15940
/* set up input amps for analog loopback */
15941
/* Amp Indices: DAC = 0, mixer = 1 */
15942
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
15943
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
15944
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
15945
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
15946
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
15947
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
15948
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
15949
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
15955
* 3-stack pin configuration:
15956
* front = 0x14, mic/clfe = 0x18, HP = 0x19, line/surr = 0x1a, f-mic = 0x1b
15958
static struct hda_verb alc861vd_3stack_init_verbs[] = {
15960
* Set pin mode and muting
15962
/* set front pin widgets 0x14 for output */
15963
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
15964
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
15965
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
15967
/* Mic (rear) pin: input vref at 80% */
15968
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
15969
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
15970
/* Front Mic pin: input vref at 80% */
15971
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
15972
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
15973
/* Line In pin: input */
15974
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
15975
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
15976
/* Line-2 In: Headphone output (output 0 - 0x0c) */
15977
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
15978
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
15979
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
15980
/* CD pin widget for input */
15981
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
15987
* 6-stack pin configuration:
15989
static struct hda_verb alc861vd_6stack_init_verbs[] = {
15991
* Set pin mode and muting
15993
/* set front pin widgets 0x14 for output */
15994
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
15995
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
15996
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
15998
/* Rear Pin: output 1 (0x0d) */
15999
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
16000
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16001
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
16002
/* CLFE Pin: output 2 (0x0e) */
16003
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
16004
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16005
{0x16, AC_VERB_SET_CONNECT_SEL, 0x02},
16006
/* Side Pin: output 3 (0x0f) */
16007
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
16008
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16009
{0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
16011
/* Mic (rear) pin: input vref at 80% */
16012
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
16013
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
16014
/* Front Mic pin: input vref at 80% */
16015
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
16016
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
16017
/* Line In pin: input */
16018
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16019
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
16020
/* Line-2 In: Headphone output (output 0 - 0x0c) */
16021
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
16022
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16023
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
16024
/* CD pin widget for input */
16025
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16030
static struct hda_verb alc861vd_eapd_verbs[] = {
16031
{0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
16035
static struct hda_verb alc660vd_eapd_verbs[] = {
16036
{0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
16037
{0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
16041
static struct hda_verb alc861vd_lenovo_unsol_verbs[] = {
16042
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
16043
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
16044
{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)},
16045
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
16046
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
16050
static void alc861vd_lenovo_mic_automute(struct hda_codec *codec)
16052
unsigned int present;
16053
unsigned char bits;
16055
present = snd_hda_jack_detect(codec, 0x18);
16056
bits = present ? HDA_AMP_MUTE : 0;
16058
snd_hda_codec_amp_stereo(codec, 0x0b, HDA_INPUT, 1,
16059
HDA_AMP_MUTE, bits);
16062
static void alc861vd_lenovo_setup(struct hda_codec *codec)
16064
struct alc_spec *spec = codec->spec;
16065
spec->autocfg.hp_pins[0] = 0x1b;
16066
spec->autocfg.speaker_pins[0] = 0x14;
16069
static void alc861vd_lenovo_init_hook(struct hda_codec *codec)
16071
alc_automute_amp(codec);
16072
alc861vd_lenovo_mic_automute(codec);
16075
static void alc861vd_lenovo_unsol_event(struct hda_codec *codec,
16078
switch (res >> 26) {
16079
case ALC880_MIC_EVENT:
16080
alc861vd_lenovo_mic_automute(codec);
16083
alc_automute_amp_unsol_event(codec, res);
16088
static struct hda_verb alc861vd_dallas_verbs[] = {
16089
{0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
16090
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
16091
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
16092
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
16094
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
16095
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
16096
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
16097
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
16098
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
16099
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
16100
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
16101
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
16103
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
16104
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16105
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
16106
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16107
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
16108
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16109
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
16110
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16112
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
16113
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
16114
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
16115
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
16116
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16117
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16118
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16119
{0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16121
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
16122
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
16123
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
16124
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
16126
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
16127
{0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
16128
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
16133
/* toggle speaker-output according to the hp-jack state */
16134
static void alc861vd_dallas_setup(struct hda_codec *codec)
16136
struct alc_spec *spec = codec->spec;
16138
spec->autocfg.hp_pins[0] = 0x15;
16139
spec->autocfg.speaker_pins[0] = 0x14;
16142
#ifdef CONFIG_SND_HDA_POWER_SAVE
16143
#define alc861vd_loopbacks alc880_loopbacks
16146
/* pcm configuration: identical with ALC880 */
16147
#define alc861vd_pcm_analog_playback alc880_pcm_analog_playback
16148
#define alc861vd_pcm_analog_capture alc880_pcm_analog_capture
16149
#define alc861vd_pcm_digital_playback alc880_pcm_digital_playback
16150
#define alc861vd_pcm_digital_capture alc880_pcm_digital_capture
16153
* configuration and preset
16155
static const char *alc861vd_models[ALC861VD_MODEL_LAST] = {
16156
[ALC660VD_3ST] = "3stack-660",
16157
[ALC660VD_3ST_DIG] = "3stack-660-digout",
16158
[ALC660VD_ASUS_V1S] = "asus-v1s",
16159
[ALC861VD_3ST] = "3stack",
16160
[ALC861VD_3ST_DIG] = "3stack-digout",
16161
[ALC861VD_6ST_DIG] = "6stack-digout",
16162
[ALC861VD_LENOVO] = "lenovo",
16163
[ALC861VD_DALLAS] = "dallas",
16164
[ALC861VD_HP] = "hp",
16165
[ALC861VD_AUTO] = "auto",
16168
static struct snd_pci_quirk alc861vd_cfg_tbl[] = {
16169
SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST),
16170
SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_HP),
16171
SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST),
16172
/*SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST),*/ /* auto */
16173
SND_PCI_QUIRK(0x1043, 0x1633, "Asus V1Sn", ALC660VD_ASUS_V1S),
16174
SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST_DIG),
16175
SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST),
16176
SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO),
16177
/*SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS),*/ /*lenovo*/
16178
SND_PCI_QUIRK(0x1179, 0xff01, "Toshiba A135", ALC861VD_LENOVO),
16179
SND_PCI_QUIRK(0x1179, 0xff03, "Toshiba P205", ALC861VD_LENOVO),
16180
SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_DALLAS),
16181
SND_PCI_QUIRK(0x1565, 0x820d, "Biostar NF61S SE", ALC861VD_6ST_DIG),
16182
SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", ALC861VD_LENOVO),
16183
SND_PCI_QUIRK(0x1849, 0x0862, "ASRock K8NF6G-VSTA", ALC861VD_6ST_DIG),
16187
static struct alc_config_preset alc861vd_presets[] = {
16189
.mixers = { alc861vd_3st_mixer },
16190
.init_verbs = { alc861vd_volume_init_verbs,
16191
alc861vd_3stack_init_verbs },
16192
.num_dacs = ARRAY_SIZE(alc660vd_dac_nids),
16193
.dac_nids = alc660vd_dac_nids,
16194
.num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes),
16195
.channel_mode = alc861vd_3stack_2ch_modes,
16196
.input_mux = &alc861vd_capture_source,
16198
[ALC660VD_3ST_DIG] = {
16199
.mixers = { alc861vd_3st_mixer },
16200
.init_verbs = { alc861vd_volume_init_verbs,
16201
alc861vd_3stack_init_verbs },
16202
.num_dacs = ARRAY_SIZE(alc660vd_dac_nids),
16203
.dac_nids = alc660vd_dac_nids,
16204
.dig_out_nid = ALC861VD_DIGOUT_NID,
16205
.num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes),
16206
.channel_mode = alc861vd_3stack_2ch_modes,
16207
.input_mux = &alc861vd_capture_source,
16210
.mixers = { alc861vd_3st_mixer },
16211
.init_verbs = { alc861vd_volume_init_verbs,
16212
alc861vd_3stack_init_verbs },
16213
.num_dacs = ARRAY_SIZE(alc861vd_dac_nids),
16214
.dac_nids = alc861vd_dac_nids,
16215
.num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes),
16216
.channel_mode = alc861vd_3stack_2ch_modes,
16217
.input_mux = &alc861vd_capture_source,
16219
[ALC861VD_3ST_DIG] = {
16220
.mixers = { alc861vd_3st_mixer },
16221
.init_verbs = { alc861vd_volume_init_verbs,
16222
alc861vd_3stack_init_verbs },
16223
.num_dacs = ARRAY_SIZE(alc861vd_dac_nids),
16224
.dac_nids = alc861vd_dac_nids,
16225
.dig_out_nid = ALC861VD_DIGOUT_NID,
16226
.num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes),
16227
.channel_mode = alc861vd_3stack_2ch_modes,
16228
.input_mux = &alc861vd_capture_source,
16230
[ALC861VD_6ST_DIG] = {
16231
.mixers = { alc861vd_6st_mixer, alc861vd_chmode_mixer },
16232
.init_verbs = { alc861vd_volume_init_verbs,
16233
alc861vd_6stack_init_verbs },
16234
.num_dacs = ARRAY_SIZE(alc861vd_dac_nids),
16235
.dac_nids = alc861vd_dac_nids,
16236
.dig_out_nid = ALC861VD_DIGOUT_NID,
16237
.num_channel_mode = ARRAY_SIZE(alc861vd_6stack_modes),
16238
.channel_mode = alc861vd_6stack_modes,
16239
.input_mux = &alc861vd_capture_source,
16241
[ALC861VD_LENOVO] = {
16242
.mixers = { alc861vd_lenovo_mixer },
16243
.init_verbs = { alc861vd_volume_init_verbs,
16244
alc861vd_3stack_init_verbs,
16245
alc861vd_eapd_verbs,
16246
alc861vd_lenovo_unsol_verbs },
16247
.num_dacs = ARRAY_SIZE(alc660vd_dac_nids),
16248
.dac_nids = alc660vd_dac_nids,
16249
.num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes),
16250
.channel_mode = alc861vd_3stack_2ch_modes,
16251
.input_mux = &alc861vd_capture_source,
16252
.unsol_event = alc861vd_lenovo_unsol_event,
16253
.setup = alc861vd_lenovo_setup,
16254
.init_hook = alc861vd_lenovo_init_hook,
16256
[ALC861VD_DALLAS] = {
16257
.mixers = { alc861vd_dallas_mixer },
16258
.init_verbs = { alc861vd_dallas_verbs },
16259
.num_dacs = ARRAY_SIZE(alc861vd_dac_nids),
16260
.dac_nids = alc861vd_dac_nids,
16261
.num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes),
16262
.channel_mode = alc861vd_3stack_2ch_modes,
16263
.input_mux = &alc861vd_dallas_capture_source,
16264
.unsol_event = alc_automute_amp_unsol_event,
16265
.setup = alc861vd_dallas_setup,
16266
.init_hook = alc_automute_amp,
16269
.mixers = { alc861vd_hp_mixer },
16270
.init_verbs = { alc861vd_dallas_verbs, alc861vd_eapd_verbs },
16271
.num_dacs = ARRAY_SIZE(alc861vd_dac_nids),
16272
.dac_nids = alc861vd_dac_nids,
16273
.dig_out_nid = ALC861VD_DIGOUT_NID,
16274
.num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes),
16275
.channel_mode = alc861vd_3stack_2ch_modes,
16276
.input_mux = &alc861vd_hp_capture_source,
16277
.unsol_event = alc_automute_amp_unsol_event,
16278
.setup = alc861vd_dallas_setup,
16279
.init_hook = alc_automute_amp,
16281
[ALC660VD_ASUS_V1S] = {
16282
.mixers = { alc861vd_lenovo_mixer },
16283
.init_verbs = { alc861vd_volume_init_verbs,
16284
alc861vd_3stack_init_verbs,
16285
alc861vd_eapd_verbs,
16286
alc861vd_lenovo_unsol_verbs },
16287
.num_dacs = ARRAY_SIZE(alc660vd_dac_nids),
16288
.dac_nids = alc660vd_dac_nids,
16289
.dig_out_nid = ALC861VD_DIGOUT_NID,
16290
.num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes),
16291
.channel_mode = alc861vd_3stack_2ch_modes,
16292
.input_mux = &alc861vd_capture_source,
16293
.unsol_event = alc861vd_lenovo_unsol_event,
16294
.setup = alc861vd_lenovo_setup,
16295
.init_hook = alc861vd_lenovo_init_hook,
16300
* BIOS auto configuration
16302
static int alc861vd_auto_create_input_ctls(struct hda_codec *codec,
16303
const struct auto_pin_cfg *cfg)
16305
return alc_auto_create_input_ctls(codec, cfg, 0x0b, 0x22, 0);
16309
static void alc861vd_auto_set_output_and_unmute(struct hda_codec *codec,
16310
hda_nid_t nid, int pin_type, int dac_idx)
16312
alc_set_pin_output(codec, nid, pin_type);
16315
static void alc861vd_auto_init_multi_out(struct hda_codec *codec)
16317
struct alc_spec *spec = codec->spec;
16320
for (i = 0; i <= HDA_SIDE; i++) {
16321
hda_nid_t nid = spec->autocfg.line_out_pins[i];
16322
int pin_type = get_pin_type(spec->autocfg.line_out_type);
16324
alc861vd_auto_set_output_and_unmute(codec, nid,
16330
static void alc861vd_auto_init_hp_out(struct hda_codec *codec)
16332
struct alc_spec *spec = codec->spec;
16335
pin = spec->autocfg.hp_pins[0];
16336
if (pin) /* connect to front and use dac 0 */
16337
alc861vd_auto_set_output_and_unmute(codec, pin, PIN_HP, 0);
16338
pin = spec->autocfg.speaker_pins[0];
16340
alc861vd_auto_set_output_and_unmute(codec, pin, PIN_OUT, 0);
16343
#define ALC861VD_PIN_CD_NID ALC880_PIN_CD_NID
16345
static void alc861vd_auto_init_analog_input(struct hda_codec *codec)
16347
struct alc_spec *spec = codec->spec;
16350
for (i = 0; i < AUTO_PIN_LAST; i++) {
16351
hda_nid_t nid = spec->autocfg.input_pins[i];
16352
if (alc_is_input_pin(codec, nid)) {
16353
alc_set_input_pin(codec, nid, i);
16354
if (nid != ALC861VD_PIN_CD_NID &&
16355
(get_wcaps(codec, nid) & AC_WCAP_OUT_AMP))
16356
snd_hda_codec_write(codec, nid, 0,
16357
AC_VERB_SET_AMP_GAIN_MUTE,
16363
#define alc861vd_auto_init_input_src alc882_auto_init_input_src
16365
#define alc861vd_idx_to_mixer_vol(nid) ((nid) + 0x02)
16366
#define alc861vd_idx_to_mixer_switch(nid) ((nid) + 0x0c)
16368
/* add playback controls from the parsed DAC table */
16369
/* Based on ALC880 version. But ALC861VD has separate,
16370
* different NIDs for mute/unmute switch and volume control */
16371
static int alc861vd_auto_create_multi_out_ctls(struct alc_spec *spec,
16372
const struct auto_pin_cfg *cfg)
16374
static const char *chname[4] = {"Front", "Surround", "CLFE", "Side"};
16375
hda_nid_t nid_v, nid_s;
16378
for (i = 0; i < cfg->line_outs; i++) {
16379
if (!spec->multiout.dac_nids[i])
16381
nid_v = alc861vd_idx_to_mixer_vol(
16383
spec->multiout.dac_nids[i]));
16384
nid_s = alc861vd_idx_to_mixer_switch(
16386
spec->multiout.dac_nids[i]));
16390
err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL,
16392
HDA_COMPOSE_AMP_VAL(nid_v, 1, 0,
16396
err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL,
16398
HDA_COMPOSE_AMP_VAL(nid_v, 2, 0,
16402
err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE,
16404
HDA_COMPOSE_AMP_VAL(nid_s, 1, 2,
16408
err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE,
16410
HDA_COMPOSE_AMP_VAL(nid_s, 2, 2,
16416
if (cfg->line_outs == 1 &&
16417
cfg->line_out_type == AUTO_PIN_SPEAKER_OUT) {
16424
err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, pfx,
16425
HDA_COMPOSE_AMP_VAL(nid_v, 3, 0,
16429
if (cfg->line_outs == 1 &&
16430
cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)
16432
err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE, pfx,
16433
HDA_COMPOSE_AMP_VAL(nid_s, 3, 2,
16442
/* add playback controls for speaker and HP outputs */
16443
/* Based on ALC880 version. But ALC861VD has separate,
16444
* different NIDs for mute/unmute switch and volume control */
16445
static int alc861vd_auto_create_extra_out(struct alc_spec *spec,
16446
hda_nid_t pin, const char *pfx)
16448
hda_nid_t nid_v, nid_s;
16454
if (alc880_is_fixed_pin(pin)) {
16455
nid_v = alc880_idx_to_dac(alc880_fixed_pin_idx(pin));
16456
/* specify the DAC as the extra output */
16457
if (!spec->multiout.hp_nid)
16458
spec->multiout.hp_nid = nid_v;
16460
spec->multiout.extra_out_nid[0] = nid_v;
16461
/* control HP volume/switch on the output mixer amp */
16462
nid_v = alc861vd_idx_to_mixer_vol(
16463
alc880_fixed_pin_idx(pin));
16464
nid_s = alc861vd_idx_to_mixer_switch(
16465
alc880_fixed_pin_idx(pin));
16467
err = add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, pfx,
16468
HDA_COMPOSE_AMP_VAL(nid_v, 3, 0, HDA_OUTPUT));
16471
err = add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE, pfx,
16472
HDA_COMPOSE_AMP_VAL(nid_s, 3, 2, HDA_INPUT));
16475
} else if (alc880_is_multi_pin(pin)) {
16476
/* set manual connection */
16477
/* we have only a switch on HP-out PIN */
16478
err = add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx,
16479
HDA_COMPOSE_AMP_VAL(pin, 3, 0, HDA_OUTPUT));
16486
/* parse the BIOS configuration and set up the alc_spec
16487
* return 1 if successful, 0 if the proper config is not found,
16488
* or a negative error code
16489
* Based on ALC880 version - had to change it to override
16490
* alc880_auto_create_extra_out and alc880_auto_create_multi_out_ctls */
16491
static int alc861vd_parse_auto_config(struct hda_codec *codec)
16493
struct alc_spec *spec = codec->spec;
16495
static hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
16497
err = snd_hda_parse_pin_def_config(codec, &spec->autocfg,
16501
if (!spec->autocfg.line_outs)
16502
return 0; /* can't find valid BIOS pin config */
16504
err = alc880_auto_fill_dac_nids(spec, &spec->autocfg);
16507
err = alc861vd_auto_create_multi_out_ctls(spec, &spec->autocfg);
16510
err = alc861vd_auto_create_extra_out(spec,
16511
spec->autocfg.speaker_pins[0],
16515
err = alc861vd_auto_create_extra_out(spec,
16516
spec->autocfg.hp_pins[0],
16520
err = alc861vd_auto_create_input_ctls(codec, &spec->autocfg);
16524
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
16526
if (spec->autocfg.dig_outs)
16527
spec->multiout.dig_out_nid = ALC861VD_DIGOUT_NID;
16529
if (spec->kctls.list)
16530
add_mixer(spec, spec->kctls.list);
16532
add_verb(spec, alc861vd_volume_init_verbs);
16534
spec->num_mux_defs = 1;
16535
spec->input_mux = &spec->private_imux[0];
16537
err = alc_auto_add_mic_boost(codec);
16541
alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0);
16546
/* additional initialization for auto-configuration model */
16547
static void alc861vd_auto_init(struct hda_codec *codec)
16549
struct alc_spec *spec = codec->spec;
16550
alc861vd_auto_init_multi_out(codec);
16551
alc861vd_auto_init_hp_out(codec);
16552
alc861vd_auto_init_analog_input(codec);
16553
alc861vd_auto_init_input_src(codec);
16554
if (spec->unsol_event)
16555
alc_inithook(codec);
16559
ALC660VD_FIX_ASUS_GPIO1
16563
static const struct hda_verb alc660vd_fix_asus_gpio1_verbs[] = {
16564
{0x01, AC_VERB_SET_GPIO_MASK, 0x03},
16565
{0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01},
16566
{0x01, AC_VERB_SET_GPIO_DATA, 0x01},
16570
static const struct alc_fixup alc861vd_fixups[] = {
16571
[ALC660VD_FIX_ASUS_GPIO1] = {
16572
.verbs = alc660vd_fix_asus_gpio1_verbs,
16576
static struct snd_pci_quirk alc861vd_fixup_tbl[] = {
16577
SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
16581
static int patch_alc861vd(struct hda_codec *codec)
16583
struct alc_spec *spec;
16584
int err, board_config;
16586
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
16590
codec->spec = spec;
16592
board_config = snd_hda_check_board_config(codec, ALC861VD_MODEL_LAST,
16596
if (board_config < 0 || board_config >= ALC861VD_MODEL_LAST) {
16597
printk(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n",
16599
board_config = ALC861VD_AUTO;
16602
if (board_config == ALC861VD_AUTO)
16603
alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 1);
16605
if (board_config == ALC861VD_AUTO) {
16606
/* automatic parse from the BIOS config */
16607
err = alc861vd_parse_auto_config(codec);
16613
"hda_codec: Cannot set up configuration "
16614
"from BIOS. Using base mode...\n");
16615
board_config = ALC861VD_3ST;
16619
err = snd_hda_attach_beep_device(codec, 0x23);
16625
if (board_config != ALC861VD_AUTO)
16626
setup_preset(codec, &alc861vd_presets[board_config]);
16628
if (codec->vendor_id == 0x10ec0660) {
16629
/* always turn on EAPD */
16630
add_verb(spec, alc660vd_eapd_verbs);
16633
spec->stream_analog_playback = &alc861vd_pcm_analog_playback;
16634
spec->stream_analog_capture = &alc861vd_pcm_analog_capture;
16636
spec->stream_digital_playback = &alc861vd_pcm_digital_playback;
16637
spec->stream_digital_capture = &alc861vd_pcm_digital_capture;
16639
if (!spec->adc_nids) {
16640
spec->adc_nids = alc861vd_adc_nids;
16641
spec->num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids);
16643
if (!spec->capsrc_nids)
16644
spec->capsrc_nids = alc861vd_capsrc_nids;
16646
set_capture_mixer(codec);
16647
set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
16649
spec->vmaster_nid = 0x02;
16651
if (board_config == ALC861VD_AUTO)
16652
alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 0);
16654
codec->patch_ops = alc_patch_ops;
16656
if (board_config == ALC861VD_AUTO)
16657
spec->init_hook = alc861vd_auto_init;
16658
#ifdef CONFIG_SND_HDA_POWER_SAVE
16659
if (!spec->loopback.amplist)
16660
spec->loopback.amplist = alc861vd_loopbacks;
16669
* ALC662 is almost identical with ALC880 but has cleaner and more flexible
16670
* configuration. Each pin widget can choose any input DACs and a mixer.
16671
* Each ADC is connected from a mixer of all inputs. This makes possible
16672
* 6-channel independent captures.
16674
* In addition, an independent DAC for the multi-playback (not used in this
16677
#define ALC662_DIGOUT_NID 0x06
16678
#define ALC662_DIGIN_NID 0x0a
16680
static hda_nid_t alc662_dac_nids[4] = {
16681
/* front, rear, clfe, rear_surr */
16685
static hda_nid_t alc272_dac_nids[2] = {
16689
static hda_nid_t alc662_adc_nids[2] = {
16694
static hda_nid_t alc272_adc_nids[1] = {
16699
static hda_nid_t alc662_capsrc_nids[2] = { 0x22, 0x23 };
16700
static hda_nid_t alc272_capsrc_nids[1] = { 0x23 };
16704
/* FIXME: should be a matrix-type input source selection */
16705
static struct hda_input_mux alc662_capture_source = {
16709
{ "Front Mic", 0x1 },
16715
static struct hda_input_mux alc662_lenovo_101e_capture_source = {
16723
static struct hda_input_mux alc663_capture_source = {
16727
{ "Front Mic", 0x1 },
16732
#if 0 /* set to 1 for testing other input sources below */
16733
static struct hda_input_mux alc272_nc10_capture_source = {
16736
{ "Autoselect Mic", 0x0 },
16737
{ "Internal Mic", 0x1 },
16738
{ "In-0x02", 0x2 },
16739
{ "In-0x03", 0x3 },
16740
{ "In-0x04", 0x4 },
16741
{ "In-0x05", 0x5 },
16742
{ "In-0x06", 0x6 },
16743
{ "In-0x07", 0x7 },
16744
{ "In-0x08", 0x8 },
16745
{ "In-0x09", 0x9 },
16746
{ "In-0x0a", 0x0a },
16747
{ "In-0x0b", 0x0b },
16748
{ "In-0x0c", 0x0c },
16749
{ "In-0x0d", 0x0d },
16750
{ "In-0x0e", 0x0e },
16751
{ "In-0x0f", 0x0f },
16759
static struct hda_channel_mode alc662_3ST_2ch_modes[1] = {
16766
static struct hda_verb alc662_3ST_ch2_init[] = {
16767
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
16768
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
16769
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
16770
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
16777
static struct hda_verb alc662_3ST_ch6_init[] = {
16778
{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
16779
{ 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
16780
{ 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
16781
{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
16782
{ 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
16783
{ 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
16787
static struct hda_channel_mode alc662_3ST_6ch_modes[2] = {
16788
{ 2, alc662_3ST_ch2_init },
16789
{ 6, alc662_3ST_ch6_init },
16795
static struct hda_verb alc662_sixstack_ch6_init[] = {
16796
{ 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
16797
{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
16798
{ 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
16805
static struct hda_verb alc662_sixstack_ch8_init[] = {
16806
{ 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
16807
{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
16808
{ 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
16812
static struct hda_channel_mode alc662_5stack_modes[2] = {
16813
{ 2, alc662_sixstack_ch6_init },
16814
{ 6, alc662_sixstack_ch8_init },
16817
/* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
16818
* Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
16821
static struct snd_kcontrol_new alc662_base_mixer[] = {
16822
/* output mixer control */
16823
HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT),
16824
HDA_CODEC_MUTE("Front Playback Switch", 0x0c, 0x0, HDA_INPUT),
16825
HDA_CODEC_VOLUME("Surround Playback Volume", 0x3, 0x0, HDA_OUTPUT),
16826
HDA_CODEC_MUTE("Surround Playback Switch", 0x0d, 0x0, HDA_INPUT),
16827
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0, HDA_OUTPUT),
16828
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0, HDA_OUTPUT),
16829
HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x0, HDA_INPUT),
16830
HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x0, HDA_INPUT),
16831
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
16833
/*Input mixer control */
16834
HDA_CODEC_VOLUME("CD Playback Volume", 0xb, 0x4, HDA_INPUT),
16835
HDA_CODEC_MUTE("CD Playback Switch", 0xb, 0x4, HDA_INPUT),
16836
HDA_CODEC_VOLUME("Line Playback Volume", 0xb, 0x02, HDA_INPUT),
16837
HDA_CODEC_MUTE("Line Playback Switch", 0xb, 0x02, HDA_INPUT),
16838
HDA_CODEC_VOLUME("Mic Playback Volume", 0xb, 0x0, HDA_INPUT),
16839
HDA_CODEC_MUTE("Mic Playback Switch", 0xb, 0x0, HDA_INPUT),
16840
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0xb, 0x01, HDA_INPUT),
16841
HDA_CODEC_MUTE("Front Mic Playback Switch", 0xb, 0x01, HDA_INPUT),
16845
static struct snd_kcontrol_new alc662_3ST_2ch_mixer[] = {
16846
HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT),
16847
HDA_CODEC_MUTE("Front Playback Switch", 0x0c, 0x0, HDA_INPUT),
16848
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
16849
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
16850
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
16851
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
16852
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
16853
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
16854
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
16855
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
16856
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
16860
static struct snd_kcontrol_new alc662_3ST_6ch_mixer[] = {
16861
HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT),
16862
HDA_CODEC_MUTE("Front Playback Switch", 0x0c, 0x0, HDA_INPUT),
16863
HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT),
16864
HDA_CODEC_MUTE("Surround Playback Switch", 0x0d, 0x0, HDA_INPUT),
16865
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0, HDA_OUTPUT),
16866
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0, HDA_OUTPUT),
16867
HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x0, HDA_INPUT),
16868
HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x0, HDA_INPUT),
16869
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
16870
HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
16871
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
16872
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
16873
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
16874
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
16875
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
16876
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
16877
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
16881
static struct snd_kcontrol_new alc662_lenovo_101e_mixer[] = {
16882
HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT),
16883
HDA_BIND_MUTE("Front Playback Switch", 0x02, 2, HDA_INPUT),
16884
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x03, 0x0, HDA_OUTPUT),
16885
HDA_BIND_MUTE("Speaker Playback Switch", 0x03, 2, HDA_INPUT),
16886
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
16887
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
16888
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
16889
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
16890
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
16894
static struct snd_kcontrol_new alc662_eeepc_p701_mixer[] = {
16895
HDA_CODEC_VOLUME("Master Playback Volume", 0x02, 0x0, HDA_OUTPUT),
16896
ALC262_HIPPO_MASTER_SWITCH,
16898
HDA_CODEC_VOLUME("e-Mic Boost", 0x18, 0, HDA_INPUT),
16899
HDA_CODEC_VOLUME("e-Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
16900
HDA_CODEC_MUTE("e-Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
16902
HDA_CODEC_VOLUME("i-Mic Boost", 0x19, 0, HDA_INPUT),
16903
HDA_CODEC_VOLUME("i-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
16904
HDA_CODEC_MUTE("i-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
16908
static struct snd_kcontrol_new alc662_eeepc_ep20_mixer[] = {
16909
ALC262_HIPPO_MASTER_SWITCH,
16910
HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT),
16911
HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT),
16912
HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0, HDA_OUTPUT),
16913
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0, HDA_OUTPUT),
16914
HDA_BIND_MUTE("MuteCtrl Playback Switch", 0x0c, 2, HDA_INPUT),
16915
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
16916
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
16917
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
16918
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
16922
static struct hda_bind_ctls alc663_asus_bind_master_vol = {
16923
.ops = &snd_hda_bind_vol,
16925
HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT),
16926
HDA_COMPOSE_AMP_VAL(0x03, 3, 0, HDA_OUTPUT),
16931
static struct hda_bind_ctls alc663_asus_one_bind_switch = {
16932
.ops = &snd_hda_bind_sw,
16934
HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
16935
HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT),
16940
static struct snd_kcontrol_new alc663_m51va_mixer[] = {
16941
HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol),
16942
HDA_BIND_SW("Master Playback Switch", &alc663_asus_one_bind_switch),
16943
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
16944
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
16948
static struct hda_bind_ctls alc663_asus_tree_bind_switch = {
16949
.ops = &snd_hda_bind_sw,
16951
HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
16952
HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT),
16953
HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT),
16958
static struct snd_kcontrol_new alc663_two_hp_m1_mixer[] = {
16959
HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol),
16960
HDA_BIND_SW("Master Playback Switch", &alc663_asus_tree_bind_switch),
16961
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
16962
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
16963
HDA_CODEC_VOLUME("F-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
16964
HDA_CODEC_MUTE("F-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
16969
static struct hda_bind_ctls alc663_asus_four_bind_switch = {
16970
.ops = &snd_hda_bind_sw,
16972
HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
16973
HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT),
16974
HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_OUTPUT),
16979
static struct snd_kcontrol_new alc663_two_hp_m2_mixer[] = {
16980
HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol),
16981
HDA_BIND_SW("Master Playback Switch", &alc663_asus_four_bind_switch),
16982
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
16983
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
16984
HDA_CODEC_VOLUME("F-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
16985
HDA_CODEC_MUTE("F-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
16989
static struct snd_kcontrol_new alc662_1bjd_mixer[] = {
16990
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT),
16991
HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
16992
HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
16993
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
16994
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
16995
HDA_CODEC_VOLUME("F-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
16996
HDA_CODEC_MUTE("F-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
17000
static struct hda_bind_ctls alc663_asus_two_bind_master_vol = {
17001
.ops = &snd_hda_bind_vol,
17003
HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT),
17004
HDA_COMPOSE_AMP_VAL(0x04, 3, 0, HDA_OUTPUT),
17009
static struct hda_bind_ctls alc663_asus_two_bind_switch = {
17010
.ops = &snd_hda_bind_sw,
17012
HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
17013
HDA_COMPOSE_AMP_VAL(0x16, 3, 0, HDA_OUTPUT),
17018
static struct snd_kcontrol_new alc663_asus_21jd_clfe_mixer[] = {
17019
HDA_BIND_VOL("Master Playback Volume",
17020
&alc663_asus_two_bind_master_vol),
17021
HDA_BIND_SW("Master Playback Switch", &alc663_asus_two_bind_switch),
17022
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
17023
HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT),
17024
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
17025
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
17029
static struct snd_kcontrol_new alc663_asus_15jd_clfe_mixer[] = {
17030
HDA_BIND_VOL("Master Playback Volume", &alc663_asus_bind_master_vol),
17031
HDA_BIND_SW("Master Playback Switch", &alc663_asus_two_bind_switch),
17032
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
17033
HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
17034
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
17035
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
17039
static struct snd_kcontrol_new alc663_g71v_mixer[] = {
17040
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT),
17041
HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
17042
HDA_CODEC_VOLUME("Front Playback Volume", 0x03, 0x0, HDA_OUTPUT),
17043
HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT),
17044
HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT),
17046
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
17047
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
17048
HDA_CODEC_VOLUME("i-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
17049
HDA_CODEC_MUTE("i-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
17053
static struct snd_kcontrol_new alc663_g50v_mixer[] = {
17054
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT),
17055
HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
17056
HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT),
17058
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
17059
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
17060
HDA_CODEC_VOLUME("i-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
17061
HDA_CODEC_MUTE("i-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
17062
HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
17063
HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
17067
static struct hda_bind_ctls alc663_asus_mode7_8_all_bind_switch = {
17068
.ops = &snd_hda_bind_sw,
17070
HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
17071
HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT),
17072
HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT),
17073
HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_OUTPUT),
17074
HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT),
17079
static struct hda_bind_ctls alc663_asus_mode7_8_sp_bind_switch = {
17080
.ops = &snd_hda_bind_sw,
17082
HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
17083
HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT),
17088
static struct snd_kcontrol_new alc663_mode7_mixer[] = {
17089
HDA_BIND_SW("Master Playback Switch", &alc663_asus_mode7_8_all_bind_switch),
17090
HDA_BIND_VOL("Speaker Playback Volume", &alc663_asus_bind_master_vol),
17091
HDA_BIND_SW("Speaker Playback Switch", &alc663_asus_mode7_8_sp_bind_switch),
17092
HDA_CODEC_MUTE("Headphone1 Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
17093
HDA_CODEC_MUTE("Headphone2 Playback Switch", 0x21, 0x0, HDA_OUTPUT),
17094
HDA_CODEC_VOLUME("IntMic Playback Volume", 0x0b, 0x0, HDA_INPUT),
17095
HDA_CODEC_MUTE("IntMic Playback Switch", 0x0b, 0x0, HDA_INPUT),
17096
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
17097
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
17101
static struct snd_kcontrol_new alc663_mode8_mixer[] = {
17102
HDA_BIND_SW("Master Playback Switch", &alc663_asus_mode7_8_all_bind_switch),
17103
HDA_BIND_VOL("Speaker Playback Volume", &alc663_asus_bind_master_vol),
17104
HDA_BIND_SW("Speaker Playback Switch", &alc663_asus_mode7_8_sp_bind_switch),
17105
HDA_CODEC_MUTE("Headphone1 Playback Switch", 0x15, 0x0, HDA_OUTPUT),
17106
HDA_CODEC_MUTE("Headphone2 Playback Switch", 0x21, 0x0, HDA_OUTPUT),
17107
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
17108
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
17113
static struct snd_kcontrol_new alc662_chmode_mixer[] = {
17115
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
17116
.name = "Channel Mode",
17117
.info = alc_ch_mode_info,
17118
.get = alc_ch_mode_get,
17119
.put = alc_ch_mode_put,
17124
static struct hda_verb alc662_init_verbs[] = {
17125
/* ADC: mute amp left and right */
17126
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
17127
{0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
17129
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
17130
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
17131
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
17132
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
17133
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
17134
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
17136
/* Front Pin: output 0 (0x0c) */
17137
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
17138
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17140
/* Rear Pin: output 1 (0x0d) */
17141
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
17142
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17144
/* CLFE Pin: output 2 (0x0e) */
17145
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
17146
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17148
/* Mic (rear) pin: input vref at 80% */
17149
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
17150
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
17151
/* Front Mic pin: input vref at 80% */
17152
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
17153
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
17154
/* Line In pin: input */
17155
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17156
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
17157
/* Line-2 In: Headphone output (output 0 - 0x0c) */
17158
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17159
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17160
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
17161
/* CD pin widget for input */
17162
{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17164
/* FIXME: use matrix-type input source selection */
17165
/* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
17167
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
17168
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
17170
/* always trun on EAPD */
17171
{0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
17172
{0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
17177
static struct hda_verb alc663_init_verbs[] = {
17178
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
17179
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17180
{0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
17181
{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17182
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
17183
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
17187
static struct hda_verb alc272_init_verbs[] = {
17188
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17189
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
17190
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
17191
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17192
{0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
17193
{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17194
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
17195
{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
17199
static struct hda_verb alc662_sue_init_verbs[] = {
17200
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_FRONT_EVENT},
17201
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_HP_EVENT},
17205
static struct hda_verb alc662_eeepc_sue_init_verbs[] = {
17206
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
17207
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17211
/* Set Unsolicited Event*/
17212
static struct hda_verb alc662_eeepc_ep20_sue_init_verbs[] = {
17213
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
17214
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17218
static struct hda_verb alc663_m51va_init_verbs[] = {
17219
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17220
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17221
{0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17222
{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17223
{0x21, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Headphone */
17224
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
17225
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(9)},
17226
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
17227
{0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17231
static struct hda_verb alc663_21jd_amic_init_verbs[] = {
17232
{0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17233
{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17234
{0x21, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Headphone */
17235
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
17236
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
17237
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
17238
{0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17242
static struct hda_verb alc662_1bjd_amic_init_verbs[] = {
17243
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17244
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17245
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17246
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Headphone */
17247
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
17248
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
17249
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
17250
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17254
static struct hda_verb alc663_15jd_amic_init_verbs[] = {
17255
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17256
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17257
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Headphone */
17258
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
17259
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
17260
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
17261
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17265
static struct hda_verb alc663_two_hp_amic_m1_init_verbs[] = {
17266
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17267
{0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17268
{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17269
{0x21, AC_VERB_SET_CONNECT_SEL, 0x0}, /* Headphone */
17270
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17271
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17272
{0x15, AC_VERB_SET_CONNECT_SEL, 0x0}, /* Headphone */
17273
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
17274
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
17275
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
17276
{0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17277
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17281
static struct hda_verb alc663_two_hp_amic_m2_init_verbs[] = {
17282
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17283
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17284
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17285
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Headphone */
17286
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17287
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17288
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Headphone */
17289
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
17290
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
17291
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
17292
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17293
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17297
static struct hda_verb alc663_g71v_init_verbs[] = {
17298
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17299
/* {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, */
17300
/* {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, */ /* Headphone */
17302
{0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17303
{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17304
{0x21, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Headphone */
17306
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_FRONT_EVENT},
17307
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_MIC_EVENT},
17308
{0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_HP_EVENT},
17312
static struct hda_verb alc663_g50v_init_verbs[] = {
17313
{0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17314
{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17315
{0x21, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Headphone */
17317
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
17318
{0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17322
static struct hda_verb alc662_ecs_init_verbs[] = {
17323
{0x09, AC_VERB_SET_AMP_GAIN_MUTE, 0x701f},
17324
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
17325
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
17326
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17330
static struct hda_verb alc272_dell_zm1_init_verbs[] = {
17331
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17332
{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17333
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17334
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17335
{0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17336
{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17337
{0x21, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Headphone */
17338
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
17339
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(9)},
17340
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
17341
{0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17345
static struct hda_verb alc272_dell_init_verbs[] = {
17346
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17347
{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17348
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17349
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17350
{0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17351
{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17352
{0x21, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Headphone */
17353
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
17354
{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(9)},
17355
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
17356
{0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17360
static struct hda_verb alc663_mode7_init_verbs[] = {
17361
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17362
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17363
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
17364
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17365
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17366
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17367
{0x1b, AC_VERB_SET_CONNECT_SEL, 0x01},
17368
{0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17369
{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17370
{0x21, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Headphone */
17371
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
17372
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(9)},
17373
{0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
17374
{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17375
{0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17379
static struct hda_verb alc663_mode8_init_verbs[] = {
17380
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17381
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17382
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17383
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
17384
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17385
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
17386
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17387
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
17388
{0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
17389
{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
17390
{0x21, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Headphone */
17391
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
17392
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(9)},
17393
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17394
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
17395
{0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
17399
static struct snd_kcontrol_new alc662_auto_capture_mixer[] = {
17400
HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),
17401
HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),
17405
static struct snd_kcontrol_new alc272_auto_capture_mixer[] = {
17406
HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
17407
HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
17411
static void alc662_lenovo_101e_ispeaker_automute(struct hda_codec *codec)
17413
unsigned int present;
17414
unsigned char bits;
17416
present = snd_hda_jack_detect(codec, 0x14);
17417
bits = present ? HDA_AMP_MUTE : 0;
17419
snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
17420
HDA_AMP_MUTE, bits);
17423
static void alc662_lenovo_101e_all_automute(struct hda_codec *codec)
17425
unsigned int present;
17426
unsigned char bits;
17428
present = snd_hda_jack_detect(codec, 0x1b);
17429
bits = present ? HDA_AMP_MUTE : 0;
17431
snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
17432
HDA_AMP_MUTE, bits);
17433
snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
17434
HDA_AMP_MUTE, bits);
17437
static void alc662_lenovo_101e_unsol_event(struct hda_codec *codec,
17440
if ((res >> 26) == ALC880_HP_EVENT)
17441
alc662_lenovo_101e_all_automute(codec);
17442
if ((res >> 26) == ALC880_FRONT_EVENT)
17443
alc662_lenovo_101e_ispeaker_automute(codec);
17446
/* unsolicited event for HP jack sensing */
17447
static void alc662_eeepc_unsol_event(struct hda_codec *codec,
17450
if ((res >> 26) == ALC880_MIC_EVENT)
17451
alc_mic_automute(codec);
17453
alc262_hippo_unsol_event(codec, res);
17456
static void alc662_eeepc_setup(struct hda_codec *codec)
17458
struct alc_spec *spec = codec->spec;
17460
alc262_hippo1_setup(codec);
17461
spec->ext_mic.pin = 0x18;
17462
spec->ext_mic.mux_idx = 0;
17463
spec->int_mic.pin = 0x19;
17464
spec->int_mic.mux_idx = 1;
17465
spec->auto_mic = 1;
17468
static void alc662_eeepc_inithook(struct hda_codec *codec)
17470
alc262_hippo_automute(codec);
17471
alc_mic_automute(codec);
17474
static void alc662_eeepc_ep20_setup(struct hda_codec *codec)
17476
struct alc_spec *spec = codec->spec;
17478
spec->autocfg.hp_pins[0] = 0x14;
17479
spec->autocfg.speaker_pins[0] = 0x1b;
17482
#define alc662_eeepc_ep20_inithook alc262_hippo_master_update
17484
static void alc663_m51va_speaker_automute(struct hda_codec *codec)
17486
unsigned int present;
17487
unsigned char bits;
17489
present = snd_hda_jack_detect(codec, 0x21);
17490
bits = present ? HDA_AMP_MUTE : 0;
17491
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
17492
HDA_AMP_MUTE, bits);
17493
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
17494
HDA_AMP_MUTE, bits);
17497
static void alc663_21jd_two_speaker_automute(struct hda_codec *codec)
17499
unsigned int present;
17500
unsigned char bits;
17502
present = snd_hda_jack_detect(codec, 0x21);
17503
bits = present ? HDA_AMP_MUTE : 0;
17504
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
17505
HDA_AMP_MUTE, bits);
17506
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
17507
HDA_AMP_MUTE, bits);
17508
snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 0,
17509
HDA_AMP_MUTE, bits);
17510
snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 1,
17511
HDA_AMP_MUTE, bits);
17514
static void alc663_15jd_two_speaker_automute(struct hda_codec *codec)
17516
unsigned int present;
17517
unsigned char bits;
17519
present = snd_hda_jack_detect(codec, 0x15);
17520
bits = present ? HDA_AMP_MUTE : 0;
17521
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
17522
HDA_AMP_MUTE, bits);
17523
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
17524
HDA_AMP_MUTE, bits);
17525
snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 0,
17526
HDA_AMP_MUTE, bits);
17527
snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 1,
17528
HDA_AMP_MUTE, bits);
17531
static void alc662_f5z_speaker_automute(struct hda_codec *codec)
17533
unsigned int present;
17534
unsigned char bits;
17536
present = snd_hda_jack_detect(codec, 0x1b);
17537
bits = present ? 0 : PIN_OUT;
17538
snd_hda_codec_write(codec, 0x14, 0,
17539
AC_VERB_SET_PIN_WIDGET_CONTROL, bits);
17542
static void alc663_two_hp_m1_speaker_automute(struct hda_codec *codec)
17544
unsigned int present1, present2;
17546
present1 = snd_hda_jack_detect(codec, 0x21);
17547
present2 = snd_hda_jack_detect(codec, 0x15);
17549
if (present1 || present2) {
17550
snd_hda_codec_write_cache(codec, 0x14, 0,
17551
AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
17553
snd_hda_codec_write_cache(codec, 0x14, 0,
17554
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
17558
static void alc663_two_hp_m2_speaker_automute(struct hda_codec *codec)
17560
unsigned int present1, present2;
17562
present1 = snd_hda_jack_detect(codec, 0x1b);
17563
present2 = snd_hda_jack_detect(codec, 0x15);
17565
if (present1 || present2) {
17566
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
17567
HDA_AMP_MUTE, HDA_AMP_MUTE);
17568
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
17569
HDA_AMP_MUTE, HDA_AMP_MUTE);
17571
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
17573
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
17578
static void alc663_two_hp_m7_speaker_automute(struct hda_codec *codec)
17580
unsigned int present1, present2;
17582
present1 = snd_hda_codec_read(codec, 0x1b, 0,
17583
AC_VERB_GET_PIN_SENSE, 0)
17584
& AC_PINSENSE_PRESENCE;
17585
present2 = snd_hda_codec_read(codec, 0x21, 0,
17586
AC_VERB_GET_PIN_SENSE, 0)
17587
& AC_PINSENSE_PRESENCE;
17589
if (present1 || present2) {
17590
snd_hda_codec_write_cache(codec, 0x14, 0,
17591
AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
17592
snd_hda_codec_write_cache(codec, 0x17, 0,
17593
AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
17595
snd_hda_codec_write_cache(codec, 0x14, 0,
17596
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
17597
snd_hda_codec_write_cache(codec, 0x17, 0,
17598
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
17602
static void alc663_two_hp_m8_speaker_automute(struct hda_codec *codec)
17604
unsigned int present1, present2;
17606
present1 = snd_hda_codec_read(codec, 0x21, 0,
17607
AC_VERB_GET_PIN_SENSE, 0)
17608
& AC_PINSENSE_PRESENCE;
17609
present2 = snd_hda_codec_read(codec, 0x15, 0,
17610
AC_VERB_GET_PIN_SENSE, 0)
17611
& AC_PINSENSE_PRESENCE;
17613
if (present1 || present2) {
17614
snd_hda_codec_write_cache(codec, 0x14, 0,
17615
AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
17616
snd_hda_codec_write_cache(codec, 0x17, 0,
17617
AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
17619
snd_hda_codec_write_cache(codec, 0x14, 0,
17620
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
17621
snd_hda_codec_write_cache(codec, 0x17, 0,
17622
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
17626
static void alc663_m51va_unsol_event(struct hda_codec *codec,
17629
switch (res >> 26) {
17630
case ALC880_HP_EVENT:
17631
alc663_m51va_speaker_automute(codec);
17633
case ALC880_MIC_EVENT:
17634
alc_mic_automute(codec);
17639
static void alc663_m51va_setup(struct hda_codec *codec)
17641
struct alc_spec *spec = codec->spec;
17642
spec->ext_mic.pin = 0x18;
17643
spec->ext_mic.mux_idx = 0;
17644
spec->int_mic.pin = 0x12;
17645
spec->int_mic.mux_idx = 9;
17646
spec->auto_mic = 1;
17649
static void alc663_m51va_inithook(struct hda_codec *codec)
17651
alc663_m51va_speaker_automute(codec);
17652
alc_mic_automute(codec);
17655
/* ***************** Mode1 ******************************/
17656
#define alc663_mode1_unsol_event alc663_m51va_unsol_event
17658
static void alc663_mode1_setup(struct hda_codec *codec)
17660
struct alc_spec *spec = codec->spec;
17661
spec->ext_mic.pin = 0x18;
17662
spec->ext_mic.mux_idx = 0;
17663
spec->int_mic.pin = 0x19;
17664
spec->int_mic.mux_idx = 1;
17665
spec->auto_mic = 1;
17668
#define alc663_mode1_inithook alc663_m51va_inithook
17670
/* ***************** Mode2 ******************************/
17671
static void alc662_mode2_unsol_event(struct hda_codec *codec,
17674
switch (res >> 26) {
17675
case ALC880_HP_EVENT:
17676
alc662_f5z_speaker_automute(codec);
17678
case ALC880_MIC_EVENT:
17679
alc_mic_automute(codec);
17684
#define alc662_mode2_setup alc663_mode1_setup
17686
static void alc662_mode2_inithook(struct hda_codec *codec)
17688
alc662_f5z_speaker_automute(codec);
17689
alc_mic_automute(codec);
17691
/* ***************** Mode3 ******************************/
17692
static void alc663_mode3_unsol_event(struct hda_codec *codec,
17695
switch (res >> 26) {
17696
case ALC880_HP_EVENT:
17697
alc663_two_hp_m1_speaker_automute(codec);
17699
case ALC880_MIC_EVENT:
17700
alc_mic_automute(codec);
17705
#define alc663_mode3_setup alc663_mode1_setup
17707
static void alc663_mode3_inithook(struct hda_codec *codec)
17709
alc663_two_hp_m1_speaker_automute(codec);
17710
alc_mic_automute(codec);
17712
/* ***************** Mode4 ******************************/
17713
static void alc663_mode4_unsol_event(struct hda_codec *codec,
17716
switch (res >> 26) {
17717
case ALC880_HP_EVENT:
17718
alc663_21jd_two_speaker_automute(codec);
17720
case ALC880_MIC_EVENT:
17721
alc_mic_automute(codec);
17726
#define alc663_mode4_setup alc663_mode1_setup
17728
static void alc663_mode4_inithook(struct hda_codec *codec)
17730
alc663_21jd_two_speaker_automute(codec);
17731
alc_mic_automute(codec);
17733
/* ***************** Mode5 ******************************/
17734
static void alc663_mode5_unsol_event(struct hda_codec *codec,
17737
switch (res >> 26) {
17738
case ALC880_HP_EVENT:
17739
alc663_15jd_two_speaker_automute(codec);
17741
case ALC880_MIC_EVENT:
17742
alc_mic_automute(codec);
17747
#define alc663_mode5_setup alc663_mode1_setup
17749
static void alc663_mode5_inithook(struct hda_codec *codec)
17751
alc663_15jd_two_speaker_automute(codec);
17752
alc_mic_automute(codec);
17754
/* ***************** Mode6 ******************************/
17755
static void alc663_mode6_unsol_event(struct hda_codec *codec,
17758
switch (res >> 26) {
17759
case ALC880_HP_EVENT:
17760
alc663_two_hp_m2_speaker_automute(codec);
17762
case ALC880_MIC_EVENT:
17763
alc_mic_automute(codec);
17768
#define alc663_mode6_setup alc663_mode1_setup
17770
static void alc663_mode6_inithook(struct hda_codec *codec)
17772
alc663_two_hp_m2_speaker_automute(codec);
17773
alc_mic_automute(codec);
17776
/* ***************** Mode7 ******************************/
17777
static void alc663_mode7_unsol_event(struct hda_codec *codec,
17780
switch (res >> 26) {
17781
case ALC880_HP_EVENT:
17782
alc663_two_hp_m7_speaker_automute(codec);
17784
case ALC880_MIC_EVENT:
17785
alc_mic_automute(codec);
17790
#define alc663_mode7_setup alc663_mode1_setup
17792
static void alc663_mode7_inithook(struct hda_codec *codec)
17794
alc663_two_hp_m7_speaker_automute(codec);
17795
alc_mic_automute(codec);
17798
/* ***************** Mode8 ******************************/
17799
static void alc663_mode8_unsol_event(struct hda_codec *codec,
17802
switch (res >> 26) {
17803
case ALC880_HP_EVENT:
17804
alc663_two_hp_m8_speaker_automute(codec);
17806
case ALC880_MIC_EVENT:
17807
alc_mic_automute(codec);
17812
#define alc663_mode8_setup alc663_m51va_setup
17814
static void alc663_mode8_inithook(struct hda_codec *codec)
17816
alc663_two_hp_m8_speaker_automute(codec);
17817
alc_mic_automute(codec);
17820
static void alc663_g71v_hp_automute(struct hda_codec *codec)
17822
unsigned int present;
17823
unsigned char bits;
17825
present = snd_hda_jack_detect(codec, 0x21);
17826
bits = present ? HDA_AMP_MUTE : 0;
17827
snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
17828
HDA_AMP_MUTE, bits);
17829
snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
17830
HDA_AMP_MUTE, bits);
17833
static void alc663_g71v_front_automute(struct hda_codec *codec)
17835
unsigned int present;
17836
unsigned char bits;
17838
present = snd_hda_jack_detect(codec, 0x15);
17839
bits = present ? HDA_AMP_MUTE : 0;
17840
snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
17841
HDA_AMP_MUTE, bits);
17844
static void alc663_g71v_unsol_event(struct hda_codec *codec,
17847
switch (res >> 26) {
17848
case ALC880_HP_EVENT:
17849
alc663_g71v_hp_automute(codec);
17851
case ALC880_FRONT_EVENT:
17852
alc663_g71v_front_automute(codec);
17854
case ALC880_MIC_EVENT:
17855
alc_mic_automute(codec);
17860
#define alc663_g71v_setup alc663_m51va_setup
17862
static void alc663_g71v_inithook(struct hda_codec *codec)
17864
alc663_g71v_front_automute(codec);
17865
alc663_g71v_hp_automute(codec);
17866
alc_mic_automute(codec);
17869
static void alc663_g50v_unsol_event(struct hda_codec *codec,
17872
switch (res >> 26) {
17873
case ALC880_HP_EVENT:
17874
alc663_m51va_speaker_automute(codec);
17876
case ALC880_MIC_EVENT:
17877
alc_mic_automute(codec);
17882
#define alc663_g50v_setup alc663_m51va_setup
17884
static void alc663_g50v_inithook(struct hda_codec *codec)
17886
alc663_m51va_speaker_automute(codec);
17887
alc_mic_automute(codec);
17890
static struct snd_kcontrol_new alc662_ecs_mixer[] = {
17891
HDA_CODEC_VOLUME("Master Playback Volume", 0x02, 0x0, HDA_OUTPUT),
17892
ALC262_HIPPO_MASTER_SWITCH,
17894
HDA_CODEC_VOLUME("e-Mic/LineIn Boost", 0x18, 0, HDA_INPUT),
17895
HDA_CODEC_VOLUME("e-Mic/LineIn Playback Volume", 0x0b, 0x0, HDA_INPUT),
17896
HDA_CODEC_MUTE("e-Mic/LineIn Playback Switch", 0x0b, 0x0, HDA_INPUT),
17898
HDA_CODEC_VOLUME("i-Mic Boost", 0x19, 0, HDA_INPUT),
17899
HDA_CODEC_VOLUME("i-Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
17900
HDA_CODEC_MUTE("i-Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
17904
static struct snd_kcontrol_new alc272_nc10_mixer[] = {
17905
/* Master Playback automatically created from Speaker and Headphone */
17906
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT),
17907
HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
17908
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
17909
HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT),
17911
HDA_CODEC_VOLUME("Ext Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
17912
HDA_CODEC_MUTE("Ext Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
17913
HDA_CODEC_VOLUME("Ext Mic Boost", 0x18, 0, HDA_INPUT),
17915
HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
17916
HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
17917
HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT),
17921
#ifdef CONFIG_SND_HDA_POWER_SAVE
17922
#define alc662_loopbacks alc880_loopbacks
17926
/* pcm configuration: identical with ALC880 */
17927
#define alc662_pcm_analog_playback alc880_pcm_analog_playback
17928
#define alc662_pcm_analog_capture alc880_pcm_analog_capture
17929
#define alc662_pcm_digital_playback alc880_pcm_digital_playback
17930
#define alc662_pcm_digital_capture alc880_pcm_digital_capture
17933
* configuration and preset
17935
static const char *alc662_models[ALC662_MODEL_LAST] = {
17936
[ALC662_3ST_2ch_DIG] = "3stack-dig",
17937
[ALC662_3ST_6ch_DIG] = "3stack-6ch-dig",
17938
[ALC662_3ST_6ch] = "3stack-6ch",
17939
[ALC662_5ST_DIG] = "6stack-dig",
17940
[ALC662_LENOVO_101E] = "lenovo-101e",
17941
[ALC662_ASUS_EEEPC_P701] = "eeepc-p701",
17942
[ALC662_ASUS_EEEPC_EP20] = "eeepc-ep20",
17943
[ALC662_ECS] = "ecs",
17944
[ALC663_ASUS_M51VA] = "m51va",
17945
[ALC663_ASUS_G71V] = "g71v",
17946
[ALC663_ASUS_H13] = "h13",
17947
[ALC663_ASUS_G50V] = "g50v",
17948
[ALC663_ASUS_MODE1] = "asus-mode1",
17949
[ALC662_ASUS_MODE2] = "asus-mode2",
17950
[ALC663_ASUS_MODE3] = "asus-mode3",
17951
[ALC663_ASUS_MODE4] = "asus-mode4",
17952
[ALC663_ASUS_MODE5] = "asus-mode5",
17953
[ALC663_ASUS_MODE6] = "asus-mode6",
17954
[ALC663_ASUS_MODE7] = "asus-mode7",
17955
[ALC663_ASUS_MODE8] = "asus-mode8",
17956
[ALC272_DELL] = "dell",
17957
[ALC272_DELL_ZM1] = "dell-zm1",
17958
[ALC272_SAMSUNG_NC10] = "samsung-nc10",
17959
[ALC662_AUTO] = "auto",
17962
static struct snd_pci_quirk alc662_cfg_tbl[] = {
17963
SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_ECS),
17964
SND_PCI_QUIRK(0x1028, 0x02d6, "DELL", ALC272_DELL),
17965
SND_PCI_QUIRK(0x1028, 0x02f4, "DELL ZM1", ALC272_DELL_ZM1),
17966
SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC663_ASUS_MODE1),
17967
SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC663_ASUS_MODE3),
17968
SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC663_ASUS_MODE1),
17969
SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC663_ASUS_MODE3),
17970
SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1),
17971
SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2),
17972
SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC663_ASUS_MODE1),
17973
SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC663_ASUS_MODE1),
17974
SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC663_ASUS_MODE1),
17975
SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_ASUS_MODE2),
17976
SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC663_ASUS_MODE7),
17977
SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC663_ASUS_MODE7),
17978
SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC663_ASUS_MODE8),
17979
SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC663_ASUS_MODE3),
17980
SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC663_ASUS_MODE1),
17981
SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_ASUS_MODE2),
17982
SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_ASUS_MODE2),
17983
SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC663_ASUS_MODE1),
17984
SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_ASUS_MODE2),
17985
SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC663_ASUS_MODE6),
17986
SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC663_ASUS_MODE6),
17987
SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_ASUS_MODE2),
17988
SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC663_ASUS_MODE1),
17989
SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC663_ASUS_MODE3),
17990
SND_PCI_QUIRK(0x1043, 0x17c3, "ASUS UX20", ALC663_ASUS_M51VA),
17991
SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_ASUS_MODE2),
17992
SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_ASUS_MODE2),
17993
SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC663_ASUS_MODE5),
17994
SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC663_ASUS_MODE6),
17995
SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_ASUS_MODE2),
17996
SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC663_ASUS_MODE1),
17997
SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_ASUS_MODE2),
17998
SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_ASUS_MODE2),
17999
SND_PCI_QUIRK(0x1043, 0x1878, "ASUS M51VA", ALC663_ASUS_M51VA),
18000
/*SND_PCI_QUIRK(0x1043, 0x1878, "ASUS M50Vr", ALC663_ASUS_MODE1),*/
18001
SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC663_ASUS_MODE3),
18002
SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC663_ASUS_MODE3),
18003
SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC663_ASUS_MODE1),
18004
SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC663_ASUS_MODE1),
18005
SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC663_ASUS_MODE1),
18006
SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC663_ASUS_MODE1),
18007
SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC663_ASUS_MODE1),
18008
SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_ASUS_MODE2),
18009
SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_ASUS_MODE2),
18010
SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC663_ASUS_MODE1),
18011
SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC663_ASUS_MODE1),
18012
SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC663_ASUS_MODE3),
18013
SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC663_ASUS_MODE1),
18014
SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC663_ASUS_MODE1),
18015
SND_PCI_QUIRK(0x1043, 0x19a3, "ASUS G50V", ALC663_ASUS_G50V),
18016
/*SND_PCI_QUIRK(0x1043, 0x19a3, "ASUS NB", ALC663_ASUS_MODE1),*/
18017
SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC663_ASUS_MODE1),
18018
SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_ASUS_MODE2),
18019
SND_PCI_QUIRK(0x1043, 0x19d3, "ASUS NB", ALC663_ASUS_M51VA),
18020
SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC663_ASUS_MODE1),
18021
SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC663_ASUS_MODE4),
18022
SND_PCI_QUIRK(0x1043, 0x8290, "ASUS P5GC-MX", ALC662_3ST_6ch_DIG),
18023
SND_PCI_QUIRK(0x1043, 0x82a1, "ASUS Eeepc", ALC662_ASUS_EEEPC_P701),
18024
SND_PCI_QUIRK(0x1043, 0x82d1, "ASUS Eeepc EP20", ALC662_ASUS_EEEPC_EP20),
18025
SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_ECS),
18026
SND_PCI_QUIRK(0x105b, 0x0d47, "Foxconn 45CMX/45GMX/45CMX-K",
18027
ALC662_3ST_6ch_DIG),
18028
SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB20x", ALC662_AUTO),
18029
SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10),
18030
SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L",
18031
ALC662_3ST_6ch_DIG),
18032
SND_PCI_QUIRK(0x152d, 0x2304, "Quanta WH1", ALC663_ASUS_H13),
18033
SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG),
18034
SND_PCI_QUIRK(0x1631, 0xc10c, "PB RS65", ALC663_ASUS_M51VA),
18035
SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo", ALC662_LENOVO_101E),
18036
SND_PCI_QUIRK(0x1849, 0x3662, "ASROCK K10N78FullHD-hSLI R3.0",
18037
ALC662_3ST_6ch_DIG),
18038
SND_PCI_QUIRK_MASK(0x1854, 0xf000, 0x2000, "ASUS H13-200x",
18043
static struct alc_config_preset alc662_presets[] = {
18044
[ALC662_3ST_2ch_DIG] = {
18045
.mixers = { alc662_3ST_2ch_mixer },
18046
.init_verbs = { alc662_init_verbs },
18047
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18048
.dac_nids = alc662_dac_nids,
18049
.dig_out_nid = ALC662_DIGOUT_NID,
18050
.dig_in_nid = ALC662_DIGIN_NID,
18051
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18052
.channel_mode = alc662_3ST_2ch_modes,
18053
.input_mux = &alc662_capture_source,
18055
[ALC662_3ST_6ch_DIG] = {
18056
.mixers = { alc662_3ST_6ch_mixer, alc662_chmode_mixer },
18057
.init_verbs = { alc662_init_verbs },
18058
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18059
.dac_nids = alc662_dac_nids,
18060
.dig_out_nid = ALC662_DIGOUT_NID,
18061
.dig_in_nid = ALC662_DIGIN_NID,
18062
.num_channel_mode = ARRAY_SIZE(alc662_3ST_6ch_modes),
18063
.channel_mode = alc662_3ST_6ch_modes,
18065
.input_mux = &alc662_capture_source,
18067
[ALC662_3ST_6ch] = {
18068
.mixers = { alc662_3ST_6ch_mixer, alc662_chmode_mixer },
18069
.init_verbs = { alc662_init_verbs },
18070
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18071
.dac_nids = alc662_dac_nids,
18072
.num_channel_mode = ARRAY_SIZE(alc662_3ST_6ch_modes),
18073
.channel_mode = alc662_3ST_6ch_modes,
18075
.input_mux = &alc662_capture_source,
18077
[ALC662_5ST_DIG] = {
18078
.mixers = { alc662_base_mixer, alc662_chmode_mixer },
18079
.init_verbs = { alc662_init_verbs },
18080
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18081
.dac_nids = alc662_dac_nids,
18082
.dig_out_nid = ALC662_DIGOUT_NID,
18083
.dig_in_nid = ALC662_DIGIN_NID,
18084
.num_channel_mode = ARRAY_SIZE(alc662_5stack_modes),
18085
.channel_mode = alc662_5stack_modes,
18086
.input_mux = &alc662_capture_source,
18088
[ALC662_LENOVO_101E] = {
18089
.mixers = { alc662_lenovo_101e_mixer },
18090
.init_verbs = { alc662_init_verbs, alc662_sue_init_verbs },
18091
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18092
.dac_nids = alc662_dac_nids,
18093
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18094
.channel_mode = alc662_3ST_2ch_modes,
18095
.input_mux = &alc662_lenovo_101e_capture_source,
18096
.unsol_event = alc662_lenovo_101e_unsol_event,
18097
.init_hook = alc662_lenovo_101e_all_automute,
18099
[ALC662_ASUS_EEEPC_P701] = {
18100
.mixers = { alc662_eeepc_p701_mixer },
18101
.init_verbs = { alc662_init_verbs,
18102
alc662_eeepc_sue_init_verbs },
18103
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18104
.dac_nids = alc662_dac_nids,
18105
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18106
.channel_mode = alc662_3ST_2ch_modes,
18107
.unsol_event = alc662_eeepc_unsol_event,
18108
.setup = alc662_eeepc_setup,
18109
.init_hook = alc662_eeepc_inithook,
18111
[ALC662_ASUS_EEEPC_EP20] = {
18112
.mixers = { alc662_eeepc_ep20_mixer,
18113
alc662_chmode_mixer },
18114
.init_verbs = { alc662_init_verbs,
18115
alc662_eeepc_ep20_sue_init_verbs },
18116
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18117
.dac_nids = alc662_dac_nids,
18118
.num_channel_mode = ARRAY_SIZE(alc662_3ST_6ch_modes),
18119
.channel_mode = alc662_3ST_6ch_modes,
18120
.input_mux = &alc662_lenovo_101e_capture_source,
18121
.unsol_event = alc662_eeepc_unsol_event,
18122
.setup = alc662_eeepc_ep20_setup,
18123
.init_hook = alc662_eeepc_ep20_inithook,
18126
.mixers = { alc662_ecs_mixer },
18127
.init_verbs = { alc662_init_verbs,
18128
alc662_ecs_init_verbs },
18129
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18130
.dac_nids = alc662_dac_nids,
18131
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18132
.channel_mode = alc662_3ST_2ch_modes,
18133
.unsol_event = alc662_eeepc_unsol_event,
18134
.setup = alc662_eeepc_setup,
18135
.init_hook = alc662_eeepc_inithook,
18137
[ALC663_ASUS_M51VA] = {
18138
.mixers = { alc663_m51va_mixer },
18139
.init_verbs = { alc662_init_verbs, alc663_m51va_init_verbs },
18140
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18141
.dac_nids = alc662_dac_nids,
18142
.dig_out_nid = ALC662_DIGOUT_NID,
18143
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18144
.channel_mode = alc662_3ST_2ch_modes,
18145
.unsol_event = alc663_m51va_unsol_event,
18146
.setup = alc663_m51va_setup,
18147
.init_hook = alc663_m51va_inithook,
18149
[ALC663_ASUS_G71V] = {
18150
.mixers = { alc663_g71v_mixer },
18151
.init_verbs = { alc662_init_verbs, alc663_g71v_init_verbs },
18152
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18153
.dac_nids = alc662_dac_nids,
18154
.dig_out_nid = ALC662_DIGOUT_NID,
18155
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18156
.channel_mode = alc662_3ST_2ch_modes,
18157
.unsol_event = alc663_g71v_unsol_event,
18158
.setup = alc663_g71v_setup,
18159
.init_hook = alc663_g71v_inithook,
18161
[ALC663_ASUS_H13] = {
18162
.mixers = { alc663_m51va_mixer },
18163
.init_verbs = { alc662_init_verbs, alc663_m51va_init_verbs },
18164
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18165
.dac_nids = alc662_dac_nids,
18166
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18167
.channel_mode = alc662_3ST_2ch_modes,
18168
.unsol_event = alc663_m51va_unsol_event,
18169
.init_hook = alc663_m51va_inithook,
18171
[ALC663_ASUS_G50V] = {
18172
.mixers = { alc663_g50v_mixer },
18173
.init_verbs = { alc662_init_verbs, alc663_g50v_init_verbs },
18174
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18175
.dac_nids = alc662_dac_nids,
18176
.dig_out_nid = ALC662_DIGOUT_NID,
18177
.num_channel_mode = ARRAY_SIZE(alc662_3ST_6ch_modes),
18178
.channel_mode = alc662_3ST_6ch_modes,
18179
.input_mux = &alc663_capture_source,
18180
.unsol_event = alc663_g50v_unsol_event,
18181
.setup = alc663_g50v_setup,
18182
.init_hook = alc663_g50v_inithook,
18184
[ALC663_ASUS_MODE1] = {
18185
.mixers = { alc663_m51va_mixer },
18186
.cap_mixer = alc662_auto_capture_mixer,
18187
.init_verbs = { alc662_init_verbs,
18188
alc663_21jd_amic_init_verbs },
18189
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18191
.dac_nids = alc662_dac_nids,
18192
.dig_out_nid = ALC662_DIGOUT_NID,
18193
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18194
.channel_mode = alc662_3ST_2ch_modes,
18195
.unsol_event = alc663_mode1_unsol_event,
18196
.setup = alc663_mode1_setup,
18197
.init_hook = alc663_mode1_inithook,
18199
[ALC662_ASUS_MODE2] = {
18200
.mixers = { alc662_1bjd_mixer },
18201
.cap_mixer = alc662_auto_capture_mixer,
18202
.init_verbs = { alc662_init_verbs,
18203
alc662_1bjd_amic_init_verbs },
18204
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18205
.dac_nids = alc662_dac_nids,
18206
.dig_out_nid = ALC662_DIGOUT_NID,
18207
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18208
.channel_mode = alc662_3ST_2ch_modes,
18209
.unsol_event = alc662_mode2_unsol_event,
18210
.setup = alc662_mode2_setup,
18211
.init_hook = alc662_mode2_inithook,
18213
[ALC663_ASUS_MODE3] = {
18214
.mixers = { alc663_two_hp_m1_mixer },
18215
.cap_mixer = alc662_auto_capture_mixer,
18216
.init_verbs = { alc662_init_verbs,
18217
alc663_two_hp_amic_m1_init_verbs },
18218
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18220
.dac_nids = alc662_dac_nids,
18221
.dig_out_nid = ALC662_DIGOUT_NID,
18222
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18223
.channel_mode = alc662_3ST_2ch_modes,
18224
.unsol_event = alc663_mode3_unsol_event,
18225
.setup = alc663_mode3_setup,
18226
.init_hook = alc663_mode3_inithook,
18228
[ALC663_ASUS_MODE4] = {
18229
.mixers = { alc663_asus_21jd_clfe_mixer },
18230
.cap_mixer = alc662_auto_capture_mixer,
18231
.init_verbs = { alc662_init_verbs,
18232
alc663_21jd_amic_init_verbs},
18233
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18235
.dac_nids = alc662_dac_nids,
18236
.dig_out_nid = ALC662_DIGOUT_NID,
18237
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18238
.channel_mode = alc662_3ST_2ch_modes,
18239
.unsol_event = alc663_mode4_unsol_event,
18240
.setup = alc663_mode4_setup,
18241
.init_hook = alc663_mode4_inithook,
18243
[ALC663_ASUS_MODE5] = {
18244
.mixers = { alc663_asus_15jd_clfe_mixer },
18245
.cap_mixer = alc662_auto_capture_mixer,
18246
.init_verbs = { alc662_init_verbs,
18247
alc663_15jd_amic_init_verbs },
18248
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18250
.dac_nids = alc662_dac_nids,
18251
.dig_out_nid = ALC662_DIGOUT_NID,
18252
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18253
.channel_mode = alc662_3ST_2ch_modes,
18254
.unsol_event = alc663_mode5_unsol_event,
18255
.setup = alc663_mode5_setup,
18256
.init_hook = alc663_mode5_inithook,
18258
[ALC663_ASUS_MODE6] = {
18259
.mixers = { alc663_two_hp_m2_mixer },
18260
.cap_mixer = alc662_auto_capture_mixer,
18261
.init_verbs = { alc662_init_verbs,
18262
alc663_two_hp_amic_m2_init_verbs },
18263
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18265
.dac_nids = alc662_dac_nids,
18266
.dig_out_nid = ALC662_DIGOUT_NID,
18267
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18268
.channel_mode = alc662_3ST_2ch_modes,
18269
.unsol_event = alc663_mode6_unsol_event,
18270
.setup = alc663_mode6_setup,
18271
.init_hook = alc663_mode6_inithook,
18273
[ALC663_ASUS_MODE7] = {
18274
.mixers = { alc663_mode7_mixer },
18275
.cap_mixer = alc662_auto_capture_mixer,
18276
.init_verbs = { alc662_init_verbs,
18277
alc663_mode7_init_verbs },
18278
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18280
.dac_nids = alc662_dac_nids,
18281
.dig_out_nid = ALC662_DIGOUT_NID,
18282
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18283
.channel_mode = alc662_3ST_2ch_modes,
18284
.unsol_event = alc663_mode7_unsol_event,
18285
.setup = alc663_mode7_setup,
18286
.init_hook = alc663_mode7_inithook,
18288
[ALC663_ASUS_MODE8] = {
18289
.mixers = { alc663_mode8_mixer },
18290
.cap_mixer = alc662_auto_capture_mixer,
18291
.init_verbs = { alc662_init_verbs,
18292
alc663_mode8_init_verbs },
18293
.num_dacs = ARRAY_SIZE(alc662_dac_nids),
18295
.dac_nids = alc662_dac_nids,
18296
.dig_out_nid = ALC662_DIGOUT_NID,
18297
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18298
.channel_mode = alc662_3ST_2ch_modes,
18299
.unsol_event = alc663_mode8_unsol_event,
18300
.setup = alc663_mode8_setup,
18301
.init_hook = alc663_mode8_inithook,
18304
.mixers = { alc663_m51va_mixer },
18305
.cap_mixer = alc272_auto_capture_mixer,
18306
.init_verbs = { alc662_init_verbs, alc272_dell_init_verbs },
18307
.num_dacs = ARRAY_SIZE(alc272_dac_nids),
18308
.dac_nids = alc662_dac_nids,
18309
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18310
.adc_nids = alc272_adc_nids,
18311
.num_adc_nids = ARRAY_SIZE(alc272_adc_nids),
18312
.capsrc_nids = alc272_capsrc_nids,
18313
.channel_mode = alc662_3ST_2ch_modes,
18314
.unsol_event = alc663_m51va_unsol_event,
18315
.setup = alc663_m51va_setup,
18316
.init_hook = alc663_m51va_inithook,
18318
[ALC272_DELL_ZM1] = {
18319
.mixers = { alc663_m51va_mixer },
18320
.cap_mixer = alc662_auto_capture_mixer,
18321
.init_verbs = { alc662_init_verbs, alc272_dell_zm1_init_verbs },
18322
.num_dacs = ARRAY_SIZE(alc272_dac_nids),
18323
.dac_nids = alc662_dac_nids,
18324
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18325
.adc_nids = alc662_adc_nids,
18327
.capsrc_nids = alc662_capsrc_nids,
18328
.channel_mode = alc662_3ST_2ch_modes,
18329
.unsol_event = alc663_m51va_unsol_event,
18330
.setup = alc663_m51va_setup,
18331
.init_hook = alc663_m51va_inithook,
18333
[ALC272_SAMSUNG_NC10] = {
18334
.mixers = { alc272_nc10_mixer },
18335
.init_verbs = { alc662_init_verbs,
18336
alc663_21jd_amic_init_verbs },
18337
.num_dacs = ARRAY_SIZE(alc272_dac_nids),
18338
.dac_nids = alc272_dac_nids,
18339
.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
18340
.channel_mode = alc662_3ST_2ch_modes,
18341
/*.input_mux = &alc272_nc10_capture_source,*/
18342
.unsol_event = alc663_mode4_unsol_event,
18343
.setup = alc663_mode4_setup,
18344
.init_hook = alc663_mode4_inithook,
18350
* BIOS auto configuration
18353
/* convert from MIX nid to DAC */
18354
static inline hda_nid_t alc662_mix_to_dac(hda_nid_t nid)
18358
else if (nid >= 0x0c && nid <= 0x0e)
18359
return nid - 0x0c + 0x02;
18360
else if (nid == 0x26) /* ALC887-VD has this DAC too */
18366
/* get MIX nid connected to the given pin targeted to DAC */
18367
static hda_nid_t alc662_dac_to_mix(struct hda_codec *codec, hda_nid_t pin,
18373
num = snd_hda_get_connections(codec, pin, mix, ARRAY_SIZE(mix));
18374
for (i = 0; i < num; i++) {
18375
if (alc662_mix_to_dac(mix[i]) == dac)
18381
/* look for an empty DAC slot */
18382
static hda_nid_t alc662_look_for_dac(struct hda_codec *codec, hda_nid_t pin)
18384
struct alc_spec *spec = codec->spec;
18388
num = snd_hda_get_connections(codec, pin, srcs, ARRAY_SIZE(srcs));
18391
for (i = 0; i < num; i++) {
18392
hda_nid_t nid = alc662_mix_to_dac(srcs[i]);
18395
for (j = 0; j < spec->multiout.num_dacs; j++)
18396
if (spec->multiout.dac_nids[j] == nid)
18398
if (j >= spec->multiout.num_dacs)
18404
/* fill in the dac_nids table from the parsed pin configuration */
18405
static int alc662_auto_fill_dac_nids(struct hda_codec *codec,
18406
const struct auto_pin_cfg *cfg)
18408
struct alc_spec *spec = codec->spec;
18412
spec->multiout.dac_nids = spec->private_dac_nids;
18413
for (i = 0; i < cfg->line_outs; i++) {
18414
dac = alc662_look_for_dac(codec, cfg->line_out_pins[i]);
18417
spec->multiout.dac_nids[spec->multiout.num_dacs++] = dac;
18422
static inline int alc662_add_vol_ctl(struct alc_spec *spec, const char *pfx,
18423
hda_nid_t nid, unsigned int chs)
18425
return add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL, pfx,
18426
HDA_COMPOSE_AMP_VAL(nid, chs, 0, HDA_OUTPUT));
18429
static inline int alc662_add_sw_ctl(struct alc_spec *spec, const char *pfx,
18430
hda_nid_t nid, unsigned int chs)
18432
return add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx,
18433
HDA_COMPOSE_AMP_VAL(nid, chs, 0, HDA_INPUT));
18436
#define alc662_add_stereo_vol(spec, pfx, nid) \
18437
alc662_add_vol_ctl(spec, pfx, nid, 3)
18438
#define alc662_add_stereo_sw(spec, pfx, nid) \
18439
alc662_add_sw_ctl(spec, pfx, nid, 3)
18441
/* add playback controls from the parsed DAC table */
18442
static int alc662_auto_create_multi_out_ctls(struct hda_codec *codec,
18443
const struct auto_pin_cfg *cfg)
18445
struct alc_spec *spec = codec->spec;
18446
static const char *chname[4] = {
18447
"Front", "Surround", NULL /*CLFE*/, "Side"
18449
hda_nid_t nid, mix;
18452
for (i = 0; i < cfg->line_outs; i++) {
18453
nid = spec->multiout.dac_nids[i];
18456
mix = alc662_dac_to_mix(codec, cfg->line_out_pins[i], nid);
18461
err = alc662_add_vol_ctl(spec, "Center", nid, 1);
18464
err = alc662_add_vol_ctl(spec, "LFE", nid, 2);
18467
err = alc662_add_sw_ctl(spec, "Center", mix, 1);
18470
err = alc662_add_sw_ctl(spec, "LFE", mix, 2);
18475
if (cfg->line_outs == 1 &&
18476
cfg->line_out_type == AUTO_PIN_SPEAKER_OUT) {
18483
err = alc662_add_vol_ctl(spec, pfx, nid, 3);
18486
if (cfg->line_outs == 1 &&
18487
cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)
18489
err = alc662_add_sw_ctl(spec, pfx, mix, 3);
18497
/* add playback controls for speaker and HP outputs */
18498
/* return DAC nid if any new DAC is assigned */
18499
static int alc662_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin,
18502
struct alc_spec *spec = codec->spec;
18503
hda_nid_t nid, mix;
18508
nid = alc662_look_for_dac(codec, pin);
18510
/* the corresponding DAC is already occupied */
18511
if (!(get_wcaps(codec, pin) & AC_WCAP_OUT_AMP))
18512
return 0; /* no way */
18513
/* create a switch only */
18514
return add_pb_sw_ctrl(spec, ALC_CTL_WIDGET_MUTE, pfx,
18515
HDA_COMPOSE_AMP_VAL(pin, 3, 0, HDA_OUTPUT));
18518
mix = alc662_dac_to_mix(codec, pin, nid);
18521
err = alc662_add_vol_ctl(spec, pfx, nid, 3);
18524
err = alc662_add_sw_ctl(spec, pfx, mix, 3);
18530
/* create playback/capture controls for input pins */
18531
#define alc662_auto_create_input_ctls \
18532
alc882_auto_create_input_ctls
18534
static void alc662_auto_set_output_and_unmute(struct hda_codec *codec,
18535
hda_nid_t nid, int pin_type,
18541
alc_set_pin_output(codec, nid, pin_type);
18542
/* need the manual connection? */
18543
num = snd_hda_get_connections(codec, nid, srcs, ARRAY_SIZE(srcs));
18546
for (i = 0; i < num; i++) {
18547
if (alc662_mix_to_dac(srcs[i]) != dac)
18549
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, i);
18554
static void alc662_auto_init_multi_out(struct hda_codec *codec)
18556
struct alc_spec *spec = codec->spec;
18557
int pin_type = get_pin_type(spec->autocfg.line_out_type);
18560
for (i = 0; i <= HDA_SIDE; i++) {
18561
hda_nid_t nid = spec->autocfg.line_out_pins[i];
18563
alc662_auto_set_output_and_unmute(codec, nid, pin_type,
18564
spec->multiout.dac_nids[i]);
18568
static void alc662_auto_init_hp_out(struct hda_codec *codec)
18570
struct alc_spec *spec = codec->spec;
18573
pin = spec->autocfg.hp_pins[0];
18575
alc662_auto_set_output_and_unmute(codec, pin, PIN_HP,
18576
spec->multiout.hp_nid);
18577
pin = spec->autocfg.speaker_pins[0];
18579
alc662_auto_set_output_and_unmute(codec, pin, PIN_OUT,
18580
spec->multiout.extra_out_nid[0]);
18583
#define ALC662_PIN_CD_NID ALC880_PIN_CD_NID
18585
static void alc662_auto_init_analog_input(struct hda_codec *codec)
18587
struct alc_spec *spec = codec->spec;
18590
for (i = 0; i < AUTO_PIN_LAST; i++) {
18591
hda_nid_t nid = spec->autocfg.input_pins[i];
18592
if (alc_is_input_pin(codec, nid)) {
18593
alc_set_input_pin(codec, nid, i);
18594
if (nid != ALC662_PIN_CD_NID &&
18595
(get_wcaps(codec, nid) & AC_WCAP_OUT_AMP))
18596
snd_hda_codec_write(codec, nid, 0,
18597
AC_VERB_SET_AMP_GAIN_MUTE,
18603
#define alc662_auto_init_input_src alc882_auto_init_input_src
18605
static int alc662_parse_auto_config(struct hda_codec *codec)
18607
struct alc_spec *spec = codec->spec;
18609
static hda_nid_t alc662_ignore[] = { 0x1d, 0 };
18611
err = snd_hda_parse_pin_def_config(codec, &spec->autocfg,
18615
if (!spec->autocfg.line_outs)
18616
return 0; /* can't find valid BIOS pin config */
18618
err = alc662_auto_fill_dac_nids(codec, &spec->autocfg);
18621
err = alc662_auto_create_multi_out_ctls(codec, &spec->autocfg);
18624
err = alc662_auto_create_extra_out(codec,
18625
spec->autocfg.speaker_pins[0],
18630
spec->multiout.extra_out_nid[0] = err;
18631
err = alc662_auto_create_extra_out(codec, spec->autocfg.hp_pins[0],
18636
spec->multiout.hp_nid = err;
18637
err = alc662_auto_create_input_ctls(codec, &spec->autocfg);
18641
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
18643
if (spec->autocfg.dig_outs)
18644
spec->multiout.dig_out_nid = ALC880_DIGOUT_NID;
18646
if (spec->kctls.list)
18647
add_mixer(spec, spec->kctls.list);
18649
spec->num_mux_defs = 1;
18650
spec->input_mux = &spec->private_imux[0];
18652
add_verb(spec, alc662_init_verbs);
18653
if (codec->vendor_id == 0x10ec0272 || codec->vendor_id == 0x10ec0663 ||
18654
codec->vendor_id == 0x10ec0665)
18655
add_verb(spec, alc663_init_verbs);
18657
if (codec->vendor_id == 0x10ec0272)
18658
add_verb(spec, alc272_init_verbs);
18660
err = alc_auto_add_mic_boost(codec);
18664
if (codec->vendor_id == 0x10ec0272 || codec->vendor_id == 0x10ec0663 ||
18665
codec->vendor_id == 0x10ec0665 || codec->vendor_id == 0x10ec0670)
18666
alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0x21);
18668
alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0);
18673
/* additional initialization for auto-configuration model */
18674
static void alc662_auto_init(struct hda_codec *codec)
18676
struct alc_spec *spec = codec->spec;
18677
alc662_auto_init_multi_out(codec);
18678
alc662_auto_init_hp_out(codec);
18679
alc662_auto_init_analog_input(codec);
18680
alc662_auto_init_input_src(codec);
18681
if (spec->unsol_event)
18682
alc_inithook(codec);
18686
ALC662_FIXUP_ASPIRE,
18687
ALC662_FIXUP_IDEAPAD,
18690
static const struct alc_fixup alc662_fixups[] = {
18691
[ALC662_FIXUP_ASPIRE] = {
18692
.pins = (const struct alc_pincfg[]) {
18693
{ 0x15, 0x99130112 }, /* subwoofer */
18697
[ALC662_FIXUP_IDEAPAD] = {
18698
.pins = (const struct alc_pincfg[]) {
18699
{ 0x17, 0x99130112 }, /* subwoofer */
18705
static struct snd_pci_quirk alc662_fixup_tbl[] = {
18706
SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
18707
SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
18708
SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
18709
SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
18715
static int patch_alc662(struct hda_codec *codec)
18717
struct alc_spec *spec;
18718
int err, board_config;
18720
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
18724
codec->spec = spec;
18726
alc_auto_parse_customize_define(codec);
18728
alc_fix_pll_init(codec, 0x20, 0x04, 15);
18730
if (alc_read_coef_idx(codec, 0) == 0x8020)
18731
alc_codec_rename(codec, "ALC661");
18732
else if ((alc_read_coef_idx(codec, 0) & (1 << 14)) &&
18733
codec->bus->pci->subsystem_vendor == 0x1025 &&
18734
spec->cdefine.platform_type == 1)
18735
alc_codec_rename(codec, "ALC272X");
18737
board_config = snd_hda_check_board_config(codec, ALC662_MODEL_LAST,
18740
if (board_config < 0) {
18741
printk(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n",
18743
board_config = ALC662_AUTO;
18746
if (board_config == ALC662_AUTO) {
18747
alc_pick_fixup(codec, alc662_fixup_tbl, alc662_fixups, 1);
18748
/* automatic parse from the BIOS config */
18749
err = alc662_parse_auto_config(codec);
18755
"hda_codec: Cannot set up configuration "
18756
"from BIOS. Using base mode...\n");
18757
board_config = ALC662_3ST_2ch_DIG;
18761
if (has_cdefine_beep(codec)) {
18762
err = snd_hda_attach_beep_device(codec, 0x1);
18769
if (board_config != ALC662_AUTO)
18770
setup_preset(codec, &alc662_presets[board_config]);
18772
spec->stream_analog_playback = &alc662_pcm_analog_playback;
18773
spec->stream_analog_capture = &alc662_pcm_analog_capture;
18775
spec->stream_digital_playback = &alc662_pcm_digital_playback;
18776
spec->stream_digital_capture = &alc662_pcm_digital_capture;
18778
if (!spec->adc_nids) {
18779
spec->adc_nids = alc662_adc_nids;
18780
spec->num_adc_nids = ARRAY_SIZE(alc662_adc_nids);
18782
if (!spec->capsrc_nids)
18783
spec->capsrc_nids = alc662_capsrc_nids;
18785
if (!spec->cap_mixer)
18786
set_capture_mixer(codec);
18788
if (has_cdefine_beep(codec)) {
18789
switch (codec->vendor_id) {
18791
set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
18796
set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
18799
set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
18803
spec->vmaster_nid = 0x02;
18805
codec->patch_ops = alc_patch_ops;
18806
if (board_config == ALC662_AUTO) {
18807
spec->init_hook = alc662_auto_init;
18808
alc_pick_fixup(codec, alc662_fixup_tbl, alc662_fixups, 0);
18811
#ifdef CONFIG_SND_HDA_POWER_SAVE
18812
if (!spec->loopback.amplist)
18813
spec->loopback.amplist = alc662_loopbacks;
18819
static int patch_alc888(struct hda_codec *codec)
18821
if ((alc_read_coef_idx(codec, 0) & 0x00f0)==0x0030){
18822
kfree(codec->chip_name);
18823
if (codec->vendor_id == 0x10ec0887)
18824
codec->chip_name = kstrdup("ALC887-VD", GFP_KERNEL);
18826
codec->chip_name = kstrdup("ALC888-VD", GFP_KERNEL);
18827
if (!codec->chip_name) {
18831
return patch_alc662(codec);
18833
return patch_alc882(codec);
18839
static struct hda_codec_preset snd_hda_preset_realtek[] = {
18840
{ .id = 0x10ec0260, .name = "ALC260", .patch = patch_alc260 },
18841
{ .id = 0x10ec0262, .name = "ALC262", .patch = patch_alc262 },
18842
{ .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 },
18843
{ .id = 0x10ec0268, .name = "ALC268", .patch = patch_alc268 },
18844
{ .id = 0x10ec0269, .name = "ALC269", .patch = patch_alc269 },
18845
{ .id = 0x10ec0270, .name = "ALC270", .patch = patch_alc269 },
18846
{ .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 },
18847
{ .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 },
18848
{ .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
18849
.patch = patch_alc861 },
18850
{ .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd },
18851
{ .id = 0x10ec0861, .name = "ALC861", .patch = patch_alc861 },
18852
{ .id = 0x10ec0862, .name = "ALC861-VD", .patch = patch_alc861vd },
18853
{ .id = 0x10ec0662, .rev = 0x100002, .name = "ALC662 rev2",
18854
.patch = patch_alc882 },
18855
{ .id = 0x10ec0662, .rev = 0x100101, .name = "ALC662 rev1",
18856
.patch = patch_alc662 },
18857
{ .id = 0x10ec0663, .name = "ALC663", .patch = patch_alc662 },
18858
{ .id = 0x10ec0665, .name = "ALC665", .patch = patch_alc662 },
18859
{ .id = 0x10ec0670, .name = "ALC670", .patch = patch_alc662 },
18860
{ .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 },
18861
{ .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 },
18862
{ .id = 0x10ec0883, .name = "ALC883", .patch = patch_alc882 },
18863
{ .id = 0x10ec0885, .rev = 0x100101, .name = "ALC889A",
18864
.patch = patch_alc882 },
18865
{ .id = 0x10ec0885, .rev = 0x100103, .name = "ALC889A",
18866
.patch = patch_alc882 },
18867
{ .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 },
18868
{ .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc888 },
18869
{ .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200",
18870
.patch = patch_alc882 },
18871
{ .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc888 },
18872
{ .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc882 },
18873
{ .id = 0x10ec0892, .name = "ALC892", .patch = patch_alc662 },
18874
{} /* terminator */
18877
MODULE_ALIAS("snd-hda-codec-id:10ec*");
18879
MODULE_LICENSE("GPL");
18880
MODULE_DESCRIPTION("Realtek HD-audio codec");
18882
static struct hda_codec_preset_list realtek_list = {
18883
.preset = snd_hda_preset_realtek,
18884
.owner = THIS_MODULE,
18887
static int __init patch_realtek_init(void)
18889
return snd_hda_add_codec_preset(&realtek_list);
18892
static void __exit patch_realtek_exit(void)
18894
snd_hda_delete_codec_preset(&realtek_list);
18897
module_init(patch_realtek_init)
18898
module_exit(patch_realtek_exit)