Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Universal Interface for Intel High Definition Audio Codec |
| 3 | * |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4 | * HD audio interface patch for Realtek ALC codecs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 6 | * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw> |
| 7 | * PeiSen Hou <pshou@realtek.com.tw> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | * Takashi Iwai <tiwai@suse.de> |
Jonathan Woithe | 409a3e9 | 2012-03-27 13:01:01 +1030 | [diff] [blame] | 9 | * Jonathan Woithe <jwoithe@just42.net> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | * |
| 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. |
| 15 | * |
| 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. |
| 20 | * |
| 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 |
| 24 | */ |
| 25 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | #include <linux/init.h> |
| 27 | #include <linux/delay.h> |
| 28 | #include <linux/slab.h> |
| 29 | #include <linux/pci.h> |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 30 | #include <linux/dmi.h> |
Paul Gortmaker | da155d5 | 2011-07-15 12:38:28 -0400 | [diff] [blame] | 31 | #include <linux/module.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | #include <sound/core.h> |
Kailang Yang | 9ad0e49 | 2010-09-14 23:22:00 +0200 | [diff] [blame] | 33 | #include <sound/jack.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | #include "hda_codec.h" |
| 35 | #include "hda_local.h" |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 36 | #include "hda_auto_parser.h" |
Takashi Iwai | 1835a0f | 2011-10-27 22:12:46 +0200 | [diff] [blame] | 37 | #include "hda_jack.h" |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 38 | #include "hda_generic.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 40 | /* keep halting ALC5505 DSP, for power saving */ |
| 41 | #define HALT_REALTEK_ALC5505 |
| 42 | |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 43 | /* for GPIO Poll */ |
| 44 | #define GPIO_MASK 0x03 |
| 45 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 46 | /* extra amp-initialization sequence types */ |
| 47 | enum { |
| 48 | ALC_INIT_NONE, |
| 49 | ALC_INIT_DEFAULT, |
| 50 | ALC_INIT_GPIO1, |
| 51 | ALC_INIT_GPIO2, |
| 52 | ALC_INIT_GPIO3, |
| 53 | }; |
| 54 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 55 | enum { |
| 56 | ALC_HEADSET_MODE_UNKNOWN, |
| 57 | ALC_HEADSET_MODE_UNPLUGGED, |
| 58 | ALC_HEADSET_MODE_HEADSET, |
| 59 | ALC_HEADSET_MODE_MIC, |
| 60 | ALC_HEADSET_MODE_HEADPHONE, |
| 61 | }; |
| 62 | |
| 63 | enum { |
| 64 | ALC_HEADSET_TYPE_UNKNOWN, |
| 65 | ALC_HEADSET_TYPE_CTIA, |
| 66 | ALC_HEADSET_TYPE_OMTP, |
| 67 | }; |
| 68 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 69 | struct alc_customize_define { |
| 70 | unsigned int sku_cfg; |
| 71 | unsigned char port_connectivity; |
| 72 | unsigned char check_sum; |
| 73 | unsigned char customization; |
| 74 | unsigned char external_amp; |
| 75 | unsigned int enable_pcbeep:1; |
| 76 | unsigned int platform_type:1; |
| 77 | unsigned int swap:1; |
| 78 | unsigned int override:1; |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 79 | unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */ |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 80 | }; |
| 81 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | struct alc_spec { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 83 | struct hda_gen_spec gen; /* must be at head */ |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 84 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 85 | /* codec parameterization */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 86 | const struct snd_kcontrol_new *mixers[5]; /* mixer arrays */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | unsigned int num_mixers; |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 88 | unsigned int beep_amp; /* beep amp value, set via set_beep_amp() */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 90 | struct alc_customize_define cdefine; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 91 | unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */ |
| 92 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 93 | /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */ |
| 94 | int mute_led_polarity; |
| 95 | hda_nid_t mute_led_nid; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 96 | hda_nid_t cap_mute_led_nid; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 97 | |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 98 | unsigned int gpio_led; /* used for alc269_fixup_hp_gpio_led() */ |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 99 | unsigned int gpio_mute_led_mask; |
| 100 | unsigned int gpio_mic_led_mask; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 101 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 102 | hda_nid_t headset_mic_pin; |
| 103 | hda_nid_t headphone_mic_pin; |
| 104 | int current_headset_mode; |
| 105 | int current_headset_type; |
| 106 | |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 107 | /* hooks */ |
| 108 | void (*init_hook)(struct hda_codec *codec); |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 109 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 110 | void (*power_hook)(struct hda_codec *codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 111 | #endif |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 112 | void (*shutup)(struct hda_codec *codec); |
Takashi Iwai | d922b51 | 2011-04-28 12:18:53 +0200 | [diff] [blame] | 113 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 114 | int init_amp; |
Takashi Iwai | d433a67 | 2010-09-20 15:11:54 +0200 | [diff] [blame] | 115 | int codec_variant; /* flag for other variants */ |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 116 | unsigned int has_alc5505_dsp:1; |
| 117 | unsigned int no_depop_delay:1; |
Takashi Iwai | e64f14f | 2009-01-20 18:32:55 +0100 | [diff] [blame] | 118 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 119 | /* for PLL fix */ |
| 120 | hda_nid_t pll_nid; |
| 121 | unsigned int pll_coef_idx, pll_coef_bit; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 122 | unsigned int coef0; |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 123 | }; |
| 124 | |
Takashi Iwai | 23f0c04 | 2009-02-26 13:03:58 +0100 | [diff] [blame] | 125 | /* |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 126 | * COEF access helper functions |
| 127 | */ |
| 128 | |
| 129 | static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 130 | unsigned int coef_idx) |
| 131 | { |
| 132 | unsigned int val; |
| 133 | |
| 134 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 135 | val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); |
| 136 | return val; |
| 137 | } |
| 138 | |
| 139 | #define alc_read_coef_idx(codec, coef_idx) \ |
| 140 | alc_read_coefex_idx(codec, 0x20, coef_idx) |
| 141 | |
| 142 | static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 143 | unsigned int coef_idx, unsigned int coef_val) |
| 144 | { |
| 145 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 146 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); |
| 147 | } |
| 148 | |
| 149 | #define alc_write_coef_idx(codec, coef_idx, coef_val) \ |
| 150 | alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) |
| 151 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 152 | static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 153 | unsigned int coef_idx, unsigned int mask, |
| 154 | unsigned int bits_set) |
| 155 | { |
| 156 | unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx); |
| 157 | |
| 158 | if (val != -1) |
| 159 | alc_write_coefex_idx(codec, nid, coef_idx, |
| 160 | (val & ~mask) | bits_set); |
| 161 | } |
| 162 | |
| 163 | #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ |
| 164 | alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) |
| 165 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 166 | /* a special bypass for COEF 0; read the cached value at the second time */ |
| 167 | static unsigned int alc_get_coef0(struct hda_codec *codec) |
| 168 | { |
| 169 | struct alc_spec *spec = codec->spec; |
| 170 | |
| 171 | if (!spec->coef0) |
| 172 | spec->coef0 = alc_read_coef_idx(codec, 0); |
| 173 | return spec->coef0; |
| 174 | } |
| 175 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 176 | /* coef writes/updates batch */ |
| 177 | struct coef_fw { |
| 178 | unsigned char nid; |
| 179 | unsigned char idx; |
| 180 | unsigned short mask; |
| 181 | unsigned short val; |
| 182 | }; |
| 183 | |
| 184 | #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ |
| 185 | { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } |
| 186 | #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) |
| 187 | #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) |
| 188 | #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) |
| 189 | |
| 190 | static void alc_process_coef_fw(struct hda_codec *codec, |
| 191 | const struct coef_fw *fw) |
| 192 | { |
| 193 | for (; fw->nid; fw++) { |
| 194 | if (fw->mask == (unsigned short)-1) |
| 195 | alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); |
| 196 | else |
| 197 | alc_update_coefex_idx(codec, fw->nid, fw->idx, |
| 198 | fw->mask, fw->val); |
| 199 | } |
| 200 | } |
| 201 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 202 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 203 | * Append the given mixer and verb elements for the later use |
| 204 | * The mixer array is referred in build_controls(), and init_verbs are |
| 205 | * called in init(). |
Takashi Iwai | d88897e | 2008-10-31 15:01:37 +0100 | [diff] [blame] | 206 | */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 207 | static void add_mixer(struct alc_spec *spec, const struct snd_kcontrol_new *mix) |
Takashi Iwai | d88897e | 2008-10-31 15:01:37 +0100 | [diff] [blame] | 208 | { |
| 209 | if (snd_BUG_ON(spec->num_mixers >= ARRAY_SIZE(spec->mixers))) |
| 210 | return; |
| 211 | spec->mixers[spec->num_mixers++] = mix; |
| 212 | } |
| 213 | |
Takashi Iwai | d88897e | 2008-10-31 15:01:37 +0100 | [diff] [blame] | 214 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 215 | * GPIO setup tables, used in initialization |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 216 | */ |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 217 | /* Enable GPIO mask and set output */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 218 | static const struct hda_verb alc_gpio1_init_verbs[] = { |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 219 | {0x01, AC_VERB_SET_GPIO_MASK, 0x01}, |
| 220 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01}, |
| 221 | {0x01, AC_VERB_SET_GPIO_DATA, 0x01}, |
| 222 | { } |
| 223 | }; |
| 224 | |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 225 | static const struct hda_verb alc_gpio2_init_verbs[] = { |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 226 | {0x01, AC_VERB_SET_GPIO_MASK, 0x02}, |
| 227 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x02}, |
| 228 | {0x01, AC_VERB_SET_GPIO_DATA, 0x02}, |
| 229 | { } |
| 230 | }; |
| 231 | |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 232 | static const struct hda_verb alc_gpio3_init_verbs[] = { |
Kailang Yang | bdd148a | 2007-05-08 15:19:08 +0200 | [diff] [blame] | 233 | {0x01, AC_VERB_SET_GPIO_MASK, 0x03}, |
| 234 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x03}, |
| 235 | {0x01, AC_VERB_SET_GPIO_DATA, 0x03}, |
| 236 | { } |
| 237 | }; |
| 238 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 239 | /* |
| 240 | * Fix hardware PLL issue |
| 241 | * On some codecs, the analog PLL gating control must be off while |
| 242 | * the default value is 1. |
| 243 | */ |
| 244 | static void alc_fix_pll(struct hda_codec *codec) |
| 245 | { |
| 246 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 247 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 248 | if (spec->pll_nid) |
| 249 | alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, |
| 250 | 1 << spec->pll_coef_bit, 0); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 251 | } |
| 252 | |
| 253 | static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, |
| 254 | unsigned int coef_idx, unsigned int coef_bit) |
| 255 | { |
| 256 | struct alc_spec *spec = codec->spec; |
| 257 | spec->pll_nid = nid; |
| 258 | spec->pll_coef_idx = coef_idx; |
| 259 | spec->pll_coef_bit = coef_bit; |
| 260 | alc_fix_pll(codec); |
| 261 | } |
| 262 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 263 | /* update the master volume per volume-knob's unsol event */ |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 264 | static void alc_update_knob_master(struct hda_codec *codec, |
| 265 | struct hda_jack_callback *jack) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 266 | { |
| 267 | unsigned int val; |
| 268 | struct snd_kcontrol *kctl; |
| 269 | struct snd_ctl_elem_value *uctl; |
| 270 | |
| 271 | kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); |
| 272 | if (!kctl) |
| 273 | return; |
| 274 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); |
| 275 | if (!uctl) |
| 276 | return; |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 277 | val = snd_hda_codec_read(codec, jack->tbl->nid, 0, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 278 | AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); |
| 279 | val &= HDA_AMP_VOLMASK; |
| 280 | uctl->value.integer.value[0] = val; |
| 281 | uctl->value.integer.value[1] = val; |
| 282 | kctl->put(kctl, uctl); |
| 283 | kfree(uctl); |
| 284 | } |
| 285 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 286 | static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 287 | { |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 288 | /* For some reason, the res given from ALC880 is broken. |
| 289 | Here we adjust it properly. */ |
| 290 | snd_hda_jack_unsol_event(codec, res >> 2); |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 291 | } |
| 292 | |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 293 | /* Change EAPD to verb control */ |
| 294 | static void alc_fill_eapd_coef(struct hda_codec *codec) |
| 295 | { |
| 296 | int coef; |
| 297 | |
| 298 | coef = alc_get_coef0(codec); |
| 299 | |
| 300 | switch (codec->vendor_id) { |
| 301 | case 0x10ec0262: |
| 302 | alc_update_coef_idx(codec, 0x7, 0, 1<<5); |
| 303 | break; |
| 304 | case 0x10ec0267: |
| 305 | case 0x10ec0268: |
| 306 | alc_update_coef_idx(codec, 0x7, 0, 1<<13); |
| 307 | break; |
| 308 | case 0x10ec0269: |
| 309 | if ((coef & 0x00f0) == 0x0010) |
| 310 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); |
| 311 | if ((coef & 0x00f0) == 0x0020) |
| 312 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 313 | if ((coef & 0x00f0) == 0x0030) |
| 314 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 315 | break; |
| 316 | case 0x10ec0280: |
| 317 | case 0x10ec0284: |
| 318 | case 0x10ec0290: |
| 319 | case 0x10ec0292: |
| 320 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 321 | break; |
| 322 | case 0x10ec0233: |
| 323 | case 0x10ec0255: |
| 324 | case 0x10ec0282: |
| 325 | case 0x10ec0283: |
| 326 | case 0x10ec0286: |
| 327 | case 0x10ec0288: |
| 328 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 329 | break; |
| 330 | case 0x10ec0285: |
| 331 | case 0x10ec0293: |
| 332 | alc_update_coef_idx(codec, 0xa, 1<<13, 0); |
| 333 | break; |
| 334 | case 0x10ec0662: |
| 335 | if ((coef & 0x00f0) == 0x0030) |
| 336 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ |
| 337 | break; |
| 338 | case 0x10ec0272: |
| 339 | case 0x10ec0273: |
| 340 | case 0x10ec0663: |
| 341 | case 0x10ec0665: |
| 342 | case 0x10ec0670: |
| 343 | case 0x10ec0671: |
| 344 | case 0x10ec0672: |
| 345 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ |
| 346 | break; |
| 347 | case 0x10ec0668: |
| 348 | alc_update_coef_idx(codec, 0x7, 3<<13, 0); |
| 349 | break; |
| 350 | case 0x10ec0867: |
| 351 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); |
| 352 | break; |
| 353 | case 0x10ec0888: |
| 354 | if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030) |
| 355 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 356 | break; |
| 357 | case 0x10ec0892: |
| 358 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 359 | break; |
| 360 | case 0x10ec0899: |
| 361 | case 0x10ec0900: |
| 362 | alc_update_coef_idx(codec, 0x7, 1<<1, 0); |
| 363 | break; |
| 364 | } |
| 365 | } |
| 366 | |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 367 | /* additional initialization for ALC888 variants */ |
| 368 | static void alc888_coef_init(struct hda_codec *codec) |
| 369 | { |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 370 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 371 | /* alc888-VA */ |
| 372 | case 0x00: |
| 373 | /* alc888-VB */ |
| 374 | case 0x10: |
| 375 | alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ |
| 376 | break; |
| 377 | } |
Jaroslav Kysela | 87a8c37 | 2009-07-23 10:58:29 +0200 | [diff] [blame] | 378 | } |
| 379 | |
Takashi Iwai | 3fb4a50 | 2010-01-19 15:46:37 +0100 | [diff] [blame] | 380 | /* turn on/off EAPD control (only if available) */ |
| 381 | static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) |
| 382 | { |
| 383 | if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) |
| 384 | return; |
| 385 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) |
| 386 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, |
| 387 | on ? 2 : 0); |
| 388 | } |
| 389 | |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 390 | /* turn on/off EAPD controls of the codec */ |
| 391 | static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) |
| 392 | { |
| 393 | /* We currently only handle front, HP */ |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 394 | static hda_nid_t pins[] = { |
| 395 | 0x0f, 0x10, 0x14, 0x15, 0 |
| 396 | }; |
| 397 | hda_nid_t *p; |
| 398 | for (p = pins; *p; p++) |
| 399 | set_eapd(codec, *p, on); |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 400 | } |
| 401 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 402 | /* generic shutup callback; |
| 403 | * just turning off EPAD and a little pause for avoiding pop-noise |
| 404 | */ |
| 405 | static void alc_eapd_shutup(struct hda_codec *codec) |
| 406 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 407 | struct alc_spec *spec = codec->spec; |
| 408 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 409 | alc_auto_setup_eapd(codec, false); |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 410 | if (!spec->no_depop_delay) |
| 411 | msleep(200); |
Takashi Iwai | 9bfb284 | 2013-07-24 14:31:50 +0200 | [diff] [blame] | 412 | snd_hda_shutup_pins(codec); |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 413 | } |
| 414 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 415 | /* generic EAPD initialization */ |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 416 | static void alc_auto_init_amp(struct hda_codec *codec, int type) |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 417 | { |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 418 | alc_fill_eapd_coef(codec); |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 419 | alc_auto_setup_eapd(codec, true); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 420 | switch (type) { |
| 421 | case ALC_INIT_GPIO1: |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 422 | snd_hda_sequence_write(codec, alc_gpio1_init_verbs); |
| 423 | break; |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 424 | case ALC_INIT_GPIO2: |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 425 | snd_hda_sequence_write(codec, alc_gpio2_init_verbs); |
| 426 | break; |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 427 | case ALC_INIT_GPIO3: |
Kailang Yang | bdd148a | 2007-05-08 15:19:08 +0200 | [diff] [blame] | 428 | snd_hda_sequence_write(codec, alc_gpio3_init_verbs); |
| 429 | break; |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 430 | case ALC_INIT_DEFAULT: |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 431 | switch (codec->vendor_id) { |
| 432 | case 0x10ec0260: |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 433 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 434 | break; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 435 | case 0x10ec0880: |
| 436 | case 0x10ec0882: |
| 437 | case 0x10ec0883: |
| 438 | case 0x10ec0885: |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 439 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 440 | break; |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 441 | case 0x10ec0888: |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 442 | alc888_coef_init(codec); |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 443 | break; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 444 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 445 | break; |
| 446 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 447 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 448 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 449 | |
| 450 | /* |
| 451 | * Realtek SSID verification |
| 452 | */ |
| 453 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 454 | /* Could be any non-zero and even value. When used as fixup, tells |
| 455 | * the driver to ignore any present sku defines. |
| 456 | */ |
| 457 | #define ALC_FIXUP_SKU_IGNORE (2) |
| 458 | |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 459 | static void alc_fixup_sku_ignore(struct hda_codec *codec, |
| 460 | const struct hda_fixup *fix, int action) |
| 461 | { |
| 462 | struct alc_spec *spec = codec->spec; |
| 463 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 464 | spec->cdefine.fixup = 1; |
| 465 | spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; |
| 466 | } |
| 467 | } |
| 468 | |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 469 | static void alc_fixup_no_depop_delay(struct hda_codec *codec, |
| 470 | const struct hda_fixup *fix, int action) |
| 471 | { |
| 472 | struct alc_spec *spec = codec->spec; |
| 473 | |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 474 | if (action == HDA_FIXUP_ACT_PROBE) { |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 475 | spec->no_depop_delay = 1; |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 476 | codec->depop_delay = 0; |
| 477 | } |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 478 | } |
| 479 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 480 | static int alc_auto_parse_customize_define(struct hda_codec *codec) |
| 481 | { |
| 482 | unsigned int ass, tmp, i; |
Takashi Iwai | 7fb5622 | 2010-03-22 17:09:47 +0100 | [diff] [blame] | 483 | unsigned nid = 0; |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 484 | struct alc_spec *spec = codec->spec; |
| 485 | |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 486 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ |
| 487 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 488 | if (spec->cdefine.fixup) { |
| 489 | ass = spec->cdefine.sku_cfg; |
| 490 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 491 | return -1; |
| 492 | goto do_sku; |
| 493 | } |
| 494 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 495 | if (!codec->bus->pci) |
| 496 | return -1; |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 497 | ass = codec->subsystem_id & 0xffff; |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 498 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 499 | goto do_sku; |
| 500 | |
| 501 | nid = 0x1d; |
| 502 | if (codec->vendor_id == 0x10ec0260) |
| 503 | nid = 0x17; |
| 504 | ass = snd_hda_codec_get_pincfg(codec, nid); |
| 505 | |
| 506 | if (!(ass & 1)) { |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 507 | codec_info(codec, "%s: SKU not ready 0x%08x\n", |
| 508 | codec->chip_name, ass); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 509 | return -1; |
| 510 | } |
| 511 | |
| 512 | /* check sum */ |
| 513 | tmp = 0; |
| 514 | for (i = 1; i < 16; i++) { |
| 515 | if ((ass >> i) & 1) |
| 516 | tmp++; |
| 517 | } |
| 518 | if (((ass >> 16) & 0xf) != tmp) |
| 519 | return -1; |
| 520 | |
| 521 | spec->cdefine.port_connectivity = ass >> 30; |
| 522 | spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; |
| 523 | spec->cdefine.check_sum = (ass >> 16) & 0xf; |
| 524 | spec->cdefine.customization = ass >> 8; |
| 525 | do_sku: |
| 526 | spec->cdefine.sku_cfg = ass; |
| 527 | spec->cdefine.external_amp = (ass & 0x38) >> 3; |
| 528 | spec->cdefine.platform_type = (ass & 0x4) >> 2; |
| 529 | spec->cdefine.swap = (ass & 0x2) >> 1; |
| 530 | spec->cdefine.override = ass & 0x1; |
| 531 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 532 | codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 533 | nid, spec->cdefine.sku_cfg); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 534 | codec_dbg(codec, "SKU: port_connectivity=0x%x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 535 | spec->cdefine.port_connectivity); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 536 | codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); |
| 537 | codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); |
| 538 | codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); |
| 539 | codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); |
| 540 | codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); |
| 541 | codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); |
| 542 | codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 543 | |
| 544 | return 0; |
| 545 | } |
| 546 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 547 | /* return the position of NID in the list, or -1 if not found */ |
| 548 | static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 549 | { |
| 550 | int i; |
| 551 | for (i = 0; i < nums; i++) |
| 552 | if (list[i] == nid) |
| 553 | return i; |
| 554 | return -1; |
| 555 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 556 | /* return true if the given NID is found in the list */ |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 557 | static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 558 | { |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 559 | return find_idx_in_nid_list(nid, list, nums) >= 0; |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 560 | } |
| 561 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 562 | /* check subsystem ID and set up device-specific initialization; |
| 563 | * return 1 if initialized, 0 if invalid SSID |
| 564 | */ |
| 565 | /* 32-bit subsystem ID for BIOS loading in HD Audio codec. |
| 566 | * 31 ~ 16 : Manufacture ID |
| 567 | * 15 ~ 8 : SKU ID |
| 568 | * 7 ~ 0 : Assembly ID |
| 569 | * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 |
| 570 | */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 571 | static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 572 | { |
| 573 | unsigned int ass, tmp, i; |
| 574 | unsigned nid; |
| 575 | struct alc_spec *spec = codec->spec; |
| 576 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 577 | if (spec->cdefine.fixup) { |
| 578 | ass = spec->cdefine.sku_cfg; |
| 579 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 580 | return 0; |
| 581 | goto do_sku; |
| 582 | } |
| 583 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 584 | ass = codec->subsystem_id & 0xffff; |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 585 | if (codec->bus->pci && |
| 586 | ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 587 | goto do_sku; |
| 588 | |
| 589 | /* invalid SSID, check the special NID pin defcfg instead */ |
| 590 | /* |
Sasha Alexandr | def319f | 2009-06-16 16:00:15 -0400 | [diff] [blame] | 591 | * 31~30 : port connectivity |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 592 | * 29~21 : reserve |
| 593 | * 20 : PCBEEP input |
| 594 | * 19~16 : Check sum (15:1) |
| 595 | * 15~1 : Custom |
| 596 | * 0 : override |
| 597 | */ |
| 598 | nid = 0x1d; |
| 599 | if (codec->vendor_id == 0x10ec0260) |
| 600 | nid = 0x17; |
| 601 | ass = snd_hda_codec_get_pincfg(codec, nid); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 602 | codec_dbg(codec, |
| 603 | "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n", |
Takashi Iwai | cb6605c | 2009-04-28 13:03:19 +0200 | [diff] [blame] | 604 | ass, nid); |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 605 | if (!(ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 606 | return 0; |
| 607 | if ((ass >> 30) != 1) /* no physical connection */ |
| 608 | return 0; |
| 609 | |
| 610 | /* check sum */ |
| 611 | tmp = 0; |
| 612 | for (i = 1; i < 16; i++) { |
| 613 | if ((ass >> i) & 1) |
| 614 | tmp++; |
| 615 | } |
| 616 | if (((ass >> 16) & 0xf) != tmp) |
| 617 | return 0; |
| 618 | do_sku: |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 619 | codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n", |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 620 | ass & 0xffff, codec->vendor_id); |
| 621 | /* |
| 622 | * 0 : override |
| 623 | * 1 : Swap Jack |
| 624 | * 2 : 0 --> Desktop, 1 --> Laptop |
| 625 | * 3~5 : External Amplifier control |
| 626 | * 7~6 : Reserved |
| 627 | */ |
| 628 | tmp = (ass & 0x38) >> 3; /* external Amp control */ |
| 629 | switch (tmp) { |
| 630 | case 1: |
| 631 | spec->init_amp = ALC_INIT_GPIO1; |
| 632 | break; |
| 633 | case 3: |
| 634 | spec->init_amp = ALC_INIT_GPIO2; |
| 635 | break; |
| 636 | case 7: |
| 637 | spec->init_amp = ALC_INIT_GPIO3; |
| 638 | break; |
| 639 | case 5: |
Takashi Iwai | 5a8cfb4 | 2010-11-26 17:11:18 +0100 | [diff] [blame] | 640 | default: |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 641 | spec->init_amp = ALC_INIT_DEFAULT; |
| 642 | break; |
| 643 | } |
| 644 | |
| 645 | /* is laptop or Desktop and enable the function "Mute internal speaker |
| 646 | * when the external headphone out jack is plugged" |
| 647 | */ |
| 648 | if (!(ass & 0x8000)) |
| 649 | return 1; |
| 650 | /* |
| 651 | * 10~8 : Jack location |
| 652 | * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered |
| 653 | * 14~13: Resvered |
| 654 | * 15 : 1 --> enable the function "Mute internal speaker |
| 655 | * when the external headphone out jack is plugged" |
| 656 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 657 | if (!spec->gen.autocfg.hp_pins[0] && |
| 658 | !(spec->gen.autocfg.line_out_pins[0] && |
| 659 | spec->gen.autocfg.line_out_type == AUTO_PIN_HP_OUT)) { |
Takashi Iwai | 01d4825 | 2009-10-06 13:21:54 +0200 | [diff] [blame] | 660 | hda_nid_t nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 661 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 662 | nid = ports[tmp]; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 663 | if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, |
| 664 | spec->gen.autocfg.line_outs)) |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 665 | return 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 666 | spec->gen.autocfg.hp_pins[0] = nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 667 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 668 | return 1; |
| 669 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 670 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 671 | /* Check the validity of ALC subsystem-id |
| 672 | * ports contains an array of 4 pin NIDs for port-A, E, D and I */ |
| 673 | static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 674 | { |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 675 | if (!alc_subsystem_id(codec, ports)) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 676 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 677 | codec_dbg(codec, |
| 678 | "realtek: Enable default setup for auto mode as fallback\n"); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 679 | spec->init_amp = ALC_INIT_DEFAULT; |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 680 | } |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 681 | } |
Takashi Iwai | 1a1455d | 2011-04-28 17:36:18 +0200 | [diff] [blame] | 682 | |
Takashi Iwai | 41e41f1 | 2005-06-08 14:48:49 +0200 | [diff] [blame] | 683 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 684 | */ |
| 685 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 686 | static void alc_fixup_inv_dmic(struct hda_codec *codec, |
| 687 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 688 | { |
| 689 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 668d1e9 | 2012-11-29 14:10:17 +0100 | [diff] [blame] | 690 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 691 | spec->gen.inv_dmic_split = 1; |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 692 | } |
| 693 | |
Takashi Iwai | 603c401 | 2008-07-30 15:01:44 +0200 | [diff] [blame] | 694 | |
Takashi Iwai | 67d634c | 2009-11-16 15:35:59 +0100 | [diff] [blame] | 695 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 696 | /* additional beep mixers; the actual parameters are overwritten at build */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 697 | static const struct snd_kcontrol_new alc_beep_mixer[] = { |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 698 | HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), |
Jaroslav Kysela | 123c07a | 2009-10-21 14:48:23 +0200 | [diff] [blame] | 699 | HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 700 | { } /* end */ |
| 701 | }; |
Takashi Iwai | 67d634c | 2009-11-16 15:35:59 +0100 | [diff] [blame] | 702 | #endif |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 703 | |
Takashi Iwai | 2eab694 | 2012-12-18 15:30:41 +0100 | [diff] [blame] | 704 | static int alc_build_controls(struct hda_codec *codec) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 705 | { |
| 706 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 666a70d | 2012-12-17 20:29:29 +0100 | [diff] [blame] | 707 | int i, err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 708 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 709 | err = snd_hda_gen_build_controls(codec); |
| 710 | if (err < 0) |
| 711 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 712 | |
| 713 | for (i = 0; i < spec->num_mixers; i++) { |
| 714 | err = snd_hda_add_new_ctls(codec, spec->mixers[i]); |
| 715 | if (err < 0) |
| 716 | return err; |
| 717 | } |
Takashi Iwai | 2134ea4 | 2008-01-10 16:53:55 +0100 | [diff] [blame] | 718 | |
Takashi Iwai | 67d634c | 2009-11-16 15:35:59 +0100 | [diff] [blame] | 719 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 720 | /* create beep controls if needed */ |
| 721 | if (spec->beep_amp) { |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 722 | const struct snd_kcontrol_new *knew; |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 723 | for (knew = alc_beep_mixer; knew->name; knew++) { |
| 724 | struct snd_kcontrol *kctl; |
| 725 | kctl = snd_ctl_new1(knew, codec); |
| 726 | if (!kctl) |
| 727 | return -ENOMEM; |
| 728 | kctl->private_value = spec->beep_amp; |
Jaroslav Kysela | 5e26dfd | 2009-12-10 13:57:01 +0100 | [diff] [blame] | 729 | err = snd_hda_ctl_add(codec, 0, kctl); |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 730 | if (err < 0) |
| 731 | return err; |
| 732 | } |
| 733 | } |
Takashi Iwai | 67d634c | 2009-11-16 15:35:59 +0100 | [diff] [blame] | 734 | #endif |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 735 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 736 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 737 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 738 | } |
| 739 | |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 740 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 741 | /* |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 742 | * Common callbacks |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 743 | */ |
Takashi Iwai | 16ded52 | 2005-06-10 19:58:24 +0200 | [diff] [blame] | 744 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 745 | static int alc_init(struct hda_codec *codec) |
| 746 | { |
| 747 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 748 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 749 | if (spec->init_hook) |
| 750 | spec->init_hook(codec); |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 751 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 752 | alc_fix_pll(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 753 | alc_auto_init_amp(codec, spec->init_amp); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 754 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 755 | snd_hda_gen_init(codec); |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 756 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 757 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); |
Takashi Iwai | e08a007 | 2006-09-07 17:52:14 +0200 | [diff] [blame] | 758 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 759 | return 0; |
| 760 | } |
| 761 | |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 762 | static inline void alc_shutup(struct hda_codec *codec) |
| 763 | { |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 764 | struct alc_spec *spec = codec->spec; |
| 765 | |
| 766 | if (spec && spec->shutup) |
| 767 | spec->shutup(codec); |
Takashi Iwai | 9bfb284 | 2013-07-24 14:31:50 +0200 | [diff] [blame] | 768 | else |
| 769 | snd_hda_shutup_pins(codec); |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 770 | } |
| 771 | |
Takashi Iwai | 8a02c0c | 2014-02-10 18:09:45 +0100 | [diff] [blame] | 772 | #define alc_free snd_hda_gen_free |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 773 | |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 774 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 775 | static void alc_power_eapd(struct hda_codec *codec) |
| 776 | { |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 777 | alc_auto_setup_eapd(codec, false); |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 778 | } |
| 779 | |
Takashi Iwai | 68cb2b5 | 2012-07-02 15:20:37 +0200 | [diff] [blame] | 780 | static int alc_suspend(struct hda_codec *codec) |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 781 | { |
| 782 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 783 | alc_shutup(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 784 | if (spec && spec->power_hook) |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 785 | spec->power_hook(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 786 | return 0; |
| 787 | } |
| 788 | #endif |
| 789 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 790 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 791 | static int alc_resume(struct hda_codec *codec) |
| 792 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 793 | struct alc_spec *spec = codec->spec; |
| 794 | |
| 795 | if (!spec->no_depop_delay) |
| 796 | msleep(150); /* to avoid pop noise */ |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 797 | codec->patch_ops.init(codec); |
| 798 | snd_hda_codec_resume_amp(codec); |
| 799 | snd_hda_codec_resume_cache(codec); |
Takashi Iwai | 9e5341b | 2010-09-21 09:57:06 +0200 | [diff] [blame] | 800 | hda_call_check_power_status(codec, 0x01); |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 801 | return 0; |
| 802 | } |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 803 | #endif |
| 804 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 805 | /* |
| 806 | */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 807 | static const struct hda_codec_ops alc_patch_ops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 808 | .build_controls = alc_build_controls, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 809 | .build_pcms = snd_hda_gen_build_pcms, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 810 | .init = alc_init, |
| 811 | .free = alc_free, |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 812 | .unsol_event = snd_hda_jack_unsol_event, |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 813 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 814 | .resume = alc_resume, |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 815 | .suspend = alc_suspend, |
Takashi Iwai | fce52a3 | 2013-01-07 12:42:48 +0100 | [diff] [blame] | 816 | .check_power_status = snd_hda_gen_check_power_status, |
Takashi Iwai | cb53c62 | 2007-08-10 17:21:45 +0200 | [diff] [blame] | 817 | #endif |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 818 | .reboot_notify = alc_shutup, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 819 | }; |
| 820 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 821 | |
Kailang Yang | c027ddc | 2010-03-19 11:33:06 +0100 | [diff] [blame] | 822 | /* replace the codec chip_name with the given string */ |
| 823 | static int alc_codec_rename(struct hda_codec *codec, const char *name) |
| 824 | { |
| 825 | kfree(codec->chip_name); |
| 826 | codec->chip_name = kstrdup(name, GFP_KERNEL); |
| 827 | if (!codec->chip_name) { |
| 828 | alc_free(codec); |
| 829 | return -ENOMEM; |
| 830 | } |
| 831 | return 0; |
| 832 | } |
| 833 | |
Takashi Iwai | 2fa522b | 2005-05-12 14:51:12 +0200 | [diff] [blame] | 834 | /* |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 835 | * Rename codecs appropriately from COEF value or subvendor id |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 836 | */ |
| 837 | struct alc_codec_rename_table { |
| 838 | unsigned int vendor_id; |
| 839 | unsigned short coef_mask; |
| 840 | unsigned short coef_bits; |
| 841 | const char *name; |
| 842 | }; |
| 843 | |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 844 | struct alc_codec_rename_pci_table { |
| 845 | unsigned int codec_vendor_id; |
| 846 | unsigned short pci_subvendor; |
| 847 | unsigned short pci_subdevice; |
| 848 | const char *name; |
| 849 | }; |
| 850 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 851 | static struct alc_codec_rename_table rename_tbl[] = { |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 852 | { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 853 | { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, |
| 854 | { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, |
| 855 | { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, |
| 856 | { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, |
| 857 | { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, |
| 858 | { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, |
| 859 | { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 860 | { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 861 | { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 862 | { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, |
| 863 | { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, |
| 864 | { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, |
| 865 | { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, |
| 866 | { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, |
| 867 | { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, |
| 868 | { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, |
| 869 | { } /* terminator */ |
| 870 | }; |
| 871 | |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 872 | static struct alc_codec_rename_pci_table rename_pci_tbl[] = { |
| 873 | { 0x10ec0280, 0x1028, 0, "ALC3220" }, |
| 874 | { 0x10ec0282, 0x1028, 0, "ALC3221" }, |
| 875 | { 0x10ec0283, 0x1028, 0, "ALC3223" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 876 | { 0x10ec0288, 0x1028, 0, "ALC3263" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 877 | { 0x10ec0292, 0x1028, 0, "ALC3226" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 878 | { 0x10ec0293, 0x1028, 0, "ALC3235" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 879 | { 0x10ec0255, 0x1028, 0, "ALC3234" }, |
| 880 | { 0x10ec0668, 0x1028, 0, "ALC3661" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 881 | { 0x10ec0275, 0x1028, 0, "ALC3260" }, |
| 882 | { 0x10ec0899, 0x1028, 0, "ALC3861" }, |
| 883 | { 0x10ec0670, 0x1025, 0, "ALC669X" }, |
| 884 | { 0x10ec0676, 0x1025, 0, "ALC679X" }, |
| 885 | { 0x10ec0282, 0x1043, 0, "ALC3229" }, |
| 886 | { 0x10ec0233, 0x1043, 0, "ALC3236" }, |
| 887 | { 0x10ec0280, 0x103c, 0, "ALC3228" }, |
| 888 | { 0x10ec0282, 0x103c, 0, "ALC3227" }, |
| 889 | { 0x10ec0286, 0x103c, 0, "ALC3242" }, |
| 890 | { 0x10ec0290, 0x103c, 0, "ALC3241" }, |
| 891 | { 0x10ec0668, 0x103c, 0, "ALC3662" }, |
| 892 | { 0x10ec0283, 0x17aa, 0, "ALC3239" }, |
| 893 | { 0x10ec0292, 0x17aa, 0, "ALC3232" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 894 | { } /* terminator */ |
| 895 | }; |
| 896 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 897 | static int alc_codec_rename_from_preset(struct hda_codec *codec) |
| 898 | { |
| 899 | const struct alc_codec_rename_table *p; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 900 | const struct alc_codec_rename_pci_table *q; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 901 | |
| 902 | for (p = rename_tbl; p->vendor_id; p++) { |
| 903 | if (p->vendor_id != codec->vendor_id) |
| 904 | continue; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 905 | if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 906 | return alc_codec_rename(codec, p->name); |
| 907 | } |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 908 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 909 | if (!codec->bus->pci) |
| 910 | return 0; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 911 | for (q = rename_pci_tbl; q->codec_vendor_id; q++) { |
| 912 | if (q->codec_vendor_id != codec->vendor_id) |
| 913 | continue; |
| 914 | if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) |
| 915 | continue; |
| 916 | if (!q->pci_subdevice || |
| 917 | q->pci_subdevice == codec->bus->pci->subsystem_device) |
| 918 | return alc_codec_rename(codec, q->name); |
| 919 | } |
| 920 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 921 | return 0; |
| 922 | } |
| 923 | |
Takashi Iwai | e477062 | 2011-07-08 11:11:35 +0200 | [diff] [blame] | 924 | |
| 925 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 926 | * Digital-beep handlers |
| 927 | */ |
| 928 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
| 929 | #define set_beep_amp(spec, nid, idx, dir) \ |
| 930 | ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) |
| 931 | |
| 932 | static const struct snd_pci_quirk beep_white_list[] = { |
Duncan Roe | 7110005 | 2012-10-10 14:19:50 +0200 | [diff] [blame] | 933 | SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), |
W. Trevor King | a4b7f21d | 2014-03-29 17:47:24 -0700 | [diff] [blame] | 934 | SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 935 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), |
Takashi Iwai | 8554ee4 | 2013-02-25 09:54:43 +0100 | [diff] [blame] | 936 | SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 937 | SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), |
| 938 | SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), |
| 939 | SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), |
Takashi Iwai | 78f8baf | 2012-03-06 14:02:32 +0100 | [diff] [blame] | 940 | SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 941 | SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), |
| 942 | {} |
| 943 | }; |
| 944 | |
| 945 | static inline int has_cdefine_beep(struct hda_codec *codec) |
| 946 | { |
| 947 | struct alc_spec *spec = codec->spec; |
| 948 | const struct snd_pci_quirk *q; |
| 949 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list); |
| 950 | if (q) |
| 951 | return q->value; |
| 952 | return spec->cdefine.enable_pcbeep; |
| 953 | } |
| 954 | #else |
| 955 | #define set_beep_amp(spec, nid, idx, dir) /* NOP */ |
| 956 | #define has_cdefine_beep(codec) 0 |
| 957 | #endif |
| 958 | |
| 959 | /* parse the BIOS configuration and set up the alc_spec */ |
| 960 | /* return 1 if successful, 0 if the proper config is not found, |
| 961 | * or a negative error code |
| 962 | */ |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 963 | static int alc_parse_auto_config(struct hda_codec *codec, |
| 964 | const hda_nid_t *ignore_nids, |
| 965 | const hda_nid_t *ssid_nids) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 966 | { |
| 967 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 968 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 969 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 970 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 971 | err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, |
| 972 | spec->parse_flags); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 973 | if (err < 0) |
| 974 | return err; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 975 | |
| 976 | if (ssid_nids) |
| 977 | alc_ssid_check(codec, ssid_nids); |
| 978 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 979 | err = snd_hda_gen_parse_auto_config(codec, cfg); |
| 980 | if (err < 0) |
| 981 | return err; |
Takashi Iwai | 070cff4 | 2012-02-21 12:54:17 +0100 | [diff] [blame] | 982 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 983 | return 1; |
| 984 | } |
| 985 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 986 | /* common preparation job for alc_spec */ |
| 987 | static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) |
| 988 | { |
| 989 | struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
| 990 | int err; |
| 991 | |
| 992 | if (!spec) |
| 993 | return -ENOMEM; |
| 994 | codec->spec = spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 995 | snd_hda_gen_spec_init(&spec->gen); |
| 996 | spec->gen.mixer_nid = mixer_nid; |
| 997 | spec->gen.own_eapd_ctl = 1; |
Takashi Iwai | 1098b7c | 2012-12-17 20:03:15 +0100 | [diff] [blame] | 998 | codec->single_adc_amp = 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 999 | /* FIXME: do we need this for all Realtek codec models? */ |
| 1000 | codec->spdif_status_reset = 1; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1001 | |
| 1002 | err = alc_codec_rename_from_preset(codec); |
| 1003 | if (err < 0) { |
| 1004 | kfree(spec); |
| 1005 | return err; |
| 1006 | } |
| 1007 | return 0; |
| 1008 | } |
| 1009 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1010 | static int alc880_parse_auto_config(struct hda_codec *codec) |
| 1011 | { |
| 1012 | static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 1013 | static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1014 | return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); |
| 1015 | } |
| 1016 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1017 | /* |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1018 | * ALC880 fix-ups |
| 1019 | */ |
| 1020 | enum { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1021 | ALC880_FIXUP_GPIO1, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1022 | ALC880_FIXUP_GPIO2, |
| 1023 | ALC880_FIXUP_MEDION_RIM, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1024 | ALC880_FIXUP_LG, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1025 | ALC880_FIXUP_LG_LW25, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1026 | ALC880_FIXUP_W810, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1027 | ALC880_FIXUP_EAPD_COEF, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1028 | ALC880_FIXUP_TCL_S700, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1029 | ALC880_FIXUP_VOL_KNOB, |
| 1030 | ALC880_FIXUP_FUJITSU, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1031 | ALC880_FIXUP_F1734, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1032 | ALC880_FIXUP_UNIWILL, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1033 | ALC880_FIXUP_UNIWILL_DIG, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1034 | ALC880_FIXUP_Z71V, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1035 | ALC880_FIXUP_ASUS_W5A, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1036 | ALC880_FIXUP_3ST_BASE, |
| 1037 | ALC880_FIXUP_3ST, |
| 1038 | ALC880_FIXUP_3ST_DIG, |
| 1039 | ALC880_FIXUP_5ST_BASE, |
| 1040 | ALC880_FIXUP_5ST, |
| 1041 | ALC880_FIXUP_5ST_DIG, |
| 1042 | ALC880_FIXUP_6ST_BASE, |
| 1043 | ALC880_FIXUP_6ST, |
| 1044 | ALC880_FIXUP_6ST_DIG, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1045 | ALC880_FIXUP_6ST_AUTOMUTE, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1046 | }; |
| 1047 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1048 | /* enable the volume-knob widget support on NID 0x21 */ |
| 1049 | static void alc880_fixup_vol_knob(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1050 | const struct hda_fixup *fix, int action) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1051 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1052 | if (action == HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1053 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
| 1054 | alc_update_knob_master); |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1055 | } |
| 1056 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1057 | static const struct hda_fixup alc880_fixups[] = { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1058 | [ALC880_FIXUP_GPIO1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1059 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1060 | .v.verbs = alc_gpio1_init_verbs, |
| 1061 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1062 | [ALC880_FIXUP_GPIO2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1063 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1064 | .v.verbs = alc_gpio2_init_verbs, |
| 1065 | }, |
| 1066 | [ALC880_FIXUP_MEDION_RIM] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1067 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1068 | .v.verbs = (const struct hda_verb[]) { |
| 1069 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1070 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1071 | { } |
| 1072 | }, |
| 1073 | .chained = true, |
| 1074 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1075 | }, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1076 | [ALC880_FIXUP_LG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1077 | .type = HDA_FIXUP_PINS, |
| 1078 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1079 | /* disable bogus unused pins */ |
| 1080 | { 0x16, 0x411111f0 }, |
| 1081 | { 0x18, 0x411111f0 }, |
| 1082 | { 0x1a, 0x411111f0 }, |
| 1083 | { } |
| 1084 | } |
| 1085 | }, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1086 | [ALC880_FIXUP_LG_LW25] = { |
| 1087 | .type = HDA_FIXUP_PINS, |
| 1088 | .v.pins = (const struct hda_pintbl[]) { |
| 1089 | { 0x1a, 0x0181344f }, /* line-in */ |
| 1090 | { 0x1b, 0x0321403f }, /* headphone */ |
| 1091 | { } |
| 1092 | } |
| 1093 | }, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1094 | [ALC880_FIXUP_W810] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1095 | .type = HDA_FIXUP_PINS, |
| 1096 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1097 | /* disable bogus unused pins */ |
| 1098 | { 0x17, 0x411111f0 }, |
| 1099 | { } |
| 1100 | }, |
| 1101 | .chained = true, |
| 1102 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1103 | }, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1104 | [ALC880_FIXUP_EAPD_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1105 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1106 | .v.verbs = (const struct hda_verb[]) { |
| 1107 | /* change to EAPD mode */ |
| 1108 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1109 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1110 | {} |
| 1111 | }, |
| 1112 | }, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1113 | [ALC880_FIXUP_TCL_S700] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1114 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1115 | .v.verbs = (const struct hda_verb[]) { |
| 1116 | /* change to EAPD mode */ |
| 1117 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1118 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 1119 | {} |
| 1120 | }, |
| 1121 | .chained = true, |
| 1122 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1123 | }, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1124 | [ALC880_FIXUP_VOL_KNOB] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1125 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1126 | .v.func = alc880_fixup_vol_knob, |
| 1127 | }, |
| 1128 | [ALC880_FIXUP_FUJITSU] = { |
| 1129 | /* override all pins as BIOS on old Amilo is broken */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1130 | .type = HDA_FIXUP_PINS, |
| 1131 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1132 | { 0x14, 0x0121411f }, /* HP */ |
| 1133 | { 0x15, 0x99030120 }, /* speaker */ |
| 1134 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1135 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1136 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1137 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1138 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1139 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1140 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1141 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1142 | { 0x1e, 0x01454140 }, /* SPDIF out */ |
| 1143 | { } |
| 1144 | }, |
| 1145 | .chained = true, |
| 1146 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1147 | }, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1148 | [ALC880_FIXUP_F1734] = { |
| 1149 | /* almost compatible with FUJITSU, but no bass and SPDIF */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1150 | .type = HDA_FIXUP_PINS, |
| 1151 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1152 | { 0x14, 0x0121411f }, /* HP */ |
| 1153 | { 0x15, 0x99030120 }, /* speaker */ |
| 1154 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1155 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1156 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1157 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1158 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1159 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1160 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1161 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1162 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1163 | { } |
| 1164 | }, |
| 1165 | .chained = true, |
| 1166 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1167 | }, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1168 | [ALC880_FIXUP_UNIWILL] = { |
| 1169 | /* need to fix HP and speaker pins to be parsed correctly */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1170 | .type = HDA_FIXUP_PINS, |
| 1171 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1172 | { 0x14, 0x0121411f }, /* HP */ |
| 1173 | { 0x15, 0x99030120 }, /* speaker */ |
| 1174 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1175 | { } |
| 1176 | }, |
| 1177 | }, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1178 | [ALC880_FIXUP_UNIWILL_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1179 | .type = HDA_FIXUP_PINS, |
| 1180 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1181 | /* disable bogus unused pins */ |
| 1182 | { 0x17, 0x411111f0 }, |
| 1183 | { 0x19, 0x411111f0 }, |
| 1184 | { 0x1b, 0x411111f0 }, |
| 1185 | { 0x1f, 0x411111f0 }, |
| 1186 | { } |
| 1187 | } |
| 1188 | }, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1189 | [ALC880_FIXUP_Z71V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1190 | .type = HDA_FIXUP_PINS, |
| 1191 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1192 | /* set up the whole pins as BIOS is utterly broken */ |
| 1193 | { 0x14, 0x99030120 }, /* speaker */ |
| 1194 | { 0x15, 0x0121411f }, /* HP */ |
| 1195 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1196 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1197 | { 0x18, 0x01a19950 }, /* mic-in */ |
| 1198 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1199 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1200 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1201 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1202 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1203 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1204 | { } |
| 1205 | } |
| 1206 | }, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1207 | [ALC880_FIXUP_ASUS_W5A] = { |
| 1208 | .type = HDA_FIXUP_PINS, |
| 1209 | .v.pins = (const struct hda_pintbl[]) { |
| 1210 | /* set up the whole pins as BIOS is utterly broken */ |
| 1211 | { 0x14, 0x0121411f }, /* HP */ |
| 1212 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1213 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1214 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1215 | { 0x18, 0x90a60160 }, /* mic */ |
| 1216 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1217 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1218 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1219 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1220 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1221 | { 0x1e, 0xb743111e }, /* SPDIF out */ |
| 1222 | { } |
| 1223 | }, |
| 1224 | .chained = true, |
| 1225 | .chain_id = ALC880_FIXUP_GPIO1, |
| 1226 | }, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1227 | [ALC880_FIXUP_3ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1228 | .type = HDA_FIXUP_PINS, |
| 1229 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1230 | { 0x14, 0x01014010 }, /* line-out */ |
| 1231 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1232 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1233 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1234 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1235 | { 0x19, 0x0121411f }, /* HP */ |
| 1236 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1237 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1238 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1239 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1240 | /* 0x1e is filled in below */ |
| 1241 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1242 | { } |
| 1243 | } |
| 1244 | }, |
| 1245 | [ALC880_FIXUP_3ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1246 | .type = HDA_FIXUP_PINS, |
| 1247 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1248 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1249 | { } |
| 1250 | }, |
| 1251 | .chained = true, |
| 1252 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1253 | }, |
| 1254 | [ALC880_FIXUP_3ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1255 | .type = HDA_FIXUP_PINS, |
| 1256 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1257 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1258 | { } |
| 1259 | }, |
| 1260 | .chained = true, |
| 1261 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1262 | }, |
| 1263 | [ALC880_FIXUP_5ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1264 | .type = HDA_FIXUP_PINS, |
| 1265 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1266 | { 0x14, 0x01014010 }, /* front */ |
| 1267 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1268 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1269 | { 0x17, 0x01016412 }, /* surr */ |
| 1270 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1271 | { 0x19, 0x0121411f }, /* HP */ |
| 1272 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1273 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1274 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1275 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1276 | /* 0x1e is filled in below */ |
| 1277 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1278 | { } |
| 1279 | } |
| 1280 | }, |
| 1281 | [ALC880_FIXUP_5ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1282 | .type = HDA_FIXUP_PINS, |
| 1283 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1284 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1285 | { } |
| 1286 | }, |
| 1287 | .chained = true, |
| 1288 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1289 | }, |
| 1290 | [ALC880_FIXUP_5ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1291 | .type = HDA_FIXUP_PINS, |
| 1292 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1293 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1294 | { } |
| 1295 | }, |
| 1296 | .chained = true, |
| 1297 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1298 | }, |
| 1299 | [ALC880_FIXUP_6ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1300 | .type = HDA_FIXUP_PINS, |
| 1301 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1302 | { 0x14, 0x01014010 }, /* front */ |
| 1303 | { 0x15, 0x01016412 }, /* surr */ |
| 1304 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1305 | { 0x17, 0x01012414 }, /* side */ |
| 1306 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1307 | { 0x19, 0x02a19c40 }, /* front-mic */ |
| 1308 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1309 | { 0x1b, 0x0121411f }, /* HP */ |
| 1310 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1311 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1312 | /* 0x1e is filled in below */ |
| 1313 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1314 | { } |
| 1315 | } |
| 1316 | }, |
| 1317 | [ALC880_FIXUP_6ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1318 | .type = HDA_FIXUP_PINS, |
| 1319 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1320 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1321 | { } |
| 1322 | }, |
| 1323 | .chained = true, |
| 1324 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1325 | }, |
| 1326 | [ALC880_FIXUP_6ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1327 | .type = HDA_FIXUP_PINS, |
| 1328 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1329 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1330 | { } |
| 1331 | }, |
| 1332 | .chained = true, |
| 1333 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1334 | }, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1335 | [ALC880_FIXUP_6ST_AUTOMUTE] = { |
| 1336 | .type = HDA_FIXUP_PINS, |
| 1337 | .v.pins = (const struct hda_pintbl[]) { |
| 1338 | { 0x1b, 0x0121401f }, /* HP with jack detect */ |
| 1339 | { } |
| 1340 | }, |
| 1341 | .chained_before = true, |
| 1342 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1343 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1344 | }; |
| 1345 | |
| 1346 | static const struct snd_pci_quirk alc880_fixup_tbl[] = { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1347 | SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1348 | SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1349 | SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1350 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), |
David Henningsson | 6538de0 | 2014-06-10 10:52:50 +0200 | [diff] [blame] | 1351 | SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1352 | SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1353 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1354 | SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1355 | SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1356 | SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), |
Takashi Iwai | 7833c7e | 2012-02-20 17:11:38 +0100 | [diff] [blame] | 1357 | SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1358 | SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1359 | SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1360 | SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1361 | SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_FIXUP_F1734), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1362 | SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1363 | SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1364 | SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1365 | SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), |
| 1366 | SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), |
| 1367 | SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1368 | SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1369 | SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1370 | |
| 1371 | /* Below is the copied entries from alc880_quirks.c. |
| 1372 | * It's not quite sure whether BIOS sets the correct pin-config table |
| 1373 | * on these machines, thus they are kept to be compatible with |
| 1374 | * the old static quirks. Once when it's confirmed to work without |
| 1375 | * these overrides, it'd be better to remove. |
| 1376 | */ |
| 1377 | SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), |
| 1378 | SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), |
| 1379 | SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1380 | SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1381 | SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1382 | SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1383 | SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1384 | SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), |
| 1385 | SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), |
| 1386 | SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), |
| 1387 | SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), |
| 1388 | SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), |
| 1389 | SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), |
| 1390 | SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), |
| 1391 | SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), |
| 1392 | SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), |
| 1393 | SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), |
| 1394 | SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), |
| 1395 | SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), |
| 1396 | SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), |
| 1397 | SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), |
| 1398 | SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ |
| 1399 | SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), |
| 1400 | SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1401 | SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1402 | SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1403 | SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1404 | SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1405 | SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1406 | SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1407 | SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1408 | SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1409 | SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1410 | /* default Intel */ |
| 1411 | SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), |
| 1412 | SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), |
| 1413 | SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), |
| 1414 | {} |
| 1415 | }; |
| 1416 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1417 | static const struct hda_model_fixup alc880_fixup_models[] = { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1418 | {.id = ALC880_FIXUP_3ST, .name = "3stack"}, |
| 1419 | {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, |
| 1420 | {.id = ALC880_FIXUP_5ST, .name = "5stack"}, |
| 1421 | {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, |
| 1422 | {.id = ALC880_FIXUP_6ST, .name = "6stack"}, |
| 1423 | {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1424 | {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1425 | {} |
| 1426 | }; |
| 1427 | |
| 1428 | |
| 1429 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1430 | * OK, here we have finally the patch for ALC880 |
| 1431 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1432 | static int patch_alc880(struct hda_codec *codec) |
| 1433 | { |
| 1434 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1435 | int err; |
| 1436 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1437 | err = alc_alloc_spec(codec, 0x0b); |
| 1438 | if (err < 0) |
| 1439 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1440 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1441 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1442 | spec->gen.need_dac_fix = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1443 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1444 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1445 | snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1446 | alc880_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1447 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1448 | |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1449 | /* automatic parse from the BIOS config */ |
| 1450 | err = alc880_parse_auto_config(codec); |
| 1451 | if (err < 0) |
| 1452 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1453 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1454 | if (!spec->gen.no_analog) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1455 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1456 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1457 | codec->patch_ops = alc_patch_ops; |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 1458 | codec->patch_ops.unsol_event = alc880_unsol_event; |
| 1459 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1460 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1461 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1462 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1463 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1464 | |
| 1465 | error: |
| 1466 | alc_free(codec); |
| 1467 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1468 | } |
| 1469 | |
| 1470 | |
| 1471 | /* |
| 1472 | * ALC260 support |
| 1473 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1474 | static int alc260_parse_auto_config(struct hda_codec *codec) |
| 1475 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1476 | static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1477 | static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; |
| 1478 | return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1479 | } |
| 1480 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1481 | /* |
| 1482 | * Pin config fixes |
| 1483 | */ |
| 1484 | enum { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1485 | ALC260_FIXUP_HP_DC5750, |
| 1486 | ALC260_FIXUP_HP_PIN_0F, |
| 1487 | ALC260_FIXUP_COEF, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1488 | ALC260_FIXUP_GPIO1, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1489 | ALC260_FIXUP_GPIO1_TOGGLE, |
| 1490 | ALC260_FIXUP_REPLACER, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1491 | ALC260_FIXUP_HP_B1900, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1492 | ALC260_FIXUP_KN1, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1493 | ALC260_FIXUP_FSC_S7020, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1494 | ALC260_FIXUP_FSC_S7020_JWSE, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1495 | ALC260_FIXUP_VAIO_PINS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1496 | }; |
| 1497 | |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1498 | static void alc260_gpio1_automute(struct hda_codec *codec) |
| 1499 | { |
| 1500 | struct alc_spec *spec = codec->spec; |
| 1501 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1502 | spec->gen.hp_jack_present); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1503 | } |
| 1504 | |
| 1505 | static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1506 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1507 | { |
| 1508 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1509 | if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1510 | /* although the machine has only one output pin, we need to |
| 1511 | * toggle GPIO1 according to the jack state |
| 1512 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1513 | spec->gen.automute_hook = alc260_gpio1_automute; |
| 1514 | spec->gen.detect_hp = 1; |
| 1515 | spec->gen.automute_speaker = 1; |
| 1516 | spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1517 | snd_hda_jack_detect_enable_callback(codec, 0x0f, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1518 | snd_hda_gen_hp_automute); |
Takashi Iwai | c9ce6b2 | 2012-12-18 18:12:44 +0100 | [diff] [blame] | 1519 | snd_hda_add_verbs(codec, alc_gpio1_init_verbs); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1520 | } |
| 1521 | } |
| 1522 | |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1523 | static void alc260_fixup_kn1(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1524 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1525 | { |
| 1526 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1527 | static const struct hda_pintbl pincfgs[] = { |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1528 | { 0x0f, 0x02214000 }, /* HP/speaker */ |
| 1529 | { 0x12, 0x90a60160 }, /* int mic */ |
| 1530 | { 0x13, 0x02a19000 }, /* ext mic */ |
| 1531 | { 0x18, 0x01446000 }, /* SPDIF out */ |
| 1532 | /* disable bogus I/O pins */ |
| 1533 | { 0x10, 0x411111f0 }, |
| 1534 | { 0x11, 0x411111f0 }, |
| 1535 | { 0x14, 0x411111f0 }, |
| 1536 | { 0x15, 0x411111f0 }, |
| 1537 | { 0x16, 0x411111f0 }, |
| 1538 | { 0x17, 0x411111f0 }, |
| 1539 | { 0x19, 0x411111f0 }, |
| 1540 | { } |
| 1541 | }; |
| 1542 | |
| 1543 | switch (action) { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1544 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 1545 | snd_hda_apply_pincfgs(codec, pincfgs); |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1546 | break; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1547 | case HDA_FIXUP_ACT_PROBE: |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1548 | spec->init_amp = ALC_INIT_NONE; |
| 1549 | break; |
| 1550 | } |
| 1551 | } |
| 1552 | |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1553 | static void alc260_fixup_fsc_s7020(struct hda_codec *codec, |
| 1554 | const struct hda_fixup *fix, int action) |
| 1555 | { |
| 1556 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1557 | if (action == HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1558 | spec->init_amp = ALC_INIT_NONE; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1559 | } |
| 1560 | |
| 1561 | static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, |
| 1562 | const struct hda_fixup *fix, int action) |
| 1563 | { |
| 1564 | struct alc_spec *spec = codec->spec; |
| 1565 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | f811c3c | 2013-03-07 18:32:59 +0100 | [diff] [blame] | 1566 | spec->gen.add_jack_modes = 1; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1567 | spec->gen.hp_mic = 1; |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1568 | } |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1569 | } |
| 1570 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1571 | static const struct hda_fixup alc260_fixups[] = { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1572 | [ALC260_FIXUP_HP_DC5750] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1573 | .type = HDA_FIXUP_PINS, |
| 1574 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1575 | { 0x11, 0x90130110 }, /* speaker */ |
| 1576 | { } |
| 1577 | } |
| 1578 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1579 | [ALC260_FIXUP_HP_PIN_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1580 | .type = HDA_FIXUP_PINS, |
| 1581 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1582 | { 0x0f, 0x01214000 }, /* HP */ |
| 1583 | { } |
| 1584 | } |
| 1585 | }, |
| 1586 | [ALC260_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1587 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1588 | .v.verbs = (const struct hda_verb[]) { |
Ronan Marquet | e30cf2d | 2014-06-01 18:38:53 +0200 | [diff] [blame] | 1589 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1590 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1591 | { } |
| 1592 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1593 | }, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1594 | [ALC260_FIXUP_GPIO1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1595 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1596 | .v.verbs = alc_gpio1_init_verbs, |
| 1597 | }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1598 | [ALC260_FIXUP_GPIO1_TOGGLE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1599 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1600 | .v.func = alc260_fixup_gpio1_toggle, |
| 1601 | .chained = true, |
| 1602 | .chain_id = ALC260_FIXUP_HP_PIN_0F, |
| 1603 | }, |
| 1604 | [ALC260_FIXUP_REPLACER] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1605 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1606 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | 192a98e | 2014-06-02 15:16:07 +0200 | [diff] [blame] | 1607 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1608 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1609 | { } |
| 1610 | }, |
| 1611 | .chained = true, |
| 1612 | .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, |
| 1613 | }, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1614 | [ALC260_FIXUP_HP_B1900] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1615 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1616 | .v.func = alc260_fixup_gpio1_toggle, |
| 1617 | .chained = true, |
| 1618 | .chain_id = ALC260_FIXUP_COEF, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1619 | }, |
| 1620 | [ALC260_FIXUP_KN1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1621 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1622 | .v.func = alc260_fixup_kn1, |
| 1623 | }, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1624 | [ALC260_FIXUP_FSC_S7020] = { |
| 1625 | .type = HDA_FIXUP_FUNC, |
| 1626 | .v.func = alc260_fixup_fsc_s7020, |
| 1627 | }, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1628 | [ALC260_FIXUP_FSC_S7020_JWSE] = { |
| 1629 | .type = HDA_FIXUP_FUNC, |
| 1630 | .v.func = alc260_fixup_fsc_s7020_jwse, |
| 1631 | .chained = true, |
| 1632 | .chain_id = ALC260_FIXUP_FSC_S7020, |
| 1633 | }, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1634 | [ALC260_FIXUP_VAIO_PINS] = { |
| 1635 | .type = HDA_FIXUP_PINS, |
| 1636 | .v.pins = (const struct hda_pintbl[]) { |
| 1637 | /* Pin configs are missing completely on some VAIOs */ |
| 1638 | { 0x0f, 0x01211020 }, |
| 1639 | { 0x10, 0x0001003f }, |
| 1640 | { 0x11, 0x411111f0 }, |
| 1641 | { 0x12, 0x01a15930 }, |
| 1642 | { 0x13, 0x411111f0 }, |
| 1643 | { 0x14, 0x411111f0 }, |
| 1644 | { 0x15, 0x411111f0 }, |
| 1645 | { 0x16, 0x411111f0 }, |
| 1646 | { 0x17, 0x411111f0 }, |
| 1647 | { 0x18, 0x411111f0 }, |
| 1648 | { 0x19, 0x411111f0 }, |
| 1649 | { } |
| 1650 | } |
| 1651 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1652 | }; |
| 1653 | |
| 1654 | static const struct snd_pci_quirk alc260_fixup_tbl[] = { |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1655 | SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1656 | SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1657 | SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1658 | SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1659 | SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1660 | SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), |
Takashi Iwai | 0f5a5b8 | 2013-11-21 09:12:52 +0100 | [diff] [blame] | 1661 | SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F), |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1662 | SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), |
Takashi Iwai | b1f5808 | 2012-02-16 12:45:03 +0100 | [diff] [blame] | 1663 | SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1664 | SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1665 | SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1666 | SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1667 | {} |
| 1668 | }; |
| 1669 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1670 | static const struct hda_model_fixup alc260_fixup_models[] = { |
| 1671 | {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, |
| 1672 | {.id = ALC260_FIXUP_COEF, .name = "coef"}, |
| 1673 | {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, |
| 1674 | {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, |
| 1675 | {} |
| 1676 | }; |
| 1677 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1678 | /* |
| 1679 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1680 | static int patch_alc260(struct hda_codec *codec) |
| 1681 | { |
| 1682 | struct alc_spec *spec; |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1683 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1684 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1685 | err = alc_alloc_spec(codec, 0x07); |
| 1686 | if (err < 0) |
| 1687 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1688 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1689 | spec = codec->spec; |
Takashi Iwai | ea46c3c | 2013-01-15 18:45:53 +0100 | [diff] [blame] | 1690 | /* as quite a few machines require HP amp for speaker outputs, |
| 1691 | * it's easier to enable it unconditionally; even if it's unneeded, |
| 1692 | * it's almost harmless. |
| 1693 | */ |
| 1694 | spec->gen.prefer_hp_amp = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1695 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1696 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1697 | snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, |
| 1698 | alc260_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1699 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1700 | |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1701 | /* automatic parse from the BIOS config */ |
| 1702 | err = alc260_parse_auto_config(codec); |
| 1703 | if (err < 0) |
| 1704 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1705 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1706 | if (!spec->gen.no_analog) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1707 | set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1708 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1709 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1710 | spec->shutup = alc_eapd_shutup; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1711 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1712 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1713 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1714 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1715 | |
| 1716 | error: |
| 1717 | alc_free(codec); |
| 1718 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1719 | } |
| 1720 | |
| 1721 | |
| 1722 | /* |
| 1723 | * ALC882/883/885/888/889 support |
| 1724 | * |
| 1725 | * ALC882 is almost identical with ALC880 but has cleaner and more flexible |
| 1726 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 1727 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 1728 | * 6-channel independent captures. |
| 1729 | * |
| 1730 | * In addition, an independent DAC for the multi-playback (not used in this |
| 1731 | * driver yet). |
| 1732 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1733 | |
| 1734 | /* |
| 1735 | * Pin config fixes |
| 1736 | */ |
| 1737 | enum { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1738 | ALC882_FIXUP_ABIT_AW9D_MAX, |
| 1739 | ALC882_FIXUP_LENOVO_Y530, |
| 1740 | ALC882_FIXUP_PB_M5210, |
| 1741 | ALC882_FIXUP_ACER_ASPIRE_7736, |
| 1742 | ALC882_FIXUP_ASUS_W90V, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 1743 | ALC889_FIXUP_CD, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 1744 | ALC889_FIXUP_FRONT_HP_NO_PRESENCE, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1745 | ALC889_FIXUP_VAIO_TT, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 1746 | ALC888_FIXUP_EEE1601, |
Takashi Iwai | 177943a | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 1747 | ALC882_FIXUP_EAPD, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 1748 | ALC883_FIXUP_EAPD, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 1749 | ALC883_FIXUP_ACER_EAPD, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1750 | ALC882_FIXUP_GPIO1, |
| 1751 | ALC882_FIXUP_GPIO2, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 1752 | ALC882_FIXUP_GPIO3, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1753 | ALC889_FIXUP_COEF, |
| 1754 | ALC882_FIXUP_ASUS_W2JC, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 1755 | ALC882_FIXUP_ACER_ASPIRE_4930G, |
| 1756 | ALC882_FIXUP_ACER_ASPIRE_8930G, |
| 1757 | ALC882_FIXUP_ASPIRE_8930G_VERBS, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1758 | ALC885_FIXUP_MACPRO_GPIO, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1759 | ALC889_FIXUP_DAC_ROUTE, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1760 | ALC889_FIXUP_MBP_VREF, |
| 1761 | ALC889_FIXUP_IMAC91_VREF, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 1762 | ALC889_FIXUP_MBA11_VREF, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1763 | ALC889_FIXUP_MBA21_VREF, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 1764 | ALC889_FIXUP_MP11_VREF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 1765 | ALC882_FIXUP_INV_DMIC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1766 | ALC882_FIXUP_NO_PRIMARY_HP, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 1767 | ALC887_FIXUP_ASUS_BASS, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 1768 | ALC887_FIXUP_BASS_CHMAP, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1769 | }; |
| 1770 | |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1771 | static void alc889_fixup_coef(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1772 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1773 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1774 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1775 | return; |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 1776 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1777 | } |
| 1778 | |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1779 | /* toggle speaker-output according to the hp-jack state */ |
| 1780 | static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted) |
| 1781 | { |
| 1782 | unsigned int gpiostate, gpiomask, gpiodir; |
| 1783 | |
| 1784 | gpiostate = snd_hda_codec_read(codec, codec->afg, 0, |
| 1785 | AC_VERB_GET_GPIO_DATA, 0); |
| 1786 | |
| 1787 | if (!muted) |
| 1788 | gpiostate |= (1 << pin); |
| 1789 | else |
| 1790 | gpiostate &= ~(1 << pin); |
| 1791 | |
| 1792 | gpiomask = snd_hda_codec_read(codec, codec->afg, 0, |
| 1793 | AC_VERB_GET_GPIO_MASK, 0); |
| 1794 | gpiomask |= (1 << pin); |
| 1795 | |
| 1796 | gpiodir = snd_hda_codec_read(codec, codec->afg, 0, |
| 1797 | AC_VERB_GET_GPIO_DIRECTION, 0); |
| 1798 | gpiodir |= (1 << pin); |
| 1799 | |
| 1800 | |
| 1801 | snd_hda_codec_write(codec, codec->afg, 0, |
| 1802 | AC_VERB_SET_GPIO_MASK, gpiomask); |
| 1803 | snd_hda_codec_write(codec, codec->afg, 0, |
| 1804 | AC_VERB_SET_GPIO_DIRECTION, gpiodir); |
| 1805 | |
| 1806 | msleep(1); |
| 1807 | |
| 1808 | snd_hda_codec_write(codec, codec->afg, 0, |
| 1809 | AC_VERB_SET_GPIO_DATA, gpiostate); |
| 1810 | } |
| 1811 | |
| 1812 | /* set up GPIO at initialization */ |
| 1813 | static void alc885_fixup_macpro_gpio(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1814 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1815 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1816 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1817 | return; |
| 1818 | alc882_gpio_mute(codec, 0, 0); |
| 1819 | alc882_gpio_mute(codec, 1, 0); |
| 1820 | } |
| 1821 | |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1822 | /* Fix the connection of some pins for ALC889: |
| 1823 | * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't |
| 1824 | * work correctly (bko#42740) |
| 1825 | */ |
| 1826 | static void alc889_fixup_dac_route(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1827 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1828 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1829 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1830 | /* fake the connections during parsing the tree */ |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1831 | hda_nid_t conn1[2] = { 0x0c, 0x0d }; |
| 1832 | hda_nid_t conn2[2] = { 0x0e, 0x0f }; |
| 1833 | snd_hda_override_conn_list(codec, 0x14, 2, conn1); |
| 1834 | snd_hda_override_conn_list(codec, 0x15, 2, conn1); |
| 1835 | snd_hda_override_conn_list(codec, 0x18, 2, conn2); |
| 1836 | snd_hda_override_conn_list(codec, 0x1a, 2, conn2); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1837 | } else if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1838 | /* restore the connections */ |
| 1839 | hda_nid_t conn[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; |
| 1840 | snd_hda_override_conn_list(codec, 0x14, 5, conn); |
| 1841 | snd_hda_override_conn_list(codec, 0x15, 5, conn); |
| 1842 | snd_hda_override_conn_list(codec, 0x18, 5, conn); |
| 1843 | snd_hda_override_conn_list(codec, 0x1a, 5, conn); |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1844 | } |
| 1845 | } |
| 1846 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1847 | /* Set VREF on HP pin */ |
| 1848 | static void alc889_fixup_mbp_vref(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1849 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1850 | { |
| 1851 | struct alc_spec *spec = codec->spec; |
| 1852 | static hda_nid_t nids[2] = { 0x14, 0x15 }; |
| 1853 | int i; |
| 1854 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1855 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1856 | return; |
| 1857 | for (i = 0; i < ARRAY_SIZE(nids); i++) { |
| 1858 | unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); |
| 1859 | if (get_defcfg_device(val) != AC_JACK_HP_OUT) |
| 1860 | continue; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 1861 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1862 | val |= AC_PINCTL_VREF_80; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 1863 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1864 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1865 | break; |
| 1866 | } |
| 1867 | } |
| 1868 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1869 | static void alc889_fixup_mac_pins(struct hda_codec *codec, |
| 1870 | const hda_nid_t *nids, int num_nids) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1871 | { |
| 1872 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1873 | int i; |
| 1874 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1875 | for (i = 0; i < num_nids; i++) { |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1876 | unsigned int val; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 1877 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1878 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 1879 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1880 | } |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1881 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1882 | } |
| 1883 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1884 | /* Set VREF on speaker pins on imac91 */ |
| 1885 | static void alc889_fixup_imac91_vref(struct hda_codec *codec, |
| 1886 | const struct hda_fixup *fix, int action) |
| 1887 | { |
| 1888 | static hda_nid_t nids[2] = { 0x18, 0x1a }; |
| 1889 | |
| 1890 | if (action == HDA_FIXUP_ACT_INIT) |
| 1891 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 1892 | } |
| 1893 | |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 1894 | /* Set VREF on speaker pins on mba11 */ |
| 1895 | static void alc889_fixup_mba11_vref(struct hda_codec *codec, |
| 1896 | const struct hda_fixup *fix, int action) |
| 1897 | { |
| 1898 | static hda_nid_t nids[1] = { 0x18 }; |
| 1899 | |
| 1900 | if (action == HDA_FIXUP_ACT_INIT) |
| 1901 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 1902 | } |
| 1903 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1904 | /* Set VREF on speaker pins on mba21 */ |
| 1905 | static void alc889_fixup_mba21_vref(struct hda_codec *codec, |
| 1906 | const struct hda_fixup *fix, int action) |
| 1907 | { |
| 1908 | static hda_nid_t nids[2] = { 0x18, 0x19 }; |
| 1909 | |
| 1910 | if (action == HDA_FIXUP_ACT_INIT) |
| 1911 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 1912 | } |
| 1913 | |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1914 | /* Don't take HP output as primary |
Fernando Luis Vázquez Cao | d911149 | 2013-02-12 16:49:46 +0900 | [diff] [blame] | 1915 | * Strangely, the speaker output doesn't work on Vaio Z and some Vaio |
| 1916 | * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1917 | */ |
| 1918 | static void alc882_fixup_no_primary_hp(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1919 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1920 | { |
| 1921 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 1922 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1923 | spec->gen.no_primary_hp = 1; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 1924 | spec->gen.no_multi_io = 1; |
| 1925 | } |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1926 | } |
| 1927 | |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 1928 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
| 1929 | const struct hda_fixup *fix, int action); |
| 1930 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1931 | static const struct hda_fixup alc882_fixups[] = { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1932 | [ALC882_FIXUP_ABIT_AW9D_MAX] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1933 | .type = HDA_FIXUP_PINS, |
| 1934 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1935 | { 0x15, 0x01080104 }, /* side */ |
| 1936 | { 0x16, 0x01011012 }, /* rear */ |
| 1937 | { 0x17, 0x01016011 }, /* clfe */ |
| 1938 | { } |
| 1939 | } |
| 1940 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1941 | [ALC882_FIXUP_LENOVO_Y530] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1942 | .type = HDA_FIXUP_PINS, |
| 1943 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1944 | { 0x15, 0x99130112 }, /* rear int speakers */ |
| 1945 | { 0x16, 0x99130111 }, /* subwoofer */ |
| 1946 | { } |
| 1947 | } |
| 1948 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1949 | [ALC882_FIXUP_PB_M5210] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 1950 | .type = HDA_FIXUP_PINCTLS, |
| 1951 | .v.pins = (const struct hda_pintbl[]) { |
| 1952 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1953 | {} |
| 1954 | } |
| 1955 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1956 | [ALC882_FIXUP_ACER_ASPIRE_7736] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1957 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 1958 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1959 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1960 | [ALC882_FIXUP_ASUS_W90V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1961 | .type = HDA_FIXUP_PINS, |
| 1962 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5cdf745 | 2011-10-26 23:04:08 +0200 | [diff] [blame] | 1963 | { 0x16, 0x99130110 }, /* fix sequence for CLFE */ |
| 1964 | { } |
| 1965 | } |
| 1966 | }, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 1967 | [ALC889_FIXUP_CD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1968 | .type = HDA_FIXUP_PINS, |
| 1969 | .v.pins = (const struct hda_pintbl[]) { |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 1970 | { 0x1c, 0x993301f0 }, /* CD */ |
| 1971 | { } |
| 1972 | } |
| 1973 | }, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 1974 | [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { |
| 1975 | .type = HDA_FIXUP_PINS, |
| 1976 | .v.pins = (const struct hda_pintbl[]) { |
| 1977 | { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ |
| 1978 | { } |
| 1979 | }, |
| 1980 | .chained = true, |
| 1981 | .chain_id = ALC889_FIXUP_CD, |
| 1982 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1983 | [ALC889_FIXUP_VAIO_TT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1984 | .type = HDA_FIXUP_PINS, |
| 1985 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1986 | { 0x17, 0x90170111 }, /* hidden surround speaker */ |
| 1987 | { } |
| 1988 | } |
| 1989 | }, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 1990 | [ALC888_FIXUP_EEE1601] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1991 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 1992 | .v.verbs = (const struct hda_verb[]) { |
| 1993 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 1994 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, |
| 1995 | { } |
| 1996 | } |
Takashi Iwai | 177943a | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 1997 | }, |
| 1998 | [ALC882_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1999 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 177943a | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2000 | .v.verbs = (const struct hda_verb[]) { |
| 2001 | /* change to EAPD mode */ |
| 2002 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2003 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 2004 | { } |
| 2005 | } |
| 2006 | }, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2007 | [ALC883_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2008 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2009 | .v.verbs = (const struct hda_verb[]) { |
| 2010 | /* change to EAPD mode */ |
| 2011 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2012 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2013 | { } |
| 2014 | } |
| 2015 | }, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2016 | [ALC883_FIXUP_ACER_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2017 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2018 | .v.verbs = (const struct hda_verb[]) { |
| 2019 | /* eanable EAPD on Acer laptops */ |
| 2020 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2021 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2022 | { } |
| 2023 | } |
| 2024 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2025 | [ALC882_FIXUP_GPIO1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2026 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2027 | .v.verbs = alc_gpio1_init_verbs, |
| 2028 | }, |
| 2029 | [ALC882_FIXUP_GPIO2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2030 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2031 | .v.verbs = alc_gpio2_init_verbs, |
| 2032 | }, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2033 | [ALC882_FIXUP_GPIO3] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2034 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2035 | .v.verbs = alc_gpio3_init_verbs, |
| 2036 | }, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2037 | [ALC882_FIXUP_ASUS_W2JC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2038 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2039 | .v.verbs = alc_gpio1_init_verbs, |
| 2040 | .chained = true, |
| 2041 | .chain_id = ALC882_FIXUP_EAPD, |
| 2042 | }, |
| 2043 | [ALC889_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2044 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2045 | .v.func = alc889_fixup_coef, |
| 2046 | }, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2047 | [ALC882_FIXUP_ACER_ASPIRE_4930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2048 | .type = HDA_FIXUP_PINS, |
| 2049 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2050 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2051 | { 0x17, 0x99130112 }, /* surround speaker */ |
| 2052 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2053 | }, |
| 2054 | .chained = true, |
| 2055 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2056 | }, |
| 2057 | [ALC882_FIXUP_ACER_ASPIRE_8930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2058 | .type = HDA_FIXUP_PINS, |
| 2059 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2060 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2061 | { 0x1b, 0x99130112 }, /* surround speaker */ |
| 2062 | { } |
| 2063 | }, |
| 2064 | .chained = true, |
| 2065 | .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, |
| 2066 | }, |
| 2067 | [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { |
| 2068 | /* additional init verbs for Acer Aspire 8930G */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2069 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2070 | .v.verbs = (const struct hda_verb[]) { |
| 2071 | /* Enable all DACs */ |
| 2072 | /* DAC DISABLE/MUTE 1? */ |
| 2073 | /* setting bits 1-5 disables DAC nids 0x02-0x06 |
| 2074 | * apparently. Init=0x38 */ |
| 2075 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, |
| 2076 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2077 | /* DAC DISABLE/MUTE 2? */ |
| 2078 | /* some bit here disables the other DACs. |
| 2079 | * Init=0x4900 */ |
| 2080 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, |
| 2081 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2082 | /* DMIC fix |
| 2083 | * This laptop has a stereo digital microphone. |
| 2084 | * The mics are only 1cm apart which makes the stereo |
| 2085 | * useless. However, either the mic or the ALC889 |
| 2086 | * makes the signal become a difference/sum signal |
| 2087 | * instead of standard stereo, which is annoying. |
| 2088 | * So instead we flip this bit which makes the |
| 2089 | * codec replicate the sum signal to both channels, |
| 2090 | * turning it into a normal mono mic. |
| 2091 | */ |
| 2092 | /* DMIC_CONTROL? Init value = 0x0001 */ |
| 2093 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2094 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, |
| 2095 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2096 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2097 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2098 | }, |
| 2099 | .chained = true, |
| 2100 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2101 | }, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2102 | [ALC885_FIXUP_MACPRO_GPIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2103 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2104 | .v.func = alc885_fixup_macpro_gpio, |
| 2105 | }, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2106 | [ALC889_FIXUP_DAC_ROUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2107 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2108 | .v.func = alc889_fixup_dac_route, |
| 2109 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2110 | [ALC889_FIXUP_MBP_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2111 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2112 | .v.func = alc889_fixup_mbp_vref, |
| 2113 | .chained = true, |
| 2114 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2115 | }, |
| 2116 | [ALC889_FIXUP_IMAC91_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2117 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2118 | .v.func = alc889_fixup_imac91_vref, |
| 2119 | .chained = true, |
| 2120 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2121 | }, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2122 | [ALC889_FIXUP_MBA11_VREF] = { |
| 2123 | .type = HDA_FIXUP_FUNC, |
| 2124 | .v.func = alc889_fixup_mba11_vref, |
| 2125 | .chained = true, |
| 2126 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2127 | }, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2128 | [ALC889_FIXUP_MBA21_VREF] = { |
| 2129 | .type = HDA_FIXUP_FUNC, |
| 2130 | .v.func = alc889_fixup_mba21_vref, |
| 2131 | .chained = true, |
| 2132 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2133 | }, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2134 | [ALC889_FIXUP_MP11_VREF] = { |
| 2135 | .type = HDA_FIXUP_FUNC, |
| 2136 | .v.func = alc889_fixup_mba11_vref, |
| 2137 | .chained = true, |
| 2138 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2139 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2140 | [ALC882_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2141 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2142 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2143 | }, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2144 | [ALC882_FIXUP_NO_PRIMARY_HP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2145 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2146 | .v.func = alc882_fixup_no_primary_hp, |
| 2147 | }, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2148 | [ALC887_FIXUP_ASUS_BASS] = { |
| 2149 | .type = HDA_FIXUP_PINS, |
| 2150 | .v.pins = (const struct hda_pintbl[]) { |
| 2151 | {0x16, 0x99130130}, /* bass speaker */ |
| 2152 | {} |
| 2153 | }, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2154 | .chained = true, |
| 2155 | .chain_id = ALC887_FIXUP_BASS_CHMAP, |
| 2156 | }, |
| 2157 | [ALC887_FIXUP_BASS_CHMAP] = { |
| 2158 | .type = HDA_FIXUP_FUNC, |
| 2159 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2160 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2161 | }; |
| 2162 | |
| 2163 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2164 | SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), |
| 2165 | SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
| 2166 | SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), |
| 2167 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
| 2168 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), |
| 2169 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2170 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", |
| 2171 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2172 | SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", |
| 2173 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2174 | SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", |
| 2175 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2176 | SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", |
| 2177 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2178 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", |
| 2179 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2180 | SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", |
| 2181 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2182 | SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", |
| 2183 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2184 | SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), |
Takashi Iwai | f5c53d8 | 2012-05-07 10:07:33 +0200 | [diff] [blame] | 2185 | SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", |
| 2186 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2187 | SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), |
Takashi Iwai | fe97da1 | 2012-04-12 08:00:19 +0200 | [diff] [blame] | 2188 | SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2189 | SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), |
Takashi Iwai | 177943a | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2190 | SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2191 | SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2192 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2193 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2194 | SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2195 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2196 | SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), |
Fernando Luis Vázquez Cao | 12e31a7 | 2013-02-12 16:47:44 +0900 | [diff] [blame] | 2197 | SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2198 | |
| 2199 | /* All Apple entries are in codec SSIDs */ |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2200 | SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), |
| 2201 | SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), |
| 2202 | SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2203 | SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2204 | SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), |
| 2205 | SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2206 | SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), |
| 2207 | SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2208 | SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2209 | SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2210 | SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2211 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), |
| 2212 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2213 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2214 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2215 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2216 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), |
Josh Boyer | 29ebe40 | 2012-04-12 13:55:36 -0400 | [diff] [blame] | 2217 | SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 5,1", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 0519363 | 2012-11-12 10:07:36 +0100 | [diff] [blame] | 2218 | SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2219 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), |
| 2220 | SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), |
| 2221 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2222 | |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2223 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), |
Takashi Iwai | bca4013 | 2012-05-07 11:13:14 +0200 | [diff] [blame] | 2224 | SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2225 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2226 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2227 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2228 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), |
| 2229 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2230 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2231 | SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2232 | {} |
| 2233 | }; |
| 2234 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2235 | static const struct hda_model_fixup alc882_fixup_models[] = { |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2236 | {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, |
| 2237 | {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, |
| 2238 | {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2239 | {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2240 | {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2241 | {} |
| 2242 | }; |
| 2243 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2244 | /* |
| 2245 | * BIOS auto configuration |
| 2246 | */ |
| 2247 | /* almost identical with ALC880 parser... */ |
| 2248 | static int alc882_parse_auto_config(struct hda_codec *codec) |
| 2249 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2250 | static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2251 | static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2252 | return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2253 | } |
| 2254 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2255 | /* |
| 2256 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2257 | static int patch_alc882(struct hda_codec *codec) |
| 2258 | { |
| 2259 | struct alc_spec *spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2260 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2261 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2262 | err = alc_alloc_spec(codec, 0x0b); |
| 2263 | if (err < 0) |
| 2264 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2265 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2266 | spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2267 | |
| 2268 | switch (codec->vendor_id) { |
| 2269 | case 0x10ec0882: |
| 2270 | case 0x10ec0885: |
Takashi Iwai | acf0808 | 2014-09-02 07:21:56 +0200 | [diff] [blame] | 2271 | case 0x10ec0900: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2272 | break; |
| 2273 | default: |
| 2274 | /* ALC883 and variants */ |
| 2275 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2276 | break; |
| 2277 | } |
| 2278 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2279 | snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2280 | alc882_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2281 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2282 | |
| 2283 | alc_auto_parse_customize_define(codec); |
| 2284 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2285 | if (has_cdefine_beep(codec)) |
| 2286 | spec->gen.beep_nid = 0x01; |
| 2287 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2288 | /* automatic parse from the BIOS config */ |
| 2289 | err = alc882_parse_auto_config(codec); |
| 2290 | if (err < 0) |
| 2291 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2292 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2293 | if (!spec->gen.no_analog && spec->gen.beep_nid) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2294 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2295 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2296 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2297 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2298 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2299 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2300 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2301 | |
| 2302 | error: |
| 2303 | alc_free(codec); |
| 2304 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2305 | } |
| 2306 | |
| 2307 | |
| 2308 | /* |
| 2309 | * ALC262 support |
| 2310 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2311 | static int alc262_parse_auto_config(struct hda_codec *codec) |
| 2312 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2313 | static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2314 | static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2315 | return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2316 | } |
| 2317 | |
| 2318 | /* |
| 2319 | * Pin config fixes |
| 2320 | */ |
| 2321 | enum { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2322 | ALC262_FIXUP_FSC_H270, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2323 | ALC262_FIXUP_FSC_S7110, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2324 | ALC262_FIXUP_HP_Z200, |
| 2325 | ALC262_FIXUP_TYAN, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2326 | ALC262_FIXUP_LENOVO_3000, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2327 | ALC262_FIXUP_BENQ, |
| 2328 | ALC262_FIXUP_BENQ_T31, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2329 | ALC262_FIXUP_INV_DMIC, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2330 | ALC262_FIXUP_INTEL_BAYLEYBAY, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2331 | }; |
| 2332 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2333 | static const struct hda_fixup alc262_fixups[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2334 | [ALC262_FIXUP_FSC_H270] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2335 | .type = HDA_FIXUP_PINS, |
| 2336 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2337 | { 0x14, 0x99130110 }, /* speaker */ |
| 2338 | { 0x15, 0x0221142f }, /* front HP */ |
| 2339 | { 0x1b, 0x0121141f }, /* rear HP */ |
| 2340 | { } |
| 2341 | } |
| 2342 | }, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2343 | [ALC262_FIXUP_FSC_S7110] = { |
| 2344 | .type = HDA_FIXUP_PINS, |
| 2345 | .v.pins = (const struct hda_pintbl[]) { |
| 2346 | { 0x15, 0x90170110 }, /* speaker */ |
| 2347 | { } |
| 2348 | }, |
| 2349 | .chained = true, |
| 2350 | .chain_id = ALC262_FIXUP_BENQ, |
| 2351 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2352 | [ALC262_FIXUP_HP_Z200] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2353 | .type = HDA_FIXUP_PINS, |
| 2354 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2355 | { 0x16, 0x99130120 }, /* internal speaker */ |
| 2356 | { } |
| 2357 | } |
| 2358 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2359 | [ALC262_FIXUP_TYAN] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2360 | .type = HDA_FIXUP_PINS, |
| 2361 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2362 | { 0x14, 0x1993e1f0 }, /* int AUX */ |
| 2363 | { } |
| 2364 | } |
| 2365 | }, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2366 | [ALC262_FIXUP_LENOVO_3000] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2367 | .type = HDA_FIXUP_PINCTLS, |
| 2368 | .v.pins = (const struct hda_pintbl[]) { |
| 2369 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2370 | {} |
| 2371 | }, |
| 2372 | .chained = true, |
| 2373 | .chain_id = ALC262_FIXUP_BENQ, |
| 2374 | }, |
| 2375 | [ALC262_FIXUP_BENQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2376 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2377 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2378 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2379 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2380 | {} |
| 2381 | } |
| 2382 | }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2383 | [ALC262_FIXUP_BENQ_T31] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2384 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2385 | .v.verbs = (const struct hda_verb[]) { |
| 2386 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2387 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2388 | {} |
| 2389 | } |
| 2390 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2391 | [ALC262_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2392 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2393 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2394 | }, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2395 | [ALC262_FIXUP_INTEL_BAYLEYBAY] = { |
| 2396 | .type = HDA_FIXUP_FUNC, |
| 2397 | .v.func = alc_fixup_no_depop_delay, |
| 2398 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2399 | }; |
| 2400 | |
| 2401 | static const struct snd_pci_quirk alc262_fixup_tbl[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2402 | SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2403 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), |
Takashi Iwai | 3dcd3be | 2011-11-07 14:59:40 +0100 | [diff] [blame] | 2404 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2405 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), |
| 2406 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2407 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2408 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), |
| 2409 | SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2410 | SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2411 | {} |
| 2412 | }; |
| 2413 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2414 | static const struct hda_model_fixup alc262_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2415 | {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
| 2416 | {} |
| 2417 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2418 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2419 | /* |
| 2420 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2421 | static int patch_alc262(struct hda_codec *codec) |
| 2422 | { |
| 2423 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2424 | int err; |
| 2425 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2426 | err = alc_alloc_spec(codec, 0x0b); |
| 2427 | if (err < 0) |
| 2428 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2429 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2430 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2431 | spec->gen.shared_mic_vref_pin = 0x18; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2432 | |
| 2433 | #if 0 |
| 2434 | /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is |
| 2435 | * under-run |
| 2436 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2437 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2438 | #endif |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2439 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2440 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2441 | snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2442 | alc262_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2443 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2444 | |
Takashi Iwai | af741c1 | 2012-05-07 18:09:48 +0200 | [diff] [blame] | 2445 | alc_auto_parse_customize_define(codec); |
| 2446 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2447 | if (has_cdefine_beep(codec)) |
| 2448 | spec->gen.beep_nid = 0x01; |
| 2449 | |
Takashi Iwai | 42399f7 | 2011-11-07 17:18:44 +0100 | [diff] [blame] | 2450 | /* automatic parse from the BIOS config */ |
| 2451 | err = alc262_parse_auto_config(codec); |
| 2452 | if (err < 0) |
| 2453 | goto error; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2454 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2455 | if (!spec->gen.no_analog && spec->gen.beep_nid) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2456 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2457 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2458 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2459 | spec->shutup = alc_eapd_shutup; |
| 2460 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2461 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2462 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2463 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2464 | |
| 2465 | error: |
| 2466 | alc_free(codec); |
| 2467 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2468 | } |
| 2469 | |
| 2470 | /* |
| 2471 | * ALC268 |
| 2472 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2473 | /* bind Beep switches of both NID 0x0f and 0x10 */ |
| 2474 | static const struct hda_bind_ctls alc268_bind_beep_sw = { |
| 2475 | .ops = &snd_hda_bind_sw, |
| 2476 | .values = { |
| 2477 | HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT), |
| 2478 | HDA_COMPOSE_AMP_VAL(0x10, 3, 1, HDA_INPUT), |
| 2479 | 0 |
| 2480 | }, |
| 2481 | }; |
| 2482 | |
| 2483 | static const struct snd_kcontrol_new alc268_beep_mixer[] = { |
| 2484 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), |
| 2485 | HDA_BIND_SW("Beep Playback Switch", &alc268_bind_beep_sw), |
| 2486 | { } |
| 2487 | }; |
| 2488 | |
| 2489 | /* set PCBEEP vol = 0, mute connections */ |
| 2490 | static const struct hda_verb alc268_beep_init_verbs[] = { |
| 2491 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
| 2492 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2493 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2494 | { } |
| 2495 | }; |
| 2496 | |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2497 | enum { |
| 2498 | ALC268_FIXUP_INV_DMIC, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2499 | ALC268_FIXUP_HP_EAPD, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2500 | ALC268_FIXUP_SPDIF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2501 | }; |
| 2502 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2503 | static const struct hda_fixup alc268_fixups[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2504 | [ALC268_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2505 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2506 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2507 | }, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2508 | [ALC268_FIXUP_HP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2509 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2510 | .v.verbs = (const struct hda_verb[]) { |
| 2511 | {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 2512 | {} |
| 2513 | } |
| 2514 | }, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2515 | [ALC268_FIXUP_SPDIF] = { |
| 2516 | .type = HDA_FIXUP_PINS, |
| 2517 | .v.pins = (const struct hda_pintbl[]) { |
| 2518 | { 0x1e, 0x014b1180 }, /* enable SPDIF out */ |
| 2519 | {} |
| 2520 | } |
| 2521 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2522 | }; |
| 2523 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2524 | static const struct hda_model_fixup alc268_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2525 | {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2526 | {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, |
| 2527 | {} |
| 2528 | }; |
| 2529 | |
| 2530 | static const struct snd_pci_quirk alc268_fixup_tbl[] = { |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2531 | SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), |
David Henningsson | fcd8f3b | 2013-01-28 05:45:47 +0100 | [diff] [blame] | 2532 | SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC), |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2533 | /* below is codec SSID since multiple Toshiba laptops have the |
| 2534 | * same PCI SSID 1179:ff00 |
| 2535 | */ |
| 2536 | SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2537 | {} |
| 2538 | }; |
| 2539 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2540 | /* |
| 2541 | * BIOS auto configuration |
| 2542 | */ |
| 2543 | static int alc268_parse_auto_config(struct hda_codec *codec) |
| 2544 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2545 | static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2546 | return alc_parse_auto_config(codec, NULL, alc268_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2547 | } |
| 2548 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2549 | /* |
| 2550 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2551 | static int patch_alc268(struct hda_codec *codec) |
| 2552 | { |
| 2553 | struct alc_spec *spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2554 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2555 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2556 | /* ALC268 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2557 | err = alc_alloc_spec(codec, 0); |
| 2558 | if (err < 0) |
| 2559 | return err; |
| 2560 | |
| 2561 | spec = codec->spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2562 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2563 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2564 | snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); |
| 2565 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2566 | |
Takashi Iwai | 6ebb805 | 2011-08-16 15:15:40 +0200 | [diff] [blame] | 2567 | /* automatic parse from the BIOS config */ |
| 2568 | err = alc268_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2569 | if (err < 0) |
| 2570 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2571 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2572 | if (err > 0 && !spec->gen.no_analog && |
| 2573 | spec->gen.autocfg.speaker_pins[0] != 0x1d) { |
| 2574 | add_mixer(spec, alc268_beep_mixer); |
| 2575 | snd_hda_add_verbs(codec, alc268_beep_init_verbs); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2576 | if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) |
| 2577 | /* override the amp caps for beep generator */ |
| 2578 | snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, |
| 2579 | (0x0c << AC_AMPCAP_OFFSET_SHIFT) | |
| 2580 | (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 2581 | (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 2582 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 2583 | } |
| 2584 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2585 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2586 | spec->shutup = alc_eapd_shutup; |
| 2587 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2588 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2589 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2590 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2591 | |
| 2592 | error: |
| 2593 | alc_free(codec); |
| 2594 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2595 | } |
| 2596 | |
| 2597 | /* |
| 2598 | * ALC269 |
| 2599 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2600 | |
| 2601 | static int playback_pcm_open(struct hda_pcm_stream *hinfo, |
| 2602 | struct hda_codec *codec, |
| 2603 | struct snd_pcm_substream *substream) |
| 2604 | { |
| 2605 | struct hda_gen_spec *spec = codec->spec; |
| 2606 | return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream, |
| 2607 | hinfo); |
| 2608 | } |
| 2609 | |
| 2610 | static int playback_pcm_prepare(struct hda_pcm_stream *hinfo, |
| 2611 | struct hda_codec *codec, |
| 2612 | unsigned int stream_tag, |
| 2613 | unsigned int format, |
| 2614 | struct snd_pcm_substream *substream) |
| 2615 | { |
| 2616 | struct hda_gen_spec *spec = codec->spec; |
| 2617 | return snd_hda_multi_out_analog_prepare(codec, &spec->multiout, |
| 2618 | stream_tag, format, substream); |
| 2619 | } |
| 2620 | |
| 2621 | static int playback_pcm_cleanup(struct hda_pcm_stream *hinfo, |
| 2622 | struct hda_codec *codec, |
| 2623 | struct snd_pcm_substream *substream) |
| 2624 | { |
| 2625 | struct hda_gen_spec *spec = codec->spec; |
| 2626 | return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); |
| 2627 | } |
| 2628 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2629 | static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { |
| 2630 | .substreams = 1, |
| 2631 | .channels_min = 2, |
| 2632 | .channels_max = 8, |
| 2633 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
| 2634 | /* NID is set in alc_build_pcms */ |
| 2635 | .ops = { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2636 | .open = playback_pcm_open, |
| 2637 | .prepare = playback_pcm_prepare, |
| 2638 | .cleanup = playback_pcm_cleanup |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2639 | }, |
| 2640 | }; |
| 2641 | |
| 2642 | static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { |
| 2643 | .substreams = 1, |
| 2644 | .channels_min = 2, |
| 2645 | .channels_max = 2, |
| 2646 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
| 2647 | /* NID is set in alc_build_pcms */ |
| 2648 | }; |
| 2649 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2650 | /* different alc269-variants */ |
| 2651 | enum { |
| 2652 | ALC269_TYPE_ALC269VA, |
| 2653 | ALC269_TYPE_ALC269VB, |
| 2654 | ALC269_TYPE_ALC269VC, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2655 | ALC269_TYPE_ALC269VD, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2656 | ALC269_TYPE_ALC280, |
| 2657 | ALC269_TYPE_ALC282, |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2658 | ALC269_TYPE_ALC283, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2659 | ALC269_TYPE_ALC284, |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 2660 | ALC269_TYPE_ALC285, |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 2661 | ALC269_TYPE_ALC286, |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 2662 | ALC269_TYPE_ALC255, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2663 | }; |
| 2664 | |
| 2665 | /* |
| 2666 | * BIOS auto configuration |
| 2667 | */ |
| 2668 | static int alc269_parse_auto_config(struct hda_codec *codec) |
| 2669 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2670 | static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2671 | static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; |
| 2672 | static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2673 | struct alc_spec *spec = codec->spec; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2674 | const hda_nid_t *ssids; |
| 2675 | |
| 2676 | switch (spec->codec_variant) { |
| 2677 | case ALC269_TYPE_ALC269VA: |
| 2678 | case ALC269_TYPE_ALC269VC: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2679 | case ALC269_TYPE_ALC280: |
| 2680 | case ALC269_TYPE_ALC284: |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 2681 | case ALC269_TYPE_ALC285: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2682 | ssids = alc269va_ssids; |
| 2683 | break; |
| 2684 | case ALC269_TYPE_ALC269VB: |
| 2685 | case ALC269_TYPE_ALC269VD: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2686 | case ALC269_TYPE_ALC282: |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2687 | case ALC269_TYPE_ALC283: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 2688 | case ALC269_TYPE_ALC286: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 2689 | case ALC269_TYPE_ALC255: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2690 | ssids = alc269_ssids; |
| 2691 | break; |
| 2692 | default: |
| 2693 | ssids = alc269_ssids; |
| 2694 | break; |
| 2695 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2696 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2697 | return alc_parse_auto_config(codec, alc269_ignore, ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2698 | } |
| 2699 | |
Kailang Yang | f7ae9ba | 2014-06-30 16:10:37 +0800 | [diff] [blame] | 2700 | static int find_ext_mic_pin(struct hda_codec *codec); |
| 2701 | |
| 2702 | static void alc286_shutup(struct hda_codec *codec) |
| 2703 | { |
| 2704 | int i; |
| 2705 | int mic_pin = find_ext_mic_pin(codec); |
| 2706 | /* don't shut up pins when unloading the driver; otherwise it breaks |
| 2707 | * the default pin setup at the next load of the driver |
| 2708 | */ |
| 2709 | if (codec->bus->shutdown) |
| 2710 | return; |
| 2711 | for (i = 0; i < codec->init_pins.used; i++) { |
| 2712 | struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i); |
| 2713 | /* use read here for syncing after issuing each verb */ |
| 2714 | if (pin->nid != mic_pin) |
| 2715 | snd_hda_codec_read(codec, pin->nid, 0, |
| 2716 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); |
| 2717 | } |
| 2718 | codec->pins_shutup = 1; |
| 2719 | } |
| 2720 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 2721 | static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2722 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2723 | alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2724 | } |
| 2725 | |
| 2726 | static void alc269_shutup(struct hda_codec *codec) |
| 2727 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2728 | struct alc_spec *spec = codec->spec; |
| 2729 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 2730 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 2731 | alc269vb_toggle_power_output(codec, 0); |
| 2732 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
| 2733 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2734 | msleep(150); |
| 2735 | } |
Takashi Iwai | 9bfb284 | 2013-07-24 14:31:50 +0200 | [diff] [blame] | 2736 | snd_hda_shutup_pins(codec); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2737 | } |
| 2738 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2739 | static struct coef_fw alc282_coefs[] = { |
| 2740 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 32fa7e4 | 2014-10-24 16:26:01 +0800 | [diff] [blame] | 2741 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2742 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 2743 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 2744 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 2745 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 2746 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 2747 | WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ |
| 2748 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 2749 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 2750 | WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ |
| 2751 | UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ |
| 2752 | WRITE_COEF(0x34, 0xa0c0), /* ANC */ |
| 2753 | UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ |
| 2754 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 2755 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 2756 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 2757 | WRITE_COEF(0x63, 0x2902), /* PLL */ |
| 2758 | WRITE_COEF(0x68, 0xa080), /* capless control 2 */ |
| 2759 | WRITE_COEF(0x69, 0x3400), /* capless control 3 */ |
| 2760 | WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ |
| 2761 | WRITE_COEF(0x6b, 0x0), /* capless control 5 */ |
| 2762 | UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ |
| 2763 | WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ |
| 2764 | UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ |
| 2765 | WRITE_COEF(0x71, 0x0014), /* class D test 6 */ |
| 2766 | WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ |
| 2767 | UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ |
| 2768 | WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ |
| 2769 | {} |
| 2770 | }; |
| 2771 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 2772 | static void alc282_restore_default_value(struct hda_codec *codec) |
| 2773 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2774 | alc_process_coef_fw(codec, alc282_coefs); |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 2775 | } |
| 2776 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 2777 | static void alc282_init(struct hda_codec *codec) |
| 2778 | { |
| 2779 | struct alc_spec *spec = codec->spec; |
| 2780 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 2781 | bool hp_pin_sense; |
| 2782 | int coef78; |
| 2783 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 2784 | alc282_restore_default_value(codec); |
| 2785 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 2786 | if (!hp_pin) |
| 2787 | return; |
| 2788 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 2789 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 2790 | |
| 2791 | /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ |
| 2792 | /* Headphone capless set to high power mode */ |
| 2793 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 2794 | |
| 2795 | if (hp_pin_sense) |
| 2796 | msleep(2); |
| 2797 | |
| 2798 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2799 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 2800 | |
| 2801 | if (hp_pin_sense) |
| 2802 | msleep(85); |
| 2803 | |
| 2804 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2805 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 2806 | |
| 2807 | if (hp_pin_sense) |
| 2808 | msleep(100); |
| 2809 | |
| 2810 | /* Headphone capless set to normal mode */ |
| 2811 | alc_write_coef_idx(codec, 0x78, coef78); |
| 2812 | } |
| 2813 | |
| 2814 | static void alc282_shutup(struct hda_codec *codec) |
| 2815 | { |
| 2816 | struct alc_spec *spec = codec->spec; |
| 2817 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 2818 | bool hp_pin_sense; |
| 2819 | int coef78; |
| 2820 | |
| 2821 | if (!hp_pin) { |
| 2822 | alc269_shutup(codec); |
| 2823 | return; |
| 2824 | } |
| 2825 | |
| 2826 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 2827 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 2828 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 2829 | |
| 2830 | if (hp_pin_sense) |
| 2831 | msleep(2); |
| 2832 | |
| 2833 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2834 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 2835 | |
| 2836 | if (hp_pin_sense) |
| 2837 | msleep(85); |
| 2838 | |
| 2839 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2840 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 2841 | |
| 2842 | if (hp_pin_sense) |
| 2843 | msleep(100); |
| 2844 | |
| 2845 | alc_auto_setup_eapd(codec, false); |
| 2846 | snd_hda_shutup_pins(codec); |
| 2847 | alc_write_coef_idx(codec, 0x78, coef78); |
| 2848 | } |
| 2849 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2850 | static struct coef_fw alc283_coefs[] = { |
| 2851 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 2852 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2853 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 2854 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 2855 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 2856 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 2857 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 2858 | WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ |
| 2859 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 2860 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 2861 | WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ |
| 2862 | UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ |
| 2863 | WRITE_COEF(0x22, 0xa0c0), /* ANC */ |
| 2864 | UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ |
| 2865 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 2866 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 2867 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 2868 | WRITE_COEF(0x2e, 0x2902), /* PLL */ |
| 2869 | WRITE_COEF(0x33, 0xa080), /* capless control 2 */ |
| 2870 | WRITE_COEF(0x34, 0x3400), /* capless control 3 */ |
| 2871 | WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ |
| 2872 | WRITE_COEF(0x36, 0x0), /* capless control 5 */ |
| 2873 | UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ |
| 2874 | WRITE_COEF(0x39, 0x110a), /* class D test 3 */ |
| 2875 | UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ |
| 2876 | WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ |
| 2877 | WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ |
| 2878 | UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ |
| 2879 | WRITE_COEF(0x49, 0x0), /* test mode */ |
| 2880 | UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ |
| 2881 | UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ |
| 2882 | WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 2883 | UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2884 | {} |
| 2885 | }; |
| 2886 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 2887 | static void alc283_restore_default_value(struct hda_codec *codec) |
| 2888 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2889 | alc_process_coef_fw(codec, alc283_coefs); |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 2890 | } |
| 2891 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2892 | static void alc283_init(struct hda_codec *codec) |
| 2893 | { |
| 2894 | struct alc_spec *spec = codec->spec; |
| 2895 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 2896 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2897 | |
Kailang Yang | 8314f22 | 2014-04-03 17:28:39 +0800 | [diff] [blame] | 2898 | if (!spec->gen.autocfg.hp_outs) { |
| 2899 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) |
| 2900 | hp_pin = spec->gen.autocfg.line_out_pins[0]; |
| 2901 | } |
| 2902 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 2903 | alc283_restore_default_value(codec); |
| 2904 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2905 | if (!hp_pin) |
| 2906 | return; |
| 2907 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 2908 | |
| 2909 | /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ |
| 2910 | /* Headphone capless set to high power mode */ |
| 2911 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 2912 | |
| 2913 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2914 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 2915 | |
| 2916 | if (hp_pin_sense) |
| 2917 | msleep(85); |
| 2918 | |
| 2919 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2920 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 2921 | |
| 2922 | if (hp_pin_sense) |
| 2923 | msleep(85); |
| 2924 | /* Index 0x46 Combo jack auto switch control 2 */ |
| 2925 | /* 3k pull low control for Headset jack. */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2926 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2927 | /* Headphone capless set to normal mode */ |
| 2928 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 2929 | } |
| 2930 | |
| 2931 | static void alc283_shutup(struct hda_codec *codec) |
| 2932 | { |
| 2933 | struct alc_spec *spec = codec->spec; |
| 2934 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 2935 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2936 | |
Kailang Yang | 8314f22 | 2014-04-03 17:28:39 +0800 | [diff] [blame] | 2937 | if (!spec->gen.autocfg.hp_outs) { |
| 2938 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) |
| 2939 | hp_pin = spec->gen.autocfg.line_out_pins[0]; |
| 2940 | } |
| 2941 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2942 | if (!hp_pin) { |
| 2943 | alc269_shutup(codec); |
| 2944 | return; |
| 2945 | } |
| 2946 | |
| 2947 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 2948 | |
| 2949 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 2950 | |
Harsha Priya | b450b17 | 2014-10-09 11:04:56 +0000 | [diff] [blame] | 2951 | /*depop hp during suspend*/ |
| 2952 | alc_write_coef_idx(codec, 0x06, 0x2100); |
| 2953 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2954 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2955 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 2956 | |
| 2957 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 2958 | msleep(100); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2959 | |
| 2960 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2961 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 2962 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2963 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2964 | |
| 2965 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 2966 | msleep(100); |
Kailang Yang | 0435b3f | 2014-04-08 17:14:14 +0800 | [diff] [blame] | 2967 | alc_auto_setup_eapd(codec, false); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2968 | snd_hda_shutup_pins(codec); |
| 2969 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 2970 | } |
| 2971 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 2972 | static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, |
| 2973 | unsigned int val) |
| 2974 | { |
| 2975 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 2976 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ |
| 2977 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ |
| 2978 | } |
| 2979 | |
| 2980 | static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) |
| 2981 | { |
| 2982 | unsigned int val; |
| 2983 | |
| 2984 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 2985 | val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 2986 | & 0xffff; |
| 2987 | val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 2988 | << 16; |
| 2989 | return val; |
| 2990 | } |
| 2991 | |
| 2992 | static void alc5505_dsp_halt(struct hda_codec *codec) |
| 2993 | { |
| 2994 | unsigned int val; |
| 2995 | |
| 2996 | alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ |
| 2997 | alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ |
| 2998 | alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ |
| 2999 | alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ |
| 3000 | alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ |
| 3001 | alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ |
| 3002 | alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ |
| 3003 | val = alc5505_coef_get(codec, 0x6220); |
| 3004 | alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ |
| 3005 | } |
| 3006 | |
| 3007 | static void alc5505_dsp_back_from_halt(struct hda_codec *codec) |
| 3008 | { |
| 3009 | alc5505_coef_set(codec, 0x61b8, 0x04133302); |
| 3010 | alc5505_coef_set(codec, 0x61b0, 0x00005b16); |
| 3011 | alc5505_coef_set(codec, 0x61b4, 0x040a2b02); |
| 3012 | alc5505_coef_set(codec, 0x6230, 0xf80d4011); |
| 3013 | alc5505_coef_set(codec, 0x6220, 0x2002010f); |
| 3014 | alc5505_coef_set(codec, 0x880c, 0x00000004); |
| 3015 | } |
| 3016 | |
| 3017 | static void alc5505_dsp_init(struct hda_codec *codec) |
| 3018 | { |
| 3019 | unsigned int val; |
| 3020 | |
| 3021 | alc5505_dsp_halt(codec); |
| 3022 | alc5505_dsp_back_from_halt(codec); |
| 3023 | alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ |
| 3024 | alc5505_coef_set(codec, 0x61b0, 0x5b16); |
| 3025 | alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ |
| 3026 | alc5505_coef_set(codec, 0x61b4, 0x04132b02); |
| 3027 | alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ |
| 3028 | alc5505_coef_set(codec, 0x61b8, 0x041f3302); |
| 3029 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ |
| 3030 | alc5505_coef_set(codec, 0x61b8, 0x041b3302); |
| 3031 | alc5505_coef_set(codec, 0x61b8, 0x04173302); |
| 3032 | alc5505_coef_set(codec, 0x61b8, 0x04163302); |
| 3033 | alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ |
| 3034 | alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ |
| 3035 | alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ |
| 3036 | |
| 3037 | val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ |
| 3038 | if (val <= 3) |
| 3039 | alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ |
| 3040 | else |
| 3041 | alc5505_coef_set(codec, 0x6220, 0x6002018f); |
| 3042 | |
| 3043 | alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ |
| 3044 | alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ |
| 3045 | alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ |
| 3046 | alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ |
| 3047 | alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ |
| 3048 | alc5505_coef_set(codec, 0x880c, 0x00000003); |
| 3049 | alc5505_coef_set(codec, 0x880c, 0x00000010); |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3050 | |
| 3051 | #ifdef HALT_REALTEK_ALC5505 |
| 3052 | alc5505_dsp_halt(codec); |
| 3053 | #endif |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3054 | } |
| 3055 | |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3056 | #ifdef HALT_REALTEK_ALC5505 |
| 3057 | #define alc5505_dsp_suspend(codec) /* NOP */ |
| 3058 | #define alc5505_dsp_resume(codec) /* NOP */ |
| 3059 | #else |
| 3060 | #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) |
| 3061 | #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) |
| 3062 | #endif |
| 3063 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3064 | #ifdef CONFIG_PM |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3065 | static int alc269_suspend(struct hda_codec *codec) |
| 3066 | { |
| 3067 | struct alc_spec *spec = codec->spec; |
| 3068 | |
| 3069 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3070 | alc5505_dsp_suspend(codec); |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3071 | return alc_suspend(codec); |
| 3072 | } |
| 3073 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3074 | static int alc269_resume(struct hda_codec *codec) |
| 3075 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3076 | struct alc_spec *spec = codec->spec; |
| 3077 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3078 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3079 | alc269vb_toggle_power_output(codec, 0); |
| 3080 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3081 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3082 | msleep(150); |
| 3083 | } |
| 3084 | |
| 3085 | codec->patch_ops.init(codec); |
| 3086 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3087 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3088 | alc269vb_toggle_power_output(codec, 1); |
| 3089 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3090 | (alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3091 | msleep(200); |
| 3092 | } |
| 3093 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3094 | snd_hda_codec_resume_amp(codec); |
| 3095 | snd_hda_codec_resume_cache(codec); |
| 3096 | hda_call_check_power_status(codec, 0x01); |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 3097 | |
| 3098 | /* on some machine, the BIOS will clear the codec gpio data when enter |
| 3099 | * suspend, and won't restore the data after resume, so we restore it |
| 3100 | * in the driver. |
| 3101 | */ |
| 3102 | if (spec->gpio_led) |
| 3103 | snd_hda_codec_write(codec, codec->afg, 0, AC_VERB_SET_GPIO_DATA, |
| 3104 | spec->gpio_led); |
| 3105 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3106 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3107 | alc5505_dsp_resume(codec); |
Kailang Yang | c5177c8 | 2013-07-24 14:39:49 +0200 | [diff] [blame] | 3108 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3109 | return 0; |
| 3110 | } |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3111 | #endif /* CONFIG_PM */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3112 | |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3113 | static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3114 | const struct hda_fixup *fix, int action) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3115 | { |
| 3116 | struct alc_spec *spec = codec->spec; |
| 3117 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3118 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3119 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 3120 | } |
| 3121 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3122 | static void alc269_fixup_hweq(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3123 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3124 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3125 | if (action == HDA_FIXUP_ACT_INIT) |
| 3126 | alc_update_coef_idx(codec, 0x1e, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3127 | } |
| 3128 | |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 3129 | static void alc269_fixup_headset_mic(struct hda_codec *codec, |
| 3130 | const struct hda_fixup *fix, int action) |
| 3131 | { |
| 3132 | struct alc_spec *spec = codec->spec; |
| 3133 | |
| 3134 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 3135 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3136 | } |
| 3137 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3138 | static void alc271_fixup_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3139 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3140 | { |
| 3141 | static const struct hda_verb verbs[] = { |
| 3142 | {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, |
| 3143 | {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, |
| 3144 | {} |
| 3145 | }; |
| 3146 | unsigned int cfg; |
| 3147 | |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 3148 | if (strcmp(codec->chip_name, "ALC271X") && |
| 3149 | strcmp(codec->chip_name, "ALC269VB")) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3150 | return; |
| 3151 | cfg = snd_hda_codec_get_pincfg(codec, 0x12); |
| 3152 | if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) |
| 3153 | snd_hda_sequence_write(codec, verbs); |
| 3154 | } |
| 3155 | |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3156 | static void alc269_fixup_pcm_44k(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3157 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3158 | { |
| 3159 | struct alc_spec *spec = codec->spec; |
| 3160 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3161 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3162 | return; |
| 3163 | |
| 3164 | /* Due to a hardware problem on Lenovo Ideadpad, we need to |
| 3165 | * fix the sample rate of analog I/O to 44.1kHz |
| 3166 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3167 | spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; |
| 3168 | spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3169 | } |
| 3170 | |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3171 | static void alc269_fixup_stereo_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3172 | const struct hda_fixup *fix, int action) |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3173 | { |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3174 | /* The digital-mic unit sends PDM (differential signal) instead of |
| 3175 | * the standard PCM, thus you can't record a valid mono stream as is. |
| 3176 | * Below is a workaround specific to ALC269 to control the dmic |
| 3177 | * signal source as mono. |
| 3178 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3179 | if (action == HDA_FIXUP_ACT_INIT) |
| 3180 | alc_update_coef_idx(codec, 0x07, 0, 0x80); |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3181 | } |
| 3182 | |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3183 | static void alc269_quanta_automute(struct hda_codec *codec) |
| 3184 | { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3185 | snd_hda_gen_update_outputs(codec); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3186 | |
Takashi Iwai | 1687ccc | 2014-08-18 13:49:35 +0200 | [diff] [blame] | 3187 | alc_write_coef_idx(codec, 0x0c, 0x680); |
| 3188 | alc_write_coef_idx(codec, 0x0c, 0x480); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3189 | } |
| 3190 | |
| 3191 | static void alc269_fixup_quanta_mute(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3192 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3193 | { |
| 3194 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3195 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3196 | return; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3197 | spec->gen.automute_hook = alc269_quanta_automute; |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3198 | } |
| 3199 | |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3200 | static void alc269_x101_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 3201 | struct hda_jack_callback *jack) |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3202 | { |
| 3203 | struct alc_spec *spec = codec->spec; |
| 3204 | int vref; |
| 3205 | msleep(200); |
| 3206 | snd_hda_gen_hp_automute(codec, jack); |
| 3207 | |
| 3208 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 3209 | msleep(100); |
| 3210 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 3211 | vref); |
| 3212 | msleep(500); |
| 3213 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 3214 | vref); |
| 3215 | } |
| 3216 | |
| 3217 | static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, |
| 3218 | const struct hda_fixup *fix, int action) |
| 3219 | { |
| 3220 | struct alc_spec *spec = codec->spec; |
| 3221 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3222 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3223 | spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; |
| 3224 | } |
| 3225 | } |
| 3226 | |
| 3227 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3228 | /* update mute-LED according to the speaker mute state via mic VREF pin */ |
| 3229 | static void alc269_fixup_mic_mute_hook(void *private_data, int enabled) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3230 | { |
| 3231 | struct hda_codec *codec = private_data; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3232 | struct alc_spec *spec = codec->spec; |
| 3233 | unsigned int pinval; |
| 3234 | |
| 3235 | if (spec->mute_led_polarity) |
| 3236 | enabled = !enabled; |
Takashi Iwai | 415d555 | 2014-04-03 11:51:21 +0200 | [diff] [blame] | 3237 | pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid); |
| 3238 | pinval &= ~AC_PINCTL_VREFEN; |
| 3239 | pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3240 | if (spec->mute_led_nid) |
| 3241 | snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval); |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3242 | } |
| 3243 | |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3244 | /* Make sure the led works even in runtime suspend */ |
| 3245 | static unsigned int led_power_filter(struct hda_codec *codec, |
| 3246 | hda_nid_t nid, |
| 3247 | unsigned int power_state) |
| 3248 | { |
| 3249 | struct alc_spec *spec = codec->spec; |
| 3250 | |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 3251 | if (power_state != AC_PWRST_D3 || nid == 0 || |
| 3252 | (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3253 | return power_state; |
| 3254 | |
| 3255 | /* Set pin ctl again, it might have just been set to 0 */ |
| 3256 | snd_hda_set_pin_ctl(codec, nid, |
| 3257 | snd_hda_codec_get_pin_target(codec, nid)); |
| 3258 | |
| 3259 | return AC_PWRST_D0; |
| 3260 | } |
| 3261 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3262 | static void alc269_fixup_hp_mute_led(struct hda_codec *codec, |
| 3263 | const struct hda_fixup *fix, int action) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3264 | { |
| 3265 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3266 | const struct dmi_device *dev = NULL; |
| 3267 | |
| 3268 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 3269 | return; |
| 3270 | |
| 3271 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { |
| 3272 | int pol, pin; |
| 3273 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) |
| 3274 | continue; |
| 3275 | if (pin < 0x0a || pin >= 0x10) |
| 3276 | break; |
| 3277 | spec->mute_led_polarity = pol; |
| 3278 | spec->mute_led_nid = pin - 0x0a + 0x18; |
| 3279 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
Takashi Iwai | fd25a97 | 2012-12-20 14:57:18 +0100 | [diff] [blame] | 3280 | spec->gen.vmaster_mute_enum = 1; |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3281 | codec->power_filter = led_power_filter; |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3282 | codec_dbg(codec, |
| 3283 | "Detected mute LED for %x:%d\n", spec->mute_led_nid, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3284 | spec->mute_led_polarity); |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3285 | break; |
| 3286 | } |
| 3287 | } |
| 3288 | |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3289 | static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, |
| 3290 | const struct hda_fixup *fix, int action) |
| 3291 | { |
| 3292 | struct alc_spec *spec = codec->spec; |
| 3293 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3294 | spec->mute_led_polarity = 0; |
| 3295 | spec->mute_led_nid = 0x18; |
| 3296 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
| 3297 | spec->gen.vmaster_mute_enum = 1; |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3298 | codec->power_filter = led_power_filter; |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3299 | } |
| 3300 | } |
| 3301 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3302 | static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, |
| 3303 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 3304 | { |
| 3305 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 9bb1f06 | 2013-01-10 17:14:29 +0100 | [diff] [blame] | 3306 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3307 | spec->mute_led_polarity = 0; |
| 3308 | spec->mute_led_nid = 0x19; |
| 3309 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
Takashi Iwai | fd25a97 | 2012-12-20 14:57:18 +0100 | [diff] [blame] | 3310 | spec->gen.vmaster_mute_enum = 1; |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3311 | codec->power_filter = led_power_filter; |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 3312 | } |
| 3313 | } |
| 3314 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3315 | /* update LED status via GPIO */ |
| 3316 | static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask, |
| 3317 | bool enabled) |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3318 | { |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3319 | struct alc_spec *spec = codec->spec; |
| 3320 | unsigned int oldval = spec->gpio_led; |
| 3321 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3322 | if (spec->mute_led_polarity) |
| 3323 | enabled = !enabled; |
| 3324 | |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3325 | if (enabled) |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3326 | spec->gpio_led &= ~mask; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3327 | else |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3328 | spec->gpio_led |= mask; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3329 | if (spec->gpio_led != oldval) |
| 3330 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
| 3331 | spec->gpio_led); |
| 3332 | } |
| 3333 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3334 | /* turn on/off mute LED via GPIO per vmaster hook */ |
| 3335 | static void alc_fixup_gpio_mute_hook(void *private_data, int enabled) |
| 3336 | { |
| 3337 | struct hda_codec *codec = private_data; |
| 3338 | struct alc_spec *spec = codec->spec; |
| 3339 | |
| 3340 | alc_update_gpio_led(codec, spec->gpio_mute_led_mask, enabled); |
| 3341 | } |
| 3342 | |
| 3343 | /* turn on/off mic-mute LED via GPIO per capture hook */ |
| 3344 | static void alc_fixup_gpio_mic_mute_hook(struct hda_codec *codec, |
| 3345 | struct snd_kcontrol *kcontrol, |
| 3346 | struct snd_ctl_elem_value *ucontrol) |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3347 | { |
| 3348 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3349 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3350 | if (ucontrol) |
| 3351 | alc_update_gpio_led(codec, spec->gpio_mic_led_mask, |
| 3352 | ucontrol->value.integer.value[0] || |
| 3353 | ucontrol->value.integer.value[1]); |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3354 | } |
| 3355 | |
| 3356 | static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, |
| 3357 | const struct hda_fixup *fix, int action) |
| 3358 | { |
| 3359 | struct alc_spec *spec = codec->spec; |
| 3360 | static const struct hda_verb gpio_init[] = { |
| 3361 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x18 }, |
| 3362 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x18 }, |
| 3363 | {} |
| 3364 | }; |
| 3365 | |
| 3366 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3367 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
| 3368 | spec->gen.cap_sync_hook = alc_fixup_gpio_mic_mute_hook; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3369 | spec->gpio_led = 0; |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3370 | spec->mute_led_polarity = 0; |
| 3371 | spec->gpio_mute_led_mask = 0x08; |
| 3372 | spec->gpio_mic_led_mask = 0x10; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3373 | snd_hda_add_verbs(codec, gpio_init); |
| 3374 | } |
| 3375 | } |
| 3376 | |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 3377 | static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, |
| 3378 | const struct hda_fixup *fix, int action) |
| 3379 | { |
| 3380 | struct alc_spec *spec = codec->spec; |
| 3381 | static const struct hda_verb gpio_init[] = { |
| 3382 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x22 }, |
| 3383 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x22 }, |
| 3384 | {} |
| 3385 | }; |
| 3386 | |
| 3387 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3388 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
| 3389 | spec->gen.cap_sync_hook = alc_fixup_gpio_mic_mute_hook; |
| 3390 | spec->gpio_led = 0; |
| 3391 | spec->mute_led_polarity = 0; |
| 3392 | spec->gpio_mute_led_mask = 0x02; |
| 3393 | spec->gpio_mic_led_mask = 0x20; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3394 | snd_hda_add_verbs(codec, gpio_init); |
| 3395 | } |
| 3396 | } |
| 3397 | |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3398 | /* turn on/off mic-mute LED per capture hook */ |
| 3399 | static void alc269_fixup_hp_cap_mic_mute_hook(struct hda_codec *codec, |
| 3400 | struct snd_kcontrol *kcontrol, |
| 3401 | struct snd_ctl_elem_value *ucontrol) |
| 3402 | { |
| 3403 | struct alc_spec *spec = codec->spec; |
| 3404 | unsigned int pinval, enable, disable; |
| 3405 | |
Hui Wang | fc1fad9 | 2014-07-08 17:56:14 +0800 | [diff] [blame] | 3406 | pinval = snd_hda_codec_get_pin_target(codec, spec->cap_mute_led_nid); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3407 | pinval &= ~AC_PINCTL_VREFEN; |
| 3408 | enable = pinval | AC_PINCTL_VREF_80; |
| 3409 | disable = pinval | AC_PINCTL_VREF_HIZ; |
| 3410 | |
| 3411 | if (!ucontrol) |
| 3412 | return; |
| 3413 | |
| 3414 | if (ucontrol->value.integer.value[0] || |
| 3415 | ucontrol->value.integer.value[1]) |
| 3416 | pinval = disable; |
| 3417 | else |
| 3418 | pinval = enable; |
| 3419 | |
| 3420 | if (spec->cap_mute_led_nid) |
| 3421 | snd_hda_set_pin_ctl_cache(codec, spec->cap_mute_led_nid, pinval); |
| 3422 | } |
| 3423 | |
| 3424 | static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, |
| 3425 | const struct hda_fixup *fix, int action) |
| 3426 | { |
| 3427 | struct alc_spec *spec = codec->spec; |
| 3428 | static const struct hda_verb gpio_init[] = { |
| 3429 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x08 }, |
| 3430 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x08 }, |
| 3431 | {} |
| 3432 | }; |
| 3433 | |
| 3434 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3435 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3436 | spec->gen.cap_sync_hook = alc269_fixup_hp_cap_mic_mute_hook; |
| 3437 | spec->gpio_led = 0; |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3438 | spec->mute_led_polarity = 0; |
| 3439 | spec->gpio_mute_led_mask = 0x08; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3440 | spec->cap_mute_led_nid = 0x18; |
| 3441 | snd_hda_add_verbs(codec, gpio_init); |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 3442 | codec->power_filter = led_power_filter; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3443 | } |
| 3444 | } |
| 3445 | |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3446 | static void alc280_fixup_hp_gpio4(struct hda_codec *codec, |
| 3447 | const struct hda_fixup *fix, int action) |
| 3448 | { |
| 3449 | /* Like hp_gpio_mic1_led, but also needs GPIO4 low to enable headphone amp */ |
| 3450 | struct alc_spec *spec = codec->spec; |
| 3451 | static const struct hda_verb gpio_init[] = { |
| 3452 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x18 }, |
| 3453 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x18 }, |
| 3454 | {} |
| 3455 | }; |
| 3456 | |
| 3457 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3458 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3459 | spec->gen.cap_sync_hook = alc269_fixup_hp_cap_mic_mute_hook; |
| 3460 | spec->gpio_led = 0; |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3461 | spec->mute_led_polarity = 0; |
| 3462 | spec->gpio_mute_led_mask = 0x08; |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3463 | spec->cap_mute_led_nid = 0x18; |
| 3464 | snd_hda_add_verbs(codec, gpio_init); |
| 3465 | codec->power_filter = led_power_filter; |
| 3466 | } |
| 3467 | } |
| 3468 | |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3469 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, |
| 3470 | const struct hda_fixup *fix, int action) |
| 3471 | { |
| 3472 | struct alc_spec *spec = codec->spec; |
| 3473 | |
| 3474 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3475 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
| 3476 | spec->gen.cap_sync_hook = alc269_fixup_hp_cap_mic_mute_hook; |
| 3477 | spec->mute_led_polarity = 0; |
| 3478 | spec->mute_led_nid = 0x1a; |
| 3479 | spec->cap_mute_led_nid = 0x18; |
| 3480 | spec->gen.vmaster_mute_enum = 1; |
| 3481 | codec->power_filter = led_power_filter; |
| 3482 | } |
| 3483 | } |
| 3484 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3485 | static void alc_headset_mode_unplugged(struct hda_codec *codec) |
| 3486 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3487 | static struct coef_fw coef0255[] = { |
| 3488 | WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ |
| 3489 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
| 3490 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 3491 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ |
| 3492 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ |
| 3493 | {} |
| 3494 | }; |
| 3495 | static struct coef_fw coef0233[] = { |
| 3496 | WRITE_COEF(0x1b, 0x0c0b), |
| 3497 | WRITE_COEF(0x45, 0xc429), |
| 3498 | UPDATE_COEF(0x35, 0x4000, 0), |
| 3499 | WRITE_COEF(0x06, 0x2104), |
| 3500 | WRITE_COEF(0x1a, 0x0001), |
| 3501 | WRITE_COEF(0x26, 0x0004), |
| 3502 | WRITE_COEF(0x32, 0x42a3), |
| 3503 | {} |
| 3504 | }; |
| 3505 | static struct coef_fw coef0292[] = { |
| 3506 | WRITE_COEF(0x76, 0x000e), |
| 3507 | WRITE_COEF(0x6c, 0x2400), |
| 3508 | WRITE_COEF(0x18, 0x7308), |
| 3509 | WRITE_COEF(0x6b, 0xc429), |
| 3510 | {} |
| 3511 | }; |
| 3512 | static struct coef_fw coef0293[] = { |
| 3513 | UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ |
| 3514 | UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ |
| 3515 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ |
| 3516 | UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ |
| 3517 | WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ |
| 3518 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 3519 | {} |
| 3520 | }; |
| 3521 | static struct coef_fw coef0668[] = { |
| 3522 | WRITE_COEF(0x15, 0x0d40), |
| 3523 | WRITE_COEF(0xb7, 0x802b), |
| 3524 | {} |
| 3525 | }; |
| 3526 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3527 | switch (codec->vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3528 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3529 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3530 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 3531 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3532 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3533 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3534 | break; |
| 3535 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3536 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3537 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3538 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3539 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3540 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3541 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3542 | alc_process_coef_fw(codec, coef0668); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3543 | break; |
| 3544 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3545 | codec_dbg(codec, "Headset jack set to unplugged mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3546 | } |
| 3547 | |
| 3548 | |
| 3549 | static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, |
| 3550 | hda_nid_t mic_pin) |
| 3551 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3552 | static struct coef_fw coef0255[] = { |
| 3553 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), |
| 3554 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ |
| 3555 | {} |
| 3556 | }; |
| 3557 | static struct coef_fw coef0233[] = { |
| 3558 | UPDATE_COEF(0x35, 0, 1<<14), |
| 3559 | WRITE_COEF(0x06, 0x2100), |
| 3560 | WRITE_COEF(0x1a, 0x0021), |
| 3561 | WRITE_COEF(0x26, 0x008c), |
| 3562 | {} |
| 3563 | }; |
| 3564 | static struct coef_fw coef0292[] = { |
| 3565 | WRITE_COEF(0x19, 0xa208), |
| 3566 | WRITE_COEF(0x2e, 0xacf0), |
| 3567 | {} |
| 3568 | }; |
| 3569 | static struct coef_fw coef0293[] = { |
| 3570 | UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ |
| 3571 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ |
| 3572 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 3573 | {} |
| 3574 | }; |
| 3575 | static struct coef_fw coef0688[] = { |
| 3576 | WRITE_COEF(0xb7, 0x802b), |
| 3577 | WRITE_COEF(0xb5, 0x1040), |
| 3578 | UPDATE_COEF(0xc3, 0, 1<<12), |
| 3579 | {} |
| 3580 | }; |
| 3581 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3582 | switch (codec->vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3583 | case 0x10ec0255: |
| 3584 | alc_write_coef_idx(codec, 0x45, 0xc489); |
| 3585 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3586 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3587 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 3588 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 3589 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3590 | case 0x10ec0283: |
| 3591 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 3592 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3593 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3594 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 3595 | break; |
| 3596 | case 0x10ec0292: |
| 3597 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3598 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3599 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3600 | case 0x10ec0293: |
| 3601 | /* Set to TRS mode */ |
| 3602 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 3603 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3604 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3605 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 3606 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3607 | case 0x10ec0668: |
| 3608 | alc_write_coef_idx(codec, 0x11, 0x0001); |
| 3609 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3610 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3611 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 3612 | break; |
| 3613 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3614 | codec_dbg(codec, "Headset jack set to mic-in mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3615 | } |
| 3616 | |
| 3617 | static void alc_headset_mode_default(struct hda_codec *codec) |
| 3618 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3619 | static struct coef_fw coef0255[] = { |
| 3620 | WRITE_COEF(0x45, 0xc089), |
| 3621 | WRITE_COEF(0x45, 0xc489), |
| 3622 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 3623 | WRITE_COEF(0x49, 0x0049), |
| 3624 | {} |
| 3625 | }; |
| 3626 | static struct coef_fw coef0233[] = { |
| 3627 | WRITE_COEF(0x06, 0x2100), |
| 3628 | WRITE_COEF(0x32, 0x4ea3), |
| 3629 | {} |
| 3630 | }; |
| 3631 | static struct coef_fw coef0292[] = { |
| 3632 | WRITE_COEF(0x76, 0x000e), |
| 3633 | WRITE_COEF(0x6c, 0x2400), |
| 3634 | WRITE_COEF(0x6b, 0xc429), |
| 3635 | WRITE_COEF(0x18, 0x7308), |
| 3636 | {} |
| 3637 | }; |
| 3638 | static struct coef_fw coef0293[] = { |
| 3639 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 3640 | WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ |
| 3641 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 3642 | {} |
| 3643 | }; |
| 3644 | static struct coef_fw coef0688[] = { |
| 3645 | WRITE_COEF(0x11, 0x0041), |
| 3646 | WRITE_COEF(0x15, 0x0d40), |
| 3647 | WRITE_COEF(0xb7, 0x802b), |
| 3648 | {} |
| 3649 | }; |
| 3650 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3651 | switch (codec->vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3652 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3653 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3654 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 3655 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3656 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3657 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3658 | break; |
| 3659 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3660 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3661 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3662 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3663 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3664 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3665 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3666 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3667 | break; |
| 3668 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3669 | codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3670 | } |
| 3671 | |
| 3672 | /* Iphone type */ |
| 3673 | static void alc_headset_mode_ctia(struct hda_codec *codec) |
| 3674 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3675 | static struct coef_fw coef0255[] = { |
| 3676 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
| 3677 | WRITE_COEF(0x1b, 0x0c2b), |
| 3678 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 3679 | {} |
| 3680 | }; |
| 3681 | static struct coef_fw coef0233[] = { |
| 3682 | WRITE_COEF(0x45, 0xd429), |
| 3683 | WRITE_COEF(0x1b, 0x0c2b), |
| 3684 | WRITE_COEF(0x32, 0x4ea3), |
| 3685 | {} |
| 3686 | }; |
| 3687 | static struct coef_fw coef0292[] = { |
| 3688 | WRITE_COEF(0x6b, 0xd429), |
| 3689 | WRITE_COEF(0x76, 0x0008), |
| 3690 | WRITE_COEF(0x18, 0x7388), |
| 3691 | {} |
| 3692 | }; |
| 3693 | static struct coef_fw coef0293[] = { |
| 3694 | WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ |
| 3695 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 3696 | {} |
| 3697 | }; |
| 3698 | static struct coef_fw coef0688[] = { |
| 3699 | WRITE_COEF(0x11, 0x0001), |
| 3700 | WRITE_COEF(0x15, 0x0d60), |
| 3701 | WRITE_COEF(0xc3, 0x0000), |
| 3702 | {} |
| 3703 | }; |
| 3704 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3705 | switch (codec->vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3706 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3707 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3708 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 3709 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3710 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3711 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3712 | break; |
| 3713 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3714 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3715 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3716 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3717 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3718 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3719 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3720 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3721 | break; |
| 3722 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3723 | codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3724 | } |
| 3725 | |
| 3726 | /* Nokia type */ |
| 3727 | static void alc_headset_mode_omtp(struct hda_codec *codec) |
| 3728 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3729 | static struct coef_fw coef0255[] = { |
| 3730 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
| 3731 | WRITE_COEF(0x1b, 0x0c2b), |
| 3732 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 3733 | {} |
| 3734 | }; |
| 3735 | static struct coef_fw coef0233[] = { |
| 3736 | WRITE_COEF(0x45, 0xe429), |
| 3737 | WRITE_COEF(0x1b, 0x0c2b), |
| 3738 | WRITE_COEF(0x32, 0x4ea3), |
| 3739 | {} |
| 3740 | }; |
| 3741 | static struct coef_fw coef0292[] = { |
| 3742 | WRITE_COEF(0x6b, 0xe429), |
| 3743 | WRITE_COEF(0x76, 0x0008), |
| 3744 | WRITE_COEF(0x18, 0x7388), |
| 3745 | {} |
| 3746 | }; |
| 3747 | static struct coef_fw coef0293[] = { |
| 3748 | WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ |
| 3749 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 3750 | {} |
| 3751 | }; |
| 3752 | static struct coef_fw coef0688[] = { |
| 3753 | WRITE_COEF(0x11, 0x0001), |
| 3754 | WRITE_COEF(0x15, 0x0d50), |
| 3755 | WRITE_COEF(0xc3, 0x0000), |
| 3756 | {} |
| 3757 | }; |
| 3758 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3759 | switch (codec->vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3760 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3761 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3762 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 3763 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3764 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3765 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3766 | break; |
| 3767 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3768 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3769 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3770 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3771 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3772 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3773 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3774 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3775 | break; |
| 3776 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3777 | codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3778 | } |
| 3779 | |
| 3780 | static void alc_determine_headset_type(struct hda_codec *codec) |
| 3781 | { |
| 3782 | int val; |
| 3783 | bool is_ctia = false; |
| 3784 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3785 | static struct coef_fw coef0255[] = { |
| 3786 | WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ |
| 3787 | WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref |
| 3788 | conteol) */ |
| 3789 | {} |
| 3790 | }; |
| 3791 | static struct coef_fw coef0293[] = { |
| 3792 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ |
| 3793 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ |
| 3794 | {} |
| 3795 | }; |
| 3796 | static struct coef_fw coef0688[] = { |
| 3797 | WRITE_COEF(0x11, 0x0001), |
| 3798 | WRITE_COEF(0xb7, 0x802b), |
| 3799 | WRITE_COEF(0x15, 0x0d60), |
| 3800 | WRITE_COEF(0xc3, 0x0c00), |
| 3801 | {} |
| 3802 | }; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3803 | |
| 3804 | switch (codec->vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3805 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3806 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3807 | msleep(300); |
| 3808 | val = alc_read_coef_idx(codec, 0x46); |
| 3809 | is_ctia = (val & 0x0070) == 0x0070; |
| 3810 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 3811 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3812 | case 0x10ec0283: |
| 3813 | alc_write_coef_idx(codec, 0x45, 0xd029); |
| 3814 | msleep(300); |
| 3815 | val = alc_read_coef_idx(codec, 0x46); |
| 3816 | is_ctia = (val & 0x0070) == 0x0070; |
| 3817 | break; |
| 3818 | case 0x10ec0292: |
| 3819 | alc_write_coef_idx(codec, 0x6b, 0xd429); |
| 3820 | msleep(300); |
| 3821 | val = alc_read_coef_idx(codec, 0x6c); |
| 3822 | is_ctia = (val & 0x001c) == 0x001c; |
| 3823 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3824 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3825 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 3826 | msleep(300); |
| 3827 | val = alc_read_coef_idx(codec, 0x46); |
| 3828 | is_ctia = (val & 0x0070) == 0x0070; |
| 3829 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3830 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3831 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3832 | msleep(300); |
| 3833 | val = alc_read_coef_idx(codec, 0xbe); |
| 3834 | is_ctia = (val & 0x1c02) == 0x1c02; |
| 3835 | break; |
| 3836 | } |
| 3837 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3838 | codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3839 | is_ctia ? "yes" : "no"); |
| 3840 | spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; |
| 3841 | } |
| 3842 | |
| 3843 | static void alc_update_headset_mode(struct hda_codec *codec) |
| 3844 | { |
| 3845 | struct alc_spec *spec = codec->spec; |
| 3846 | |
| 3847 | hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]]; |
| 3848 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 3849 | |
| 3850 | int new_headset_mode; |
| 3851 | |
| 3852 | if (!snd_hda_jack_detect(codec, hp_pin)) |
| 3853 | new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; |
| 3854 | else if (mux_pin == spec->headset_mic_pin) |
| 3855 | new_headset_mode = ALC_HEADSET_MODE_HEADSET; |
| 3856 | else if (mux_pin == spec->headphone_mic_pin) |
| 3857 | new_headset_mode = ALC_HEADSET_MODE_MIC; |
| 3858 | else |
| 3859 | new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; |
| 3860 | |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 3861 | if (new_headset_mode == spec->current_headset_mode) { |
| 3862 | snd_hda_gen_update_outputs(codec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3863 | return; |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 3864 | } |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3865 | |
| 3866 | switch (new_headset_mode) { |
| 3867 | case ALC_HEADSET_MODE_UNPLUGGED: |
| 3868 | alc_headset_mode_unplugged(codec); |
| 3869 | spec->gen.hp_jack_present = false; |
| 3870 | break; |
| 3871 | case ALC_HEADSET_MODE_HEADSET: |
| 3872 | if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) |
| 3873 | alc_determine_headset_type(codec); |
| 3874 | if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) |
| 3875 | alc_headset_mode_ctia(codec); |
| 3876 | else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) |
| 3877 | alc_headset_mode_omtp(codec); |
| 3878 | spec->gen.hp_jack_present = true; |
| 3879 | break; |
| 3880 | case ALC_HEADSET_MODE_MIC: |
| 3881 | alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); |
| 3882 | spec->gen.hp_jack_present = false; |
| 3883 | break; |
| 3884 | case ALC_HEADSET_MODE_HEADPHONE: |
| 3885 | alc_headset_mode_default(codec); |
| 3886 | spec->gen.hp_jack_present = true; |
| 3887 | break; |
| 3888 | } |
| 3889 | if (new_headset_mode != ALC_HEADSET_MODE_MIC) { |
| 3890 | snd_hda_set_pin_ctl_cache(codec, hp_pin, |
| 3891 | AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); |
| 3892 | if (spec->headphone_mic_pin) |
| 3893 | snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, |
| 3894 | PIN_VREFHIZ); |
| 3895 | } |
| 3896 | spec->current_headset_mode = new_headset_mode; |
| 3897 | |
| 3898 | snd_hda_gen_update_outputs(codec); |
| 3899 | } |
| 3900 | |
| 3901 | static void alc_update_headset_mode_hook(struct hda_codec *codec, |
Takashi Iwai | 7fe3071 | 2014-01-30 17:59:02 +0100 | [diff] [blame] | 3902 | struct snd_kcontrol *kcontrol, |
| 3903 | struct snd_ctl_elem_value *ucontrol) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3904 | { |
| 3905 | alc_update_headset_mode(codec); |
| 3906 | } |
| 3907 | |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 3908 | static void alc_update_headset_jack_cb(struct hda_codec *codec, |
| 3909 | struct hda_jack_callback *jack) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3910 | { |
| 3911 | struct alc_spec *spec = codec->spec; |
David Henningsson | 5db4d34 | 2013-11-22 12:17:06 +0100 | [diff] [blame] | 3912 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 3913 | snd_hda_gen_hp_automute(codec, jack); |
| 3914 | } |
| 3915 | |
| 3916 | static void alc_probe_headset_mode(struct hda_codec *codec) |
| 3917 | { |
| 3918 | int i; |
| 3919 | struct alc_spec *spec = codec->spec; |
| 3920 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 3921 | |
| 3922 | /* Find mic pins */ |
| 3923 | for (i = 0; i < cfg->num_inputs; i++) { |
| 3924 | if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) |
| 3925 | spec->headset_mic_pin = cfg->inputs[i].pin; |
| 3926 | if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) |
| 3927 | spec->headphone_mic_pin = cfg->inputs[i].pin; |
| 3928 | } |
| 3929 | |
| 3930 | spec->gen.cap_sync_hook = alc_update_headset_mode_hook; |
| 3931 | spec->gen.automute_hook = alc_update_headset_mode; |
| 3932 | spec->gen.hp_automute_hook = alc_update_headset_jack_cb; |
| 3933 | } |
| 3934 | |
| 3935 | static void alc_fixup_headset_mode(struct hda_codec *codec, |
| 3936 | const struct hda_fixup *fix, int action) |
| 3937 | { |
| 3938 | struct alc_spec *spec = codec->spec; |
| 3939 | |
| 3940 | switch (action) { |
| 3941 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 3942 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; |
| 3943 | break; |
| 3944 | case HDA_FIXUP_ACT_PROBE: |
| 3945 | alc_probe_headset_mode(codec); |
| 3946 | break; |
| 3947 | case HDA_FIXUP_ACT_INIT: |
| 3948 | spec->current_headset_mode = 0; |
| 3949 | alc_update_headset_mode(codec); |
| 3950 | break; |
| 3951 | } |
| 3952 | } |
| 3953 | |
| 3954 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
| 3955 | const struct hda_fixup *fix, int action) |
| 3956 | { |
| 3957 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3958 | struct alc_spec *spec = codec->spec; |
| 3959 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3960 | } |
| 3961 | else |
| 3962 | alc_fixup_headset_mode(codec, fix, action); |
| 3963 | } |
| 3964 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 3965 | static void alc255_set_default_jack_type(struct hda_codec *codec) |
| 3966 | { |
| 3967 | /* Set to iphone type */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3968 | static struct coef_fw fw[] = { |
| 3969 | WRITE_COEF(0x1b, 0x880b), |
| 3970 | WRITE_COEF(0x45, 0xd089), |
| 3971 | WRITE_COEF(0x1b, 0x080b), |
| 3972 | WRITE_COEF(0x46, 0x0004), |
| 3973 | WRITE_COEF(0x1b, 0x0c0b), |
| 3974 | {} |
| 3975 | }; |
| 3976 | alc_process_coef_fw(codec, fw); |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 3977 | msleep(30); |
| 3978 | } |
| 3979 | |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3980 | static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, |
| 3981 | const struct hda_fixup *fix, int action) |
| 3982 | { |
| 3983 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 3984 | alc255_set_default_jack_type(codec); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 3985 | } |
| 3986 | alc_fixup_headset_mode(codec, fix, action); |
| 3987 | } |
| 3988 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 3989 | static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, |
| 3990 | const struct hda_fixup *fix, int action) |
| 3991 | { |
| 3992 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3993 | struct alc_spec *spec = codec->spec; |
| 3994 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3995 | alc255_set_default_jack_type(codec); |
| 3996 | } |
| 3997 | else |
| 3998 | alc_fixup_headset_mode(codec, fix, action); |
| 3999 | } |
| 4000 | |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 4001 | static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, |
| 4002 | const struct hda_fixup *fix, int action) |
| 4003 | { |
| 4004 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4005 | struct alc_spec *spec = codec->spec; |
| 4006 | spec->gen.auto_mute_via_amp = 1; |
| 4007 | } |
| 4008 | } |
| 4009 | |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 4010 | static void alc_no_shutup(struct hda_codec *codec) |
| 4011 | { |
| 4012 | } |
| 4013 | |
| 4014 | static void alc_fixup_no_shutup(struct hda_codec *codec, |
| 4015 | const struct hda_fixup *fix, int action) |
| 4016 | { |
| 4017 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4018 | struct alc_spec *spec = codec->spec; |
| 4019 | spec->shutup = alc_no_shutup; |
| 4020 | } |
| 4021 | } |
| 4022 | |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 4023 | static void alc_fixup_disable_aamix(struct hda_codec *codec, |
| 4024 | const struct hda_fixup *fix, int action) |
| 4025 | { |
| 4026 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4027 | struct alc_spec *spec = codec->spec; |
| 4028 | /* Disable AA-loopback as it causes white noise */ |
| 4029 | spec->gen.mixer_nid = 0; |
| 4030 | } |
| 4031 | } |
| 4032 | |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 4033 | static unsigned int alc_power_filter_xps13(struct hda_codec *codec, |
| 4034 | hda_nid_t nid, |
| 4035 | unsigned int power_state) |
| 4036 | { |
| 4037 | struct alc_spec *spec = codec->spec; |
| 4038 | |
| 4039 | /* Avoid pop noises when headphones are plugged in */ |
| 4040 | if (spec->gen.hp_jack_present) |
Gabriele Mazzotta | de3da4f | 2014-08-08 19:34:41 +0200 | [diff] [blame] | 4041 | if (nid == codec->afg || nid == 0x02 || nid == 0x15) |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 4042 | return AC_PWRST_D0; |
| 4043 | return power_state; |
| 4044 | } |
| 4045 | |
| 4046 | static void alc_fixup_dell_xps13(struct hda_codec *codec, |
| 4047 | const struct hda_fixup *fix, int action) |
| 4048 | { |
| 4049 | if (action == HDA_FIXUP_ACT_PROBE) { |
| 4050 | struct alc_spec *spec = codec->spec; |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 4051 | struct hda_input_mux *imux = &spec->gen.input_mux; |
| 4052 | int i; |
| 4053 | |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 4054 | spec->shutup = alc_no_shutup; |
| 4055 | codec->power_filter = alc_power_filter_xps13; |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 4056 | |
| 4057 | /* Make the internal mic the default input source. */ |
| 4058 | for (i = 0; i < imux->num_items; i++) { |
| 4059 | if (spec->gen.imux_pins[i] == 0x12) { |
| 4060 | spec->gen.cur_mux[0] = i; |
| 4061 | break; |
| 4062 | } |
| 4063 | } |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 4064 | } |
| 4065 | } |
| 4066 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4067 | static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, |
| 4068 | const struct hda_fixup *fix, int action) |
| 4069 | { |
| 4070 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4071 | alc_write_coef_idx(codec, 0xc4, 0x8000); |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 4072 | alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4073 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
| 4074 | } |
| 4075 | alc_fixup_headset_mode(codec, fix, action); |
| 4076 | } |
| 4077 | |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 4078 | /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ |
| 4079 | static int find_ext_mic_pin(struct hda_codec *codec) |
| 4080 | { |
| 4081 | struct alc_spec *spec = codec->spec; |
| 4082 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 4083 | hda_nid_t nid; |
| 4084 | unsigned int defcfg; |
| 4085 | int i; |
| 4086 | |
| 4087 | for (i = 0; i < cfg->num_inputs; i++) { |
| 4088 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 4089 | continue; |
| 4090 | nid = cfg->inputs[i].pin; |
| 4091 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 4092 | if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) |
| 4093 | continue; |
| 4094 | return nid; |
| 4095 | } |
| 4096 | |
| 4097 | return 0; |
| 4098 | } |
| 4099 | |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 4100 | static void alc271_hp_gate_mic_jack(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4101 | const struct hda_fixup *fix, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 4102 | int action) |
| 4103 | { |
| 4104 | struct alc_spec *spec = codec->spec; |
| 4105 | |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 4106 | if (action == HDA_FIXUP_ACT_PROBE) { |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 4107 | int mic_pin = find_ext_mic_pin(codec); |
| 4108 | int hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 4109 | |
| 4110 | if (snd_BUG_ON(!mic_pin || !hp_pin)) |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 4111 | return; |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 4112 | snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 4113 | } |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 4114 | } |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 4115 | |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 4116 | static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, |
| 4117 | const struct hda_fixup *fix, |
| 4118 | int action) |
| 4119 | { |
| 4120 | struct alc_spec *spec = codec->spec; |
| 4121 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 4122 | int i; |
| 4123 | |
| 4124 | /* The mic boosts on level 2 and 3 are too noisy |
| 4125 | on the internal mic input. |
| 4126 | Therefore limit the boost to 0 or 1. */ |
| 4127 | |
| 4128 | if (action != HDA_FIXUP_ACT_PROBE) |
| 4129 | return; |
| 4130 | |
| 4131 | for (i = 0; i < cfg->num_inputs; i++) { |
| 4132 | hda_nid_t nid = cfg->inputs[i].pin; |
| 4133 | unsigned int defcfg; |
| 4134 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 4135 | continue; |
| 4136 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 4137 | if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) |
| 4138 | continue; |
| 4139 | |
| 4140 | snd_hda_override_amp_caps(codec, nid, HDA_INPUT, |
| 4141 | (0x00 << AC_AMPCAP_OFFSET_SHIFT) | |
| 4142 | (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 4143 | (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 4144 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 4145 | } |
| 4146 | } |
| 4147 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 4148 | static void alc283_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 4149 | struct hda_jack_callback *jack) |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 4150 | { |
| 4151 | struct alc_spec *spec = codec->spec; |
| 4152 | int vref; |
| 4153 | |
| 4154 | msleep(200); |
| 4155 | snd_hda_gen_hp_automute(codec, jack); |
| 4156 | |
| 4157 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 4158 | |
| 4159 | msleep(600); |
| 4160 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 4161 | vref); |
| 4162 | } |
| 4163 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 4164 | static void alc283_fixup_chromebook(struct hda_codec *codec, |
| 4165 | const struct hda_fixup *fix, int action) |
| 4166 | { |
| 4167 | struct alc_spec *spec = codec->spec; |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 4168 | |
| 4169 | switch (action) { |
| 4170 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 4171 | snd_hda_override_wcaps(codec, 0x03, 0); |
Takashi Iwai | d2e9270 | 2013-10-30 07:50:53 +0100 | [diff] [blame] | 4172 | /* Disable AA-loopback as it causes white noise */ |
| 4173 | spec->gen.mixer_nid = 0; |
Kailang Yang | 3807021 | 2013-11-01 15:57:35 +0800 | [diff] [blame] | 4174 | break; |
| 4175 | case HDA_FIXUP_ACT_INIT: |
Kailang Yang | de9481c | 2014-04-07 16:41:52 +0800 | [diff] [blame] | 4176 | /* MIC2-VREF control */ |
| 4177 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 4178 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 4179 | /* Enable Line1 input control by verb */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 4180 | alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 4181 | break; |
| 4182 | } |
| 4183 | } |
| 4184 | |
| 4185 | static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, |
| 4186 | const struct hda_fixup *fix, int action) |
| 4187 | { |
| 4188 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 4189 | |
| 4190 | switch (action) { |
| 4191 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 4192 | spec->gen.hp_automute_hook = alc283_hp_automute_hook; |
| 4193 | break; |
| 4194 | case HDA_FIXUP_ACT_INIT: |
| 4195 | /* MIC2-VREF control */ |
| 4196 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 4197 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 4198 | break; |
| 4199 | } |
| 4200 | } |
| 4201 | |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 4202 | /* mute tablet speaker pin (0x14) via dock plugging in addition */ |
| 4203 | static void asus_tx300_automute(struct hda_codec *codec) |
| 4204 | { |
| 4205 | struct alc_spec *spec = codec->spec; |
| 4206 | snd_hda_gen_update_outputs(codec); |
| 4207 | if (snd_hda_jack_detect(codec, 0x1b)) |
| 4208 | spec->gen.mute_bits |= (1ULL << 0x14); |
| 4209 | } |
| 4210 | |
| 4211 | static void alc282_fixup_asus_tx300(struct hda_codec *codec, |
| 4212 | const struct hda_fixup *fix, int action) |
| 4213 | { |
| 4214 | struct alc_spec *spec = codec->spec; |
| 4215 | /* TX300 needs to set up GPIO2 for the speaker amp */ |
| 4216 | static const struct hda_verb gpio2_verbs[] = { |
| 4217 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x04 }, |
| 4218 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04 }, |
| 4219 | { 0x01, AC_VERB_SET_GPIO_DATA, 0x04 }, |
| 4220 | {} |
| 4221 | }; |
| 4222 | static const struct hda_pintbl dock_pins[] = { |
| 4223 | { 0x1b, 0x21114000 }, /* dock speaker pin */ |
| 4224 | {} |
| 4225 | }; |
| 4226 | struct snd_kcontrol *kctl; |
| 4227 | |
| 4228 | switch (action) { |
| 4229 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 4230 | snd_hda_add_verbs(codec, gpio2_verbs); |
| 4231 | snd_hda_apply_pincfgs(codec, dock_pins); |
| 4232 | spec->gen.auto_mute_via_amp = 1; |
| 4233 | spec->gen.automute_hook = asus_tx300_automute; |
| 4234 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 4235 | snd_hda_gen_hp_automute); |
| 4236 | break; |
| 4237 | case HDA_FIXUP_ACT_BUILD: |
| 4238 | /* this is a bit tricky; give more sane names for the main |
| 4239 | * (tablet) speaker and the dock speaker, respectively |
| 4240 | */ |
| 4241 | kctl = snd_hda_find_mixer_ctl(codec, "Speaker Playback Switch"); |
| 4242 | if (kctl) |
| 4243 | strcpy(kctl->id.name, "Dock Speaker Playback Switch"); |
| 4244 | kctl = snd_hda_find_mixer_ctl(codec, "Bass Speaker Playback Switch"); |
| 4245 | if (kctl) |
| 4246 | strcpy(kctl->id.name, "Speaker Playback Switch"); |
| 4247 | break; |
| 4248 | } |
| 4249 | } |
| 4250 | |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 4251 | static void alc290_fixup_mono_speakers(struct hda_codec *codec, |
| 4252 | const struct hda_fixup *fix, int action) |
| 4253 | { |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 4254 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4255 | /* DAC node 0x03 is giving mono output. We therefore want to |
| 4256 | make sure 0x14 (front speaker) and 0x15 (headphones) use the |
| 4257 | stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ |
| 4258 | hda_nid_t conn1[2] = { 0x0c }; |
| 4259 | snd_hda_override_conn_list(codec, 0x14, 1, conn1); |
| 4260 | snd_hda_override_conn_list(codec, 0x15, 1, conn1); |
| 4261 | } |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 4262 | } |
| 4263 | |
Takashi Iwai | b317b03 | 2014-01-08 11:44:21 +0100 | [diff] [blame] | 4264 | /* for hda_fixup_thinkpad_acpi() */ |
| 4265 | #include "thinkpad_helper.c" |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 4266 | |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 4267 | /* for dell wmi mic mute led */ |
| 4268 | #include "dell_wmi_helper.c" |
| 4269 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4270 | enum { |
| 4271 | ALC269_FIXUP_SONY_VAIO, |
| 4272 | ALC275_FIXUP_SONY_VAIO_GPIO2, |
| 4273 | ALC269_FIXUP_DELL_M101Z, |
| 4274 | ALC269_FIXUP_SKU_IGNORE, |
| 4275 | ALC269_FIXUP_ASUS_G73JW, |
| 4276 | ALC269_FIXUP_LENOVO_EAPD, |
| 4277 | ALC275_FIXUP_SONY_HWEQ, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 4278 | ALC275_FIXUP_SONY_DISABLE_AAMIX, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4279 | ALC271_FIXUP_DMIC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 4280 | ALC269_FIXUP_PCM_44K, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 4281 | ALC269_FIXUP_STEREO_DMIC, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 4282 | ALC269_FIXUP_HEADSET_MIC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4283 | ALC269_FIXUP_QUANTA_MUTE, |
| 4284 | ALC269_FIXUP_LIFEBOOK, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 4285 | ALC269_FIXUP_LIFEBOOK_EXTMIC, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4286 | ALC269_FIXUP_AMIC, |
| 4287 | ALC269_FIXUP_DMIC, |
| 4288 | ALC269VB_FIXUP_AMIC, |
| 4289 | ALC269VB_FIXUP_DMIC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4290 | ALC269_FIXUP_HP_MUTE_LED, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4291 | ALC269_FIXUP_HP_MUTE_LED_MIC1, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4292 | ALC269_FIXUP_HP_MUTE_LED_MIC2, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4293 | ALC269_FIXUP_HP_GPIO_LED, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4294 | ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 4295 | ALC269_FIXUP_HP_LINE1_MIC1_LED, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 4296 | ALC269_FIXUP_INV_DMIC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4297 | ALC269_FIXUP_LENOVO_DOCK, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 4298 | ALC269_FIXUP_NO_SHUTUP, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 4299 | ALC286_FIXUP_SONY_MIC_NO_PRESENCE, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4300 | ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4301 | ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 4302 | ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 4303 | ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4304 | ALC269_FIXUP_HEADSET_MODE, |
| 4305 | ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 4306 | ALC269_FIXUP_ASUS_X101_FUNC, |
| 4307 | ALC269_FIXUP_ASUS_X101_VERB, |
| 4308 | ALC269_FIXUP_ASUS_X101, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 4309 | ALC271_FIXUP_AMIC_MIC2, |
| 4310 | ALC271_FIXUP_HP_GATE_MIC_JACK, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 4311 | ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 4312 | ALC269_FIXUP_ACER_AC700, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 4313 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 4314 | ALC269VB_FIXUP_ASUS_ZENBOOK, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 4315 | ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 4316 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 4317 | ALC269VB_FIXUP_ORDISSIMO_EVE2, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 4318 | ALC283_FIXUP_CHROME_BOOK, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 4319 | ALC283_FIXUP_SENSE_COMBO_JACK, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 4320 | ALC282_FIXUP_ASUS_TX300, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 4321 | ALC283_FIXUP_INT_MIC, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 4322 | ALC290_FIXUP_MONO_SPEAKERS, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 4323 | ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 4324 | ALC290_FIXUP_SUBWOOFER, |
| 4325 | ALC290_FIXUP_SUBWOOFER_HSJACK, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 4326 | ALC269_FIXUP_THINKPAD_ACPI, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4327 | ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4328 | ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4329 | ALC255_FIXUP_HEADSET_MODE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4330 | ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4331 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 4332 | ALC292_FIXUP_TPT440_DOCK, |
Daniel Drake | 9dc1286 | 2014-07-22 10:58:29 +0100 | [diff] [blame] | 4333 | ALC283_FIXUP_BXBT2807_MIC, |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 4334 | ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 4335 | ALC282_FIXUP_ASPIRE_V5_PINS, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4336 | ALC280_FIXUP_HP_GPIO4, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 4337 | ALC286_FIXUP_HP_GPIO_LED, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4338 | }; |
| 4339 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4340 | static const struct hda_fixup alc269_fixups[] = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4341 | [ALC269_FIXUP_SONY_VAIO] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 4342 | .type = HDA_FIXUP_PINCTLS, |
| 4343 | .v.pins = (const struct hda_pintbl[]) { |
| 4344 | {0x19, PIN_VREFGRD}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4345 | {} |
| 4346 | } |
| 4347 | }, |
| 4348 | [ALC275_FIXUP_SONY_VAIO_GPIO2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4349 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4350 | .v.verbs = (const struct hda_verb[]) { |
| 4351 | {0x01, AC_VERB_SET_GPIO_MASK, 0x04}, |
| 4352 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04}, |
| 4353 | {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, |
| 4354 | { } |
| 4355 | }, |
| 4356 | .chained = true, |
| 4357 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 4358 | }, |
| 4359 | [ALC269_FIXUP_DELL_M101Z] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4360 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4361 | .v.verbs = (const struct hda_verb[]) { |
| 4362 | /* Enables internal speaker */ |
| 4363 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, |
| 4364 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, |
| 4365 | {} |
| 4366 | } |
| 4367 | }, |
| 4368 | [ALC269_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4369 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 4370 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4371 | }, |
| 4372 | [ALC269_FIXUP_ASUS_G73JW] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4373 | .type = HDA_FIXUP_PINS, |
| 4374 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4375 | { 0x17, 0x99130111 }, /* subwoofer */ |
| 4376 | { } |
| 4377 | } |
| 4378 | }, |
| 4379 | [ALC269_FIXUP_LENOVO_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4380 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4381 | .v.verbs = (const struct hda_verb[]) { |
| 4382 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 4383 | {} |
| 4384 | } |
| 4385 | }, |
| 4386 | [ALC275_FIXUP_SONY_HWEQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4387 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4388 | .v.func = alc269_fixup_hweq, |
| 4389 | .chained = true, |
| 4390 | .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 |
| 4391 | }, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 4392 | [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { |
| 4393 | .type = HDA_FIXUP_FUNC, |
| 4394 | .v.func = alc_fixup_disable_aamix, |
| 4395 | .chained = true, |
| 4396 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 4397 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4398 | [ALC271_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4399 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4400 | .v.func = alc271_fixup_dmic, |
| 4401 | }, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 4402 | [ALC269_FIXUP_PCM_44K] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4403 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 4404 | .v.func = alc269_fixup_pcm_44k, |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 4405 | .chained = true, |
| 4406 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 4407 | }, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 4408 | [ALC269_FIXUP_STEREO_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4409 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 4410 | .v.func = alc269_fixup_stereo_dmic, |
| 4411 | }, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 4412 | [ALC269_FIXUP_HEADSET_MIC] = { |
| 4413 | .type = HDA_FIXUP_FUNC, |
| 4414 | .v.func = alc269_fixup_headset_mic, |
| 4415 | }, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4416 | [ALC269_FIXUP_QUANTA_MUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4417 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4418 | .v.func = alc269_fixup_quanta_mute, |
| 4419 | }, |
| 4420 | [ALC269_FIXUP_LIFEBOOK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4421 | .type = HDA_FIXUP_PINS, |
| 4422 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4423 | { 0x1a, 0x2101103f }, /* dock line-out */ |
| 4424 | { 0x1b, 0x23a11040 }, /* dock mic-in */ |
| 4425 | { } |
| 4426 | }, |
| 4427 | .chained = true, |
| 4428 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
| 4429 | }, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 4430 | [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { |
| 4431 | .type = HDA_FIXUP_PINS, |
| 4432 | .v.pins = (const struct hda_pintbl[]) { |
| 4433 | { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ |
| 4434 | { } |
| 4435 | }, |
| 4436 | }, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4437 | [ALC269_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4438 | .type = HDA_FIXUP_PINS, |
| 4439 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4440 | { 0x14, 0x99130110 }, /* speaker */ |
| 4441 | { 0x15, 0x0121401f }, /* HP out */ |
| 4442 | { 0x18, 0x01a19c20 }, /* mic */ |
| 4443 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 4444 | { } |
| 4445 | }, |
| 4446 | }, |
| 4447 | [ALC269_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4448 | .type = HDA_FIXUP_PINS, |
| 4449 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4450 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 4451 | { 0x14, 0x99130110 }, /* speaker */ |
| 4452 | { 0x15, 0x0121401f }, /* HP out */ |
| 4453 | { 0x18, 0x01a19c20 }, /* mic */ |
| 4454 | { } |
| 4455 | }, |
| 4456 | }, |
| 4457 | [ALC269VB_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4458 | .type = HDA_FIXUP_PINS, |
| 4459 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4460 | { 0x14, 0x99130110 }, /* speaker */ |
| 4461 | { 0x18, 0x01a19c20 }, /* mic */ |
| 4462 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 4463 | { 0x21, 0x0121401f }, /* HP out */ |
| 4464 | { } |
| 4465 | }, |
| 4466 | }, |
David Henningsson | 2267ea9 | 2012-01-03 08:45:56 +0100 | [diff] [blame] | 4467 | [ALC269VB_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4468 | .type = HDA_FIXUP_PINS, |
| 4469 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4470 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 4471 | { 0x14, 0x99130110 }, /* speaker */ |
| 4472 | { 0x18, 0x01a19c20 }, /* mic */ |
| 4473 | { 0x21, 0x0121401f }, /* HP out */ |
| 4474 | { } |
| 4475 | }, |
| 4476 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4477 | [ALC269_FIXUP_HP_MUTE_LED] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4478 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4479 | .v.func = alc269_fixup_hp_mute_led, |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 4480 | }, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 4481 | [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { |
| 4482 | .type = HDA_FIXUP_FUNC, |
| 4483 | .v.func = alc269_fixup_hp_mute_led_mic1, |
| 4484 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4485 | [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4486 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4487 | .v.func = alc269_fixup_hp_mute_led_mic2, |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 4488 | }, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4489 | [ALC269_FIXUP_HP_GPIO_LED] = { |
| 4490 | .type = HDA_FIXUP_FUNC, |
| 4491 | .v.func = alc269_fixup_hp_gpio_led, |
| 4492 | }, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4493 | [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { |
| 4494 | .type = HDA_FIXUP_FUNC, |
| 4495 | .v.func = alc269_fixup_hp_gpio_mic1_led, |
| 4496 | }, |
| 4497 | [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { |
| 4498 | .type = HDA_FIXUP_FUNC, |
| 4499 | .v.func = alc269_fixup_hp_line1_mic1_led, |
| 4500 | }, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 4501 | [ALC269_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4502 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 4503 | .v.func = alc_fixup_inv_dmic, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 4504 | }, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 4505 | [ALC269_FIXUP_NO_SHUTUP] = { |
| 4506 | .type = HDA_FIXUP_FUNC, |
| 4507 | .v.func = alc_fixup_no_shutup, |
| 4508 | }, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4509 | [ALC269_FIXUP_LENOVO_DOCK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4510 | .type = HDA_FIXUP_PINS, |
| 4511 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4512 | { 0x19, 0x23a11040 }, /* dock mic */ |
| 4513 | { 0x1b, 0x2121103f }, /* dock headphone */ |
| 4514 | { } |
| 4515 | }, |
| 4516 | .chained = true, |
| 4517 | .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT |
| 4518 | }, |
| 4519 | [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4520 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4521 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
David Henningsson | 5212900 | 2013-11-19 10:25:53 +0100 | [diff] [blame] | 4522 | .chained = true, |
| 4523 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4524 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4525 | [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 4526 | .type = HDA_FIXUP_PINS, |
| 4527 | .v.pins = (const struct hda_pintbl[]) { |
| 4528 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 4529 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 4530 | { } |
| 4531 | }, |
| 4532 | .chained = true, |
| 4533 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 4534 | }, |
| 4535 | [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 4536 | .type = HDA_FIXUP_PINS, |
| 4537 | .v.pins = (const struct hda_pintbl[]) { |
| 4538 | { 0x16, 0x21014020 }, /* dock line out */ |
| 4539 | { 0x19, 0x21a19030 }, /* dock mic */ |
| 4540 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 4541 | { } |
| 4542 | }, |
| 4543 | .chained = true, |
| 4544 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 4545 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 4546 | [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { |
| 4547 | .type = HDA_FIXUP_PINS, |
| 4548 | .v.pins = (const struct hda_pintbl[]) { |
| 4549 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 4550 | { } |
| 4551 | }, |
| 4552 | .chained = true, |
| 4553 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 4554 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4555 | [ALC269_FIXUP_HEADSET_MODE] = { |
| 4556 | .type = HDA_FIXUP_FUNC, |
| 4557 | .v.func = alc_fixup_headset_mode, |
Hui Wang | 6676f30 | 2014-11-18 17:57:41 +0800 | [diff] [blame] | 4558 | .chained = true, |
| 4559 | .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4560 | }, |
| 4561 | [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 4562 | .type = HDA_FIXUP_FUNC, |
| 4563 | .v.func = alc_fixup_headset_mode_no_hp_mic, |
| 4564 | }, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 4565 | [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { |
| 4566 | .type = HDA_FIXUP_PINS, |
| 4567 | .v.pins = (const struct hda_pintbl[]) { |
| 4568 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 4569 | { } |
| 4570 | }, |
David Henningsson | fbc78ad | 2013-10-11 13:46:04 +0200 | [diff] [blame] | 4571 | .chained = true, |
| 4572 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 4573 | }, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 4574 | [ALC269_FIXUP_ASUS_X101_FUNC] = { |
| 4575 | .type = HDA_FIXUP_FUNC, |
| 4576 | .v.func = alc269_fixup_x101_headset_mic, |
| 4577 | }, |
| 4578 | [ALC269_FIXUP_ASUS_X101_VERB] = { |
| 4579 | .type = HDA_FIXUP_VERBS, |
| 4580 | .v.verbs = (const struct hda_verb[]) { |
| 4581 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, |
| 4582 | {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, |
| 4583 | {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, |
| 4584 | { } |
| 4585 | }, |
| 4586 | .chained = true, |
| 4587 | .chain_id = ALC269_FIXUP_ASUS_X101_FUNC |
| 4588 | }, |
| 4589 | [ALC269_FIXUP_ASUS_X101] = { |
| 4590 | .type = HDA_FIXUP_PINS, |
| 4591 | .v.pins = (const struct hda_pintbl[]) { |
| 4592 | { 0x18, 0x04a1182c }, /* Headset mic */ |
| 4593 | { } |
| 4594 | }, |
| 4595 | .chained = true, |
| 4596 | .chain_id = ALC269_FIXUP_ASUS_X101_VERB |
| 4597 | }, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 4598 | [ALC271_FIXUP_AMIC_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4599 | .type = HDA_FIXUP_PINS, |
| 4600 | .v.pins = (const struct hda_pintbl[]) { |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 4601 | { 0x14, 0x99130110 }, /* speaker */ |
| 4602 | { 0x19, 0x01a19c20 }, /* mic */ |
| 4603 | { 0x1b, 0x99a7012f }, /* int-mic */ |
| 4604 | { 0x21, 0x0121401f }, /* HP out */ |
| 4605 | { } |
| 4606 | }, |
| 4607 | }, |
| 4608 | [ALC271_FIXUP_HP_GATE_MIC_JACK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 4609 | .type = HDA_FIXUP_FUNC, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 4610 | .v.func = alc271_hp_gate_mic_jack, |
| 4611 | .chained = true, |
| 4612 | .chain_id = ALC271_FIXUP_AMIC_MIC2, |
| 4613 | }, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 4614 | [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { |
| 4615 | .type = HDA_FIXUP_FUNC, |
| 4616 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 4617 | .chained = true, |
| 4618 | .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, |
| 4619 | }, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 4620 | [ALC269_FIXUP_ACER_AC700] = { |
| 4621 | .type = HDA_FIXUP_PINS, |
| 4622 | .v.pins = (const struct hda_pintbl[]) { |
| 4623 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 4624 | { 0x14, 0x99130110 }, /* speaker */ |
| 4625 | { 0x18, 0x03a11c20 }, /* mic */ |
| 4626 | { 0x1e, 0x0346101e }, /* SPDIF1 */ |
| 4627 | { 0x21, 0x0321101f }, /* HP out */ |
| 4628 | { } |
| 4629 | }, |
| 4630 | .chained = true, |
| 4631 | .chain_id = ALC271_FIXUP_DMIC, |
| 4632 | }, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 4633 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { |
| 4634 | .type = HDA_FIXUP_FUNC, |
| 4635 | .v.func = alc269_fixup_limit_int_mic_boost, |
David Henningsson | 2793769 | 2013-11-18 11:51:47 +0100 | [diff] [blame] | 4636 | .chained = true, |
| 4637 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 4638 | }, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 4639 | [ALC269VB_FIXUP_ASUS_ZENBOOK] = { |
| 4640 | .type = HDA_FIXUP_FUNC, |
| 4641 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 4642 | .chained = true, |
| 4643 | .chain_id = ALC269VB_FIXUP_DMIC, |
| 4644 | }, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 4645 | [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { |
| 4646 | .type = HDA_FIXUP_VERBS, |
| 4647 | .v.verbs = (const struct hda_verb[]) { |
| 4648 | /* class-D output amp +5dB */ |
| 4649 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, |
| 4650 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, |
| 4651 | {} |
| 4652 | }, |
| 4653 | .chained = true, |
| 4654 | .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, |
| 4655 | }, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 4656 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { |
| 4657 | .type = HDA_FIXUP_FUNC, |
| 4658 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 4659 | .chained = true, |
| 4660 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, |
| 4661 | }, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 4662 | [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { |
| 4663 | .type = HDA_FIXUP_PINS, |
| 4664 | .v.pins = (const struct hda_pintbl[]) { |
| 4665 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 4666 | { 0x18, 0x03a11d20 }, /* mic */ |
| 4667 | { 0x19, 0x411111f0 }, /* Unused bogus pin */ |
| 4668 | { } |
| 4669 | }, |
| 4670 | }, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 4671 | [ALC283_FIXUP_CHROME_BOOK] = { |
| 4672 | .type = HDA_FIXUP_FUNC, |
| 4673 | .v.func = alc283_fixup_chromebook, |
| 4674 | }, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 4675 | [ALC283_FIXUP_SENSE_COMBO_JACK] = { |
| 4676 | .type = HDA_FIXUP_FUNC, |
| 4677 | .v.func = alc283_fixup_sense_combo_jack, |
| 4678 | .chained = true, |
| 4679 | .chain_id = ALC283_FIXUP_CHROME_BOOK, |
| 4680 | }, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 4681 | [ALC282_FIXUP_ASUS_TX300] = { |
| 4682 | .type = HDA_FIXUP_FUNC, |
| 4683 | .v.func = alc282_fixup_asus_tx300, |
| 4684 | }, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 4685 | [ALC283_FIXUP_INT_MIC] = { |
| 4686 | .type = HDA_FIXUP_VERBS, |
| 4687 | .v.verbs = (const struct hda_verb[]) { |
| 4688 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, |
| 4689 | {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, |
| 4690 | { } |
| 4691 | }, |
| 4692 | .chained = true, |
| 4693 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 4694 | }, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 4695 | [ALC290_FIXUP_SUBWOOFER_HSJACK] = { |
| 4696 | .type = HDA_FIXUP_PINS, |
| 4697 | .v.pins = (const struct hda_pintbl[]) { |
| 4698 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 4699 | { } |
| 4700 | }, |
| 4701 | .chained = true, |
| 4702 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 4703 | }, |
| 4704 | [ALC290_FIXUP_SUBWOOFER] = { |
| 4705 | .type = HDA_FIXUP_PINS, |
| 4706 | .v.pins = (const struct hda_pintbl[]) { |
| 4707 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 4708 | { } |
| 4709 | }, |
| 4710 | .chained = true, |
| 4711 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS, |
| 4712 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 4713 | [ALC290_FIXUP_MONO_SPEAKERS] = { |
| 4714 | .type = HDA_FIXUP_FUNC, |
| 4715 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 4716 | }, |
| 4717 | [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { |
| 4718 | .type = HDA_FIXUP_FUNC, |
| 4719 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 4720 | .chained = true, |
| 4721 | .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
| 4722 | }, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 4723 | [ALC269_FIXUP_THINKPAD_ACPI] = { |
| 4724 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | b317b03 | 2014-01-08 11:44:21 +0100 | [diff] [blame] | 4725 | .v.func = hda_fixup_thinkpad_acpi, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 4726 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4727 | [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 4728 | .type = HDA_FIXUP_PINS, |
| 4729 | .v.pins = (const struct hda_pintbl[]) { |
| 4730 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 4731 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 4732 | { } |
| 4733 | }, |
| 4734 | .chained = true, |
| 4735 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 4736 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4737 | [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 4738 | .type = HDA_FIXUP_PINS, |
| 4739 | .v.pins = (const struct hda_pintbl[]) { |
| 4740 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 4741 | { } |
| 4742 | }, |
| 4743 | .chained = true, |
| 4744 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 4745 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4746 | [ALC255_FIXUP_HEADSET_MODE] = { |
| 4747 | .type = HDA_FIXUP_FUNC, |
| 4748 | .v.func = alc_fixup_headset_mode_alc255, |
Hui Wang | 4a83d42 | 2014-11-18 17:57:40 +0800 | [diff] [blame] | 4749 | .chained = true, |
| 4750 | .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4751 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4752 | [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 4753 | .type = HDA_FIXUP_FUNC, |
| 4754 | .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, |
| 4755 | }, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4756 | [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 4757 | .type = HDA_FIXUP_PINS, |
| 4758 | .v.pins = (const struct hda_pintbl[]) { |
| 4759 | { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 4760 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 4761 | { } |
| 4762 | }, |
| 4763 | .chained = true, |
| 4764 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 4765 | }, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 4766 | [ALC292_FIXUP_TPT440_DOCK] = { |
| 4767 | .type = HDA_FIXUP_PINS, |
| 4768 | .v.pins = (const struct hda_pintbl[]) { |
| 4769 | { 0x16, 0x21211010 }, /* dock headphone */ |
| 4770 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 4771 | { } |
| 4772 | }, |
| 4773 | .chained = true, |
| 4774 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 4775 | }, |
Daniel Drake | 9dc1286 | 2014-07-22 10:58:29 +0100 | [diff] [blame] | 4776 | [ALC283_FIXUP_BXBT2807_MIC] = { |
| 4777 | .type = HDA_FIXUP_PINS, |
| 4778 | .v.pins = (const struct hda_pintbl[]) { |
| 4779 | { 0x19, 0x04a110f0 }, |
| 4780 | { }, |
| 4781 | }, |
| 4782 | }, |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 4783 | [ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED] = { |
| 4784 | .type = HDA_FIXUP_FUNC, |
| 4785 | .v.func = alc_fixup_dell_wmi, |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 4786 | }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 4787 | [ALC282_FIXUP_ASPIRE_V5_PINS] = { |
| 4788 | .type = HDA_FIXUP_PINS, |
| 4789 | .v.pins = (const struct hda_pintbl[]) { |
| 4790 | { 0x12, 0x90a60130 }, |
| 4791 | { 0x14, 0x90170110 }, |
| 4792 | { 0x17, 0x40000008 }, |
| 4793 | { 0x18, 0x411111f0 }, |
| 4794 | { 0x19, 0x411111f0 }, |
| 4795 | { 0x1a, 0x411111f0 }, |
| 4796 | { 0x1b, 0x411111f0 }, |
| 4797 | { 0x1d, 0x40f89b2d }, |
| 4798 | { 0x1e, 0x411111f0 }, |
| 4799 | { 0x21, 0x0321101f }, |
| 4800 | { }, |
| 4801 | }, |
| 4802 | }, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 4803 | [ALC280_FIXUP_HP_GPIO4] = { |
| 4804 | .type = HDA_FIXUP_FUNC, |
| 4805 | .v.func = alc280_fixup_hp_gpio4, |
| 4806 | }, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 4807 | [ALC286_FIXUP_HP_GPIO_LED] = { |
| 4808 | .type = HDA_FIXUP_FUNC, |
| 4809 | .v.func = alc286_fixup_hp_gpio_led, |
| 4810 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4811 | }; |
| 4812 | |
| 4813 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
Marius Knaust | a6b92b6 | 2014-03-03 01:48:58 +0100 | [diff] [blame] | 4814 | SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 4815 | SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), |
| 4816 | SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 4817 | SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), |
| 4818 | SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), |
| 4819 | SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 4820 | SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 4821 | SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 4822 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 4823 | SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4824 | SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 4825 | SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 4826 | SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 4827 | SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
| 4828 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 4829 | SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK), |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4830 | SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 4831 | SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Kailang Yang | b734304 | 2014-12-02 14:50:45 +0800 | [diff] [blame] | 4832 | SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 4833 | SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4834 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 4835 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 4836 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 4837 | SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 4838 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4839 | /* ALC282 */ |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 4840 | SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 4841 | SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4842 | SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 4843 | SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 4844 | SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 4845 | SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4846 | SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4847 | SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4848 | SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4849 | SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 4850 | SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 4851 | SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4852 | SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4853 | SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4854 | SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4855 | SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4856 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4857 | SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4858 | SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4859 | /* ALC290 */ |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4860 | SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4861 | SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4862 | SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4863 | SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4864 | SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4865 | SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4866 | SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4867 | SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4868 | SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4869 | SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4870 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4871 | SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4872 | SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4873 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4874 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 4875 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4876 | SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4877 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4878 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4879 | SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4880 | SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4881 | SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4882 | SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4883 | SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 4884 | SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 4885 | SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4886 | SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4887 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 4888 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 4889 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 4890 | SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
| 4891 | SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 4892 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 4893 | SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A), |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 4894 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 4895 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 4896 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 4897 | SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 4898 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), |
| 4899 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), |
| 4900 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
| 4901 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 4902 | SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), |
Takashi Iwai | f88abaa | 2014-02-07 12:07:59 +0100 | [diff] [blame] | 4903 | SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 4904 | SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4905 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), |
| 4906 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
| 4907 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 4908 | SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX), |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 4909 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 4910 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
David Henningsson | a33cc48 | 2014-10-07 10:18:41 +0200 | [diff] [blame] | 4911 | SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), |
Daniel Drake | 9dc1286 | 2014-07-22 10:58:29 +0100 | [diff] [blame] | 4912 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_BXBT2807_MIC), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4913 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
| 4914 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), |
| 4915 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), |
| 4916 | SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), |
| 4917 | SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), |
Takashi Iwai | 707fba3 | 2012-08-02 09:04:39 +0200 | [diff] [blame] | 4918 | SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK), |
Felix Kaechele | c8415a4 | 2012-08-06 23:02:01 +0200 | [diff] [blame] | 4919 | SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), |
Stefán Freyr | 84f98fd | 2012-10-19 22:46:00 +0200 | [diff] [blame] | 4920 | SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), |
Philipp A. Mohrenweiser | 4407be6 | 2012-08-06 13:14:18 +0200 | [diff] [blame] | 4921 | SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 4922 | SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 4923 | SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 4924 | SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440_DOCK), |
| 4925 | SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | a12137e | 2014-06-27 12:14:35 +0200 | [diff] [blame] | 4926 | SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | 6d16941 | 2014-10-07 17:27:02 +0200 | [diff] [blame] | 4927 | SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), |
Lukas Bossard | 7c21539 | 2014-10-29 18:31:07 +0100 | [diff] [blame] | 4928 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 4929 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Takashi Iwai | fedb224 | 2014-11-13 07:11:38 +0100 | [diff] [blame] | 4930 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 4931 | SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 4932 | SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 4933 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), |
Takashi Iwai | c497d9f | 2014-10-08 12:14:40 +0200 | [diff] [blame] | 4934 | SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 4935 | SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
| 4936 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 4937 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 4938 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 4939 | SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4940 | |
Takashi Iwai | a7f3eed | 2012-02-16 13:03:18 +0100 | [diff] [blame] | 4941 | #if 0 |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4942 | /* Below is a quirk table taken from the old code. |
| 4943 | * Basically the device should work as is without the fixup table. |
| 4944 | * If BIOS doesn't give a proper info, enable the corresponding |
| 4945 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 4946 | */ |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4947 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", |
| 4948 | ALC269_FIXUP_AMIC), |
| 4949 | SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 4950 | SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), |
| 4951 | SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), |
| 4952 | SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), |
| 4953 | SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), |
| 4954 | SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), |
| 4955 | SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), |
| 4956 | SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), |
| 4957 | SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), |
| 4958 | SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), |
| 4959 | SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), |
| 4960 | SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), |
| 4961 | SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), |
| 4962 | SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), |
| 4963 | SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), |
| 4964 | SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), |
| 4965 | SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), |
| 4966 | SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), |
| 4967 | SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), |
| 4968 | SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), |
| 4969 | SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), |
| 4970 | SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), |
| 4971 | SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), |
| 4972 | SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), |
| 4973 | SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), |
| 4974 | SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), |
| 4975 | SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), |
| 4976 | SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), |
| 4977 | SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), |
| 4978 | SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), |
| 4979 | SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), |
| 4980 | SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), |
| 4981 | SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), |
| 4982 | SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), |
| 4983 | SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), |
| 4984 | SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), |
| 4985 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), |
| 4986 | SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), |
| 4987 | SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), |
| 4988 | #endif |
| 4989 | {} |
| 4990 | }; |
| 4991 | |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 4992 | static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = { |
| 4993 | SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), |
| 4994 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), |
| 4995 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), |
| 4996 | SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), |
| 4997 | {} |
| 4998 | }; |
| 4999 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5000 | static const struct hda_model_fixup alc269_fixup_models[] = { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5001 | {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, |
| 5002 | {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 5003 | {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, |
| 5004 | {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, |
| 5005 | {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 5006 | {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5007 | {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 5008 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
David Henningsson | e32aa85 | 2013-06-17 11:04:02 +0200 | [diff] [blame] | 5009 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
| 5010 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, |
Kailang Yang | be8ef16 | 2014-04-08 15:19:49 +0800 | [diff] [blame] | 5011 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5012 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 5013 | {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5014 | {} |
| 5015 | }; |
| 5016 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 5017 | #define ALC255_STANDARD_PINS \ |
| 5018 | {0x18, 0x411111f0}, \ |
| 5019 | {0x19, 0x411111f0}, \ |
| 5020 | {0x1a, 0x411111f0}, \ |
| 5021 | {0x1b, 0x411111f0}, \ |
| 5022 | {0x1e, 0x411111f0} |
| 5023 | |
| 5024 | #define ALC282_STANDARD_PINS \ |
| 5025 | {0x14, 0x90170110}, \ |
| 5026 | {0x18, 0x411111f0}, \ |
| 5027 | {0x1a, 0x411111f0}, \ |
| 5028 | {0x1b, 0x411111f0}, \ |
| 5029 | {0x1e, 0x411111f0} |
| 5030 | |
| 5031 | #define ALC290_STANDARD_PINS \ |
| 5032 | {0x12, 0x99a30130}, \ |
| 5033 | {0x13, 0x40000000}, \ |
| 5034 | {0x16, 0x411111f0}, \ |
| 5035 | {0x17, 0x411111f0}, \ |
| 5036 | {0x19, 0x411111f0}, \ |
| 5037 | {0x1b, 0x411111f0}, \ |
| 5038 | {0x1e, 0x411111f0} |
| 5039 | |
| 5040 | #define ALC292_STANDARD_PINS \ |
| 5041 | {0x14, 0x90170110}, \ |
| 5042 | {0x15, 0x0221401f}, \ |
| 5043 | {0x1a, 0x411111f0}, \ |
| 5044 | {0x1b, 0x411111f0}, \ |
| 5045 | {0x1d, 0x40700001}, \ |
| 5046 | {0x1e, 0x411111f0} |
| 5047 | |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 5048 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 5049 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5050 | ALC255_STANDARD_PINS, |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 5051 | {0x12, 0x40300000}, |
| 5052 | {0x14, 0x90170110}, |
| 5053 | {0x17, 0x411111f0}, |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 5054 | {0x1d, 0x40538029}, |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 5055 | {0x21, 0x02211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5056 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5057 | ALC255_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5058 | {0x12, 0x90a60140}, |
| 5059 | {0x14, 0x90170110}, |
| 5060 | {0x17, 0x40000000}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5061 | {0x1d, 0x40700001}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5062 | {0x21, 0x02211020}), |
| 5063 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5064 | ALC255_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5065 | {0x12, 0x90a60160}, |
| 5066 | {0x14, 0x90170120}, |
| 5067 | {0x17, 0x40000000}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5068 | {0x1d, 0x40700001}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5069 | {0x21, 0x02211030}), |
| 5070 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 5071 | {0x12, 0x90a60160}, |
| 5072 | {0x14, 0x90170120}, |
| 5073 | {0x17, 0x90170140}, |
| 5074 | {0x18, 0x40000000}, |
| 5075 | {0x19, 0x411111f0}, |
| 5076 | {0x1a, 0x411111f0}, |
| 5077 | {0x1b, 0x411111f0}, |
| 5078 | {0x1d, 0x41163b05}, |
| 5079 | {0x1e, 0x411111f0}, |
| 5080 | {0x21, 0x0321102f}), |
| 5081 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5082 | ALC255_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5083 | {0x12, 0x90a60160}, |
| 5084 | {0x14, 0x90170130}, |
| 5085 | {0x17, 0x40000000}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5086 | {0x1d, 0x40700001}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5087 | {0x21, 0x02211040}), |
| 5088 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5089 | ALC255_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5090 | {0x12, 0x90a60160}, |
| 5091 | {0x14, 0x90170140}, |
| 5092 | {0x17, 0x40000000}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5093 | {0x1d, 0x40700001}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5094 | {0x21, 0x02211050}), |
| 5095 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5096 | ALC255_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5097 | {0x12, 0x90a60170}, |
| 5098 | {0x14, 0x90170120}, |
| 5099 | {0x17, 0x40000000}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5100 | {0x1d, 0x40700001}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5101 | {0x21, 0x02211030}), |
| 5102 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5103 | ALC255_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5104 | {0x12, 0x90a60170}, |
| 5105 | {0x14, 0x90170130}, |
| 5106 | {0x17, 0x40000000}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5107 | {0x1d, 0x40700001}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5108 | {0x21, 0x02211040}), |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 5109 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, |
| 5110 | {0x12, 0x90a60130}, |
| 5111 | {0x13, 0x40000000}, |
| 5112 | {0x14, 0x90170110}, |
| 5113 | {0x15, 0x0421101f}, |
| 5114 | {0x16, 0x411111f0}, |
| 5115 | {0x17, 0x411111f0}, |
| 5116 | {0x18, 0x411111f0}, |
| 5117 | {0x19, 0x411111f0}, |
| 5118 | {0x1a, 0x04a11020}, |
| 5119 | {0x1b, 0x411111f0}, |
| 5120 | {0x1d, 0x40748605}, |
| 5121 | {0x1e, 0x411111f0}), |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 5122 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 5123 | {0x12, 0x90a60140}, |
| 5124 | {0x13, 0x40000000}, |
| 5125 | {0x14, 0x90170110}, |
| 5126 | {0x15, 0x0421101f}, |
| 5127 | {0x16, 0x411111f0}, |
| 5128 | {0x17, 0x411111f0}, |
| 5129 | {0x18, 0x02811030}, |
| 5130 | {0x19, 0x411111f0}, |
| 5131 | {0x1a, 0x04a1103f}, |
| 5132 | {0x1b, 0x02011020}, |
| 5133 | {0x1d, 0x40700001}, |
| 5134 | {0x1e, 0x411111f0}), |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 5135 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5136 | ALC282_STANDARD_PINS, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 5137 | {0x12, 0x99a30130}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 5138 | {0x17, 0x40000000}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 5139 | {0x19, 0x03a11020}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 5140 | {0x1d, 0x40f41905}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 5141 | {0x21, 0x0321101f}), |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5142 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5143 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5144 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5145 | {0x17, 0x40020008}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5146 | {0x19, 0x03a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5147 | {0x1d, 0x40e00001}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5148 | {0x21, 0x03211040}), |
| 5149 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5150 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5151 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5152 | {0x17, 0x40000000}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5153 | {0x19, 0x03a11030}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5154 | {0x1d, 0x40e00001}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5155 | {0x21, 0x03211020}), |
| 5156 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5157 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5158 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5159 | {0x17, 0x40000000}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5160 | {0x19, 0x03a11030}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5161 | {0x1d, 0x40f00001}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5162 | {0x21, 0x03211020}), |
| 5163 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5164 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5165 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5166 | {0x17, 0x40000000}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5167 | {0x19, 0x04a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5168 | {0x1d, 0x40f00001}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5169 | {0x21, 0x0421101f}), |
| 5170 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5171 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5172 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5173 | {0x17, 0x40000000}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5174 | {0x19, 0x03a11030}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5175 | {0x1d, 0x40f00001}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 5176 | {0x21, 0x04211020}), |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 5177 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5178 | ALC282_STANDARD_PINS, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 5179 | {0x12, 0x90a60140}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 5180 | {0x17, 0x40000000}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 5181 | {0x19, 0x04a11030}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 5182 | {0x1d, 0x40f00001}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 5183 | {0x21, 0x04211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5184 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5185 | ALC282_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5186 | {0x12, 0x90a60130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5187 | {0x17, 0x40020008}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5188 | {0x19, 0x411111f0}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5189 | {0x1d, 0x40e00001}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5190 | {0x21, 0x0321101f}), |
| 5191 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 5192 | {0x12, 0x90a60160}, |
| 5193 | {0x14, 0x90170120}, |
| 5194 | {0x17, 0x40000000}, |
| 5195 | {0x18, 0x411111f0}, |
| 5196 | {0x19, 0x411111f0}, |
| 5197 | {0x1a, 0x411111f0}, |
| 5198 | {0x1b, 0x411111f0}, |
| 5199 | {0x1d, 0x40700001}, |
| 5200 | {0x1e, 0x411111f0}, |
| 5201 | {0x21, 0x02211030}), |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 5202 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5203 | ALC282_STANDARD_PINS, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 5204 | {0x12, 0x90a60130}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 5205 | {0x17, 0x40020008}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 5206 | {0x19, 0x03a11020}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 5207 | {0x1d, 0x40e00001}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 5208 | {0x21, 0x0321101f}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5209 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5210 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5211 | {0x14, 0x411111f0}, |
| 5212 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5213 | {0x18, 0x90170112}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5214 | {0x1a, 0x04a11020}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5215 | {0x1d, 0x4075812d}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5216 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5217 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5218 | {0x14, 0x411111f0}, |
| 5219 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5220 | {0x18, 0x90170110}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5221 | {0x1a, 0x04a11020}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5222 | {0x1d, 0x4075812d}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5223 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5224 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5225 | {0x14, 0x411111f0}, |
| 5226 | {0x15, 0x0421101f}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5227 | {0x18, 0x411111f0}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5228 | {0x1a, 0x04a11020}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5229 | {0x1d, 0x4075812d}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5230 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5231 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5232 | {0x14, 0x411111f0}, |
| 5233 | {0x15, 0x04211020}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5234 | {0x18, 0x411111f0}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5235 | {0x1a, 0x04a11040}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5236 | {0x1d, 0x4076a12d}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5237 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5238 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5239 | {0x14, 0x90170110}, |
| 5240 | {0x15, 0x04211020}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5241 | {0x18, 0x411111f0}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5242 | {0x1a, 0x04a11040}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5243 | {0x1d, 0x4076a12d}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5244 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5245 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5246 | {0x14, 0x90170110}, |
| 5247 | {0x15, 0x04211020}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5248 | {0x18, 0x411111f0}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5249 | {0x1a, 0x04a11020}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5250 | {0x1d, 0x4076a12d}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5251 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5252 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5253 | {0x14, 0x90170110}, |
| 5254 | {0x15, 0x0421101f}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5255 | {0x18, 0x411111f0}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 5256 | {0x1a, 0x04a11020}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5257 | {0x1d, 0x4075812d}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 5258 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5259 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 5260 | {0x12, 0x90a60140}, |
| 5261 | {0x13, 0x411111f0}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 5262 | {0x16, 0x01014020}, |
| 5263 | {0x18, 0x411111f0}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5264 | {0x19, 0x01a19030}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 5265 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5266 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 5267 | {0x12, 0x90a60140}, |
| 5268 | {0x13, 0x411111f0}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 5269 | {0x16, 0x01014020}, |
| 5270 | {0x18, 0x02a19031}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5271 | {0x19, 0x01a1903e}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5272 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5273 | ALC292_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5274 | {0x12, 0x90a60140}, |
| 5275 | {0x13, 0x411111f0}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5276 | {0x16, 0x411111f0}, |
| 5277 | {0x18, 0x411111f0}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5278 | {0x19, 0x411111f0}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5279 | SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5280 | ALC292_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5281 | {0x12, 0x40000000}, |
| 5282 | {0x13, 0x90a60140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 5283 | {0x16, 0x21014020}, |
| 5284 | {0x18, 0x411111f0}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5285 | {0x19, 0x21a19030}), |
David Henningsson | e03fdbd | 2014-06-27 08:41:59 +0200 | [diff] [blame] | 5286 | SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5287 | ALC292_STANDARD_PINS, |
David Henningsson | e03fdbd | 2014-06-27 08:41:59 +0200 | [diff] [blame] | 5288 | {0x12, 0x40000000}, |
| 5289 | {0x13, 0x90a60140}, |
David Henningsson | e03fdbd | 2014-06-27 08:41:59 +0200 | [diff] [blame] | 5290 | {0x16, 0x411111f0}, |
| 5291 | {0x18, 0x411111f0}, |
David Henningsson | aec856d | 2014-09-03 10:23:05 +0200 | [diff] [blame] | 5292 | {0x19, 0x411111f0}), |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 5293 | {} |
| 5294 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5295 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 5296 | static void alc269_fill_coef(struct hda_codec *codec) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5297 | { |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 5298 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5299 | int val; |
| 5300 | |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 5301 | if (spec->codec_variant != ALC269_TYPE_ALC269VB) |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 5302 | return; |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 5303 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5304 | if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5305 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 5306 | alc_write_coef_idx(codec, 0xe, 0x8817); |
| 5307 | } |
| 5308 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5309 | if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5310 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 5311 | alc_write_coef_idx(codec, 0xe, 0x8814); |
| 5312 | } |
| 5313 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5314 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5315 | /* Power up output pin */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5316 | alc_update_coef_idx(codec, 0x04, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5317 | } |
| 5318 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5319 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5320 | val = alc_read_coef_idx(codec, 0xd); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 5321 | if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5322 | /* Capless ramp up clock control */ |
| 5323 | alc_write_coef_idx(codec, 0xd, val | (1<<10)); |
| 5324 | } |
| 5325 | val = alc_read_coef_idx(codec, 0x17); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 5326 | if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5327 | /* Class D power on reset */ |
| 5328 | alc_write_coef_idx(codec, 0x17, val | (1<<7)); |
| 5329 | } |
| 5330 | } |
| 5331 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5332 | /* HP */ |
| 5333 | alc_update_coef_idx(codec, 0x4, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5334 | } |
| 5335 | |
| 5336 | /* |
| 5337 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5338 | static int patch_alc269(struct hda_codec *codec) |
| 5339 | { |
| 5340 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 5341 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5342 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 5343 | err = alc_alloc_spec(codec, 0x0b); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5344 | if (err < 0) |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 5345 | return err; |
| 5346 | |
| 5347 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 5348 | spec->gen.shared_mic_vref_pin = 0x18; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5349 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5350 | snd_hda_pick_fixup(codec, alc269_fixup_models, |
Herton Ronaldo Krzesinski | 9f720bb9 | 2012-09-27 10:38:14 -0300 | [diff] [blame] | 5351 | alc269_fixup_tbl, alc269_fixups); |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 5352 | snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups); |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 5353 | snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, |
| 5354 | alc269_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5355 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Herton Ronaldo Krzesinski | 9f720bb9 | 2012-09-27 10:38:14 -0300 | [diff] [blame] | 5356 | |
| 5357 | alc_auto_parse_customize_define(codec); |
| 5358 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 5359 | if (has_cdefine_beep(codec)) |
| 5360 | spec->gen.beep_nid = 0x01; |
| 5361 | |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 5362 | switch (codec->vendor_id) { |
| 5363 | case 0x10ec0269: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5364 | spec->codec_variant = ALC269_TYPE_ALC269VA; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5365 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 5366 | case 0x0010: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 5367 | if (codec->bus->pci && |
| 5368 | codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5369 | spec->cdefine.platform_type == 1) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 5370 | err = alc_codec_rename(codec, "ALC271X"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5371 | spec->codec_variant = ALC269_TYPE_ALC269VB; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5372 | break; |
| 5373 | case 0x0020: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 5374 | if (codec->bus->pci && |
| 5375 | codec->bus->pci->subsystem_vendor == 0x17aa && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5376 | codec->bus->pci->subsystem_device == 0x21f3) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 5377 | err = alc_codec_rename(codec, "ALC3202"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5378 | spec->codec_variant = ALC269_TYPE_ALC269VC; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5379 | break; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 5380 | case 0x0030: |
| 5381 | spec->codec_variant = ALC269_TYPE_ALC269VD; |
| 5382 | break; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5383 | default: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5384 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 5385 | } |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5386 | if (err < 0) |
| 5387 | goto error; |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 5388 | spec->init_hook = alc269_fill_coef; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5389 | alc269_fill_coef(codec); |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 5390 | break; |
| 5391 | |
| 5392 | case 0x10ec0280: |
| 5393 | case 0x10ec0290: |
| 5394 | spec->codec_variant = ALC269_TYPE_ALC280; |
| 5395 | break; |
| 5396 | case 0x10ec0282: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 5397 | spec->codec_variant = ALC269_TYPE_ALC282; |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 5398 | spec->shutup = alc282_shutup; |
| 5399 | spec->init_hook = alc282_init; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 5400 | break; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 5401 | case 0x10ec0233: |
| 5402 | case 0x10ec0283: |
| 5403 | spec->codec_variant = ALC269_TYPE_ALC283; |
| 5404 | spec->shutup = alc283_shutup; |
| 5405 | spec->init_hook = alc283_init; |
| 5406 | break; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 5407 | case 0x10ec0284: |
| 5408 | case 0x10ec0292: |
| 5409 | spec->codec_variant = ALC269_TYPE_ALC284; |
| 5410 | break; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 5411 | case 0x10ec0285: |
| 5412 | case 0x10ec0293: |
| 5413 | spec->codec_variant = ALC269_TYPE_ALC285; |
| 5414 | break; |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 5415 | case 0x10ec0286: |
Kailang Yang | 7c66593 | 2014-04-14 15:09:44 +0800 | [diff] [blame] | 5416 | case 0x10ec0288: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 5417 | spec->codec_variant = ALC269_TYPE_ALC286; |
Kailang Yang | f7ae9ba | 2014-06-30 16:10:37 +0800 | [diff] [blame] | 5418 | spec->shutup = alc286_shutup; |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 5419 | break; |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 5420 | case 0x10ec0255: |
| 5421 | spec->codec_variant = ALC269_TYPE_ALC255; |
| 5422 | break; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5423 | } |
| 5424 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 5425 | if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 5426 | spec->has_alc5505_dsp = 1; |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 5427 | spec->init_hook = alc5505_dsp_init; |
| 5428 | } |
| 5429 | |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5430 | /* automatic parse from the BIOS config */ |
| 5431 | err = alc269_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5432 | if (err < 0) |
| 5433 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5434 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 5435 | if (!spec->gen.no_analog && spec->gen.beep_nid) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5436 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
| 5437 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5438 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 5439 | #ifdef CONFIG_PM |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 5440 | codec->patch_ops.suspend = alc269_suspend; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5441 | codec->patch_ops.resume = alc269_resume; |
| 5442 | #endif |
Kailang Yang | c5177c8 | 2013-07-24 14:39:49 +0200 | [diff] [blame] | 5443 | if (!spec->shutup) |
| 5444 | spec->shutup = alc269_shutup; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5445 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5446 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 5447 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5448 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5449 | |
| 5450 | error: |
| 5451 | alc_free(codec); |
| 5452 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5453 | } |
| 5454 | |
| 5455 | /* |
| 5456 | * ALC861 |
| 5457 | */ |
| 5458 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5459 | static int alc861_parse_auto_config(struct hda_codec *codec) |
| 5460 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5461 | static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 5462 | static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; |
| 5463 | return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5464 | } |
| 5465 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5466 | /* Pin config fixes */ |
| 5467 | enum { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5468 | ALC861_FIXUP_FSC_AMILO_PI1505, |
| 5469 | ALC861_FIXUP_AMP_VREF_0F, |
| 5470 | ALC861_FIXUP_NO_JACK_DETECT, |
| 5471 | ALC861_FIXUP_ASUS_A6RP, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 5472 | ALC660_FIXUP_ASUS_W7J, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5473 | }; |
| 5474 | |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 5475 | /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ |
| 5476 | static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5477 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 5478 | { |
| 5479 | struct alc_spec *spec = codec->spec; |
| 5480 | unsigned int val; |
| 5481 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5482 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 5483 | return; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 5484 | val = snd_hda_codec_get_pin_target(codec, 0x0f); |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 5485 | if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) |
| 5486 | val |= AC_PINCTL_IN_EN; |
| 5487 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 5488 | snd_hda_set_pin_ctl(codec, 0x0f, val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 5489 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 5490 | } |
| 5491 | |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5492 | /* suppress the jack-detection */ |
| 5493 | static void alc_fixup_no_jack_detect(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5494 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5495 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5496 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5497 | codec->no_jack_detect = 1; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 5498 | } |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5499 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5500 | static const struct hda_fixup alc861_fixups[] = { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5501 | [ALC861_FIXUP_FSC_AMILO_PI1505] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5502 | .type = HDA_FIXUP_PINS, |
| 5503 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5504 | { 0x0b, 0x0221101f }, /* HP */ |
| 5505 | { 0x0f, 0x90170310 }, /* speaker */ |
| 5506 | { } |
| 5507 | } |
| 5508 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5509 | [ALC861_FIXUP_AMP_VREF_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5510 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 5511 | .v.func = alc861_fixup_asus_amp_vref_0f, |
Takashi Iwai | 3b25eb6 | 2012-01-25 09:55:46 +0100 | [diff] [blame] | 5512 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5513 | [ALC861_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5514 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5515 | .v.func = alc_fixup_no_jack_detect, |
| 5516 | }, |
| 5517 | [ALC861_FIXUP_ASUS_A6RP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5518 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5519 | .v.func = alc861_fixup_asus_amp_vref_0f, |
| 5520 | .chained = true, |
| 5521 | .chain_id = ALC861_FIXUP_NO_JACK_DETECT, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 5522 | }, |
| 5523 | [ALC660_FIXUP_ASUS_W7J] = { |
| 5524 | .type = HDA_FIXUP_VERBS, |
| 5525 | .v.verbs = (const struct hda_verb[]) { |
| 5526 | /* ASUS W7J needs a magic pin setup on unused NID 0x10 |
| 5527 | * for enabling outputs |
| 5528 | */ |
| 5529 | {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, |
| 5530 | { } |
| 5531 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5532 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5533 | }; |
| 5534 | |
| 5535 | static const struct snd_pci_quirk alc861_fixup_tbl[] = { |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 5536 | SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e7ca237 | 2013-12-02 15:27:19 +0100 | [diff] [blame] | 5537 | SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 5538 | SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), |
| 5539 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), |
| 5540 | SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), |
| 5541 | SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F), |
| 5542 | SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F), |
| 5543 | SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5544 | {} |
| 5545 | }; |
| 5546 | |
| 5547 | /* |
| 5548 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5549 | static int patch_alc861(struct hda_codec *codec) |
| 5550 | { |
| 5551 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5552 | int err; |
| 5553 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 5554 | err = alc_alloc_spec(codec, 0x15); |
| 5555 | if (err < 0) |
| 5556 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5557 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 5558 | spec = codec->spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 5559 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5560 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5561 | snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); |
| 5562 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5563 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 5564 | /* automatic parse from the BIOS config */ |
| 5565 | err = alc861_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5566 | if (err < 0) |
| 5567 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5568 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 5569 | if (!spec->gen.no_analog) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 5570 | set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5571 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5572 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 5573 | #ifdef CONFIG_PM |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 5574 | spec->power_hook = alc_power_eapd; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5575 | #endif |
| 5576 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5577 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 5578 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5579 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5580 | |
| 5581 | error: |
| 5582 | alc_free(codec); |
| 5583 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5584 | } |
| 5585 | |
| 5586 | /* |
| 5587 | * ALC861-VD support |
| 5588 | * |
| 5589 | * Based on ALC882 |
| 5590 | * |
| 5591 | * In addition, an independent DAC |
| 5592 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5593 | static int alc861vd_parse_auto_config(struct hda_codec *codec) |
| 5594 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5595 | static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 5596 | static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 5597 | return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5598 | } |
| 5599 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5600 | enum { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5601 | ALC660VD_FIX_ASUS_GPIO1, |
| 5602 | ALC861VD_FIX_DALLAS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5603 | }; |
| 5604 | |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5605 | /* exclude VREF80 */ |
| 5606 | static void alc861vd_fixup_dallas(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5607 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5608 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5609 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | b78562b | 2012-12-17 20:06:49 +0100 | [diff] [blame] | 5610 | snd_hda_override_pin_caps(codec, 0x18, 0x00000734); |
| 5611 | snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5612 | } |
| 5613 | } |
| 5614 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5615 | static const struct hda_fixup alc861vd_fixups[] = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5616 | [ALC660VD_FIX_ASUS_GPIO1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5617 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5618 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5619 | /* reset GPIO1 */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5620 | {0x01, AC_VERB_SET_GPIO_MASK, 0x03}, |
| 5621 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01}, |
| 5622 | {0x01, AC_VERB_SET_GPIO_DATA, 0x01}, |
| 5623 | { } |
| 5624 | } |
| 5625 | }, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5626 | [ALC861VD_FIX_DALLAS] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5627 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5628 | .v.func = alc861vd_fixup_dallas, |
| 5629 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5630 | }; |
| 5631 | |
| 5632 | static const struct snd_pci_quirk alc861vd_fixup_tbl[] = { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5633 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5634 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 5635 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5636 | {} |
| 5637 | }; |
| 5638 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5639 | /* |
| 5640 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5641 | static int patch_alc861vd(struct hda_codec *codec) |
| 5642 | { |
| 5643 | struct alc_spec *spec; |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 5644 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5645 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 5646 | err = alc_alloc_spec(codec, 0x0b); |
| 5647 | if (err < 0) |
| 5648 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5649 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 5650 | spec = codec->spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 5651 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5652 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5653 | snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); |
| 5654 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5655 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 5656 | /* automatic parse from the BIOS config */ |
| 5657 | err = alc861vd_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5658 | if (err < 0) |
| 5659 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5660 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 5661 | if (!spec->gen.no_analog) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 5662 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5663 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5664 | codec->patch_ops = alc_patch_ops; |
| 5665 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5666 | spec->shutup = alc_eapd_shutup; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5667 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5668 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 5669 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5670 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 5671 | |
| 5672 | error: |
| 5673 | alc_free(codec); |
| 5674 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5675 | } |
| 5676 | |
| 5677 | /* |
| 5678 | * ALC662 support |
| 5679 | * |
| 5680 | * ALC662 is almost identical with ALC880 but has cleaner and more flexible |
| 5681 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 5682 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 5683 | * 6-channel independent captures. |
| 5684 | * |
| 5685 | * In addition, an independent DAC for the multi-playback (not used in this |
| 5686 | * driver yet). |
| 5687 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5688 | |
| 5689 | /* |
| 5690 | * BIOS auto configuration |
| 5691 | */ |
| 5692 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 5693 | static int alc662_parse_auto_config(struct hda_codec *codec) |
| 5694 | { |
Takashi Iwai | 4c6d72d | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 5695 | static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 5696 | static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; |
| 5697 | static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 5698 | const hda_nid_t *ssids; |
Takashi Iwai | ee979a14 | 2008-09-02 15:42:20 +0200 | [diff] [blame] | 5699 | |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 5700 | if (codec->vendor_id == 0x10ec0272 || codec->vendor_id == 0x10ec0663 || |
Rainer Koenig | 1d87caa | 2013-04-04 08:40:38 +0200 | [diff] [blame] | 5701 | codec->vendor_id == 0x10ec0665 || codec->vendor_id == 0x10ec0670 || |
| 5702 | codec->vendor_id == 0x10ec0671) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 5703 | ssids = alc663_ssids; |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 5704 | else |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 5705 | ssids = alc662_ssids; |
| 5706 | return alc_parse_auto_config(codec, alc662_ignore, ssids); |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 5707 | } |
| 5708 | |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 5709 | static void alc272_fixup_mario(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5710 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 5711 | { |
Takashi Iwai | 9bb1f06 | 2013-01-10 17:14:29 +0100 | [diff] [blame] | 5712 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 5713 | return; |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 5714 | if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, |
| 5715 | (0x3b << AC_AMPCAP_OFFSET_SHIFT) | |
| 5716 | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 5717 | (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 5718 | (0 << AC_AMPCAP_MUTE_SHIFT))) |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 5719 | codec_warn(codec, "failed to override amp caps for NID 0x2\n"); |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 5720 | } |
| 5721 | |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 5722 | static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { |
| 5723 | { .channels = 2, |
| 5724 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, |
| 5725 | { .channels = 4, |
| 5726 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, |
| 5727 | SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ |
| 5728 | { } |
| 5729 | }; |
| 5730 | |
| 5731 | /* override the 2.1 chmap */ |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 5732 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 5733 | const struct hda_fixup *fix, int action) |
| 5734 | { |
| 5735 | if (action == HDA_FIXUP_ACT_BUILD) { |
| 5736 | struct alc_spec *spec = codec->spec; |
| 5737 | spec->gen.pcm_rec[0].stream[0].chmap = asus_pcm_2_1_chmaps; |
| 5738 | } |
| 5739 | } |
| 5740 | |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 5741 | /* avoid D3 for keeping GPIO up */ |
| 5742 | static unsigned int gpio_led_power_filter(struct hda_codec *codec, |
| 5743 | hda_nid_t nid, |
| 5744 | unsigned int power_state) |
| 5745 | { |
| 5746 | struct alc_spec *spec = codec->spec; |
| 5747 | if (nid == codec->afg && power_state == AC_PWRST_D3 && spec->gpio_led) |
| 5748 | return AC_PWRST_D0; |
| 5749 | return power_state; |
| 5750 | } |
| 5751 | |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 5752 | static void alc662_fixup_led_gpio1(struct hda_codec *codec, |
| 5753 | const struct hda_fixup *fix, int action) |
| 5754 | { |
| 5755 | struct alc_spec *spec = codec->spec; |
| 5756 | static const struct hda_verb gpio_init[] = { |
| 5757 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x01 }, |
| 5758 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01 }, |
| 5759 | {} |
| 5760 | }; |
| 5761 | |
| 5762 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 5763 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 5764 | spec->gpio_led = 0; |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 5765 | spec->mute_led_polarity = 1; |
| 5766 | spec->gpio_mute_led_mask = 0x01; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 5767 | snd_hda_add_verbs(codec, gpio_init); |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 5768 | codec->power_filter = gpio_led_power_filter; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 5769 | } |
| 5770 | } |
| 5771 | |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 5772 | static struct coef_fw alc668_coefs[] = { |
| 5773 | WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), |
| 5774 | WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), |
| 5775 | WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), |
| 5776 | WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), |
| 5777 | WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), |
| 5778 | WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), |
| 5779 | WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), |
| 5780 | WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), |
| 5781 | WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), |
| 5782 | WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), |
| 5783 | WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), |
| 5784 | WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), |
| 5785 | WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), |
| 5786 | WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), |
| 5787 | WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), |
| 5788 | WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), |
| 5789 | WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), |
| 5790 | WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), |
| 5791 | WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), |
| 5792 | WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), |
| 5793 | {} |
| 5794 | }; |
| 5795 | |
| 5796 | static void alc668_restore_default_value(struct hda_codec *codec) |
| 5797 | { |
| 5798 | alc_process_coef_fw(codec, alc668_coefs); |
| 5799 | } |
| 5800 | |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 5801 | enum { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 5802 | ALC662_FIXUP_ASPIRE, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 5803 | ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 5804 | ALC662_FIXUP_IDEAPAD, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 5805 | ALC272_FIXUP_MARIO, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 5806 | ALC662_FIXUP_CZC_P10T, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 5807 | ALC662_FIXUP_SKU_IGNORE, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 5808 | ALC662_FIXUP_HP_RP5800, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5809 | ALC662_FIXUP_ASUS_MODE1, |
| 5810 | ALC662_FIXUP_ASUS_MODE2, |
| 5811 | ALC662_FIXUP_ASUS_MODE3, |
| 5812 | ALC662_FIXUP_ASUS_MODE4, |
| 5813 | ALC662_FIXUP_ASUS_MODE5, |
| 5814 | ALC662_FIXUP_ASUS_MODE6, |
| 5815 | ALC662_FIXUP_ASUS_MODE7, |
| 5816 | ALC662_FIXUP_ASUS_MODE8, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 5817 | ALC662_FIXUP_NO_JACK_DETECT, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 5818 | ALC662_FIXUP_ZOTAC_Z68, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 5819 | ALC662_FIXUP_INV_DMIC, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5820 | ALC668_FIXUP_DELL_MIC_NO_PRESENCE, |
| 5821 | ALC668_FIXUP_HEADSET_MODE, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 5822 | ALC662_FIXUP_BASS_MODE4_CHMAP, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 5823 | ALC662_FIXUP_BASS_16, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 5824 | ALC662_FIXUP_BASS_1A, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 5825 | ALC662_FIXUP_BASS_CHMAP, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 5826 | ALC668_FIXUP_AUTO_MUTE, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 5827 | ALC668_FIXUP_DELL_DISABLE_AAMIX, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5828 | ALC668_FIXUP_DELL_XPS13, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 5829 | }; |
| 5830 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5831 | static const struct hda_fixup alc662_fixups[] = { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 5832 | [ALC662_FIXUP_ASPIRE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5833 | .type = HDA_FIXUP_PINS, |
| 5834 | .v.pins = (const struct hda_pintbl[]) { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 5835 | { 0x15, 0x99130112 }, /* subwoofer */ |
| 5836 | { } |
| 5837 | } |
| 5838 | }, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 5839 | [ALC662_FIXUP_LED_GPIO1] = { |
| 5840 | .type = HDA_FIXUP_FUNC, |
| 5841 | .v.func = alc662_fixup_led_gpio1, |
| 5842 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 5843 | [ALC662_FIXUP_IDEAPAD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5844 | .type = HDA_FIXUP_PINS, |
| 5845 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 5846 | { 0x17, 0x99130112 }, /* subwoofer */ |
| 5847 | { } |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 5848 | }, |
| 5849 | .chained = true, |
| 5850 | .chain_id = ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 5851 | }, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 5852 | [ALC272_FIXUP_MARIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5853 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | b5bfbc6 | 2011-01-13 14:22:32 +0100 | [diff] [blame] | 5854 | .v.func = alc272_fixup_mario, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 5855 | }, |
| 5856 | [ALC662_FIXUP_CZC_P10T] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5857 | .type = HDA_FIXUP_VERBS, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 5858 | .v.verbs = (const struct hda_verb[]) { |
| 5859 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 5860 | {} |
| 5861 | } |
| 5862 | }, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 5863 | [ALC662_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5864 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 5865 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | c6b3587 | 2011-03-28 12:05:31 +0200 | [diff] [blame] | 5866 | }, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 5867 | [ALC662_FIXUP_HP_RP5800] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5868 | .type = HDA_FIXUP_PINS, |
| 5869 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 5870 | { 0x14, 0x0221201f }, /* HP out */ |
| 5871 | { } |
| 5872 | }, |
| 5873 | .chained = true, |
| 5874 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5875 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5876 | [ALC662_FIXUP_ASUS_MODE1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5877 | .type = HDA_FIXUP_PINS, |
| 5878 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5879 | { 0x14, 0x99130110 }, /* speaker */ |
| 5880 | { 0x18, 0x01a19c20 }, /* mic */ |
| 5881 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 5882 | { 0x21, 0x0121401f }, /* HP out */ |
| 5883 | { } |
| 5884 | }, |
| 5885 | .chained = true, |
| 5886 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5887 | }, |
| 5888 | [ALC662_FIXUP_ASUS_MODE2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5889 | .type = HDA_FIXUP_PINS, |
| 5890 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 5891 | { 0x14, 0x99130110 }, /* speaker */ |
| 5892 | { 0x18, 0x01a19820 }, /* mic */ |
| 5893 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 5894 | { 0x1b, 0x0121401f }, /* HP out */ |
| 5895 | { } |
| 5896 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5897 | .chained = true, |
| 5898 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5899 | }, |
| 5900 | [ALC662_FIXUP_ASUS_MODE3] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5901 | .type = HDA_FIXUP_PINS, |
| 5902 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5903 | { 0x14, 0x99130110 }, /* speaker */ |
| 5904 | { 0x15, 0x0121441f }, /* HP */ |
| 5905 | { 0x18, 0x01a19840 }, /* mic */ |
| 5906 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 5907 | { 0x21, 0x01211420 }, /* HP2 */ |
| 5908 | { } |
| 5909 | }, |
| 5910 | .chained = true, |
| 5911 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5912 | }, |
| 5913 | [ALC662_FIXUP_ASUS_MODE4] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5914 | .type = HDA_FIXUP_PINS, |
| 5915 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5916 | { 0x14, 0x99130110 }, /* speaker */ |
| 5917 | { 0x16, 0x99130111 }, /* speaker */ |
| 5918 | { 0x18, 0x01a19840 }, /* mic */ |
| 5919 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 5920 | { 0x21, 0x0121441f }, /* HP */ |
| 5921 | { } |
| 5922 | }, |
| 5923 | .chained = true, |
| 5924 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5925 | }, |
| 5926 | [ALC662_FIXUP_ASUS_MODE5] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5927 | .type = HDA_FIXUP_PINS, |
| 5928 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5929 | { 0x14, 0x99130110 }, /* speaker */ |
| 5930 | { 0x15, 0x0121441f }, /* HP */ |
| 5931 | { 0x16, 0x99130111 }, /* speaker */ |
| 5932 | { 0x18, 0x01a19840 }, /* mic */ |
| 5933 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 5934 | { } |
| 5935 | }, |
| 5936 | .chained = true, |
| 5937 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5938 | }, |
| 5939 | [ALC662_FIXUP_ASUS_MODE6] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5940 | .type = HDA_FIXUP_PINS, |
| 5941 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5942 | { 0x14, 0x99130110 }, /* speaker */ |
| 5943 | { 0x15, 0x01211420 }, /* HP2 */ |
| 5944 | { 0x18, 0x01a19840 }, /* mic */ |
| 5945 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 5946 | { 0x1b, 0x0121441f }, /* HP */ |
| 5947 | { } |
| 5948 | }, |
| 5949 | .chained = true, |
| 5950 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5951 | }, |
| 5952 | [ALC662_FIXUP_ASUS_MODE7] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5953 | .type = HDA_FIXUP_PINS, |
| 5954 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5955 | { 0x14, 0x99130110 }, /* speaker */ |
| 5956 | { 0x17, 0x99130111 }, /* speaker */ |
| 5957 | { 0x18, 0x01a19840 }, /* mic */ |
| 5958 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 5959 | { 0x1b, 0x01214020 }, /* HP */ |
| 5960 | { 0x21, 0x0121401f }, /* HP */ |
| 5961 | { } |
| 5962 | }, |
| 5963 | .chained = true, |
| 5964 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 5965 | }, |
| 5966 | [ALC662_FIXUP_ASUS_MODE8] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5967 | .type = HDA_FIXUP_PINS, |
| 5968 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 5969 | { 0x14, 0x99130110 }, /* speaker */ |
| 5970 | { 0x12, 0x99a30970 }, /* int-mic */ |
| 5971 | { 0x15, 0x01214020 }, /* HP */ |
| 5972 | { 0x17, 0x99130111 }, /* speaker */ |
| 5973 | { 0x18, 0x01a19840 }, /* mic */ |
| 5974 | { 0x21, 0x0121401f }, /* HP */ |
| 5975 | { } |
| 5976 | }, |
| 5977 | .chained = true, |
| 5978 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 5979 | }, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 5980 | [ALC662_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5981 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 5982 | .v.func = alc_fixup_no_jack_detect, |
| 5983 | }, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 5984 | [ALC662_FIXUP_ZOTAC_Z68] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5985 | .type = HDA_FIXUP_PINS, |
| 5986 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 5987 | { 0x1b, 0x02214020 }, /* Front HP */ |
| 5988 | { } |
| 5989 | } |
| 5990 | }, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 5991 | [ALC662_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5992 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 5993 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 5994 | }, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5995 | [ALC668_FIXUP_DELL_XPS13] = { |
| 5996 | .type = HDA_FIXUP_FUNC, |
| 5997 | .v.func = alc_fixup_dell_xps13, |
| 5998 | .chained = true, |
| 5999 | .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX |
| 6000 | }, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 6001 | [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { |
| 6002 | .type = HDA_FIXUP_FUNC, |
| 6003 | .v.func = alc_fixup_disable_aamix, |
| 6004 | .chained = true, |
| 6005 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 6006 | }, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 6007 | [ALC668_FIXUP_AUTO_MUTE] = { |
| 6008 | .type = HDA_FIXUP_FUNC, |
| 6009 | .v.func = alc_fixup_auto_mute_via_amp, |
| 6010 | .chained = true, |
| 6011 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 6012 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6013 | [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 6014 | .type = HDA_FIXUP_PINS, |
| 6015 | .v.pins = (const struct hda_pintbl[]) { |
| 6016 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6017 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 6018 | { } |
| 6019 | }, |
| 6020 | .chained = true, |
| 6021 | .chain_id = ALC668_FIXUP_HEADSET_MODE |
| 6022 | }, |
| 6023 | [ALC668_FIXUP_HEADSET_MODE] = { |
| 6024 | .type = HDA_FIXUP_FUNC, |
| 6025 | .v.func = alc_fixup_headset_mode_alc668, |
| 6026 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 6027 | [ALC662_FIXUP_BASS_MODE4_CHMAP] = { |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 6028 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 6029 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 6030 | .chained = true, |
| 6031 | .chain_id = ALC662_FIXUP_ASUS_MODE4 |
| 6032 | }, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 6033 | [ALC662_FIXUP_BASS_16] = { |
| 6034 | .type = HDA_FIXUP_PINS, |
| 6035 | .v.pins = (const struct hda_pintbl[]) { |
| 6036 | {0x16, 0x80106111}, /* bass speaker */ |
| 6037 | {} |
| 6038 | }, |
| 6039 | .chained = true, |
| 6040 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
| 6041 | }, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 6042 | [ALC662_FIXUP_BASS_1A] = { |
| 6043 | .type = HDA_FIXUP_PINS, |
| 6044 | .v.pins = (const struct hda_pintbl[]) { |
| 6045 | {0x1a, 0x80106111}, /* bass speaker */ |
| 6046 | {} |
| 6047 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 6048 | .chained = true, |
| 6049 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 6050 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 6051 | [ALC662_FIXUP_BASS_CHMAP] = { |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 6052 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 6053 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 6054 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 6055 | }; |
| 6056 | |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 6057 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 6058 | SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), |
Takashi Iwai | d3d3835 | 2013-08-19 20:05:50 +0200 | [diff] [blame] | 6059 | SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), |
David Henningsson | a6c47a8 | 2011-02-10 15:39:19 +0100 | [diff] [blame] | 6060 | SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 6061 | SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 6062 | SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), |
Takashi Iwai | 1801928 | 2013-08-16 08:17:05 +0200 | [diff] [blame] | 6063 | SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 6064 | SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6065 | SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 6066 | SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | c5d019c | 2014-07-22 17:33:32 +0200 | [diff] [blame] | 6067 | SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 6068 | SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), |
David Henningsson | 09d2014 | 2013-11-20 11:43:30 +0100 | [diff] [blame] | 6069 | SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
David Henningsson | ad8ff99 | 2013-11-07 09:28:59 +0100 | [diff] [blame] | 6070 | SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 8dc9abb | 2014-04-16 15:53:12 +0800 | [diff] [blame] | 6071 | SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 6072 | SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 6a98e34 | 2014-10-27 16:20:30 +0800 | [diff] [blame] | 6073 | SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 6074 | SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 6075 | SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_BASS_1A), |
| 6076 | SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 6077 | SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), |
| 6078 | SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 6079 | SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 6080 | SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 6081 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), |
Daniel T Chen | a0e90ac | 2010-11-20 10:20:35 -0500 | [diff] [blame] | 6082 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
Valentine Sinitsyn | d411858 | 2010-10-01 22:24:08 +0600 | [diff] [blame] | 6083 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 6084 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 6085 | SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 6086 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 6087 | |
| 6088 | #if 0 |
| 6089 | /* Below is a quirk table taken from the old code. |
| 6090 | * Basically the device should work as is without the fixup table. |
| 6091 | * If BIOS doesn't give a proper info, enable the corresponding |
| 6092 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 6093 | */ |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 6094 | SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), |
| 6095 | SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), |
| 6096 | SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), |
| 6097 | SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), |
| 6098 | SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 6099 | SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6100 | SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 6101 | SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), |
| 6102 | SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), |
| 6103 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6104 | SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), |
| 6105 | SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), |
| 6106 | SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), |
| 6107 | SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), |
| 6108 | SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), |
| 6109 | SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6110 | SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), |
| 6111 | SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), |
| 6112 | SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6113 | SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 6114 | SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 6115 | SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6116 | SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), |
| 6117 | SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), |
| 6118 | SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), |
| 6119 | SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6120 | SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), |
| 6121 | SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 6122 | SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6123 | SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), |
| 6124 | SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6125 | SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6126 | SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), |
| 6127 | SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), |
| 6128 | SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), |
| 6129 | SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), |
| 6130 | SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), |
| 6131 | SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), |
| 6132 | SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), |
| 6133 | SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 6134 | SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), |
| 6135 | SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), |
| 6136 | SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 6137 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), |
| 6138 | SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), |
| 6139 | SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), |
| 6140 | SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), |
| 6141 | SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), |
| 6142 | SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 6143 | SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), |
| 6144 | #endif |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 6145 | {} |
| 6146 | }; |
| 6147 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6148 | static const struct hda_model_fixup alc662_fixup_models[] = { |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 6149 | {.id = ALC272_FIXUP_MARIO, .name = "mario"}, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 6150 | {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, |
| 6151 | {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, |
| 6152 | {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, |
| 6153 | {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, |
| 6154 | {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, |
| 6155 | {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, |
| 6156 | {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, |
| 6157 | {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 6158 | {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
David Henningsson | e32aa85 | 2013-06-17 11:04:02 +0200 | [diff] [blame] | 6159 | {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 6160 | {} |
| 6161 | }; |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 6162 | |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 6163 | static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6164 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 6165 | {0x12, 0x99a30130}, |
| 6166 | {0x14, 0x90170110}, |
| 6167 | {0x15, 0x0321101f}, |
| 6168 | {0x16, 0x03011020}, |
| 6169 | {0x18, 0x40000008}, |
| 6170 | {0x19, 0x411111f0}, |
| 6171 | {0x1a, 0x411111f0}, |
| 6172 | {0x1b, 0x411111f0}, |
| 6173 | {0x1d, 0x41000001}, |
| 6174 | {0x1e, 0x411111f0}, |
| 6175 | {0x1f, 0x411111f0}), |
| 6176 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 6177 | {0x12, 0x99a30140}, |
| 6178 | {0x14, 0x90170110}, |
| 6179 | {0x15, 0x0321101f}, |
| 6180 | {0x16, 0x03011020}, |
| 6181 | {0x18, 0x40000008}, |
| 6182 | {0x19, 0x411111f0}, |
| 6183 | {0x1a, 0x411111f0}, |
| 6184 | {0x1b, 0x411111f0}, |
| 6185 | {0x1d, 0x41000001}, |
| 6186 | {0x1e, 0x411111f0}, |
| 6187 | {0x1f, 0x411111f0}), |
| 6188 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 6189 | {0x12, 0x99a30150}, |
| 6190 | {0x14, 0x90170110}, |
| 6191 | {0x15, 0x0321101f}, |
| 6192 | {0x16, 0x03011020}, |
| 6193 | {0x18, 0x40000008}, |
| 6194 | {0x19, 0x411111f0}, |
| 6195 | {0x1a, 0x411111f0}, |
| 6196 | {0x1b, 0x411111f0}, |
| 6197 | {0x1d, 0x41000001}, |
| 6198 | {0x1e, 0x411111f0}, |
| 6199 | {0x1f, 0x411111f0}), |
| 6200 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 6201 | {0x12, 0x411111f0}, |
| 6202 | {0x14, 0x90170110}, |
| 6203 | {0x15, 0x0321101f}, |
| 6204 | {0x16, 0x03011020}, |
| 6205 | {0x18, 0x40000008}, |
| 6206 | {0x19, 0x411111f0}, |
| 6207 | {0x1a, 0x411111f0}, |
| 6208 | {0x1b, 0x411111f0}, |
| 6209 | {0x1d, 0x41000001}, |
| 6210 | {0x1e, 0x411111f0}, |
| 6211 | {0x1f, 0x411111f0}), |
| 6212 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, |
| 6213 | {0x12, 0x90a60130}, |
| 6214 | {0x14, 0x90170110}, |
| 6215 | {0x15, 0x0321101f}, |
| 6216 | {0x16, 0x40000000}, |
| 6217 | {0x18, 0x411111f0}, |
| 6218 | {0x19, 0x411111f0}, |
| 6219 | {0x1a, 0x411111f0}, |
| 6220 | {0x1b, 0x411111f0}, |
| 6221 | {0x1d, 0x40d6832d}, |
| 6222 | {0x1e, 0x411111f0}, |
| 6223 | {0x1f, 0x411111f0}), |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 6224 | {} |
| 6225 | }; |
| 6226 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6227 | /* |
| 6228 | */ |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6229 | static int patch_alc662(struct hda_codec *codec) |
| 6230 | { |
| 6231 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 6232 | int err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6233 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 6234 | err = alc_alloc_spec(codec, 0x0b); |
| 6235 | if (err < 0) |
| 6236 | return err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6237 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 6238 | spec = codec->spec; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 6239 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 6240 | /* handle multiple HPs as is */ |
| 6241 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 6242 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 6243 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
| 6244 | |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 6245 | switch (codec->vendor_id) { |
| 6246 | case 0x10ec0668: |
| 6247 | spec->init_hook = alc668_restore_default_value; |
| 6248 | break; |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 6249 | } |
Kailang Yang | 8663ff7 | 2012-06-29 09:35:52 +0200 | [diff] [blame] | 6250 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6251 | snd_hda_pick_fixup(codec, alc662_fixup_models, |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 6252 | alc662_fixup_tbl, alc662_fixups); |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 6253 | snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6254 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 6255 | |
| 6256 | alc_auto_parse_customize_define(codec); |
| 6257 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 6258 | if (has_cdefine_beep(codec)) |
| 6259 | spec->gen.beep_nid = 0x01; |
| 6260 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 6261 | if ((alc_get_coef0(codec) & (1 << 14)) && |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 6262 | codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 6263 | spec->cdefine.platform_type == 1) { |
Wei Yongjun | 6134b1a | 2013-04-18 11:12:59 +0800 | [diff] [blame] | 6264 | err = alc_codec_rename(codec, "ALC272X"); |
| 6265 | if (err < 0) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 6266 | goto error; |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 6267 | } |
Kailang Yang | 274693f | 2009-12-03 10:07:50 +0100 | [diff] [blame] | 6268 | |
Takashi Iwai | b9c5106 | 2011-08-24 18:08:07 +0200 | [diff] [blame] | 6269 | /* automatic parse from the BIOS config */ |
| 6270 | err = alc662_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 6271 | if (err < 0) |
| 6272 | goto error; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6273 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 6274 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 6275 | switch (codec->vendor_id) { |
| 6276 | case 0x10ec0662: |
| 6277 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 6278 | break; |
| 6279 | case 0x10ec0272: |
| 6280 | case 0x10ec0663: |
| 6281 | case 0x10ec0665: |
Kailang Yang | 9ad5454 | 2013-11-26 15:41:40 +0800 | [diff] [blame] | 6282 | case 0x10ec0668: |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 6283 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
| 6284 | break; |
| 6285 | case 0x10ec0273: |
| 6286 | set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); |
| 6287 | break; |
| 6288 | } |
Kailang Yang | cec27c8 | 2010-02-04 14:18:18 +0100 | [diff] [blame] | 6289 | } |
Takashi Iwai | 2134ea4 | 2008-01-10 16:53:55 +0100 | [diff] [blame] | 6290 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6291 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 6292 | spec->shutup = alc_eapd_shutup; |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 6293 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6294 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 6295 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6296 | return 0; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6297 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 6298 | error: |
| 6299 | alc_free(codec); |
| 6300 | return err; |
Kailang Yang | b478b99 | 2011-05-18 11:51:15 +0200 | [diff] [blame] | 6301 | } |
| 6302 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6303 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6304 | * ALC680 support |
| 6305 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6306 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6307 | static int alc680_parse_auto_config(struct hda_codec *codec) |
| 6308 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 6309 | return alc_parse_auto_config(codec, NULL, NULL); |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6310 | } |
| 6311 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6312 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6313 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6314 | static int patch_alc680(struct hda_codec *codec) |
| 6315 | { |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6316 | int err; |
| 6317 | |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 6318 | /* ALC680 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 6319 | err = alc_alloc_spec(codec, 0); |
| 6320 | if (err < 0) |
| 6321 | return err; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 6322 | |
Takashi Iwai | 1ebec5f | 2011-08-15 13:21:48 +0200 | [diff] [blame] | 6323 | /* automatic parse from the BIOS config */ |
| 6324 | err = alc680_parse_auto_config(codec); |
| 6325 | if (err < 0) { |
| 6326 | alc_free(codec); |
| 6327 | return err; |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6328 | } |
| 6329 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6330 | codec->patch_ops = alc_patch_ops; |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6331 | |
| 6332 | return 0; |
| 6333 | } |
| 6334 | |
| 6335 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6336 | * patch entries |
| 6337 | */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 6338 | static const struct hda_codec_preset snd_hda_preset_realtek[] = { |
Kailang Yang | 296f033 | 2011-05-18 11:52:36 +0200 | [diff] [blame] | 6339 | { .id = 0x10ec0221, .name = "ALC221", .patch = patch_alc269 }, |
Kailang Yang | ba4c4d0 | 2013-11-26 15:17:50 +0800 | [diff] [blame] | 6340 | { .id = 0x10ec0231, .name = "ALC231", .patch = patch_alc269 }, |
Kailang Yang | 84dfd0a | 2013-03-07 09:19:38 +0100 | [diff] [blame] | 6341 | { .id = 0x10ec0233, .name = "ALC233", .patch = patch_alc269 }, |
Kailang Yang | 92f974d | 2014-06-06 17:05:33 +0800 | [diff] [blame] | 6342 | { .id = 0x10ec0235, .name = "ALC233", .patch = patch_alc269 }, |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 6343 | { .id = 0x10ec0255, .name = "ALC255", .patch = patch_alc269 }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6344 | { .id = 0x10ec0260, .name = "ALC260", .patch = patch_alc260 }, |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 6345 | { .id = 0x10ec0262, .name = "ALC262", .patch = patch_alc262 }, |
Kailang Yang | f6a9224 | 2007-12-13 16:52:54 +0100 | [diff] [blame] | 6346 | { .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 }, |
Kailang Yang | a361d84 | 2007-06-05 12:30:55 +0200 | [diff] [blame] | 6347 | { .id = 0x10ec0268, .name = "ALC268", .patch = patch_alc268 }, |
Kailang Yang | f6a9224 | 2007-12-13 16:52:54 +0100 | [diff] [blame] | 6348 | { .id = 0x10ec0269, .name = "ALC269", .patch = patch_alc269 }, |
Kailang Yang | ebb83ee | 2009-12-17 12:23:00 +0100 | [diff] [blame] | 6349 | { .id = 0x10ec0270, .name = "ALC270", .patch = patch_alc269 }, |
Kailang Yang | 01afd41 | 2008-10-15 11:22:09 +0200 | [diff] [blame] | 6350 | { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 }, |
Kailang Yang | ebb83ee | 2009-12-17 12:23:00 +0100 | [diff] [blame] | 6351 | { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 }, |
Kailang Yang | 296f033 | 2011-05-18 11:52:36 +0200 | [diff] [blame] | 6352 | { .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 }, |
David Henningsson | befae82 | 2012-06-25 19:49:28 +0200 | [diff] [blame] | 6353 | { .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 }, |
David Henningsson | 4e01ec6 | 2012-07-18 07:38:46 +0200 | [diff] [blame] | 6354 | { .id = 0x10ec0282, .name = "ALC282", .patch = patch_alc269 }, |
Kailang Yang | 7ff34ad | 2012-10-06 17:02:30 +0200 | [diff] [blame] | 6355 | { .id = 0x10ec0283, .name = "ALC283", .patch = patch_alc269 }, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 6356 | { .id = 0x10ec0284, .name = "ALC284", .patch = patch_alc269 }, |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 6357 | { .id = 0x10ec0285, .name = "ALC285", .patch = patch_alc269 }, |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 6358 | { .id = 0x10ec0286, .name = "ALC286", .patch = patch_alc269 }, |
Kailang Yang | 7c66593 | 2014-04-14 15:09:44 +0800 | [diff] [blame] | 6359 | { .id = 0x10ec0288, .name = "ALC288", .patch = patch_alc269 }, |
Kailang Yang | 7ff34ad | 2012-10-06 17:02:30 +0200 | [diff] [blame] | 6360 | { .id = 0x10ec0290, .name = "ALC290", .patch = patch_alc269 }, |
David Henningsson | af02dde | 2012-11-21 08:57:58 +0100 | [diff] [blame] | 6361 | { .id = 0x10ec0292, .name = "ALC292", .patch = patch_alc269 }, |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 6362 | { .id = 0x10ec0293, .name = "ALC293", .patch = patch_alc269 }, |
Jakub Schmidtke | f32610e | 2007-02-02 18:17:27 +0100 | [diff] [blame] | 6363 | { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6364 | .patch = patch_alc861 }, |
Jakub Schmidtke | f32610e | 2007-02-02 18:17:27 +0100 | [diff] [blame] | 6365 | { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd }, |
| 6366 | { .id = 0x10ec0861, .name = "ALC861", .patch = patch_alc861 }, |
| 6367 | { .id = 0x10ec0862, .name = "ALC861-VD", .patch = patch_alc861vd }, |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6368 | { .id = 0x10ec0662, .rev = 0x100002, .name = "ALC662 rev2", |
Takashi Iwai | 4953550a | 2009-06-30 15:28:30 +0200 | [diff] [blame] | 6369 | .patch = patch_alc882 }, |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 6370 | { .id = 0x10ec0662, .rev = 0x100101, .name = "ALC662 rev1", |
| 6371 | .patch = patch_alc662 }, |
David Henningsson | cc667a7 | 2011-10-18 14:07:51 +0200 | [diff] [blame] | 6372 | { .id = 0x10ec0662, .rev = 0x100300, .name = "ALC662 rev3", |
| 6373 | .patch = patch_alc662 }, |
Kailang Yang | 6dda9f4 | 2008-05-27 12:05:31 +0200 | [diff] [blame] | 6374 | { .id = 0x10ec0663, .name = "ALC663", .patch = patch_alc662 }, |
Kailang Yang | cec27c8 | 2010-02-04 14:18:18 +0100 | [diff] [blame] | 6375 | { .id = 0x10ec0665, .name = "ALC665", .patch = patch_alc662 }, |
Kailang Yang | 7200943 | 2014-06-06 16:51:18 +0800 | [diff] [blame] | 6376 | { .id = 0x10ec0667, .name = "ALC667", .patch = patch_alc662 }, |
Kailang Yang | 19a6282 | 2012-11-08 10:25:37 +0100 | [diff] [blame] | 6377 | { .id = 0x10ec0668, .name = "ALC668", .patch = patch_alc662 }, |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 6378 | { .id = 0x10ec0670, .name = "ALC670", .patch = patch_alc662 }, |
Rainer Koenig | 1d87caa | 2013-04-04 08:40:38 +0200 | [diff] [blame] | 6379 | { .id = 0x10ec0671, .name = "ALC671", .patch = patch_alc662 }, |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 6380 | { .id = 0x10ec0680, .name = "ALC680", .patch = patch_alc680 }, |
Kailang Yang | b6c5fba | 2014-06-05 11:13:44 +0800 | [diff] [blame] | 6381 | { .id = 0x10ec0867, .name = "ALC891", .patch = patch_alc882 }, |
Jakub Schmidtke | f32610e | 2007-02-02 18:17:27 +0100 | [diff] [blame] | 6382 | { .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6383 | { .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 }, |
Takashi Iwai | 4953550a | 2009-06-30 15:28:30 +0200 | [diff] [blame] | 6384 | { .id = 0x10ec0883, .name = "ALC883", .patch = patch_alc882 }, |
Clive Messer | 669faba | 2008-09-30 15:49:13 +0200 | [diff] [blame] | 6385 | { .id = 0x10ec0885, .rev = 0x100101, .name = "ALC889A", |
Takashi Iwai | 4953550a | 2009-06-30 15:28:30 +0200 | [diff] [blame] | 6386 | .patch = patch_alc882 }, |
Takashi Iwai | cb308f9 | 2008-04-16 14:13:29 +0200 | [diff] [blame] | 6387 | { .id = 0x10ec0885, .rev = 0x100103, .name = "ALC889A", |
Takashi Iwai | 4953550a | 2009-06-30 15:28:30 +0200 | [diff] [blame] | 6388 | .patch = patch_alc882 }, |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 6389 | { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 6390 | { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc882 }, |
Kailang Yang | 4442608 | 2008-10-15 11:18:05 +0200 | [diff] [blame] | 6391 | { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200", |
Takashi Iwai | 4953550a | 2009-06-30 15:28:30 +0200 | [diff] [blame] | 6392 | .patch = patch_alc882 }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 6393 | { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc882 }, |
Takashi Iwai | 4953550a | 2009-06-30 15:28:30 +0200 | [diff] [blame] | 6394 | { .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc882 }, |
Kailang Yang | 274693f | 2009-12-03 10:07:50 +0100 | [diff] [blame] | 6395 | { .id = 0x10ec0892, .name = "ALC892", .patch = patch_alc662 }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 6396 | { .id = 0x10ec0899, .name = "ALC898", .patch = patch_alc882 }, |
Kailang Yang | 19a6282 | 2012-11-08 10:25:37 +0100 | [diff] [blame] | 6397 | { .id = 0x10ec0900, .name = "ALC1150", .patch = patch_alc882 }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6398 | {} /* terminator */ |
| 6399 | }; |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 6400 | |
| 6401 | MODULE_ALIAS("snd-hda-codec-id:10ec*"); |
| 6402 | |
| 6403 | MODULE_LICENSE("GPL"); |
| 6404 | MODULE_DESCRIPTION("Realtek HD-audio codec"); |
| 6405 | |
| 6406 | static struct hda_codec_preset_list realtek_list = { |
| 6407 | .preset = snd_hda_preset_realtek, |
| 6408 | .owner = THIS_MODULE, |
| 6409 | }; |
| 6410 | |
| 6411 | static int __init patch_realtek_init(void) |
| 6412 | { |
| 6413 | return snd_hda_add_codec_preset(&realtek_list); |
| 6414 | } |
| 6415 | |
| 6416 | static void __exit patch_realtek_exit(void) |
| 6417 | { |
| 6418 | snd_hda_delete_codec_preset(&realtek_list); |
| 6419 | } |
| 6420 | |
| 6421 | module_init(patch_realtek_init) |
| 6422 | module_exit(patch_realtek_exit) |