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> |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 32 | #include <linux/input.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | #include <sound/core.h> |
Kailang Yang | 9ad0e49 | 2010-09-14 23:22:00 +0200 | [diff] [blame] | 34 | #include <sound/jack.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | #include "hda_codec.h" |
| 36 | #include "hda_local.h" |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 37 | #include "hda_auto_parser.h" |
Takashi Iwai | 1835a0f | 2011-10-27 22:12:46 +0200 | [diff] [blame] | 38 | #include "hda_jack.h" |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 39 | #include "hda_generic.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 41 | /* keep halting ALC5505 DSP, for power saving */ |
| 42 | #define HALT_REALTEK_ALC5505 |
| 43 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 44 | /* extra amp-initialization sequence types */ |
| 45 | enum { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 46 | ALC_INIT_UNDEFINED, |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 47 | ALC_INIT_NONE, |
| 48 | ALC_INIT_DEFAULT, |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 49 | }; |
| 50 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 51 | enum { |
| 52 | ALC_HEADSET_MODE_UNKNOWN, |
| 53 | ALC_HEADSET_MODE_UNPLUGGED, |
| 54 | ALC_HEADSET_MODE_HEADSET, |
| 55 | ALC_HEADSET_MODE_MIC, |
| 56 | ALC_HEADSET_MODE_HEADPHONE, |
| 57 | }; |
| 58 | |
| 59 | enum { |
| 60 | ALC_HEADSET_TYPE_UNKNOWN, |
| 61 | ALC_HEADSET_TYPE_CTIA, |
| 62 | ALC_HEADSET_TYPE_OMTP, |
| 63 | }; |
| 64 | |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 65 | enum { |
| 66 | ALC_KEY_MICMUTE_INDEX, |
| 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 | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 93 | /* GPIO bits */ |
| 94 | unsigned int gpio_mask; |
| 95 | unsigned int gpio_dir; |
| 96 | unsigned int gpio_data; |
| 97 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 98 | /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */ |
| 99 | int mute_led_polarity; |
| 100 | hda_nid_t mute_led_nid; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 101 | hda_nid_t cap_mute_led_nid; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 102 | |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 103 | unsigned int gpio_led; /* used for alc269_fixup_hp_gpio_led() */ |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 104 | unsigned int gpio_mute_led_mask; |
| 105 | unsigned int gpio_mic_led_mask; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 106 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 107 | hda_nid_t headset_mic_pin; |
| 108 | hda_nid_t headphone_mic_pin; |
| 109 | int current_headset_mode; |
| 110 | int current_headset_type; |
| 111 | |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 112 | /* hooks */ |
| 113 | void (*init_hook)(struct hda_codec *codec); |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 114 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 115 | void (*power_hook)(struct hda_codec *codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 116 | #endif |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 117 | void (*shutup)(struct hda_codec *codec); |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 118 | void (*reboot_notify)(struct hda_codec *codec); |
Takashi Iwai | d922b51 | 2011-04-28 12:18:53 +0200 | [diff] [blame] | 119 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 120 | int init_amp; |
Takashi Iwai | d433a67 | 2010-09-20 15:11:54 +0200 | [diff] [blame] | 121 | int codec_variant; /* flag for other variants */ |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 122 | unsigned int has_alc5505_dsp:1; |
| 123 | unsigned int no_depop_delay:1; |
Takashi Iwai | e64f14f | 2009-01-20 18:32:55 +0100 | [diff] [blame] | 124 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 125 | /* for PLL fix */ |
| 126 | hda_nid_t pll_nid; |
| 127 | unsigned int pll_coef_idx, pll_coef_bit; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 128 | unsigned int coef0; |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 129 | struct input_dev *kb_dev; |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 130 | u8 alc_mute_keycode_map[1]; |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 131 | }; |
| 132 | |
Takashi Iwai | 23f0c04 | 2009-02-26 13:03:58 +0100 | [diff] [blame] | 133 | /* |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 134 | * COEF access helper functions |
| 135 | */ |
| 136 | |
| 137 | static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 138 | unsigned int coef_idx) |
| 139 | { |
| 140 | unsigned int val; |
| 141 | |
| 142 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 143 | val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); |
| 144 | return val; |
| 145 | } |
| 146 | |
| 147 | #define alc_read_coef_idx(codec, coef_idx) \ |
| 148 | alc_read_coefex_idx(codec, 0x20, coef_idx) |
| 149 | |
| 150 | static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 151 | unsigned int coef_idx, unsigned int coef_val) |
| 152 | { |
| 153 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 154 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); |
| 155 | } |
| 156 | |
| 157 | #define alc_write_coef_idx(codec, coef_idx, coef_val) \ |
| 158 | alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) |
| 159 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 160 | static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 161 | unsigned int coef_idx, unsigned int mask, |
| 162 | unsigned int bits_set) |
| 163 | { |
| 164 | unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx); |
| 165 | |
| 166 | if (val != -1) |
| 167 | alc_write_coefex_idx(codec, nid, coef_idx, |
| 168 | (val & ~mask) | bits_set); |
| 169 | } |
| 170 | |
| 171 | #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ |
| 172 | alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) |
| 173 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 174 | /* a special bypass for COEF 0; read the cached value at the second time */ |
| 175 | static unsigned int alc_get_coef0(struct hda_codec *codec) |
| 176 | { |
| 177 | struct alc_spec *spec = codec->spec; |
| 178 | |
| 179 | if (!spec->coef0) |
| 180 | spec->coef0 = alc_read_coef_idx(codec, 0); |
| 181 | return spec->coef0; |
| 182 | } |
| 183 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 184 | /* coef writes/updates batch */ |
| 185 | struct coef_fw { |
| 186 | unsigned char nid; |
| 187 | unsigned char idx; |
| 188 | unsigned short mask; |
| 189 | unsigned short val; |
| 190 | }; |
| 191 | |
| 192 | #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ |
| 193 | { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } |
| 194 | #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) |
| 195 | #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) |
| 196 | #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) |
| 197 | |
| 198 | static void alc_process_coef_fw(struct hda_codec *codec, |
| 199 | const struct coef_fw *fw) |
| 200 | { |
| 201 | for (; fw->nid; fw++) { |
| 202 | if (fw->mask == (unsigned short)-1) |
| 203 | alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); |
| 204 | else |
| 205 | alc_update_coefex_idx(codec, fw->nid, fw->idx, |
| 206 | fw->mask, fw->val); |
| 207 | } |
| 208 | } |
| 209 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 210 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 211 | * Append the given mixer and verb elements for the later use |
| 212 | * The mixer array is referred in build_controls(), and init_verbs are |
| 213 | * called in init(). |
Takashi Iwai | d88897e | 2008-10-31 15:01:37 +0100 | [diff] [blame] | 214 | */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 215 | 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] | 216 | { |
| 217 | if (snd_BUG_ON(spec->num_mixers >= ARRAY_SIZE(spec->mixers))) |
| 218 | return; |
| 219 | spec->mixers[spec->num_mixers++] = mix; |
| 220 | } |
| 221 | |
Takashi Iwai | d88897e | 2008-10-31 15:01:37 +0100 | [diff] [blame] | 222 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 223 | * GPIO setup tables, used in initialization |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 224 | */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 225 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 226 | /* Enable GPIO mask and set output */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 227 | static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask) |
| 228 | { |
| 229 | struct alc_spec *spec = codec->spec; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 230 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 231 | spec->gpio_mask |= mask; |
| 232 | spec->gpio_dir |= mask; |
| 233 | spec->gpio_data |= mask; |
| 234 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 235 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 236 | static void alc_write_gpio_data(struct hda_codec *codec) |
| 237 | { |
| 238 | struct alc_spec *spec = codec->spec; |
| 239 | |
| 240 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
| 241 | spec->gpio_data); |
| 242 | } |
| 243 | |
| 244 | static void alc_write_gpio(struct hda_codec *codec) |
| 245 | { |
| 246 | struct alc_spec *spec = codec->spec; |
| 247 | |
| 248 | if (!spec->gpio_mask) |
| 249 | return; |
| 250 | |
| 251 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 252 | AC_VERB_SET_GPIO_MASK, spec->gpio_mask); |
| 253 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 254 | AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir); |
| 255 | alc_write_gpio_data(codec); |
| 256 | } |
| 257 | |
| 258 | static void alc_fixup_gpio(struct hda_codec *codec, int action, |
| 259 | unsigned int mask) |
| 260 | { |
| 261 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 262 | alc_setup_gpio(codec, mask); |
| 263 | } |
| 264 | |
| 265 | static void alc_fixup_gpio1(struct hda_codec *codec, |
| 266 | const struct hda_fixup *fix, int action) |
| 267 | { |
| 268 | alc_fixup_gpio(codec, action, 0x01); |
| 269 | } |
| 270 | |
| 271 | static void alc_fixup_gpio2(struct hda_codec *codec, |
| 272 | const struct hda_fixup *fix, int action) |
| 273 | { |
| 274 | alc_fixup_gpio(codec, action, 0x02); |
| 275 | } |
| 276 | |
| 277 | static void alc_fixup_gpio3(struct hda_codec *codec, |
| 278 | const struct hda_fixup *fix, int action) |
| 279 | { |
| 280 | alc_fixup_gpio(codec, action, 0x03); |
| 281 | } |
Kailang Yang | bdd148a | 2007-05-08 15:19:08 +0200 | [diff] [blame] | 282 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 283 | /* |
| 284 | * Fix hardware PLL issue |
| 285 | * On some codecs, the analog PLL gating control must be off while |
| 286 | * the default value is 1. |
| 287 | */ |
| 288 | static void alc_fix_pll(struct hda_codec *codec) |
| 289 | { |
| 290 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 291 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 292 | if (spec->pll_nid) |
| 293 | alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, |
| 294 | 1 << spec->pll_coef_bit, 0); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 295 | } |
| 296 | |
| 297 | static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, |
| 298 | unsigned int coef_idx, unsigned int coef_bit) |
| 299 | { |
| 300 | struct alc_spec *spec = codec->spec; |
| 301 | spec->pll_nid = nid; |
| 302 | spec->pll_coef_idx = coef_idx; |
| 303 | spec->pll_coef_bit = coef_bit; |
| 304 | alc_fix_pll(codec); |
| 305 | } |
| 306 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 307 | /* update the master volume per volume-knob's unsol event */ |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 308 | static void alc_update_knob_master(struct hda_codec *codec, |
| 309 | struct hda_jack_callback *jack) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 310 | { |
| 311 | unsigned int val; |
| 312 | struct snd_kcontrol *kctl; |
| 313 | struct snd_ctl_elem_value *uctl; |
| 314 | |
| 315 | kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); |
| 316 | if (!kctl) |
| 317 | return; |
| 318 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); |
| 319 | if (!uctl) |
| 320 | return; |
Takashi Iwai | 2ebab40 | 2016-02-09 10:23:52 +0100 | [diff] [blame] | 321 | val = snd_hda_codec_read(codec, jack->nid, 0, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 322 | AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); |
| 323 | val &= HDA_AMP_VOLMASK; |
| 324 | uctl->value.integer.value[0] = val; |
| 325 | uctl->value.integer.value[1] = val; |
| 326 | kctl->put(kctl, uctl); |
| 327 | kfree(uctl); |
| 328 | } |
| 329 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 330 | static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 331 | { |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 332 | /* For some reason, the res given from ALC880 is broken. |
| 333 | Here we adjust it properly. */ |
| 334 | snd_hda_jack_unsol_event(codec, res >> 2); |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 335 | } |
| 336 | |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 337 | /* Change EAPD to verb control */ |
| 338 | static void alc_fill_eapd_coef(struct hda_codec *codec) |
| 339 | { |
| 340 | int coef; |
| 341 | |
| 342 | coef = alc_get_coef0(codec); |
| 343 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 344 | switch (codec->core.vendor_id) { |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 345 | case 0x10ec0262: |
| 346 | alc_update_coef_idx(codec, 0x7, 0, 1<<5); |
| 347 | break; |
| 348 | case 0x10ec0267: |
| 349 | case 0x10ec0268: |
| 350 | alc_update_coef_idx(codec, 0x7, 0, 1<<13); |
| 351 | break; |
| 352 | case 0x10ec0269: |
| 353 | if ((coef & 0x00f0) == 0x0010) |
| 354 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); |
| 355 | if ((coef & 0x00f0) == 0x0020) |
| 356 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 357 | if ((coef & 0x00f0) == 0x0030) |
| 358 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 359 | break; |
| 360 | case 0x10ec0280: |
| 361 | case 0x10ec0284: |
| 362 | case 0x10ec0290: |
| 363 | case 0x10ec0292: |
| 364 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 365 | break; |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 366 | case 0x10ec0225: |
Takashi Iwai | 44be77c | 2017-12-27 08:53:59 +0100 | [diff] [blame] | 367 | case 0x10ec0295: |
| 368 | case 0x10ec0299: |
| 369 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); |
| 370 | /* fallthrough */ |
| 371 | case 0x10ec0215: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 372 | case 0x10ec0233: |
Kailang Yang | ea04a1d | 2018-04-25 15:31:52 +0800 | [diff] [blame] | 373 | case 0x10ec0235: |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 374 | case 0x10ec0236: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 375 | case 0x10ec0255: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 376 | case 0x10ec0256: |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 377 | case 0x10ec0257: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 378 | case 0x10ec0282: |
| 379 | case 0x10ec0283: |
| 380 | case 0x10ec0286: |
| 381 | case 0x10ec0288: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 382 | case 0x10ec0285: |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 383 | case 0x10ec0298: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 384 | case 0x10ec0289: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 385 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 386 | break; |
Kailang Yang | 3aabf94 | 2017-11-08 15:28:33 +0800 | [diff] [blame] | 387 | case 0x10ec0275: |
| 388 | alc_update_coef_idx(codec, 0xe, 0, 1<<0); |
| 389 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 390 | case 0x10ec0293: |
| 391 | alc_update_coef_idx(codec, 0xa, 1<<13, 0); |
| 392 | break; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 393 | case 0x10ec0234: |
| 394 | case 0x10ec0274: |
| 395 | case 0x10ec0294: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 396 | case 0x10ec0700: |
| 397 | case 0x10ec0701: |
| 398 | case 0x10ec0703: |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 399 | alc_update_coef_idx(codec, 0x10, 1<<15, 0); |
| 400 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 401 | case 0x10ec0662: |
| 402 | if ((coef & 0x00f0) == 0x0030) |
| 403 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ |
| 404 | break; |
| 405 | case 0x10ec0272: |
| 406 | case 0x10ec0273: |
| 407 | case 0x10ec0663: |
| 408 | case 0x10ec0665: |
| 409 | case 0x10ec0670: |
| 410 | case 0x10ec0671: |
| 411 | case 0x10ec0672: |
| 412 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ |
| 413 | break; |
| 414 | case 0x10ec0668: |
| 415 | alc_update_coef_idx(codec, 0x7, 3<<13, 0); |
| 416 | break; |
| 417 | case 0x10ec0867: |
| 418 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); |
| 419 | break; |
| 420 | case 0x10ec0888: |
| 421 | if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030) |
| 422 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 423 | break; |
| 424 | case 0x10ec0892: |
| 425 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 426 | break; |
| 427 | case 0x10ec0899: |
| 428 | case 0x10ec0900: |
Kailang Yang | 65553b1 | 2017-07-11 15:15:47 +0800 | [diff] [blame] | 429 | case 0x10ec1168: |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 430 | case 0x10ec1220: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 431 | alc_update_coef_idx(codec, 0x7, 1<<1, 0); |
| 432 | break; |
| 433 | } |
| 434 | } |
| 435 | |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 436 | /* additional initialization for ALC888 variants */ |
| 437 | static void alc888_coef_init(struct hda_codec *codec) |
| 438 | { |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 439 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 440 | /* alc888-VA */ |
| 441 | case 0x00: |
| 442 | /* alc888-VB */ |
| 443 | case 0x10: |
| 444 | alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ |
| 445 | break; |
| 446 | } |
Jaroslav Kysela | 87a8c37 | 2009-07-23 10:58:29 +0200 | [diff] [blame] | 447 | } |
| 448 | |
Takashi Iwai | 3fb4a50 | 2010-01-19 15:46:37 +0100 | [diff] [blame] | 449 | /* turn on/off EAPD control (only if available) */ |
| 450 | static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) |
| 451 | { |
| 452 | if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) |
| 453 | return; |
| 454 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) |
| 455 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, |
| 456 | on ? 2 : 0); |
| 457 | } |
| 458 | |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 459 | /* turn on/off EAPD controls of the codec */ |
| 460 | static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) |
| 461 | { |
| 462 | /* We currently only handle front, HP */ |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 463 | static hda_nid_t pins[] = { |
Hui Wang | af95b41 | 2015-03-26 17:14:55 +0800 | [diff] [blame] | 464 | 0x0f, 0x10, 0x14, 0x15, 0x17, 0 |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 465 | }; |
| 466 | hda_nid_t *p; |
| 467 | for (p = pins; *p; p++) |
| 468 | set_eapd(codec, *p, on); |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 469 | } |
| 470 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 471 | /* generic shutup callback; |
Lars-Peter Clausen | 4ce8e6a | 2016-11-08 15:48:06 +0100 | [diff] [blame] | 472 | * just turning off EAPD and a little pause for avoiding pop-noise |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 473 | */ |
| 474 | static void alc_eapd_shutup(struct hda_codec *codec) |
| 475 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 476 | struct alc_spec *spec = codec->spec; |
| 477 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 478 | alc_auto_setup_eapd(codec, false); |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 479 | if (!spec->no_depop_delay) |
| 480 | msleep(200); |
Takashi Iwai | 9bfb284 | 2013-07-24 14:31:50 +0200 | [diff] [blame] | 481 | snd_hda_shutup_pins(codec); |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 482 | } |
| 483 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 484 | /* generic EAPD initialization */ |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 485 | static void alc_auto_init_amp(struct hda_codec *codec, int type) |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 486 | { |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 487 | alc_fill_eapd_coef(codec); |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 488 | alc_auto_setup_eapd(codec, true); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 489 | alc_write_gpio(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 490 | switch (type) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 491 | case ALC_INIT_DEFAULT: |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 492 | switch (codec->core.vendor_id) { |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 493 | case 0x10ec0260: |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 494 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 495 | break; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 496 | case 0x10ec0880: |
| 497 | case 0x10ec0882: |
| 498 | case 0x10ec0883: |
| 499 | case 0x10ec0885: |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 500 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 501 | break; |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 502 | case 0x10ec0888: |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 503 | alc888_coef_init(codec); |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 504 | break; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 505 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 506 | break; |
| 507 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 508 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 509 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 510 | |
| 511 | /* |
| 512 | * Realtek SSID verification |
| 513 | */ |
| 514 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 515 | /* Could be any non-zero and even value. When used as fixup, tells |
| 516 | * the driver to ignore any present sku defines. |
| 517 | */ |
| 518 | #define ALC_FIXUP_SKU_IGNORE (2) |
| 519 | |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 520 | static void alc_fixup_sku_ignore(struct hda_codec *codec, |
| 521 | const struct hda_fixup *fix, int action) |
| 522 | { |
| 523 | struct alc_spec *spec = codec->spec; |
| 524 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 525 | spec->cdefine.fixup = 1; |
| 526 | spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; |
| 527 | } |
| 528 | } |
| 529 | |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 530 | static void alc_fixup_no_depop_delay(struct hda_codec *codec, |
| 531 | const struct hda_fixup *fix, int action) |
| 532 | { |
| 533 | struct alc_spec *spec = codec->spec; |
| 534 | |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 535 | if (action == HDA_FIXUP_ACT_PROBE) { |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 536 | spec->no_depop_delay = 1; |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 537 | codec->depop_delay = 0; |
| 538 | } |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 539 | } |
| 540 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 541 | static int alc_auto_parse_customize_define(struct hda_codec *codec) |
| 542 | { |
| 543 | unsigned int ass, tmp, i; |
Takashi Iwai | 7fb5622 | 2010-03-22 17:09:47 +0100 | [diff] [blame] | 544 | unsigned nid = 0; |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 545 | struct alc_spec *spec = codec->spec; |
| 546 | |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 547 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ |
| 548 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 549 | if (spec->cdefine.fixup) { |
| 550 | ass = spec->cdefine.sku_cfg; |
| 551 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 552 | return -1; |
| 553 | goto do_sku; |
| 554 | } |
| 555 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 556 | if (!codec->bus->pci) |
| 557 | return -1; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 558 | ass = codec->core.subsystem_id & 0xffff; |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 559 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 560 | goto do_sku; |
| 561 | |
| 562 | nid = 0x1d; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 563 | if (codec->core.vendor_id == 0x10ec0260) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 564 | nid = 0x17; |
| 565 | ass = snd_hda_codec_get_pincfg(codec, nid); |
| 566 | |
| 567 | if (!(ass & 1)) { |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 568 | codec_info(codec, "%s: SKU not ready 0x%08x\n", |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 569 | codec->core.chip_name, ass); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 570 | return -1; |
| 571 | } |
| 572 | |
| 573 | /* check sum */ |
| 574 | tmp = 0; |
| 575 | for (i = 1; i < 16; i++) { |
| 576 | if ((ass >> i) & 1) |
| 577 | tmp++; |
| 578 | } |
| 579 | if (((ass >> 16) & 0xf) != tmp) |
| 580 | return -1; |
| 581 | |
| 582 | spec->cdefine.port_connectivity = ass >> 30; |
| 583 | spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; |
| 584 | spec->cdefine.check_sum = (ass >> 16) & 0xf; |
| 585 | spec->cdefine.customization = ass >> 8; |
| 586 | do_sku: |
| 587 | spec->cdefine.sku_cfg = ass; |
| 588 | spec->cdefine.external_amp = (ass & 0x38) >> 3; |
| 589 | spec->cdefine.platform_type = (ass & 0x4) >> 2; |
| 590 | spec->cdefine.swap = (ass & 0x2) >> 1; |
| 591 | spec->cdefine.override = ass & 0x1; |
| 592 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 593 | codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 594 | nid, spec->cdefine.sku_cfg); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 595 | codec_dbg(codec, "SKU: port_connectivity=0x%x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 596 | spec->cdefine.port_connectivity); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 597 | codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); |
| 598 | codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); |
| 599 | codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); |
| 600 | codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); |
| 601 | codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); |
| 602 | codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); |
| 603 | codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 604 | |
| 605 | return 0; |
| 606 | } |
| 607 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 608 | /* return the position of NID in the list, or -1 if not found */ |
| 609 | static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 610 | { |
| 611 | int i; |
| 612 | for (i = 0; i < nums; i++) |
| 613 | if (list[i] == nid) |
| 614 | return i; |
| 615 | return -1; |
| 616 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 617 | /* return true if the given NID is found in the list */ |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 618 | static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 619 | { |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 620 | return find_idx_in_nid_list(nid, list, nums) >= 0; |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 621 | } |
| 622 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 623 | /* check subsystem ID and set up device-specific initialization; |
| 624 | * return 1 if initialized, 0 if invalid SSID |
| 625 | */ |
| 626 | /* 32-bit subsystem ID for BIOS loading in HD Audio codec. |
| 627 | * 31 ~ 16 : Manufacture ID |
| 628 | * 15 ~ 8 : SKU ID |
| 629 | * 7 ~ 0 : Assembly ID |
| 630 | * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 |
| 631 | */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 632 | 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] | 633 | { |
| 634 | unsigned int ass, tmp, i; |
| 635 | unsigned nid; |
| 636 | struct alc_spec *spec = codec->spec; |
| 637 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 638 | if (spec->cdefine.fixup) { |
| 639 | ass = spec->cdefine.sku_cfg; |
| 640 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 641 | return 0; |
| 642 | goto do_sku; |
| 643 | } |
| 644 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 645 | ass = codec->core.subsystem_id & 0xffff; |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 646 | if (codec->bus->pci && |
| 647 | ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 648 | goto do_sku; |
| 649 | |
| 650 | /* invalid SSID, check the special NID pin defcfg instead */ |
| 651 | /* |
Sasha Alexandr | def319f | 2009-06-16 16:00:15 -0400 | [diff] [blame] | 652 | * 31~30 : port connectivity |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 653 | * 29~21 : reserve |
| 654 | * 20 : PCBEEP input |
| 655 | * 19~16 : Check sum (15:1) |
| 656 | * 15~1 : Custom |
| 657 | * 0 : override |
| 658 | */ |
| 659 | nid = 0x1d; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 660 | if (codec->core.vendor_id == 0x10ec0260) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 661 | nid = 0x17; |
| 662 | ass = snd_hda_codec_get_pincfg(codec, nid); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 663 | codec_dbg(codec, |
| 664 | "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] | 665 | ass, nid); |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 666 | if (!(ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 667 | return 0; |
| 668 | if ((ass >> 30) != 1) /* no physical connection */ |
| 669 | return 0; |
| 670 | |
| 671 | /* check sum */ |
| 672 | tmp = 0; |
| 673 | for (i = 1; i < 16; i++) { |
| 674 | if ((ass >> i) & 1) |
| 675 | tmp++; |
| 676 | } |
| 677 | if (((ass >> 16) & 0xf) != tmp) |
| 678 | return 0; |
| 679 | do_sku: |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 680 | codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n", |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 681 | ass & 0xffff, codec->core.vendor_id); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 682 | /* |
| 683 | * 0 : override |
| 684 | * 1 : Swap Jack |
| 685 | * 2 : 0 --> Desktop, 1 --> Laptop |
| 686 | * 3~5 : External Amplifier control |
| 687 | * 7~6 : Reserved |
| 688 | */ |
| 689 | tmp = (ass & 0x38) >> 3; /* external Amp control */ |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 690 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
| 691 | switch (tmp) { |
| 692 | case 1: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 693 | alc_setup_gpio(codec, 0x01); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 694 | break; |
| 695 | case 3: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 696 | alc_setup_gpio(codec, 0x02); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 697 | break; |
| 698 | case 7: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 699 | alc_setup_gpio(codec, 0x03); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 700 | break; |
| 701 | case 5: |
| 702 | default: |
| 703 | spec->init_amp = ALC_INIT_DEFAULT; |
| 704 | break; |
| 705 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 706 | } |
| 707 | |
| 708 | /* is laptop or Desktop and enable the function "Mute internal speaker |
| 709 | * when the external headphone out jack is plugged" |
| 710 | */ |
| 711 | if (!(ass & 0x8000)) |
| 712 | return 1; |
| 713 | /* |
| 714 | * 10~8 : Jack location |
| 715 | * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered |
| 716 | * 14~13: Resvered |
| 717 | * 15 : 1 --> enable the function "Mute internal speaker |
| 718 | * when the external headphone out jack is plugged" |
| 719 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 720 | if (!spec->gen.autocfg.hp_pins[0] && |
| 721 | !(spec->gen.autocfg.line_out_pins[0] && |
| 722 | spec->gen.autocfg.line_out_type == AUTO_PIN_HP_OUT)) { |
Takashi Iwai | 01d4825 | 2009-10-06 13:21:54 +0200 | [diff] [blame] | 723 | hda_nid_t nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 724 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 725 | nid = ports[tmp]; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 726 | if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, |
| 727 | spec->gen.autocfg.line_outs)) |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 728 | return 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 729 | spec->gen.autocfg.hp_pins[0] = nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 730 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 731 | return 1; |
| 732 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 733 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 734 | /* Check the validity of ALC subsystem-id |
| 735 | * ports contains an array of 4 pin NIDs for port-A, E, D and I */ |
| 736 | 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] | 737 | { |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 738 | if (!alc_subsystem_id(codec, ports)) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 739 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 740 | codec_dbg(codec, |
| 741 | "realtek: Enable default setup for auto mode as fallback\n"); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 742 | spec->init_amp = ALC_INIT_DEFAULT; |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 743 | } |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 744 | } |
Takashi Iwai | 1a1455d | 2011-04-28 17:36:18 +0200 | [diff] [blame] | 745 | |
Takashi Iwai | 41e41f1 | 2005-06-08 14:48:49 +0200 | [diff] [blame] | 746 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 747 | */ |
| 748 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 749 | static void alc_fixup_inv_dmic(struct hda_codec *codec, |
| 750 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 751 | { |
| 752 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 668d1e9 | 2012-11-29 14:10:17 +0100 | [diff] [blame] | 753 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 754 | spec->gen.inv_dmic_split = 1; |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 755 | } |
| 756 | |
Takashi Iwai | 603c401 | 2008-07-30 15:01:44 +0200 | [diff] [blame] | 757 | |
Takashi Iwai | 67d634c | 2009-11-16 15:35:59 +0100 | [diff] [blame] | 758 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 759 | /* additional beep mixers; the actual parameters are overwritten at build */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 760 | static const struct snd_kcontrol_new alc_beep_mixer[] = { |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 761 | HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), |
Jaroslav Kysela | 123c07a | 2009-10-21 14:48:23 +0200 | [diff] [blame] | 762 | HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 763 | { } /* end */ |
| 764 | }; |
Takashi Iwai | 67d634c | 2009-11-16 15:35:59 +0100 | [diff] [blame] | 765 | #endif |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 766 | |
Takashi Iwai | 2eab694 | 2012-12-18 15:30:41 +0100 | [diff] [blame] | 767 | static int alc_build_controls(struct hda_codec *codec) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 768 | { |
| 769 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 666a70d | 2012-12-17 20:29:29 +0100 | [diff] [blame] | 770 | int i, err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 771 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 772 | err = snd_hda_gen_build_controls(codec); |
| 773 | if (err < 0) |
| 774 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 775 | |
| 776 | for (i = 0; i < spec->num_mixers; i++) { |
| 777 | err = snd_hda_add_new_ctls(codec, spec->mixers[i]); |
| 778 | if (err < 0) |
| 779 | return err; |
| 780 | } |
Takashi Iwai | 2134ea4 | 2008-01-10 16:53:55 +0100 | [diff] [blame] | 781 | |
Takashi Iwai | 67d634c | 2009-11-16 15:35:59 +0100 | [diff] [blame] | 782 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 783 | /* create beep controls if needed */ |
| 784 | if (spec->beep_amp) { |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 785 | const struct snd_kcontrol_new *knew; |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 786 | for (knew = alc_beep_mixer; knew->name; knew++) { |
| 787 | struct snd_kcontrol *kctl; |
| 788 | kctl = snd_ctl_new1(knew, codec); |
| 789 | if (!kctl) |
| 790 | return -ENOMEM; |
| 791 | kctl->private_value = spec->beep_amp; |
Jaroslav Kysela | 5e26dfd | 2009-12-10 13:57:01 +0100 | [diff] [blame] | 792 | err = snd_hda_ctl_add(codec, 0, kctl); |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 793 | if (err < 0) |
| 794 | return err; |
| 795 | } |
| 796 | } |
Takashi Iwai | 67d634c | 2009-11-16 15:35:59 +0100 | [diff] [blame] | 797 | #endif |
Takashi Iwai | 45bdd1c | 2009-02-06 16:11:25 +0100 | [diff] [blame] | 798 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 799 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 800 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 801 | } |
| 802 | |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 803 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 804 | /* |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 805 | * Common callbacks |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 806 | */ |
Takashi Iwai | 16ded52 | 2005-06-10 19:58:24 +0200 | [diff] [blame] | 807 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 808 | static int alc_init(struct hda_codec *codec) |
| 809 | { |
| 810 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 811 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 812 | if (spec->init_hook) |
| 813 | spec->init_hook(codec); |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 814 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 815 | alc_fix_pll(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 816 | alc_auto_init_amp(codec, spec->init_amp); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 817 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 818 | snd_hda_gen_init(codec); |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 819 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 820 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); |
Takashi Iwai | e08a007 | 2006-09-07 17:52:14 +0200 | [diff] [blame] | 821 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 822 | return 0; |
| 823 | } |
| 824 | |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 825 | static inline void alc_shutup(struct hda_codec *codec) |
| 826 | { |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 827 | struct alc_spec *spec = codec->spec; |
| 828 | |
Takashi Iwai | c7273bd | 2018-06-12 16:09:57 +0200 | [diff] [blame] | 829 | if (!snd_hda_get_bool_hint(codec, "shutup")) |
| 830 | return; /* disabled explicitly by hints */ |
| 831 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 832 | if (spec && spec->shutup) |
| 833 | spec->shutup(codec); |
Takashi Iwai | 9bfb284 | 2013-07-24 14:31:50 +0200 | [diff] [blame] | 834 | else |
| 835 | snd_hda_shutup_pins(codec); |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 836 | } |
| 837 | |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 838 | static void alc_reboot_notify(struct hda_codec *codec) |
| 839 | { |
| 840 | struct alc_spec *spec = codec->spec; |
| 841 | |
| 842 | if (spec && spec->reboot_notify) |
| 843 | spec->reboot_notify(codec); |
| 844 | else |
| 845 | alc_shutup(codec); |
| 846 | } |
| 847 | |
| 848 | /* power down codec to D3 at reboot/shutdown; set as reboot_notify ops */ |
| 849 | static void alc_d3_at_reboot(struct hda_codec *codec) |
| 850 | { |
| 851 | snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3); |
| 852 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 853 | AC_VERB_SET_POWER_STATE, AC_PWRST_D3); |
| 854 | msleep(10); |
| 855 | } |
| 856 | |
Takashi Iwai | 8a02c0c | 2014-02-10 18:09:45 +0100 | [diff] [blame] | 857 | #define alc_free snd_hda_gen_free |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 858 | |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 859 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 860 | static void alc_power_eapd(struct hda_codec *codec) |
| 861 | { |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 862 | alc_auto_setup_eapd(codec, false); |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 863 | } |
| 864 | |
Takashi Iwai | 68cb2b5 | 2012-07-02 15:20:37 +0200 | [diff] [blame] | 865 | static int alc_suspend(struct hda_codec *codec) |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 866 | { |
| 867 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 868 | alc_shutup(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 869 | if (spec && spec->power_hook) |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 870 | spec->power_hook(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 871 | return 0; |
| 872 | } |
| 873 | #endif |
| 874 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 875 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 876 | static int alc_resume(struct hda_codec *codec) |
| 877 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 878 | struct alc_spec *spec = codec->spec; |
| 879 | |
| 880 | if (!spec->no_depop_delay) |
| 881 | msleep(150); /* to avoid pop noise */ |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 882 | codec->patch_ops.init(codec); |
Takashi Iwai | eeecd9d | 2015-02-25 15:18:50 +0100 | [diff] [blame] | 883 | regcache_sync(codec->core.regmap); |
Takashi Iwai | 9e5341b | 2010-09-21 09:57:06 +0200 | [diff] [blame] | 884 | hda_call_check_power_status(codec, 0x01); |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 885 | return 0; |
| 886 | } |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 887 | #endif |
| 888 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 889 | /* |
| 890 | */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 891 | static const struct hda_codec_ops alc_patch_ops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 892 | .build_controls = alc_build_controls, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 893 | .build_pcms = snd_hda_gen_build_pcms, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 894 | .init = alc_init, |
| 895 | .free = alc_free, |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 896 | .unsol_event = snd_hda_jack_unsol_event, |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 897 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 898 | .resume = alc_resume, |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 899 | .suspend = alc_suspend, |
Takashi Iwai | fce52a3 | 2013-01-07 12:42:48 +0100 | [diff] [blame] | 900 | .check_power_status = snd_hda_gen_check_power_status, |
Takashi Iwai | cb53c62 | 2007-08-10 17:21:45 +0200 | [diff] [blame] | 901 | #endif |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 902 | .reboot_notify = alc_reboot_notify, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 903 | }; |
| 904 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 905 | |
Takashi Iwai | ded255b | 2015-10-01 17:59:43 +0200 | [diff] [blame] | 906 | #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name) |
Kailang Yang | c027ddc | 2010-03-19 11:33:06 +0100 | [diff] [blame] | 907 | |
Takashi Iwai | 2fa522b | 2005-05-12 14:51:12 +0200 | [diff] [blame] | 908 | /* |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 909 | * Rename codecs appropriately from COEF value or subvendor id |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 910 | */ |
| 911 | struct alc_codec_rename_table { |
| 912 | unsigned int vendor_id; |
| 913 | unsigned short coef_mask; |
| 914 | unsigned short coef_bits; |
| 915 | const char *name; |
| 916 | }; |
| 917 | |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 918 | struct alc_codec_rename_pci_table { |
| 919 | unsigned int codec_vendor_id; |
| 920 | unsigned short pci_subvendor; |
| 921 | unsigned short pci_subdevice; |
| 922 | const char *name; |
| 923 | }; |
| 924 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 925 | static struct alc_codec_rename_table rename_tbl[] = { |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 926 | { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 927 | { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, |
| 928 | { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, |
| 929 | { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, |
| 930 | { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, |
| 931 | { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, |
| 932 | { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, |
| 933 | { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 934 | { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 935 | { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 936 | { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, |
| 937 | { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, |
| 938 | { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, |
| 939 | { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, |
| 940 | { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, |
| 941 | { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, |
| 942 | { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, |
| 943 | { } /* terminator */ |
| 944 | }; |
| 945 | |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 946 | static struct alc_codec_rename_pci_table rename_pci_tbl[] = { |
| 947 | { 0x10ec0280, 0x1028, 0, "ALC3220" }, |
| 948 | { 0x10ec0282, 0x1028, 0, "ALC3221" }, |
| 949 | { 0x10ec0283, 0x1028, 0, "ALC3223" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 950 | { 0x10ec0288, 0x1028, 0, "ALC3263" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 951 | { 0x10ec0292, 0x1028, 0, "ALC3226" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 952 | { 0x10ec0293, 0x1028, 0, "ALC3235" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 953 | { 0x10ec0255, 0x1028, 0, "ALC3234" }, |
| 954 | { 0x10ec0668, 0x1028, 0, "ALC3661" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 955 | { 0x10ec0275, 0x1028, 0, "ALC3260" }, |
| 956 | { 0x10ec0899, 0x1028, 0, "ALC3861" }, |
Kailang Yang | 2c674fa | 2015-05-05 15:02:42 +0800 | [diff] [blame] | 957 | { 0x10ec0298, 0x1028, 0, "ALC3266" }, |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 958 | { 0x10ec0236, 0x1028, 0, "ALC3204" }, |
Kailang Yang | 8232450 | 2015-05-25 17:16:49 +0800 | [diff] [blame] | 959 | { 0x10ec0256, 0x1028, 0, "ALC3246" }, |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 960 | { 0x10ec0225, 0x1028, 0, "ALC3253" }, |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 961 | { 0x10ec0295, 0x1028, 0, "ALC3254" }, |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 962 | { 0x10ec0299, 0x1028, 0, "ALC3271" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 963 | { 0x10ec0670, 0x1025, 0, "ALC669X" }, |
| 964 | { 0x10ec0676, 0x1025, 0, "ALC679X" }, |
| 965 | { 0x10ec0282, 0x1043, 0, "ALC3229" }, |
| 966 | { 0x10ec0233, 0x1043, 0, "ALC3236" }, |
| 967 | { 0x10ec0280, 0x103c, 0, "ALC3228" }, |
| 968 | { 0x10ec0282, 0x103c, 0, "ALC3227" }, |
| 969 | { 0x10ec0286, 0x103c, 0, "ALC3242" }, |
| 970 | { 0x10ec0290, 0x103c, 0, "ALC3241" }, |
| 971 | { 0x10ec0668, 0x103c, 0, "ALC3662" }, |
| 972 | { 0x10ec0283, 0x17aa, 0, "ALC3239" }, |
| 973 | { 0x10ec0292, 0x17aa, 0, "ALC3232" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 974 | { } /* terminator */ |
| 975 | }; |
| 976 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 977 | static int alc_codec_rename_from_preset(struct hda_codec *codec) |
| 978 | { |
| 979 | const struct alc_codec_rename_table *p; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 980 | const struct alc_codec_rename_pci_table *q; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 981 | |
| 982 | for (p = rename_tbl; p->vendor_id; p++) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 983 | if (p->vendor_id != codec->core.vendor_id) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 984 | continue; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 985 | if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 986 | return alc_codec_rename(codec, p->name); |
| 987 | } |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 988 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 989 | if (!codec->bus->pci) |
| 990 | return 0; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 991 | for (q = rename_pci_tbl; q->codec_vendor_id; q++) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 992 | if (q->codec_vendor_id != codec->core.vendor_id) |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 993 | continue; |
| 994 | if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) |
| 995 | continue; |
| 996 | if (!q->pci_subdevice || |
| 997 | q->pci_subdevice == codec->bus->pci->subsystem_device) |
| 998 | return alc_codec_rename(codec, q->name); |
| 999 | } |
| 1000 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1001 | return 0; |
| 1002 | } |
| 1003 | |
Takashi Iwai | e477062 | 2011-07-08 11:11:35 +0200 | [diff] [blame] | 1004 | |
| 1005 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1006 | * Digital-beep handlers |
| 1007 | */ |
| 1008 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
| 1009 | #define set_beep_amp(spec, nid, idx, dir) \ |
| 1010 | ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) |
| 1011 | |
| 1012 | static const struct snd_pci_quirk beep_white_list[] = { |
Duncan Roe | 7110005 | 2012-10-10 14:19:50 +0200 | [diff] [blame] | 1013 | SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), |
W. Trevor King | a4b7f21d | 2014-03-29 17:47:24 -0700 | [diff] [blame] | 1014 | SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1015 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), |
Takashi Iwai | 8554ee4 | 2013-02-25 09:54:43 +0100 | [diff] [blame] | 1016 | SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1017 | SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), |
| 1018 | SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), |
| 1019 | SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), |
Takashi Iwai | 78f8baf | 2012-03-06 14:02:32 +0100 | [diff] [blame] | 1020 | SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1021 | SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), |
| 1022 | {} |
| 1023 | }; |
| 1024 | |
| 1025 | static inline int has_cdefine_beep(struct hda_codec *codec) |
| 1026 | { |
| 1027 | struct alc_spec *spec = codec->spec; |
| 1028 | const struct snd_pci_quirk *q; |
| 1029 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list); |
| 1030 | if (q) |
| 1031 | return q->value; |
| 1032 | return spec->cdefine.enable_pcbeep; |
| 1033 | } |
| 1034 | #else |
| 1035 | #define set_beep_amp(spec, nid, idx, dir) /* NOP */ |
| 1036 | #define has_cdefine_beep(codec) 0 |
| 1037 | #endif |
| 1038 | |
| 1039 | /* parse the BIOS configuration and set up the alc_spec */ |
| 1040 | /* return 1 if successful, 0 if the proper config is not found, |
| 1041 | * or a negative error code |
| 1042 | */ |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1043 | static int alc_parse_auto_config(struct hda_codec *codec, |
| 1044 | const hda_nid_t *ignore_nids, |
| 1045 | const hda_nid_t *ssid_nids) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1046 | { |
| 1047 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1048 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1049 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1050 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 1051 | err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, |
| 1052 | spec->parse_flags); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1053 | if (err < 0) |
| 1054 | return err; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1055 | |
| 1056 | if (ssid_nids) |
| 1057 | alc_ssid_check(codec, ssid_nids); |
| 1058 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1059 | err = snd_hda_gen_parse_auto_config(codec, cfg); |
| 1060 | if (err < 0) |
| 1061 | return err; |
Takashi Iwai | 070cff4 | 2012-02-21 12:54:17 +0100 | [diff] [blame] | 1062 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1063 | return 1; |
| 1064 | } |
| 1065 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1066 | /* common preparation job for alc_spec */ |
| 1067 | static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) |
| 1068 | { |
| 1069 | struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
| 1070 | int err; |
| 1071 | |
| 1072 | if (!spec) |
| 1073 | return -ENOMEM; |
| 1074 | codec->spec = spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1075 | snd_hda_gen_spec_init(&spec->gen); |
| 1076 | spec->gen.mixer_nid = mixer_nid; |
| 1077 | spec->gen.own_eapd_ctl = 1; |
Takashi Iwai | 1098b7c | 2012-12-17 20:03:15 +0100 | [diff] [blame] | 1078 | codec->single_adc_amp = 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1079 | /* FIXME: do we need this for all Realtek codec models? */ |
| 1080 | codec->spdif_status_reset = 1; |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1081 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1082 | |
| 1083 | err = alc_codec_rename_from_preset(codec); |
| 1084 | if (err < 0) { |
| 1085 | kfree(spec); |
| 1086 | return err; |
| 1087 | } |
| 1088 | return 0; |
| 1089 | } |
| 1090 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1091 | static int alc880_parse_auto_config(struct hda_codec *codec) |
| 1092 | { |
| 1093 | static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 1094 | static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1095 | return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); |
| 1096 | } |
| 1097 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1098 | /* |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1099 | * ALC880 fix-ups |
| 1100 | */ |
| 1101 | enum { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1102 | ALC880_FIXUP_GPIO1, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1103 | ALC880_FIXUP_GPIO2, |
| 1104 | ALC880_FIXUP_MEDION_RIM, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1105 | ALC880_FIXUP_LG, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1106 | ALC880_FIXUP_LG_LW25, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1107 | ALC880_FIXUP_W810, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1108 | ALC880_FIXUP_EAPD_COEF, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1109 | ALC880_FIXUP_TCL_S700, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1110 | ALC880_FIXUP_VOL_KNOB, |
| 1111 | ALC880_FIXUP_FUJITSU, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1112 | ALC880_FIXUP_F1734, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1113 | ALC880_FIXUP_UNIWILL, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1114 | ALC880_FIXUP_UNIWILL_DIG, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1115 | ALC880_FIXUP_Z71V, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1116 | ALC880_FIXUP_ASUS_W5A, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1117 | ALC880_FIXUP_3ST_BASE, |
| 1118 | ALC880_FIXUP_3ST, |
| 1119 | ALC880_FIXUP_3ST_DIG, |
| 1120 | ALC880_FIXUP_5ST_BASE, |
| 1121 | ALC880_FIXUP_5ST, |
| 1122 | ALC880_FIXUP_5ST_DIG, |
| 1123 | ALC880_FIXUP_6ST_BASE, |
| 1124 | ALC880_FIXUP_6ST, |
| 1125 | ALC880_FIXUP_6ST_DIG, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1126 | ALC880_FIXUP_6ST_AUTOMUTE, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1127 | }; |
| 1128 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1129 | /* enable the volume-knob widget support on NID 0x21 */ |
| 1130 | static void alc880_fixup_vol_knob(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1131 | const struct hda_fixup *fix, int action) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1132 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1133 | if (action == HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1134 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
| 1135 | alc_update_knob_master); |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1136 | } |
| 1137 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1138 | static const struct hda_fixup alc880_fixups[] = { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1139 | [ALC880_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 1140 | .type = HDA_FIXUP_FUNC, |
| 1141 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1142 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1143 | [ALC880_FIXUP_GPIO2] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 1144 | .type = HDA_FIXUP_FUNC, |
| 1145 | .v.func = alc_fixup_gpio2, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1146 | }, |
| 1147 | [ALC880_FIXUP_MEDION_RIM] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1148 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1149 | .v.verbs = (const struct hda_verb[]) { |
| 1150 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1151 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1152 | { } |
| 1153 | }, |
| 1154 | .chained = true, |
| 1155 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1156 | }, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1157 | [ALC880_FIXUP_LG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1158 | .type = HDA_FIXUP_PINS, |
| 1159 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1160 | /* disable bogus unused pins */ |
| 1161 | { 0x16, 0x411111f0 }, |
| 1162 | { 0x18, 0x411111f0 }, |
| 1163 | { 0x1a, 0x411111f0 }, |
| 1164 | { } |
| 1165 | } |
| 1166 | }, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1167 | [ALC880_FIXUP_LG_LW25] = { |
| 1168 | .type = HDA_FIXUP_PINS, |
| 1169 | .v.pins = (const struct hda_pintbl[]) { |
| 1170 | { 0x1a, 0x0181344f }, /* line-in */ |
| 1171 | { 0x1b, 0x0321403f }, /* headphone */ |
| 1172 | { } |
| 1173 | } |
| 1174 | }, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1175 | [ALC880_FIXUP_W810] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1176 | .type = HDA_FIXUP_PINS, |
| 1177 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1178 | /* disable bogus unused pins */ |
| 1179 | { 0x17, 0x411111f0 }, |
| 1180 | { } |
| 1181 | }, |
| 1182 | .chained = true, |
| 1183 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1184 | }, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1185 | [ALC880_FIXUP_EAPD_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1186 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1187 | .v.verbs = (const struct hda_verb[]) { |
| 1188 | /* change to EAPD mode */ |
| 1189 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1190 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1191 | {} |
| 1192 | }, |
| 1193 | }, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1194 | [ALC880_FIXUP_TCL_S700] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1195 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1196 | .v.verbs = (const struct hda_verb[]) { |
| 1197 | /* change to EAPD mode */ |
| 1198 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1199 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 1200 | {} |
| 1201 | }, |
| 1202 | .chained = true, |
| 1203 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1204 | }, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1205 | [ALC880_FIXUP_VOL_KNOB] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1206 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1207 | .v.func = alc880_fixup_vol_knob, |
| 1208 | }, |
| 1209 | [ALC880_FIXUP_FUJITSU] = { |
| 1210 | /* override all pins as BIOS on old Amilo is broken */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1211 | .type = HDA_FIXUP_PINS, |
| 1212 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | bb148bd | 2015-08-13 18:02:39 +0200 | [diff] [blame] | 1213 | { 0x14, 0x0121401f }, /* HP */ |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1214 | { 0x15, 0x99030120 }, /* speaker */ |
| 1215 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1216 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1217 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1218 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1219 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1220 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1221 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1222 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1223 | { 0x1e, 0x01454140 }, /* SPDIF out */ |
| 1224 | { } |
| 1225 | }, |
| 1226 | .chained = true, |
| 1227 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1228 | }, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1229 | [ALC880_FIXUP_F1734] = { |
| 1230 | /* almost compatible with FUJITSU, but no bass and SPDIF */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1231 | .type = HDA_FIXUP_PINS, |
| 1232 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | bb148bd | 2015-08-13 18:02:39 +0200 | [diff] [blame] | 1233 | { 0x14, 0x0121401f }, /* HP */ |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1234 | { 0x15, 0x99030120 }, /* speaker */ |
| 1235 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1236 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1237 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1238 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1239 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1240 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1241 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1242 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1243 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1244 | { } |
| 1245 | }, |
| 1246 | .chained = true, |
| 1247 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1248 | }, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1249 | [ALC880_FIXUP_UNIWILL] = { |
| 1250 | /* need to fix HP and speaker pins to be parsed correctly */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1251 | .type = HDA_FIXUP_PINS, |
| 1252 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1253 | { 0x14, 0x0121411f }, /* HP */ |
| 1254 | { 0x15, 0x99030120 }, /* speaker */ |
| 1255 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1256 | { } |
| 1257 | }, |
| 1258 | }, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1259 | [ALC880_FIXUP_UNIWILL_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1260 | .type = HDA_FIXUP_PINS, |
| 1261 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1262 | /* disable bogus unused pins */ |
| 1263 | { 0x17, 0x411111f0 }, |
| 1264 | { 0x19, 0x411111f0 }, |
| 1265 | { 0x1b, 0x411111f0 }, |
| 1266 | { 0x1f, 0x411111f0 }, |
| 1267 | { } |
| 1268 | } |
| 1269 | }, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1270 | [ALC880_FIXUP_Z71V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1271 | .type = HDA_FIXUP_PINS, |
| 1272 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1273 | /* set up the whole pins as BIOS is utterly broken */ |
| 1274 | { 0x14, 0x99030120 }, /* speaker */ |
| 1275 | { 0x15, 0x0121411f }, /* HP */ |
| 1276 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1277 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1278 | { 0x18, 0x01a19950 }, /* mic-in */ |
| 1279 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1280 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1281 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1282 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1283 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1284 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1285 | { } |
| 1286 | } |
| 1287 | }, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1288 | [ALC880_FIXUP_ASUS_W5A] = { |
| 1289 | .type = HDA_FIXUP_PINS, |
| 1290 | .v.pins = (const struct hda_pintbl[]) { |
| 1291 | /* set up the whole pins as BIOS is utterly broken */ |
| 1292 | { 0x14, 0x0121411f }, /* HP */ |
| 1293 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1294 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1295 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1296 | { 0x18, 0x90a60160 }, /* mic */ |
| 1297 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1298 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1299 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1300 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1301 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1302 | { 0x1e, 0xb743111e }, /* SPDIF out */ |
| 1303 | { } |
| 1304 | }, |
| 1305 | .chained = true, |
| 1306 | .chain_id = ALC880_FIXUP_GPIO1, |
| 1307 | }, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1308 | [ALC880_FIXUP_3ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1309 | .type = HDA_FIXUP_PINS, |
| 1310 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1311 | { 0x14, 0x01014010 }, /* line-out */ |
| 1312 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1313 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1314 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1315 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1316 | { 0x19, 0x0121411f }, /* HP */ |
| 1317 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1318 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1319 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1320 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1321 | /* 0x1e is filled in below */ |
| 1322 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1323 | { } |
| 1324 | } |
| 1325 | }, |
| 1326 | [ALC880_FIXUP_3ST] = { |
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, 0x411111f0 }, /* N/A */ |
| 1330 | { } |
| 1331 | }, |
| 1332 | .chained = true, |
| 1333 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1334 | }, |
| 1335 | [ALC880_FIXUP_3ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1336 | .type = HDA_FIXUP_PINS, |
| 1337 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1338 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1339 | { } |
| 1340 | }, |
| 1341 | .chained = true, |
| 1342 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1343 | }, |
| 1344 | [ALC880_FIXUP_5ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1345 | .type = HDA_FIXUP_PINS, |
| 1346 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1347 | { 0x14, 0x01014010 }, /* front */ |
| 1348 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1349 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1350 | { 0x17, 0x01016412 }, /* surr */ |
| 1351 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1352 | { 0x19, 0x0121411f }, /* HP */ |
| 1353 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1354 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1355 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1356 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1357 | /* 0x1e is filled in below */ |
| 1358 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1359 | { } |
| 1360 | } |
| 1361 | }, |
| 1362 | [ALC880_FIXUP_5ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1363 | .type = HDA_FIXUP_PINS, |
| 1364 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1365 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1366 | { } |
| 1367 | }, |
| 1368 | .chained = true, |
| 1369 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1370 | }, |
| 1371 | [ALC880_FIXUP_5ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1372 | .type = HDA_FIXUP_PINS, |
| 1373 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1374 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1375 | { } |
| 1376 | }, |
| 1377 | .chained = true, |
| 1378 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1379 | }, |
| 1380 | [ALC880_FIXUP_6ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1381 | .type = HDA_FIXUP_PINS, |
| 1382 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1383 | { 0x14, 0x01014010 }, /* front */ |
| 1384 | { 0x15, 0x01016412 }, /* surr */ |
| 1385 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1386 | { 0x17, 0x01012414 }, /* side */ |
| 1387 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1388 | { 0x19, 0x02a19c40 }, /* front-mic */ |
| 1389 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1390 | { 0x1b, 0x0121411f }, /* HP */ |
| 1391 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1392 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1393 | /* 0x1e is filled in below */ |
| 1394 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1395 | { } |
| 1396 | } |
| 1397 | }, |
| 1398 | [ALC880_FIXUP_6ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1399 | .type = HDA_FIXUP_PINS, |
| 1400 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1401 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1402 | { } |
| 1403 | }, |
| 1404 | .chained = true, |
| 1405 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1406 | }, |
| 1407 | [ALC880_FIXUP_6ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1408 | .type = HDA_FIXUP_PINS, |
| 1409 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1410 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1411 | { } |
| 1412 | }, |
| 1413 | .chained = true, |
| 1414 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1415 | }, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1416 | [ALC880_FIXUP_6ST_AUTOMUTE] = { |
| 1417 | .type = HDA_FIXUP_PINS, |
| 1418 | .v.pins = (const struct hda_pintbl[]) { |
| 1419 | { 0x1b, 0x0121401f }, /* HP with jack detect */ |
| 1420 | { } |
| 1421 | }, |
| 1422 | .chained_before = true, |
| 1423 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1424 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1425 | }; |
| 1426 | |
| 1427 | static const struct snd_pci_quirk alc880_fixup_tbl[] = { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1428 | SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1429 | SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1430 | SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1431 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), |
David Henningsson | 6538de0 | 2014-06-10 10:52:50 +0200 | [diff] [blame] | 1432 | SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1433 | SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1434 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1435 | SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1436 | SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1437 | SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), |
Takashi Iwai | 7833c7e | 2012-02-20 17:11:38 +0100 | [diff] [blame] | 1438 | SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1439 | SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1440 | SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1441 | SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | a161574 | 2015-08-13 18:05:06 +0200 | [diff] [blame] | 1442 | SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1443 | SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1444 | SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1445 | SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1446 | SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), |
| 1447 | SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), |
| 1448 | SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1449 | SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1450 | SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1451 | |
| 1452 | /* Below is the copied entries from alc880_quirks.c. |
| 1453 | * It's not quite sure whether BIOS sets the correct pin-config table |
| 1454 | * on these machines, thus they are kept to be compatible with |
| 1455 | * the old static quirks. Once when it's confirmed to work without |
| 1456 | * these overrides, it'd be better to remove. |
| 1457 | */ |
| 1458 | SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), |
| 1459 | SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), |
| 1460 | SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1461 | SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1462 | SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1463 | SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1464 | SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1465 | SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), |
| 1466 | SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), |
| 1467 | SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), |
| 1468 | SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), |
| 1469 | SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), |
| 1470 | SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), |
| 1471 | SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), |
| 1472 | SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), |
| 1473 | SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), |
| 1474 | SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), |
| 1475 | SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), |
| 1476 | SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), |
| 1477 | SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), |
| 1478 | SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), |
| 1479 | SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ |
| 1480 | SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), |
| 1481 | SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1482 | SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1483 | SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1484 | SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1485 | SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1486 | SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1487 | SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1488 | SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1489 | SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1490 | SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1491 | /* default Intel */ |
| 1492 | SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), |
| 1493 | SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), |
| 1494 | SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), |
| 1495 | {} |
| 1496 | }; |
| 1497 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1498 | static const struct hda_model_fixup alc880_fixup_models[] = { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1499 | {.id = ALC880_FIXUP_3ST, .name = "3stack"}, |
| 1500 | {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, |
| 1501 | {.id = ALC880_FIXUP_5ST, .name = "5stack"}, |
| 1502 | {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, |
| 1503 | {.id = ALC880_FIXUP_6ST, .name = "6stack"}, |
| 1504 | {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1505 | {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1506 | {} |
| 1507 | }; |
| 1508 | |
| 1509 | |
| 1510 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1511 | * OK, here we have finally the patch for ALC880 |
| 1512 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1513 | static int patch_alc880(struct hda_codec *codec) |
| 1514 | { |
| 1515 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1516 | int err; |
| 1517 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1518 | err = alc_alloc_spec(codec, 0x0b); |
| 1519 | if (err < 0) |
| 1520 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1521 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1522 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1523 | spec->gen.need_dac_fix = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1524 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1525 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1526 | codec->patch_ops.unsol_event = alc880_unsol_event; |
| 1527 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1528 | snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1529 | alc880_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1530 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1531 | |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1532 | /* automatic parse from the BIOS config */ |
| 1533 | err = alc880_parse_auto_config(codec); |
| 1534 | if (err < 0) |
| 1535 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1536 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1537 | if (!spec->gen.no_analog) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1538 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1539 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1540 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1541 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1542 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1543 | |
| 1544 | error: |
| 1545 | alc_free(codec); |
| 1546 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1547 | } |
| 1548 | |
| 1549 | |
| 1550 | /* |
| 1551 | * ALC260 support |
| 1552 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1553 | static int alc260_parse_auto_config(struct hda_codec *codec) |
| 1554 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1555 | static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1556 | static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; |
| 1557 | return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1558 | } |
| 1559 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1560 | /* |
| 1561 | * Pin config fixes |
| 1562 | */ |
| 1563 | enum { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1564 | ALC260_FIXUP_HP_DC5750, |
| 1565 | ALC260_FIXUP_HP_PIN_0F, |
| 1566 | ALC260_FIXUP_COEF, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1567 | ALC260_FIXUP_GPIO1, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1568 | ALC260_FIXUP_GPIO1_TOGGLE, |
| 1569 | ALC260_FIXUP_REPLACER, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1570 | ALC260_FIXUP_HP_B1900, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1571 | ALC260_FIXUP_KN1, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1572 | ALC260_FIXUP_FSC_S7020, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1573 | ALC260_FIXUP_FSC_S7020_JWSE, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1574 | ALC260_FIXUP_VAIO_PINS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1575 | }; |
| 1576 | |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1577 | static void alc260_gpio1_automute(struct hda_codec *codec) |
| 1578 | { |
| 1579 | struct alc_spec *spec = codec->spec; |
| 1580 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1581 | spec->gen.hp_jack_present); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1582 | } |
| 1583 | |
| 1584 | static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1585 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1586 | { |
| 1587 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1588 | if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1589 | /* although the machine has only one output pin, we need to |
| 1590 | * toggle GPIO1 according to the jack state |
| 1591 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1592 | spec->gen.automute_hook = alc260_gpio1_automute; |
| 1593 | spec->gen.detect_hp = 1; |
| 1594 | spec->gen.automute_speaker = 1; |
| 1595 | spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1596 | snd_hda_jack_detect_enable_callback(codec, 0x0f, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1597 | snd_hda_gen_hp_automute); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 1598 | alc_setup_gpio(codec, 0x01); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1599 | } |
| 1600 | } |
| 1601 | |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1602 | static void alc260_fixup_kn1(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1603 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1604 | { |
| 1605 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1606 | static const struct hda_pintbl pincfgs[] = { |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1607 | { 0x0f, 0x02214000 }, /* HP/speaker */ |
| 1608 | { 0x12, 0x90a60160 }, /* int mic */ |
| 1609 | { 0x13, 0x02a19000 }, /* ext mic */ |
| 1610 | { 0x18, 0x01446000 }, /* SPDIF out */ |
| 1611 | /* disable bogus I/O pins */ |
| 1612 | { 0x10, 0x411111f0 }, |
| 1613 | { 0x11, 0x411111f0 }, |
| 1614 | { 0x14, 0x411111f0 }, |
| 1615 | { 0x15, 0x411111f0 }, |
| 1616 | { 0x16, 0x411111f0 }, |
| 1617 | { 0x17, 0x411111f0 }, |
| 1618 | { 0x19, 0x411111f0 }, |
| 1619 | { } |
| 1620 | }; |
| 1621 | |
| 1622 | switch (action) { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1623 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 1624 | snd_hda_apply_pincfgs(codec, pincfgs); |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1625 | spec->init_amp = ALC_INIT_NONE; |
| 1626 | break; |
| 1627 | } |
| 1628 | } |
| 1629 | |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1630 | static void alc260_fixup_fsc_s7020(struct hda_codec *codec, |
| 1631 | const struct hda_fixup *fix, int action) |
| 1632 | { |
| 1633 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 1634 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1635 | spec->init_amp = ALC_INIT_NONE; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1636 | } |
| 1637 | |
| 1638 | static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, |
| 1639 | const struct hda_fixup *fix, int action) |
| 1640 | { |
| 1641 | struct alc_spec *spec = codec->spec; |
| 1642 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | f811c3c | 2013-03-07 18:32:59 +0100 | [diff] [blame] | 1643 | spec->gen.add_jack_modes = 1; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1644 | spec->gen.hp_mic = 1; |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1645 | } |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1646 | } |
| 1647 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1648 | static const struct hda_fixup alc260_fixups[] = { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1649 | [ALC260_FIXUP_HP_DC5750] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1650 | .type = HDA_FIXUP_PINS, |
| 1651 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1652 | { 0x11, 0x90130110 }, /* speaker */ |
| 1653 | { } |
| 1654 | } |
| 1655 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1656 | [ALC260_FIXUP_HP_PIN_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1657 | .type = HDA_FIXUP_PINS, |
| 1658 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1659 | { 0x0f, 0x01214000 }, /* HP */ |
| 1660 | { } |
| 1661 | } |
| 1662 | }, |
| 1663 | [ALC260_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1664 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1665 | .v.verbs = (const struct hda_verb[]) { |
Ronan Marquet | e30cf2d | 2014-06-01 18:38:53 +0200 | [diff] [blame] | 1666 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1667 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1668 | { } |
| 1669 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1670 | }, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1671 | [ALC260_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 1672 | .type = HDA_FIXUP_FUNC, |
| 1673 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1674 | }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1675 | [ALC260_FIXUP_GPIO1_TOGGLE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1676 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1677 | .v.func = alc260_fixup_gpio1_toggle, |
| 1678 | .chained = true, |
| 1679 | .chain_id = ALC260_FIXUP_HP_PIN_0F, |
| 1680 | }, |
| 1681 | [ALC260_FIXUP_REPLACER] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1682 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1683 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | 192a98e | 2014-06-02 15:16:07 +0200 | [diff] [blame] | 1684 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1685 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1686 | { } |
| 1687 | }, |
| 1688 | .chained = true, |
| 1689 | .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, |
| 1690 | }, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1691 | [ALC260_FIXUP_HP_B1900] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1692 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1693 | .v.func = alc260_fixup_gpio1_toggle, |
| 1694 | .chained = true, |
| 1695 | .chain_id = ALC260_FIXUP_COEF, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1696 | }, |
| 1697 | [ALC260_FIXUP_KN1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1698 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1699 | .v.func = alc260_fixup_kn1, |
| 1700 | }, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1701 | [ALC260_FIXUP_FSC_S7020] = { |
| 1702 | .type = HDA_FIXUP_FUNC, |
| 1703 | .v.func = alc260_fixup_fsc_s7020, |
| 1704 | }, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1705 | [ALC260_FIXUP_FSC_S7020_JWSE] = { |
| 1706 | .type = HDA_FIXUP_FUNC, |
| 1707 | .v.func = alc260_fixup_fsc_s7020_jwse, |
| 1708 | .chained = true, |
| 1709 | .chain_id = ALC260_FIXUP_FSC_S7020, |
| 1710 | }, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1711 | [ALC260_FIXUP_VAIO_PINS] = { |
| 1712 | .type = HDA_FIXUP_PINS, |
| 1713 | .v.pins = (const struct hda_pintbl[]) { |
| 1714 | /* Pin configs are missing completely on some VAIOs */ |
| 1715 | { 0x0f, 0x01211020 }, |
| 1716 | { 0x10, 0x0001003f }, |
| 1717 | { 0x11, 0x411111f0 }, |
| 1718 | { 0x12, 0x01a15930 }, |
| 1719 | { 0x13, 0x411111f0 }, |
| 1720 | { 0x14, 0x411111f0 }, |
| 1721 | { 0x15, 0x411111f0 }, |
| 1722 | { 0x16, 0x411111f0 }, |
| 1723 | { 0x17, 0x411111f0 }, |
| 1724 | { 0x18, 0x411111f0 }, |
| 1725 | { 0x19, 0x411111f0 }, |
| 1726 | { } |
| 1727 | } |
| 1728 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1729 | }; |
| 1730 | |
| 1731 | static const struct snd_pci_quirk alc260_fixup_tbl[] = { |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1732 | SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1733 | SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1734 | SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1735 | SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1736 | SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1737 | SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), |
Takashi Iwai | 0f5a5b8 | 2013-11-21 09:12:52 +0100 | [diff] [blame] | 1738 | 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] | 1739 | SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), |
Takashi Iwai | b1f5808 | 2012-02-16 12:45:03 +0100 | [diff] [blame] | 1740 | SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1741 | SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1742 | SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1743 | SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1744 | {} |
| 1745 | }; |
| 1746 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1747 | static const struct hda_model_fixup alc260_fixup_models[] = { |
| 1748 | {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, |
| 1749 | {.id = ALC260_FIXUP_COEF, .name = "coef"}, |
| 1750 | {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, |
| 1751 | {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, |
| 1752 | {} |
| 1753 | }; |
| 1754 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1755 | /* |
| 1756 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1757 | static int patch_alc260(struct hda_codec *codec) |
| 1758 | { |
| 1759 | struct alc_spec *spec; |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1760 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1761 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1762 | err = alc_alloc_spec(codec, 0x07); |
| 1763 | if (err < 0) |
| 1764 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1765 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1766 | spec = codec->spec; |
Takashi Iwai | ea46c3c | 2013-01-15 18:45:53 +0100 | [diff] [blame] | 1767 | /* as quite a few machines require HP amp for speaker outputs, |
| 1768 | * it's easier to enable it unconditionally; even if it's unneeded, |
| 1769 | * it's almost harmless. |
| 1770 | */ |
| 1771 | spec->gen.prefer_hp_amp = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1772 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1773 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1774 | spec->shutup = alc_eapd_shutup; |
| 1775 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1776 | snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, |
| 1777 | alc260_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1778 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1779 | |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1780 | /* automatic parse from the BIOS config */ |
| 1781 | err = alc260_parse_auto_config(codec); |
| 1782 | if (err < 0) |
| 1783 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1784 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1785 | if (!spec->gen.no_analog) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1786 | set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1787 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1788 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1789 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1790 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1791 | |
| 1792 | error: |
| 1793 | alc_free(codec); |
| 1794 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1795 | } |
| 1796 | |
| 1797 | |
| 1798 | /* |
| 1799 | * ALC882/883/885/888/889 support |
| 1800 | * |
| 1801 | * ALC882 is almost identical with ALC880 but has cleaner and more flexible |
| 1802 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 1803 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 1804 | * 6-channel independent captures. |
| 1805 | * |
| 1806 | * In addition, an independent DAC for the multi-playback (not used in this |
| 1807 | * driver yet). |
| 1808 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1809 | |
| 1810 | /* |
| 1811 | * Pin config fixes |
| 1812 | */ |
| 1813 | enum { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1814 | ALC882_FIXUP_ABIT_AW9D_MAX, |
| 1815 | ALC882_FIXUP_LENOVO_Y530, |
| 1816 | ALC882_FIXUP_PB_M5210, |
| 1817 | ALC882_FIXUP_ACER_ASPIRE_7736, |
| 1818 | ALC882_FIXUP_ASUS_W90V, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 1819 | ALC889_FIXUP_CD, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 1820 | ALC889_FIXUP_FRONT_HP_NO_PRESENCE, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1821 | ALC889_FIXUP_VAIO_TT, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 1822 | ALC888_FIXUP_EEE1601, |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 1823 | ALC882_FIXUP_EAPD, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 1824 | ALC883_FIXUP_EAPD, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 1825 | ALC883_FIXUP_ACER_EAPD, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1826 | ALC882_FIXUP_GPIO1, |
| 1827 | ALC882_FIXUP_GPIO2, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 1828 | ALC882_FIXUP_GPIO3, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1829 | ALC889_FIXUP_COEF, |
| 1830 | ALC882_FIXUP_ASUS_W2JC, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 1831 | ALC882_FIXUP_ACER_ASPIRE_4930G, |
| 1832 | ALC882_FIXUP_ACER_ASPIRE_8930G, |
| 1833 | ALC882_FIXUP_ASPIRE_8930G_VERBS, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1834 | ALC885_FIXUP_MACPRO_GPIO, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1835 | ALC889_FIXUP_DAC_ROUTE, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1836 | ALC889_FIXUP_MBP_VREF, |
| 1837 | ALC889_FIXUP_IMAC91_VREF, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 1838 | ALC889_FIXUP_MBA11_VREF, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1839 | ALC889_FIXUP_MBA21_VREF, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 1840 | ALC889_FIXUP_MP11_VREF, |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 1841 | ALC889_FIXUP_MP41_VREF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 1842 | ALC882_FIXUP_INV_DMIC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1843 | ALC882_FIXUP_NO_PRIMARY_HP, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 1844 | ALC887_FIXUP_ASUS_BASS, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 1845 | ALC887_FIXUP_BASS_CHMAP, |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 1846 | ALC1220_FIXUP_GB_DUAL_CODECS, |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 1847 | ALC1220_FIXUP_CLEVO_P950, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1848 | }; |
| 1849 | |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1850 | static void alc889_fixup_coef(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1851 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1852 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1853 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1854 | return; |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 1855 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1856 | } |
| 1857 | |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1858 | /* toggle speaker-output according to the hp-jack state */ |
| 1859 | static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted) |
| 1860 | { |
| 1861 | unsigned int gpiostate, gpiomask, gpiodir; |
| 1862 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1863 | gpiostate = snd_hda_codec_read(codec, codec->core.afg, 0, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1864 | AC_VERB_GET_GPIO_DATA, 0); |
| 1865 | |
| 1866 | if (!muted) |
| 1867 | gpiostate |= (1 << pin); |
| 1868 | else |
| 1869 | gpiostate &= ~(1 << pin); |
| 1870 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1871 | gpiomask = snd_hda_codec_read(codec, codec->core.afg, 0, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1872 | AC_VERB_GET_GPIO_MASK, 0); |
| 1873 | gpiomask |= (1 << pin); |
| 1874 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1875 | gpiodir = snd_hda_codec_read(codec, codec->core.afg, 0, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1876 | AC_VERB_GET_GPIO_DIRECTION, 0); |
| 1877 | gpiodir |= (1 << pin); |
| 1878 | |
| 1879 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1880 | snd_hda_codec_write(codec, codec->core.afg, 0, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1881 | AC_VERB_SET_GPIO_MASK, gpiomask); |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1882 | snd_hda_codec_write(codec, codec->core.afg, 0, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1883 | AC_VERB_SET_GPIO_DIRECTION, gpiodir); |
| 1884 | |
| 1885 | msleep(1); |
| 1886 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1887 | snd_hda_codec_write(codec, codec->core.afg, 0, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1888 | AC_VERB_SET_GPIO_DATA, gpiostate); |
| 1889 | } |
| 1890 | |
| 1891 | /* set up GPIO at initialization */ |
| 1892 | static void alc885_fixup_macpro_gpio(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1893 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1894 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1895 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1896 | return; |
| 1897 | alc882_gpio_mute(codec, 0, 0); |
| 1898 | alc882_gpio_mute(codec, 1, 0); |
| 1899 | } |
| 1900 | |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1901 | /* Fix the connection of some pins for ALC889: |
| 1902 | * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't |
| 1903 | * work correctly (bko#42740) |
| 1904 | */ |
| 1905 | static void alc889_fixup_dac_route(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1906 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1907 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1908 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1909 | /* fake the connections during parsing the tree */ |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1910 | hda_nid_t conn1[2] = { 0x0c, 0x0d }; |
| 1911 | hda_nid_t conn2[2] = { 0x0e, 0x0f }; |
| 1912 | snd_hda_override_conn_list(codec, 0x14, 2, conn1); |
| 1913 | snd_hda_override_conn_list(codec, 0x15, 2, conn1); |
| 1914 | snd_hda_override_conn_list(codec, 0x18, 2, conn2); |
| 1915 | snd_hda_override_conn_list(codec, 0x1a, 2, conn2); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1916 | } else if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1917 | /* restore the connections */ |
| 1918 | hda_nid_t conn[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; |
| 1919 | snd_hda_override_conn_list(codec, 0x14, 5, conn); |
| 1920 | snd_hda_override_conn_list(codec, 0x15, 5, conn); |
| 1921 | snd_hda_override_conn_list(codec, 0x18, 5, conn); |
| 1922 | snd_hda_override_conn_list(codec, 0x1a, 5, conn); |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1923 | } |
| 1924 | } |
| 1925 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1926 | /* Set VREF on HP pin */ |
| 1927 | static void alc889_fixup_mbp_vref(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1928 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1929 | { |
| 1930 | struct alc_spec *spec = codec->spec; |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 1931 | static hda_nid_t nids[3] = { 0x14, 0x15, 0x19 }; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1932 | int i; |
| 1933 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1934 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1935 | return; |
| 1936 | for (i = 0; i < ARRAY_SIZE(nids); i++) { |
| 1937 | unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); |
| 1938 | if (get_defcfg_device(val) != AC_JACK_HP_OUT) |
| 1939 | continue; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 1940 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1941 | val |= AC_PINCTL_VREF_80; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 1942 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1943 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1944 | break; |
| 1945 | } |
| 1946 | } |
| 1947 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1948 | static void alc889_fixup_mac_pins(struct hda_codec *codec, |
| 1949 | const hda_nid_t *nids, int num_nids) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1950 | { |
| 1951 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1952 | int i; |
| 1953 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1954 | for (i = 0; i < num_nids; i++) { |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1955 | unsigned int val; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 1956 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1957 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 1958 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1959 | } |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1960 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1961 | } |
| 1962 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1963 | /* Set VREF on speaker pins on imac91 */ |
| 1964 | static void alc889_fixup_imac91_vref(struct hda_codec *codec, |
| 1965 | const struct hda_fixup *fix, int action) |
| 1966 | { |
| 1967 | static hda_nid_t nids[2] = { 0x18, 0x1a }; |
| 1968 | |
| 1969 | if (action == HDA_FIXUP_ACT_INIT) |
| 1970 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 1971 | } |
| 1972 | |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 1973 | /* Set VREF on speaker pins on mba11 */ |
| 1974 | static void alc889_fixup_mba11_vref(struct hda_codec *codec, |
| 1975 | const struct hda_fixup *fix, int action) |
| 1976 | { |
| 1977 | static hda_nid_t nids[1] = { 0x18 }; |
| 1978 | |
| 1979 | if (action == HDA_FIXUP_ACT_INIT) |
| 1980 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 1981 | } |
| 1982 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1983 | /* Set VREF on speaker pins on mba21 */ |
| 1984 | static void alc889_fixup_mba21_vref(struct hda_codec *codec, |
| 1985 | const struct hda_fixup *fix, int action) |
| 1986 | { |
| 1987 | static hda_nid_t nids[2] = { 0x18, 0x19 }; |
| 1988 | |
| 1989 | if (action == HDA_FIXUP_ACT_INIT) |
| 1990 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 1991 | } |
| 1992 | |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1993 | /* Don't take HP output as primary |
Fernando Luis Vázquez Cao | d911149 | 2013-02-12 16:49:46 +0900 | [diff] [blame] | 1994 | * Strangely, the speaker output doesn't work on Vaio Z and some Vaio |
| 1995 | * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1996 | */ |
| 1997 | static void alc882_fixup_no_primary_hp(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1998 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1999 | { |
| 2000 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 2001 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2002 | spec->gen.no_primary_hp = 1; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 2003 | spec->gen.no_multi_io = 1; |
| 2004 | } |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2005 | } |
| 2006 | |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2007 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
| 2008 | const struct hda_fixup *fix, int action); |
| 2009 | |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 2010 | /* For dual-codec configuration, we need to disable some features to avoid |
| 2011 | * conflicts of kctls and PCM streams |
| 2012 | */ |
| 2013 | static void alc_fixup_dual_codecs(struct hda_codec *codec, |
| 2014 | const struct hda_fixup *fix, int action) |
| 2015 | { |
| 2016 | struct alc_spec *spec = codec->spec; |
| 2017 | |
| 2018 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2019 | return; |
| 2020 | /* disable vmaster */ |
| 2021 | spec->gen.suppress_vmaster = 1; |
| 2022 | /* auto-mute and auto-mic switch don't work with multiple codecs */ |
| 2023 | spec->gen.suppress_auto_mute = 1; |
| 2024 | spec->gen.suppress_auto_mic = 1; |
| 2025 | /* disable aamix as well */ |
| 2026 | spec->gen.mixer_nid = 0; |
| 2027 | /* add location prefix to avoid conflicts */ |
| 2028 | codec->force_pin_prefix = 1; |
| 2029 | } |
| 2030 | |
| 2031 | static void rename_ctl(struct hda_codec *codec, const char *oldname, |
| 2032 | const char *newname) |
| 2033 | { |
| 2034 | struct snd_kcontrol *kctl; |
| 2035 | |
| 2036 | kctl = snd_hda_find_mixer_ctl(codec, oldname); |
| 2037 | if (kctl) |
| 2038 | strcpy(kctl->id.name, newname); |
| 2039 | } |
| 2040 | |
| 2041 | static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, |
| 2042 | const struct hda_fixup *fix, |
| 2043 | int action) |
| 2044 | { |
| 2045 | alc_fixup_dual_codecs(codec, fix, action); |
| 2046 | switch (action) { |
| 2047 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 2048 | /* override card longname to provide a unique UCM profile */ |
| 2049 | strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); |
| 2050 | break; |
| 2051 | case HDA_FIXUP_ACT_BUILD: |
| 2052 | /* rename Capture controls depending on the codec */ |
| 2053 | rename_ctl(codec, "Capture Volume", |
| 2054 | codec->addr == 0 ? |
| 2055 | "Rear-Panel Capture Volume" : |
| 2056 | "Front-Panel Capture Volume"); |
| 2057 | rename_ctl(codec, "Capture Switch", |
| 2058 | codec->addr == 0 ? |
| 2059 | "Rear-Panel Capture Switch" : |
| 2060 | "Front-Panel Capture Switch"); |
| 2061 | break; |
| 2062 | } |
| 2063 | } |
| 2064 | |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2065 | static void alc1220_fixup_clevo_p950(struct hda_codec *codec, |
| 2066 | const struct hda_fixup *fix, |
| 2067 | int action) |
| 2068 | { |
| 2069 | hda_nid_t conn1[1] = { 0x0c }; |
| 2070 | |
| 2071 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2072 | return; |
| 2073 | |
| 2074 | alc_update_coef_idx(codec, 0x7, 0, 0x3c3); |
| 2075 | /* We therefore want to make sure 0x14 (front headphone) and |
| 2076 | * 0x1b (speakers) use the stereo DAC 0x02 |
| 2077 | */ |
| 2078 | snd_hda_override_conn_list(codec, 0x14, 1, conn1); |
| 2079 | snd_hda_override_conn_list(codec, 0x1b, 1, conn1); |
| 2080 | } |
| 2081 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2082 | static const struct hda_fixup alc882_fixups[] = { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2083 | [ALC882_FIXUP_ABIT_AW9D_MAX] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2084 | .type = HDA_FIXUP_PINS, |
| 2085 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2086 | { 0x15, 0x01080104 }, /* side */ |
| 2087 | { 0x16, 0x01011012 }, /* rear */ |
| 2088 | { 0x17, 0x01016011 }, /* clfe */ |
| 2089 | { } |
| 2090 | } |
| 2091 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2092 | [ALC882_FIXUP_LENOVO_Y530] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2093 | .type = HDA_FIXUP_PINS, |
| 2094 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2095 | { 0x15, 0x99130112 }, /* rear int speakers */ |
| 2096 | { 0x16, 0x99130111 }, /* subwoofer */ |
| 2097 | { } |
| 2098 | } |
| 2099 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2100 | [ALC882_FIXUP_PB_M5210] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2101 | .type = HDA_FIXUP_PINCTLS, |
| 2102 | .v.pins = (const struct hda_pintbl[]) { |
| 2103 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2104 | {} |
| 2105 | } |
| 2106 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2107 | [ALC882_FIXUP_ACER_ASPIRE_7736] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2108 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 2109 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2110 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2111 | [ALC882_FIXUP_ASUS_W90V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2112 | .type = HDA_FIXUP_PINS, |
| 2113 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5cdf745 | 2011-10-26 23:04:08 +0200 | [diff] [blame] | 2114 | { 0x16, 0x99130110 }, /* fix sequence for CLFE */ |
| 2115 | { } |
| 2116 | } |
| 2117 | }, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2118 | [ALC889_FIXUP_CD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2119 | .type = HDA_FIXUP_PINS, |
| 2120 | .v.pins = (const struct hda_pintbl[]) { |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2121 | { 0x1c, 0x993301f0 }, /* CD */ |
| 2122 | { } |
| 2123 | } |
| 2124 | }, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2125 | [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { |
| 2126 | .type = HDA_FIXUP_PINS, |
| 2127 | .v.pins = (const struct hda_pintbl[]) { |
| 2128 | { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ |
| 2129 | { } |
| 2130 | }, |
| 2131 | .chained = true, |
| 2132 | .chain_id = ALC889_FIXUP_CD, |
| 2133 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2134 | [ALC889_FIXUP_VAIO_TT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2135 | .type = HDA_FIXUP_PINS, |
| 2136 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2137 | { 0x17, 0x90170111 }, /* hidden surround speaker */ |
| 2138 | { } |
| 2139 | } |
| 2140 | }, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2141 | [ALC888_FIXUP_EEE1601] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2142 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2143 | .v.verbs = (const struct hda_verb[]) { |
| 2144 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2145 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, |
| 2146 | { } |
| 2147 | } |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2148 | }, |
| 2149 | [ALC882_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2150 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2151 | .v.verbs = (const struct hda_verb[]) { |
| 2152 | /* change to EAPD mode */ |
| 2153 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2154 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 2155 | { } |
| 2156 | } |
| 2157 | }, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2158 | [ALC883_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2159 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2160 | .v.verbs = (const struct hda_verb[]) { |
| 2161 | /* change to EAPD mode */ |
| 2162 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2163 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2164 | { } |
| 2165 | } |
| 2166 | }, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2167 | [ALC883_FIXUP_ACER_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2168 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2169 | .v.verbs = (const struct hda_verb[]) { |
| 2170 | /* eanable EAPD on Acer laptops */ |
| 2171 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2172 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2173 | { } |
| 2174 | } |
| 2175 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2176 | [ALC882_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 2177 | .type = HDA_FIXUP_FUNC, |
| 2178 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2179 | }, |
| 2180 | [ALC882_FIXUP_GPIO2] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 2181 | .type = HDA_FIXUP_FUNC, |
| 2182 | .v.func = alc_fixup_gpio2, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2183 | }, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2184 | [ALC882_FIXUP_GPIO3] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 2185 | .type = HDA_FIXUP_FUNC, |
| 2186 | .v.func = alc_fixup_gpio3, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2187 | }, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2188 | [ALC882_FIXUP_ASUS_W2JC] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 2189 | .type = HDA_FIXUP_FUNC, |
| 2190 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2191 | .chained = true, |
| 2192 | .chain_id = ALC882_FIXUP_EAPD, |
| 2193 | }, |
| 2194 | [ALC889_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2195 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2196 | .v.func = alc889_fixup_coef, |
| 2197 | }, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2198 | [ALC882_FIXUP_ACER_ASPIRE_4930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2199 | .type = HDA_FIXUP_PINS, |
| 2200 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2201 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2202 | { 0x17, 0x99130112 }, /* surround speaker */ |
| 2203 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2204 | }, |
| 2205 | .chained = true, |
| 2206 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2207 | }, |
| 2208 | [ALC882_FIXUP_ACER_ASPIRE_8930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2209 | .type = HDA_FIXUP_PINS, |
| 2210 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2211 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2212 | { 0x1b, 0x99130112 }, /* surround speaker */ |
| 2213 | { } |
| 2214 | }, |
| 2215 | .chained = true, |
| 2216 | .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, |
| 2217 | }, |
| 2218 | [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { |
| 2219 | /* additional init verbs for Acer Aspire 8930G */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2220 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2221 | .v.verbs = (const struct hda_verb[]) { |
| 2222 | /* Enable all DACs */ |
| 2223 | /* DAC DISABLE/MUTE 1? */ |
| 2224 | /* setting bits 1-5 disables DAC nids 0x02-0x06 |
| 2225 | * apparently. Init=0x38 */ |
| 2226 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, |
| 2227 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2228 | /* DAC DISABLE/MUTE 2? */ |
| 2229 | /* some bit here disables the other DACs. |
| 2230 | * Init=0x4900 */ |
| 2231 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, |
| 2232 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2233 | /* DMIC fix |
| 2234 | * This laptop has a stereo digital microphone. |
| 2235 | * The mics are only 1cm apart which makes the stereo |
| 2236 | * useless. However, either the mic or the ALC889 |
| 2237 | * makes the signal become a difference/sum signal |
| 2238 | * instead of standard stereo, which is annoying. |
| 2239 | * So instead we flip this bit which makes the |
| 2240 | * codec replicate the sum signal to both channels, |
| 2241 | * turning it into a normal mono mic. |
| 2242 | */ |
| 2243 | /* DMIC_CONTROL? Init value = 0x0001 */ |
| 2244 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2245 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, |
| 2246 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2247 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2248 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2249 | }, |
| 2250 | .chained = true, |
| 2251 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2252 | }, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2253 | [ALC885_FIXUP_MACPRO_GPIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2254 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2255 | .v.func = alc885_fixup_macpro_gpio, |
| 2256 | }, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2257 | [ALC889_FIXUP_DAC_ROUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2258 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2259 | .v.func = alc889_fixup_dac_route, |
| 2260 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2261 | [ALC889_FIXUP_MBP_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2262 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2263 | .v.func = alc889_fixup_mbp_vref, |
| 2264 | .chained = true, |
| 2265 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2266 | }, |
| 2267 | [ALC889_FIXUP_IMAC91_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2268 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2269 | .v.func = alc889_fixup_imac91_vref, |
| 2270 | .chained = true, |
| 2271 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2272 | }, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2273 | [ALC889_FIXUP_MBA11_VREF] = { |
| 2274 | .type = HDA_FIXUP_FUNC, |
| 2275 | .v.func = alc889_fixup_mba11_vref, |
| 2276 | .chained = true, |
| 2277 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2278 | }, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2279 | [ALC889_FIXUP_MBA21_VREF] = { |
| 2280 | .type = HDA_FIXUP_FUNC, |
| 2281 | .v.func = alc889_fixup_mba21_vref, |
| 2282 | .chained = true, |
| 2283 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2284 | }, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2285 | [ALC889_FIXUP_MP11_VREF] = { |
| 2286 | .type = HDA_FIXUP_FUNC, |
| 2287 | .v.func = alc889_fixup_mba11_vref, |
| 2288 | .chained = true, |
| 2289 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2290 | }, |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 2291 | [ALC889_FIXUP_MP41_VREF] = { |
| 2292 | .type = HDA_FIXUP_FUNC, |
| 2293 | .v.func = alc889_fixup_mbp_vref, |
| 2294 | .chained = true, |
| 2295 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2296 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2297 | [ALC882_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2298 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2299 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2300 | }, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2301 | [ALC882_FIXUP_NO_PRIMARY_HP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2302 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2303 | .v.func = alc882_fixup_no_primary_hp, |
| 2304 | }, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2305 | [ALC887_FIXUP_ASUS_BASS] = { |
| 2306 | .type = HDA_FIXUP_PINS, |
| 2307 | .v.pins = (const struct hda_pintbl[]) { |
| 2308 | {0x16, 0x99130130}, /* bass speaker */ |
| 2309 | {} |
| 2310 | }, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2311 | .chained = true, |
| 2312 | .chain_id = ALC887_FIXUP_BASS_CHMAP, |
| 2313 | }, |
| 2314 | [ALC887_FIXUP_BASS_CHMAP] = { |
| 2315 | .type = HDA_FIXUP_FUNC, |
| 2316 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2317 | }, |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 2318 | [ALC1220_FIXUP_GB_DUAL_CODECS] = { |
| 2319 | .type = HDA_FIXUP_FUNC, |
| 2320 | .v.func = alc1220_fixup_gb_dual_codecs, |
| 2321 | }, |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2322 | [ALC1220_FIXUP_CLEVO_P950] = { |
| 2323 | .type = HDA_FIXUP_FUNC, |
| 2324 | .v.func = alc1220_fixup_clevo_p950, |
| 2325 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2326 | }; |
| 2327 | |
| 2328 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2329 | SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), |
| 2330 | SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | b5d724b | 2015-06-02 19:57:08 +0200 | [diff] [blame] | 2331 | SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2332 | SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), |
| 2333 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
| 2334 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), |
| 2335 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2336 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", |
| 2337 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2338 | SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", |
| 2339 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2340 | SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", |
| 2341 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2342 | SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", |
| 2343 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2344 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", |
| 2345 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2346 | SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", |
| 2347 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2348 | SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", |
| 2349 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2350 | SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), |
Takashi Iwai | f5c53d8 | 2012-05-07 10:07:33 +0200 | [diff] [blame] | 2351 | SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", |
| 2352 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2353 | SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), |
Takashi Iwai | fe97da1 | 2012-04-12 08:00:19 +0200 | [diff] [blame] | 2354 | 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] | 2355 | SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), |
Takashi Iwai | 177943a3 | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2356 | SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2357 | SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2358 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2359 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2360 | SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), |
Takashi Iwai | 85bcf96 | 2016-12-06 16:20:36 +0100 | [diff] [blame] | 2361 | SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2362 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2363 | SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), |
Sergei A. Trusov | 3f3c371 | 2017-08-02 20:23:48 +1000 | [diff] [blame] | 2364 | SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP), |
Fernando Luis Vázquez Cao | 12e31a7 | 2013-02-12 16:47:44 +0900 | [diff] [blame] | 2365 | SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), |
Takashi Iwai | c44d9b1 | 2016-02-07 09:38:26 +0100 | [diff] [blame] | 2366 | SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2367 | |
| 2368 | /* All Apple entries are in codec SSIDs */ |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2369 | SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), |
| 2370 | SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), |
| 2371 | SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2372 | SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2373 | SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), |
| 2374 | SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2375 | SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), |
| 2376 | SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2377 | SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2378 | SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2379 | SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2380 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), |
| 2381 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2382 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2383 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2384 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2385 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 2386 | SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF), |
Takashi Iwai | 0519363 | 2012-11-12 10:07:36 +0100 | [diff] [blame] | 2387 | SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2388 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), |
| 2389 | SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), |
Takashi Iwai | 649ccd0 | 2015-07-30 22:30:29 +0200 | [diff] [blame] | 2390 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2391 | |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2392 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2393 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 2394 | SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), |
Takashi Iwai | d2c3b14 | 2017-06-01 09:35:30 +0200 | [diff] [blame] | 2395 | SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), |
Takashi Iwai | 6369158 | 2017-05-22 16:32:46 +0200 | [diff] [blame] | 2396 | SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), |
Takashi Iwai | d2c3b14 | 2017-06-01 09:35:30 +0200 | [diff] [blame] | 2397 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2398 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2399 | SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), |
Jeremy Soller | 2f0d520 | 2018-05-07 09:28:45 -0600 | [diff] [blame] | 2400 | SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2401 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), |
| 2402 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2403 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2404 | SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2405 | {} |
| 2406 | }; |
| 2407 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2408 | static const struct hda_model_fixup alc882_fixup_models[] = { |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2409 | {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, |
| 2410 | {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, |
| 2411 | {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2412 | {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2413 | {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 2414 | {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2415 | {} |
| 2416 | }; |
| 2417 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2418 | /* |
| 2419 | * BIOS auto configuration |
| 2420 | */ |
| 2421 | /* almost identical with ALC880 parser... */ |
| 2422 | static int alc882_parse_auto_config(struct hda_codec *codec) |
| 2423 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2424 | static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2425 | static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2426 | return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2427 | } |
| 2428 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2429 | /* |
| 2430 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2431 | static int patch_alc882(struct hda_codec *codec) |
| 2432 | { |
| 2433 | struct alc_spec *spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2434 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2435 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2436 | err = alc_alloc_spec(codec, 0x0b); |
| 2437 | if (err < 0) |
| 2438 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2439 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2440 | spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2441 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 2442 | switch (codec->core.vendor_id) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2443 | case 0x10ec0882: |
| 2444 | case 0x10ec0885: |
Takashi Iwai | acf0808 | 2014-09-02 07:21:56 +0200 | [diff] [blame] | 2445 | case 0x10ec0900: |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 2446 | case 0x10ec1220: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2447 | break; |
| 2448 | default: |
| 2449 | /* ALC883 and variants */ |
| 2450 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2451 | break; |
| 2452 | } |
| 2453 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2454 | snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2455 | alc882_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2456 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2457 | |
| 2458 | alc_auto_parse_customize_define(codec); |
| 2459 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2460 | if (has_cdefine_beep(codec)) |
| 2461 | spec->gen.beep_nid = 0x01; |
| 2462 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2463 | /* automatic parse from the BIOS config */ |
| 2464 | err = alc882_parse_auto_config(codec); |
| 2465 | if (err < 0) |
| 2466 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2467 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2468 | if (!spec->gen.no_analog && spec->gen.beep_nid) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2469 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2470 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2471 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2472 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2473 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2474 | |
| 2475 | error: |
| 2476 | alc_free(codec); |
| 2477 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2478 | } |
| 2479 | |
| 2480 | |
| 2481 | /* |
| 2482 | * ALC262 support |
| 2483 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2484 | static int alc262_parse_auto_config(struct hda_codec *codec) |
| 2485 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2486 | static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2487 | static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2488 | return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2489 | } |
| 2490 | |
| 2491 | /* |
| 2492 | * Pin config fixes |
| 2493 | */ |
| 2494 | enum { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2495 | ALC262_FIXUP_FSC_H270, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2496 | ALC262_FIXUP_FSC_S7110, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2497 | ALC262_FIXUP_HP_Z200, |
| 2498 | ALC262_FIXUP_TYAN, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2499 | ALC262_FIXUP_LENOVO_3000, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2500 | ALC262_FIXUP_BENQ, |
| 2501 | ALC262_FIXUP_BENQ_T31, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2502 | ALC262_FIXUP_INV_DMIC, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2503 | ALC262_FIXUP_INTEL_BAYLEYBAY, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2504 | }; |
| 2505 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2506 | static const struct hda_fixup alc262_fixups[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2507 | [ALC262_FIXUP_FSC_H270] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2508 | .type = HDA_FIXUP_PINS, |
| 2509 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2510 | { 0x14, 0x99130110 }, /* speaker */ |
| 2511 | { 0x15, 0x0221142f }, /* front HP */ |
| 2512 | { 0x1b, 0x0121141f }, /* rear HP */ |
| 2513 | { } |
| 2514 | } |
| 2515 | }, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2516 | [ALC262_FIXUP_FSC_S7110] = { |
| 2517 | .type = HDA_FIXUP_PINS, |
| 2518 | .v.pins = (const struct hda_pintbl[]) { |
| 2519 | { 0x15, 0x90170110 }, /* speaker */ |
| 2520 | { } |
| 2521 | }, |
| 2522 | .chained = true, |
| 2523 | .chain_id = ALC262_FIXUP_BENQ, |
| 2524 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2525 | [ALC262_FIXUP_HP_Z200] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2526 | .type = HDA_FIXUP_PINS, |
| 2527 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2528 | { 0x16, 0x99130120 }, /* internal speaker */ |
| 2529 | { } |
| 2530 | } |
| 2531 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2532 | [ALC262_FIXUP_TYAN] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2533 | .type = HDA_FIXUP_PINS, |
| 2534 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2535 | { 0x14, 0x1993e1f0 }, /* int AUX */ |
| 2536 | { } |
| 2537 | } |
| 2538 | }, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2539 | [ALC262_FIXUP_LENOVO_3000] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2540 | .type = HDA_FIXUP_PINCTLS, |
| 2541 | .v.pins = (const struct hda_pintbl[]) { |
| 2542 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2543 | {} |
| 2544 | }, |
| 2545 | .chained = true, |
| 2546 | .chain_id = ALC262_FIXUP_BENQ, |
| 2547 | }, |
| 2548 | [ALC262_FIXUP_BENQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2549 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2550 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2551 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2552 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2553 | {} |
| 2554 | } |
| 2555 | }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2556 | [ALC262_FIXUP_BENQ_T31] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2557 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2558 | .v.verbs = (const struct hda_verb[]) { |
| 2559 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2560 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2561 | {} |
| 2562 | } |
| 2563 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2564 | [ALC262_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2565 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2566 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2567 | }, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2568 | [ALC262_FIXUP_INTEL_BAYLEYBAY] = { |
| 2569 | .type = HDA_FIXUP_FUNC, |
| 2570 | .v.func = alc_fixup_no_depop_delay, |
| 2571 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2572 | }; |
| 2573 | |
| 2574 | static const struct snd_pci_quirk alc262_fixup_tbl[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2575 | SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2576 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), |
Takashi Iwai | 3dcd3be | 2011-11-07 14:59:40 +0100 | [diff] [blame] | 2577 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2578 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), |
| 2579 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2580 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2581 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), |
| 2582 | SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2583 | SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2584 | {} |
| 2585 | }; |
| 2586 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2587 | static const struct hda_model_fixup alc262_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2588 | {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
| 2589 | {} |
| 2590 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2591 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2592 | /* |
| 2593 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2594 | static int patch_alc262(struct hda_codec *codec) |
| 2595 | { |
| 2596 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2597 | int err; |
| 2598 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2599 | err = alc_alloc_spec(codec, 0x0b); |
| 2600 | if (err < 0) |
| 2601 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2602 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2603 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2604 | spec->gen.shared_mic_vref_pin = 0x18; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2605 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 2606 | spec->shutup = alc_eapd_shutup; |
| 2607 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2608 | #if 0 |
| 2609 | /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is |
| 2610 | * under-run |
| 2611 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2612 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2613 | #endif |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2614 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2615 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2616 | snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2617 | alc262_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2618 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2619 | |
Takashi Iwai | af741c1 | 2012-05-07 18:09:48 +0200 | [diff] [blame] | 2620 | alc_auto_parse_customize_define(codec); |
| 2621 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2622 | if (has_cdefine_beep(codec)) |
| 2623 | spec->gen.beep_nid = 0x01; |
| 2624 | |
Takashi Iwai | 42399f7 | 2011-11-07 17:18:44 +0100 | [diff] [blame] | 2625 | /* automatic parse from the BIOS config */ |
| 2626 | err = alc262_parse_auto_config(codec); |
| 2627 | if (err < 0) |
| 2628 | goto error; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2629 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2630 | if (!spec->gen.no_analog && spec->gen.beep_nid) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2631 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2632 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2633 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2634 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2635 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2636 | |
| 2637 | error: |
| 2638 | alc_free(codec); |
| 2639 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2640 | } |
| 2641 | |
| 2642 | /* |
| 2643 | * ALC268 |
| 2644 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2645 | /* bind Beep switches of both NID 0x0f and 0x10 */ |
Takashi Iwai | a717777 | 2017-05-10 12:04:08 +0200 | [diff] [blame] | 2646 | static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol, |
| 2647 | struct snd_ctl_elem_value *ucontrol) |
| 2648 | { |
| 2649 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 2650 | unsigned long pval; |
| 2651 | int err; |
| 2652 | |
| 2653 | mutex_lock(&codec->control_mutex); |
| 2654 | pval = kcontrol->private_value; |
| 2655 | kcontrol->private_value = (pval & ~0xff) | 0x0f; |
| 2656 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); |
| 2657 | if (err >= 0) { |
| 2658 | kcontrol->private_value = (pval & ~0xff) | 0x10; |
| 2659 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); |
| 2660 | } |
| 2661 | kcontrol->private_value = pval; |
| 2662 | mutex_unlock(&codec->control_mutex); |
| 2663 | return err; |
| 2664 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2665 | |
| 2666 | static const struct snd_kcontrol_new alc268_beep_mixer[] = { |
| 2667 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), |
Takashi Iwai | a717777 | 2017-05-10 12:04:08 +0200 | [diff] [blame] | 2668 | { |
| 2669 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
| 2670 | .name = "Beep Playback Switch", |
| 2671 | .subdevice = HDA_SUBDEV_AMP_FLAG, |
| 2672 | .info = snd_hda_mixer_amp_switch_info, |
| 2673 | .get = snd_hda_mixer_amp_switch_get, |
| 2674 | .put = alc268_beep_switch_put, |
| 2675 | .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT) |
| 2676 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2677 | { } |
| 2678 | }; |
| 2679 | |
| 2680 | /* set PCBEEP vol = 0, mute connections */ |
| 2681 | static const struct hda_verb alc268_beep_init_verbs[] = { |
| 2682 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
| 2683 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2684 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2685 | { } |
| 2686 | }; |
| 2687 | |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2688 | enum { |
| 2689 | ALC268_FIXUP_INV_DMIC, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2690 | ALC268_FIXUP_HP_EAPD, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2691 | ALC268_FIXUP_SPDIF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2692 | }; |
| 2693 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2694 | static const struct hda_fixup alc268_fixups[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2695 | [ALC268_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2696 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2697 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2698 | }, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2699 | [ALC268_FIXUP_HP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2700 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2701 | .v.verbs = (const struct hda_verb[]) { |
| 2702 | {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 2703 | {} |
| 2704 | } |
| 2705 | }, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2706 | [ALC268_FIXUP_SPDIF] = { |
| 2707 | .type = HDA_FIXUP_PINS, |
| 2708 | .v.pins = (const struct hda_pintbl[]) { |
| 2709 | { 0x1e, 0x014b1180 }, /* enable SPDIF out */ |
| 2710 | {} |
| 2711 | } |
| 2712 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2713 | }; |
| 2714 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2715 | static const struct hda_model_fixup alc268_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2716 | {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2717 | {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, |
| 2718 | {} |
| 2719 | }; |
| 2720 | |
| 2721 | static const struct snd_pci_quirk alc268_fixup_tbl[] = { |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2722 | SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), |
David Henningsson | fcd8f3b | 2013-01-28 05:45:47 +0100 | [diff] [blame] | 2723 | 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] | 2724 | /* below is codec SSID since multiple Toshiba laptops have the |
| 2725 | * same PCI SSID 1179:ff00 |
| 2726 | */ |
| 2727 | SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2728 | {} |
| 2729 | }; |
| 2730 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2731 | /* |
| 2732 | * BIOS auto configuration |
| 2733 | */ |
| 2734 | static int alc268_parse_auto_config(struct hda_codec *codec) |
| 2735 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2736 | static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2737 | return alc_parse_auto_config(codec, NULL, alc268_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2738 | } |
| 2739 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2740 | /* |
| 2741 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2742 | static int patch_alc268(struct hda_codec *codec) |
| 2743 | { |
| 2744 | struct alc_spec *spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2745 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2746 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2747 | /* ALC268 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2748 | err = alc_alloc_spec(codec, 0); |
| 2749 | if (err < 0) |
| 2750 | return err; |
| 2751 | |
| 2752 | spec = codec->spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2753 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2754 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 2755 | spec->shutup = alc_eapd_shutup; |
| 2756 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2757 | snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); |
| 2758 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2759 | |
Takashi Iwai | 6ebb805 | 2011-08-16 15:15:40 +0200 | [diff] [blame] | 2760 | /* automatic parse from the BIOS config */ |
| 2761 | err = alc268_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2762 | if (err < 0) |
| 2763 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2764 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2765 | if (err > 0 && !spec->gen.no_analog && |
| 2766 | spec->gen.autocfg.speaker_pins[0] != 0x1d) { |
| 2767 | add_mixer(spec, alc268_beep_mixer); |
| 2768 | snd_hda_add_verbs(codec, alc268_beep_init_verbs); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2769 | if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) |
| 2770 | /* override the amp caps for beep generator */ |
| 2771 | snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, |
| 2772 | (0x0c << AC_AMPCAP_OFFSET_SHIFT) | |
| 2773 | (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 2774 | (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 2775 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 2776 | } |
| 2777 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2778 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2779 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2780 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2781 | |
| 2782 | error: |
| 2783 | alc_free(codec); |
| 2784 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2785 | } |
| 2786 | |
| 2787 | /* |
| 2788 | * ALC269 |
| 2789 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2790 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2791 | static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2792 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2793 | }; |
| 2794 | |
| 2795 | static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2796 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2797 | }; |
| 2798 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2799 | /* different alc269-variants */ |
| 2800 | enum { |
| 2801 | ALC269_TYPE_ALC269VA, |
| 2802 | ALC269_TYPE_ALC269VB, |
| 2803 | ALC269_TYPE_ALC269VC, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2804 | ALC269_TYPE_ALC269VD, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2805 | ALC269_TYPE_ALC280, |
| 2806 | ALC269_TYPE_ALC282, |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2807 | ALC269_TYPE_ALC283, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2808 | ALC269_TYPE_ALC284, |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 2809 | ALC269_TYPE_ALC293, |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 2810 | ALC269_TYPE_ALC286, |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 2811 | ALC269_TYPE_ALC298, |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 2812 | ALC269_TYPE_ALC255, |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 2813 | ALC269_TYPE_ALC256, |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 2814 | ALC269_TYPE_ALC257, |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 2815 | ALC269_TYPE_ALC215, |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 2816 | ALC269_TYPE_ALC225, |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 2817 | ALC269_TYPE_ALC294, |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 2818 | ALC269_TYPE_ALC700, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2819 | }; |
| 2820 | |
| 2821 | /* |
| 2822 | * BIOS auto configuration |
| 2823 | */ |
| 2824 | static int alc269_parse_auto_config(struct hda_codec *codec) |
| 2825 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2826 | static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2827 | static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; |
| 2828 | static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2829 | struct alc_spec *spec = codec->spec; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2830 | const hda_nid_t *ssids; |
| 2831 | |
| 2832 | switch (spec->codec_variant) { |
| 2833 | case ALC269_TYPE_ALC269VA: |
| 2834 | case ALC269_TYPE_ALC269VC: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2835 | case ALC269_TYPE_ALC280: |
| 2836 | case ALC269_TYPE_ALC284: |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 2837 | case ALC269_TYPE_ALC293: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2838 | ssids = alc269va_ssids; |
| 2839 | break; |
| 2840 | case ALC269_TYPE_ALC269VB: |
| 2841 | case ALC269_TYPE_ALC269VD: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2842 | case ALC269_TYPE_ALC282: |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2843 | case ALC269_TYPE_ALC283: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 2844 | case ALC269_TYPE_ALC286: |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 2845 | case ALC269_TYPE_ALC298: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 2846 | case ALC269_TYPE_ALC255: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 2847 | case ALC269_TYPE_ALC256: |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 2848 | case ALC269_TYPE_ALC257: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 2849 | case ALC269_TYPE_ALC215: |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 2850 | case ALC269_TYPE_ALC225: |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 2851 | case ALC269_TYPE_ALC294: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 2852 | case ALC269_TYPE_ALC700: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2853 | ssids = alc269_ssids; |
| 2854 | break; |
| 2855 | default: |
| 2856 | ssids = alc269_ssids; |
| 2857 | break; |
| 2858 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2859 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2860 | return alc_parse_auto_config(codec, alc269_ignore, ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2861 | } |
| 2862 | |
Kailang Yang | f7ae9ba | 2014-06-30 16:10:37 +0800 | [diff] [blame] | 2863 | static int find_ext_mic_pin(struct hda_codec *codec); |
| 2864 | |
| 2865 | static void alc286_shutup(struct hda_codec *codec) |
| 2866 | { |
Takashi Iwai | a9c2dfc | 2018-04-23 17:24:56 +0200 | [diff] [blame] | 2867 | const struct hda_pincfg *pin; |
Kailang Yang | f7ae9ba | 2014-06-30 16:10:37 +0800 | [diff] [blame] | 2868 | int i; |
| 2869 | int mic_pin = find_ext_mic_pin(codec); |
| 2870 | /* don't shut up pins when unloading the driver; otherwise it breaks |
| 2871 | * the default pin setup at the next load of the driver |
| 2872 | */ |
| 2873 | if (codec->bus->shutdown) |
| 2874 | return; |
Takashi Iwai | a9c2dfc | 2018-04-23 17:24:56 +0200 | [diff] [blame] | 2875 | snd_array_for_each(&codec->init_pins, i, pin) { |
Kailang Yang | f7ae9ba | 2014-06-30 16:10:37 +0800 | [diff] [blame] | 2876 | /* use read here for syncing after issuing each verb */ |
| 2877 | if (pin->nid != mic_pin) |
| 2878 | snd_hda_codec_read(codec, pin->nid, 0, |
| 2879 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); |
| 2880 | } |
| 2881 | codec->pins_shutup = 1; |
| 2882 | } |
| 2883 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 2884 | 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] | 2885 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2886 | 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] | 2887 | } |
| 2888 | |
| 2889 | static void alc269_shutup(struct hda_codec *codec) |
| 2890 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2891 | struct alc_spec *spec = codec->spec; |
| 2892 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 2893 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 2894 | alc269vb_toggle_power_output(codec, 0); |
| 2895 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
| 2896 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2897 | msleep(150); |
| 2898 | } |
Takashi Iwai | 9bfb284 | 2013-07-24 14:31:50 +0200 | [diff] [blame] | 2899 | snd_hda_shutup_pins(codec); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2900 | } |
| 2901 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2902 | static struct coef_fw alc282_coefs[] = { |
| 2903 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 32fa7e4 | 2014-10-24 16:26:01 +0800 | [diff] [blame] | 2904 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2905 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 2906 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 2907 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 2908 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 2909 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 2910 | WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ |
| 2911 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 2912 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 2913 | WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ |
| 2914 | UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ |
| 2915 | WRITE_COEF(0x34, 0xa0c0), /* ANC */ |
| 2916 | UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ |
| 2917 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 2918 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 2919 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 2920 | WRITE_COEF(0x63, 0x2902), /* PLL */ |
| 2921 | WRITE_COEF(0x68, 0xa080), /* capless control 2 */ |
| 2922 | WRITE_COEF(0x69, 0x3400), /* capless control 3 */ |
| 2923 | WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ |
| 2924 | WRITE_COEF(0x6b, 0x0), /* capless control 5 */ |
| 2925 | UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ |
| 2926 | WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ |
| 2927 | UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ |
| 2928 | WRITE_COEF(0x71, 0x0014), /* class D test 6 */ |
| 2929 | WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ |
| 2930 | UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ |
| 2931 | WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ |
| 2932 | {} |
| 2933 | }; |
| 2934 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 2935 | static void alc282_restore_default_value(struct hda_codec *codec) |
| 2936 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2937 | alc_process_coef_fw(codec, alc282_coefs); |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 2938 | } |
| 2939 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 2940 | static void alc282_init(struct hda_codec *codec) |
| 2941 | { |
| 2942 | struct alc_spec *spec = codec->spec; |
| 2943 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 2944 | bool hp_pin_sense; |
| 2945 | int coef78; |
| 2946 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 2947 | alc282_restore_default_value(codec); |
| 2948 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 2949 | if (!hp_pin) |
| 2950 | return; |
| 2951 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 2952 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 2953 | |
| 2954 | /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ |
| 2955 | /* Headphone capless set to high power mode */ |
| 2956 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 2957 | |
| 2958 | if (hp_pin_sense) |
| 2959 | msleep(2); |
| 2960 | |
| 2961 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2962 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 2963 | |
| 2964 | if (hp_pin_sense) |
| 2965 | msleep(85); |
| 2966 | |
| 2967 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2968 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 2969 | |
| 2970 | if (hp_pin_sense) |
| 2971 | msleep(100); |
| 2972 | |
| 2973 | /* Headphone capless set to normal mode */ |
| 2974 | alc_write_coef_idx(codec, 0x78, coef78); |
| 2975 | } |
| 2976 | |
| 2977 | static void alc282_shutup(struct hda_codec *codec) |
| 2978 | { |
| 2979 | struct alc_spec *spec = codec->spec; |
| 2980 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 2981 | bool hp_pin_sense; |
| 2982 | int coef78; |
| 2983 | |
| 2984 | if (!hp_pin) { |
| 2985 | alc269_shutup(codec); |
| 2986 | return; |
| 2987 | } |
| 2988 | |
| 2989 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 2990 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 2991 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 2992 | |
| 2993 | if (hp_pin_sense) |
| 2994 | msleep(2); |
| 2995 | |
| 2996 | snd_hda_codec_write(codec, hp_pin, 0, |
| 2997 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 2998 | |
| 2999 | if (hp_pin_sense) |
| 3000 | msleep(85); |
| 3001 | |
| 3002 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3003 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3004 | |
| 3005 | if (hp_pin_sense) |
| 3006 | msleep(100); |
| 3007 | |
| 3008 | alc_auto_setup_eapd(codec, false); |
| 3009 | snd_hda_shutup_pins(codec); |
| 3010 | alc_write_coef_idx(codec, 0x78, coef78); |
| 3011 | } |
| 3012 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3013 | static struct coef_fw alc283_coefs[] = { |
| 3014 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 3015 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3016 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 3017 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 3018 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 3019 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 3020 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 3021 | WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ |
| 3022 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 3023 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 3024 | WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ |
| 3025 | UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ |
| 3026 | WRITE_COEF(0x22, 0xa0c0), /* ANC */ |
| 3027 | UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ |
| 3028 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 3029 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 3030 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 3031 | WRITE_COEF(0x2e, 0x2902), /* PLL */ |
| 3032 | WRITE_COEF(0x33, 0xa080), /* capless control 2 */ |
| 3033 | WRITE_COEF(0x34, 0x3400), /* capless control 3 */ |
| 3034 | WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ |
| 3035 | WRITE_COEF(0x36, 0x0), /* capless control 5 */ |
| 3036 | UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ |
| 3037 | WRITE_COEF(0x39, 0x110a), /* class D test 3 */ |
| 3038 | UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ |
| 3039 | WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ |
| 3040 | WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ |
| 3041 | UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ |
| 3042 | WRITE_COEF(0x49, 0x0), /* test mode */ |
| 3043 | UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ |
| 3044 | UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ |
| 3045 | WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 3046 | UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3047 | {} |
| 3048 | }; |
| 3049 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3050 | static void alc283_restore_default_value(struct hda_codec *codec) |
| 3051 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3052 | alc_process_coef_fw(codec, alc283_coefs); |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3053 | } |
| 3054 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3055 | static void alc283_init(struct hda_codec *codec) |
| 3056 | { |
| 3057 | struct alc_spec *spec = codec->spec; |
| 3058 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 3059 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3060 | |
Kailang Yang | 8314f22 | 2014-04-03 17:28:39 +0800 | [diff] [blame] | 3061 | if (!spec->gen.autocfg.hp_outs) { |
| 3062 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) |
| 3063 | hp_pin = spec->gen.autocfg.line_out_pins[0]; |
| 3064 | } |
| 3065 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3066 | alc283_restore_default_value(codec); |
| 3067 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3068 | if (!hp_pin) |
| 3069 | return; |
Kailang Yang | a59d719 | 2015-04-08 16:34:00 +0800 | [diff] [blame] | 3070 | |
| 3071 | msleep(30); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3072 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3073 | |
| 3074 | /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ |
| 3075 | /* Headphone capless set to high power mode */ |
| 3076 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 3077 | |
| 3078 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3079 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3080 | |
| 3081 | if (hp_pin_sense) |
| 3082 | msleep(85); |
| 3083 | |
| 3084 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3085 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3086 | |
| 3087 | if (hp_pin_sense) |
| 3088 | msleep(85); |
| 3089 | /* Index 0x46 Combo jack auto switch control 2 */ |
| 3090 | /* 3k pull low control for Headset jack. */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3091 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3092 | /* Headphone capless set to normal mode */ |
| 3093 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3094 | } |
| 3095 | |
| 3096 | static void alc283_shutup(struct hda_codec *codec) |
| 3097 | { |
| 3098 | struct alc_spec *spec = codec->spec; |
| 3099 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 3100 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3101 | |
Kailang Yang | 8314f22 | 2014-04-03 17:28:39 +0800 | [diff] [blame] | 3102 | if (!spec->gen.autocfg.hp_outs) { |
| 3103 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) |
| 3104 | hp_pin = spec->gen.autocfg.line_out_pins[0]; |
| 3105 | } |
| 3106 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3107 | if (!hp_pin) { |
| 3108 | alc269_shutup(codec); |
| 3109 | return; |
| 3110 | } |
| 3111 | |
| 3112 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3113 | |
| 3114 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 3115 | |
Harsha Priya | b450b17 | 2014-10-09 11:04:56 +0000 | [diff] [blame] | 3116 | /*depop hp during suspend*/ |
| 3117 | alc_write_coef_idx(codec, 0x06, 0x2100); |
| 3118 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3119 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3120 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3121 | |
| 3122 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3123 | msleep(100); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3124 | |
| 3125 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3126 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3127 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3128 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3129 | |
| 3130 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3131 | msleep(100); |
Kailang Yang | 0435b3f | 2014-04-08 17:14:14 +0800 | [diff] [blame] | 3132 | alc_auto_setup_eapd(codec, false); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3133 | snd_hda_shutup_pins(codec); |
| 3134 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3135 | } |
| 3136 | |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3137 | static void alc256_init(struct hda_codec *codec) |
| 3138 | { |
| 3139 | struct alc_spec *spec = codec->spec; |
| 3140 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 3141 | bool hp_pin_sense; |
| 3142 | |
| 3143 | if (!hp_pin) |
| 3144 | return; |
| 3145 | |
| 3146 | msleep(30); |
| 3147 | |
| 3148 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3149 | |
| 3150 | if (hp_pin_sense) |
| 3151 | msleep(2); |
| 3152 | |
| 3153 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ |
| 3154 | |
| 3155 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3156 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3157 | |
| 3158 | if (hp_pin_sense) |
| 3159 | msleep(85); |
| 3160 | |
| 3161 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3162 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3163 | |
| 3164 | if (hp_pin_sense) |
| 3165 | msleep(100); |
| 3166 | |
| 3167 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
| 3168 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ |
Kailang Yang | 88d42b2 | 2018-03-14 16:08:57 +0800 | [diff] [blame] | 3169 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ |
| 3170 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3171 | } |
| 3172 | |
| 3173 | static void alc256_shutup(struct hda_codec *codec) |
| 3174 | { |
| 3175 | struct alc_spec *spec = codec->spec; |
| 3176 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 3177 | bool hp_pin_sense; |
| 3178 | |
| 3179 | if (!hp_pin) { |
| 3180 | alc269_shutup(codec); |
| 3181 | return; |
| 3182 | } |
| 3183 | |
| 3184 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3185 | |
| 3186 | if (hp_pin_sense) |
| 3187 | msleep(2); |
| 3188 | |
| 3189 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3190 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3191 | |
| 3192 | if (hp_pin_sense) |
| 3193 | msleep(85); |
| 3194 | |
Takashi Iwai | 1c9609e | 2018-01-19 14:18:34 +0100 | [diff] [blame] | 3195 | /* 3k pull low control for Headset jack. */ |
| 3196 | /* NOTE: call this before clearing the pin, otherwise codec stalls */ |
| 3197 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
| 3198 | |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3199 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3200 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3201 | |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3202 | if (hp_pin_sense) |
| 3203 | msleep(100); |
| 3204 | |
| 3205 | alc_auto_setup_eapd(codec, false); |
| 3206 | snd_hda_shutup_pins(codec); |
| 3207 | } |
| 3208 | |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3209 | static void alc225_init(struct hda_codec *codec) |
| 3210 | { |
| 3211 | struct alc_spec *spec = codec->spec; |
| 3212 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 3213 | bool hp1_pin_sense, hp2_pin_sense; |
| 3214 | |
| 3215 | if (!hp_pin) |
| 3216 | return; |
| 3217 | |
| 3218 | msleep(30); |
| 3219 | |
| 3220 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3221 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); |
| 3222 | |
| 3223 | if (hp1_pin_sense || hp2_pin_sense) |
| 3224 | msleep(2); |
| 3225 | |
| 3226 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ |
| 3227 | |
| 3228 | if (hp1_pin_sense) |
| 3229 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3230 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3231 | if (hp2_pin_sense) |
| 3232 | snd_hda_codec_write(codec, 0x16, 0, |
| 3233 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3234 | |
| 3235 | if (hp1_pin_sense || hp2_pin_sense) |
| 3236 | msleep(85); |
| 3237 | |
| 3238 | if (hp1_pin_sense) |
| 3239 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3240 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3241 | if (hp2_pin_sense) |
| 3242 | snd_hda_codec_write(codec, 0x16, 0, |
| 3243 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3244 | |
| 3245 | if (hp1_pin_sense || hp2_pin_sense) |
| 3246 | msleep(100); |
| 3247 | |
| 3248 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); |
| 3249 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ |
| 3250 | } |
| 3251 | |
| 3252 | static void alc225_shutup(struct hda_codec *codec) |
| 3253 | { |
| 3254 | struct alc_spec *spec = codec->spec; |
| 3255 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 3256 | bool hp1_pin_sense, hp2_pin_sense; |
| 3257 | |
| 3258 | if (!hp_pin) { |
| 3259 | alc269_shutup(codec); |
| 3260 | return; |
| 3261 | } |
| 3262 | |
| 3263 | /* 3k pull low control for Headset jack. */ |
| 3264 | alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); |
| 3265 | |
| 3266 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3267 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); |
| 3268 | |
| 3269 | if (hp1_pin_sense || hp2_pin_sense) |
| 3270 | msleep(2); |
| 3271 | |
| 3272 | if (hp1_pin_sense) |
| 3273 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3274 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3275 | if (hp2_pin_sense) |
| 3276 | snd_hda_codec_write(codec, 0x16, 0, |
| 3277 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3278 | |
| 3279 | if (hp1_pin_sense || hp2_pin_sense) |
| 3280 | msleep(85); |
| 3281 | |
| 3282 | if (hp1_pin_sense) |
| 3283 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3284 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3285 | if (hp2_pin_sense) |
| 3286 | snd_hda_codec_write(codec, 0x16, 0, |
| 3287 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3288 | |
| 3289 | if (hp1_pin_sense || hp2_pin_sense) |
| 3290 | msleep(100); |
| 3291 | |
| 3292 | alc_auto_setup_eapd(codec, false); |
| 3293 | snd_hda_shutup_pins(codec); |
| 3294 | } |
| 3295 | |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3296 | static void alc_default_init(struct hda_codec *codec) |
| 3297 | { |
| 3298 | struct alc_spec *spec = codec->spec; |
| 3299 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 3300 | bool hp_pin_sense; |
| 3301 | |
| 3302 | if (!hp_pin) |
| 3303 | return; |
| 3304 | |
| 3305 | msleep(30); |
| 3306 | |
| 3307 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3308 | |
| 3309 | if (hp_pin_sense) |
| 3310 | msleep(2); |
| 3311 | |
| 3312 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3313 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3314 | |
| 3315 | if (hp_pin_sense) |
| 3316 | msleep(85); |
| 3317 | |
| 3318 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3319 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3320 | |
| 3321 | if (hp_pin_sense) |
| 3322 | msleep(100); |
| 3323 | } |
| 3324 | |
| 3325 | static void alc_default_shutup(struct hda_codec *codec) |
| 3326 | { |
| 3327 | struct alc_spec *spec = codec->spec; |
| 3328 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 3329 | bool hp_pin_sense; |
| 3330 | |
| 3331 | if (!hp_pin) { |
| 3332 | alc269_shutup(codec); |
| 3333 | return; |
| 3334 | } |
| 3335 | |
| 3336 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3337 | |
| 3338 | if (hp_pin_sense) |
| 3339 | msleep(2); |
| 3340 | |
| 3341 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3342 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3343 | |
| 3344 | if (hp_pin_sense) |
| 3345 | msleep(85); |
| 3346 | |
| 3347 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3348 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3349 | |
| 3350 | if (hp_pin_sense) |
| 3351 | msleep(100); |
| 3352 | |
| 3353 | alc_auto_setup_eapd(codec, false); |
| 3354 | snd_hda_shutup_pins(codec); |
| 3355 | } |
| 3356 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3357 | static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, |
| 3358 | unsigned int val) |
| 3359 | { |
| 3360 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3361 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ |
| 3362 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ |
| 3363 | } |
| 3364 | |
| 3365 | static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) |
| 3366 | { |
| 3367 | unsigned int val; |
| 3368 | |
| 3369 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3370 | val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3371 | & 0xffff; |
| 3372 | val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3373 | << 16; |
| 3374 | return val; |
| 3375 | } |
| 3376 | |
| 3377 | static void alc5505_dsp_halt(struct hda_codec *codec) |
| 3378 | { |
| 3379 | unsigned int val; |
| 3380 | |
| 3381 | alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ |
| 3382 | alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ |
| 3383 | alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ |
| 3384 | alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ |
| 3385 | alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ |
| 3386 | alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ |
| 3387 | alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ |
| 3388 | val = alc5505_coef_get(codec, 0x6220); |
| 3389 | alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ |
| 3390 | } |
| 3391 | |
| 3392 | static void alc5505_dsp_back_from_halt(struct hda_codec *codec) |
| 3393 | { |
| 3394 | alc5505_coef_set(codec, 0x61b8, 0x04133302); |
| 3395 | alc5505_coef_set(codec, 0x61b0, 0x00005b16); |
| 3396 | alc5505_coef_set(codec, 0x61b4, 0x040a2b02); |
| 3397 | alc5505_coef_set(codec, 0x6230, 0xf80d4011); |
| 3398 | alc5505_coef_set(codec, 0x6220, 0x2002010f); |
| 3399 | alc5505_coef_set(codec, 0x880c, 0x00000004); |
| 3400 | } |
| 3401 | |
| 3402 | static void alc5505_dsp_init(struct hda_codec *codec) |
| 3403 | { |
| 3404 | unsigned int val; |
| 3405 | |
| 3406 | alc5505_dsp_halt(codec); |
| 3407 | alc5505_dsp_back_from_halt(codec); |
| 3408 | alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ |
| 3409 | alc5505_coef_set(codec, 0x61b0, 0x5b16); |
| 3410 | alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ |
| 3411 | alc5505_coef_set(codec, 0x61b4, 0x04132b02); |
| 3412 | alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ |
| 3413 | alc5505_coef_set(codec, 0x61b8, 0x041f3302); |
| 3414 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ |
| 3415 | alc5505_coef_set(codec, 0x61b8, 0x041b3302); |
| 3416 | alc5505_coef_set(codec, 0x61b8, 0x04173302); |
| 3417 | alc5505_coef_set(codec, 0x61b8, 0x04163302); |
| 3418 | alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ |
| 3419 | alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ |
| 3420 | alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ |
| 3421 | |
| 3422 | val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ |
| 3423 | if (val <= 3) |
| 3424 | alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ |
| 3425 | else |
| 3426 | alc5505_coef_set(codec, 0x6220, 0x6002018f); |
| 3427 | |
| 3428 | alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ |
| 3429 | alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ |
| 3430 | alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ |
| 3431 | alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ |
| 3432 | alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ |
| 3433 | alc5505_coef_set(codec, 0x880c, 0x00000003); |
| 3434 | alc5505_coef_set(codec, 0x880c, 0x00000010); |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3435 | |
| 3436 | #ifdef HALT_REALTEK_ALC5505 |
| 3437 | alc5505_dsp_halt(codec); |
| 3438 | #endif |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3439 | } |
| 3440 | |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3441 | #ifdef HALT_REALTEK_ALC5505 |
| 3442 | #define alc5505_dsp_suspend(codec) /* NOP */ |
| 3443 | #define alc5505_dsp_resume(codec) /* NOP */ |
| 3444 | #else |
| 3445 | #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) |
| 3446 | #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) |
| 3447 | #endif |
| 3448 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3449 | #ifdef CONFIG_PM |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3450 | static int alc269_suspend(struct hda_codec *codec) |
| 3451 | { |
| 3452 | struct alc_spec *spec = codec->spec; |
| 3453 | |
| 3454 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3455 | alc5505_dsp_suspend(codec); |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3456 | return alc_suspend(codec); |
| 3457 | } |
| 3458 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3459 | static int alc269_resume(struct hda_codec *codec) |
| 3460 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3461 | struct alc_spec *spec = codec->spec; |
| 3462 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3463 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3464 | alc269vb_toggle_power_output(codec, 0); |
| 3465 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3466 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3467 | msleep(150); |
| 3468 | } |
| 3469 | |
| 3470 | codec->patch_ops.init(codec); |
| 3471 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3472 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3473 | alc269vb_toggle_power_output(codec, 1); |
| 3474 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3475 | (alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3476 | msleep(200); |
| 3477 | } |
| 3478 | |
Takashi Iwai | eeecd9d | 2015-02-25 15:18:50 +0100 | [diff] [blame] | 3479 | regcache_sync(codec->core.regmap); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3480 | hda_call_check_power_status(codec, 0x01); |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 3481 | |
| 3482 | /* on some machine, the BIOS will clear the codec gpio data when enter |
| 3483 | * suspend, and won't restore the data after resume, so we restore it |
| 3484 | * in the driver. |
| 3485 | */ |
| 3486 | if (spec->gpio_led) |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 3487 | snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_GPIO_DATA, |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 3488 | spec->gpio_led); |
| 3489 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3490 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3491 | alc5505_dsp_resume(codec); |
Kailang Yang | c5177c8 | 2013-07-24 14:39:49 +0200 | [diff] [blame] | 3492 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3493 | return 0; |
| 3494 | } |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3495 | #endif /* CONFIG_PM */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3496 | |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3497 | 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] | 3498 | const struct hda_fixup *fix, int action) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3499 | { |
| 3500 | struct alc_spec *spec = codec->spec; |
| 3501 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3502 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3503 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 3504 | } |
| 3505 | |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 3506 | static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, |
| 3507 | const struct hda_fixup *fix, |
| 3508 | int action) |
| 3509 | { |
| 3510 | unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); |
| 3511 | unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); |
| 3512 | |
| 3513 | if (cfg_headphone && cfg_headset_mic == 0x411111f0) |
| 3514 | snd_hda_codec_set_pincfg(codec, 0x19, |
| 3515 | (cfg_headphone & ~AC_DEFCFG_DEVICE) | |
| 3516 | (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT)); |
| 3517 | } |
| 3518 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3519 | static void alc269_fixup_hweq(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3520 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3521 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3522 | if (action == HDA_FIXUP_ACT_INIT) |
| 3523 | alc_update_coef_idx(codec, 0x1e, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3524 | } |
| 3525 | |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 3526 | static void alc269_fixup_headset_mic(struct hda_codec *codec, |
| 3527 | const struct hda_fixup *fix, int action) |
| 3528 | { |
| 3529 | struct alc_spec *spec = codec->spec; |
| 3530 | |
| 3531 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 3532 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3533 | } |
| 3534 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3535 | static void alc271_fixup_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3536 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3537 | { |
| 3538 | static const struct hda_verb verbs[] = { |
| 3539 | {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, |
| 3540 | {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, |
| 3541 | {} |
| 3542 | }; |
| 3543 | unsigned int cfg; |
| 3544 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 3545 | if (strcmp(codec->core.chip_name, "ALC271X") && |
| 3546 | strcmp(codec->core.chip_name, "ALC269VB")) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3547 | return; |
| 3548 | cfg = snd_hda_codec_get_pincfg(codec, 0x12); |
| 3549 | if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) |
| 3550 | snd_hda_sequence_write(codec, verbs); |
| 3551 | } |
| 3552 | |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3553 | static void alc269_fixup_pcm_44k(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3554 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3555 | { |
| 3556 | struct alc_spec *spec = codec->spec; |
| 3557 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3558 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3559 | return; |
| 3560 | |
| 3561 | /* Due to a hardware problem on Lenovo Ideadpad, we need to |
| 3562 | * fix the sample rate of analog I/O to 44.1kHz |
| 3563 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3564 | spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; |
| 3565 | spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3566 | } |
| 3567 | |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3568 | static void alc269_fixup_stereo_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3569 | const struct hda_fixup *fix, int action) |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3570 | { |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3571 | /* The digital-mic unit sends PDM (differential signal) instead of |
| 3572 | * the standard PCM, thus you can't record a valid mono stream as is. |
| 3573 | * Below is a workaround specific to ALC269 to control the dmic |
| 3574 | * signal source as mono. |
| 3575 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3576 | if (action == HDA_FIXUP_ACT_INIT) |
| 3577 | alc_update_coef_idx(codec, 0x07, 0, 0x80); |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3578 | } |
| 3579 | |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3580 | static void alc269_quanta_automute(struct hda_codec *codec) |
| 3581 | { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3582 | snd_hda_gen_update_outputs(codec); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3583 | |
Takashi Iwai | 1687ccc | 2014-08-18 13:49:35 +0200 | [diff] [blame] | 3584 | alc_write_coef_idx(codec, 0x0c, 0x680); |
| 3585 | alc_write_coef_idx(codec, 0x0c, 0x480); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3586 | } |
| 3587 | |
| 3588 | static void alc269_fixup_quanta_mute(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3589 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3590 | { |
| 3591 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3592 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3593 | return; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3594 | spec->gen.automute_hook = alc269_quanta_automute; |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3595 | } |
| 3596 | |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3597 | static void alc269_x101_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 3598 | struct hda_jack_callback *jack) |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3599 | { |
| 3600 | struct alc_spec *spec = codec->spec; |
| 3601 | int vref; |
| 3602 | msleep(200); |
| 3603 | snd_hda_gen_hp_automute(codec, jack); |
| 3604 | |
| 3605 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 3606 | msleep(100); |
| 3607 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 3608 | vref); |
| 3609 | msleep(500); |
| 3610 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 3611 | vref); |
| 3612 | } |
| 3613 | |
| 3614 | static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, |
| 3615 | const struct hda_fixup *fix, int action) |
| 3616 | { |
| 3617 | struct alc_spec *spec = codec->spec; |
| 3618 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3619 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3620 | spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; |
| 3621 | } |
| 3622 | } |
| 3623 | |
| 3624 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3625 | /* update mute-LED according to the speaker mute state via mic VREF pin */ |
| 3626 | static void alc269_fixup_mic_mute_hook(void *private_data, int enabled) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3627 | { |
| 3628 | struct hda_codec *codec = private_data; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3629 | struct alc_spec *spec = codec->spec; |
| 3630 | unsigned int pinval; |
| 3631 | |
| 3632 | if (spec->mute_led_polarity) |
| 3633 | enabled = !enabled; |
Takashi Iwai | 415d555 | 2014-04-03 11:51:21 +0200 | [diff] [blame] | 3634 | pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid); |
| 3635 | pinval &= ~AC_PINCTL_VREFEN; |
| 3636 | pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80; |
Takashi Iwai | e40bdb0 | 2018-03-17 22:40:18 +0100 | [diff] [blame] | 3637 | if (spec->mute_led_nid) { |
| 3638 | /* temporarily power up/down for setting VREF */ |
| 3639 | snd_hda_power_up_pm(codec); |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3640 | snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval); |
Takashi Iwai | e40bdb0 | 2018-03-17 22:40:18 +0100 | [diff] [blame] | 3641 | snd_hda_power_down_pm(codec); |
| 3642 | } |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3643 | } |
| 3644 | |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3645 | /* Make sure the led works even in runtime suspend */ |
| 3646 | static unsigned int led_power_filter(struct hda_codec *codec, |
| 3647 | hda_nid_t nid, |
| 3648 | unsigned int power_state) |
| 3649 | { |
| 3650 | struct alc_spec *spec = codec->spec; |
| 3651 | |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 3652 | if (power_state != AC_PWRST_D3 || nid == 0 || |
| 3653 | (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3654 | return power_state; |
| 3655 | |
| 3656 | /* Set pin ctl again, it might have just been set to 0 */ |
| 3657 | snd_hda_set_pin_ctl(codec, nid, |
| 3658 | snd_hda_codec_get_pin_target(codec, nid)); |
| 3659 | |
Takashi Iwai | cffd396 | 2015-04-09 10:30:25 +0200 | [diff] [blame] | 3660 | return snd_hda_gen_path_power_filter(codec, nid, power_state); |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3661 | } |
| 3662 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3663 | static void alc269_fixup_hp_mute_led(struct hda_codec *codec, |
| 3664 | const struct hda_fixup *fix, int action) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3665 | { |
| 3666 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3667 | const struct dmi_device *dev = NULL; |
| 3668 | |
| 3669 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 3670 | return; |
| 3671 | |
| 3672 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { |
| 3673 | int pol, pin; |
| 3674 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) |
| 3675 | continue; |
| 3676 | if (pin < 0x0a || pin >= 0x10) |
| 3677 | break; |
| 3678 | spec->mute_led_polarity = pol; |
| 3679 | spec->mute_led_nid = pin - 0x0a + 0x18; |
| 3680 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
Takashi Iwai | fd25a97 | 2012-12-20 14:57:18 +0100 | [diff] [blame] | 3681 | spec->gen.vmaster_mute_enum = 1; |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3682 | codec->power_filter = led_power_filter; |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3683 | codec_dbg(codec, |
| 3684 | "Detected mute LED for %x:%d\n", spec->mute_led_nid, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3685 | spec->mute_led_polarity); |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3686 | break; |
| 3687 | } |
| 3688 | } |
| 3689 | |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3690 | static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, |
| 3691 | const struct hda_fixup *fix, |
| 3692 | int action, hda_nid_t pin) |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3693 | { |
| 3694 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3695 | |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3696 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3697 | spec->mute_led_polarity = 0; |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3698 | spec->mute_led_nid = pin; |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3699 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
| 3700 | spec->gen.vmaster_mute_enum = 1; |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3701 | codec->power_filter = led_power_filter; |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3702 | } |
| 3703 | } |
| 3704 | |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3705 | static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, |
| 3706 | const struct hda_fixup *fix, int action) |
| 3707 | { |
| 3708 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); |
| 3709 | } |
| 3710 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3711 | static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, |
| 3712 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 3713 | { |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3714 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 3715 | } |
| 3716 | |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 3717 | static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, |
| 3718 | const struct hda_fixup *fix, int action) |
| 3719 | { |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3720 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 3721 | } |
| 3722 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3723 | /* update LED status via GPIO */ |
| 3724 | static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask, |
| 3725 | bool enabled) |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3726 | { |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3727 | struct alc_spec *spec = codec->spec; |
| 3728 | unsigned int oldval = spec->gpio_led; |
| 3729 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3730 | if (spec->mute_led_polarity) |
| 3731 | enabled = !enabled; |
| 3732 | |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3733 | if (enabled) |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3734 | spec->gpio_led &= ~mask; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3735 | else |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3736 | spec->gpio_led |= mask; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3737 | if (spec->gpio_led != oldval) |
| 3738 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
| 3739 | spec->gpio_led); |
| 3740 | } |
| 3741 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3742 | /* turn on/off mute LED via GPIO per vmaster hook */ |
| 3743 | static void alc_fixup_gpio_mute_hook(void *private_data, int enabled) |
| 3744 | { |
| 3745 | struct hda_codec *codec = private_data; |
| 3746 | struct alc_spec *spec = codec->spec; |
| 3747 | |
| 3748 | alc_update_gpio_led(codec, spec->gpio_mute_led_mask, enabled); |
| 3749 | } |
| 3750 | |
| 3751 | /* turn on/off mic-mute LED via GPIO per capture hook */ |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3752 | static void alc_gpio_micmute_update(struct hda_codec *codec) |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3753 | { |
| 3754 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3755 | |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3756 | alc_update_gpio_led(codec, spec->gpio_mic_led_mask, |
| 3757 | spec->gen.micmute_led.led_value); |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3758 | } |
| 3759 | |
| 3760 | static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, |
| 3761 | const struct hda_fixup *fix, int action) |
| 3762 | { |
| 3763 | struct alc_spec *spec = codec->spec; |
| 3764 | static const struct hda_verb gpio_init[] = { |
| 3765 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x18 }, |
| 3766 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x18 }, |
| 3767 | {} |
| 3768 | }; |
| 3769 | |
| 3770 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3771 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3772 | spec->gpio_led = 0; |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3773 | spec->mute_led_polarity = 0; |
| 3774 | spec->gpio_mute_led_mask = 0x08; |
| 3775 | spec->gpio_mic_led_mask = 0x10; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3776 | snd_hda_add_verbs(codec, gpio_init); |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3777 | snd_hda_gen_add_micmute_led(codec, alc_gpio_micmute_update); |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3778 | } |
| 3779 | } |
| 3780 | |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 3781 | static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, |
| 3782 | const struct hda_fixup *fix, int action) |
| 3783 | { |
| 3784 | struct alc_spec *spec = codec->spec; |
| 3785 | static const struct hda_verb gpio_init[] = { |
| 3786 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x22 }, |
| 3787 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x22 }, |
| 3788 | {} |
| 3789 | }; |
| 3790 | |
| 3791 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3792 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 3793 | spec->gpio_led = 0; |
| 3794 | spec->mute_led_polarity = 0; |
| 3795 | spec->gpio_mute_led_mask = 0x02; |
| 3796 | spec->gpio_mic_led_mask = 0x20; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3797 | snd_hda_add_verbs(codec, gpio_init); |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3798 | snd_hda_gen_add_micmute_led(codec, alc_gpio_micmute_update); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3799 | } |
| 3800 | } |
| 3801 | |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3802 | /* turn on/off mic-mute LED per capture hook */ |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3803 | static void alc_cap_micmute_update(struct hda_codec *codec) |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3804 | { |
| 3805 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3806 | unsigned int pinval; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3807 | |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3808 | if (!spec->cap_mute_led_nid) |
| 3809 | return; |
Hui Wang | fc1fad9 | 2014-07-08 17:56:14 +0800 | [diff] [blame] | 3810 | 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] | 3811 | pinval &= ~AC_PINCTL_VREFEN; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3812 | if (spec->gen.micmute_led.led_value) |
| 3813 | pinval |= AC_PINCTL_VREF_80; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3814 | else |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3815 | pinval |= AC_PINCTL_VREF_HIZ; |
| 3816 | snd_hda_set_pin_ctl_cache(codec, spec->cap_mute_led_nid, pinval); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3817 | } |
| 3818 | |
| 3819 | static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, |
| 3820 | const struct hda_fixup *fix, int action) |
| 3821 | { |
| 3822 | struct alc_spec *spec = codec->spec; |
| 3823 | static const struct hda_verb gpio_init[] = { |
| 3824 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x08 }, |
| 3825 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x08 }, |
| 3826 | {} |
| 3827 | }; |
| 3828 | |
| 3829 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3830 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3831 | spec->gpio_led = 0; |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3832 | spec->mute_led_polarity = 0; |
| 3833 | spec->gpio_mute_led_mask = 0x08; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3834 | spec->cap_mute_led_nid = 0x18; |
| 3835 | snd_hda_add_verbs(codec, gpio_init); |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3836 | snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update); |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 3837 | codec->power_filter = led_power_filter; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3838 | } |
| 3839 | } |
| 3840 | |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3841 | static void alc280_fixup_hp_gpio4(struct hda_codec *codec, |
| 3842 | const struct hda_fixup *fix, int action) |
| 3843 | { |
| 3844 | /* Like hp_gpio_mic1_led, but also needs GPIO4 low to enable headphone amp */ |
| 3845 | struct alc_spec *spec = codec->spec; |
| 3846 | static const struct hda_verb gpio_init[] = { |
| 3847 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x18 }, |
| 3848 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x18 }, |
| 3849 | {} |
| 3850 | }; |
| 3851 | |
| 3852 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3853 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3854 | spec->gpio_led = 0; |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3855 | spec->mute_led_polarity = 0; |
| 3856 | spec->gpio_mute_led_mask = 0x08; |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3857 | spec->cap_mute_led_nid = 0x18; |
| 3858 | snd_hda_add_verbs(codec, gpio_init); |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3859 | snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update); |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3860 | codec->power_filter = led_power_filter; |
| 3861 | } |
| 3862 | } |
| 3863 | |
Takashi Iwai | 6a30aba | 2018-04-27 17:17:35 +0200 | [diff] [blame] | 3864 | #if IS_REACHABLE(CONFIG_INPUT) |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3865 | static void gpio2_mic_hotkey_event(struct hda_codec *codec, |
| 3866 | struct hda_jack_callback *event) |
| 3867 | { |
| 3868 | struct alc_spec *spec = codec->spec; |
| 3869 | |
| 3870 | /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore |
| 3871 | send both key on and key off event for every interrupt. */ |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 3872 | input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3873 | input_sync(spec->kb_dev); |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 3874 | input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3875 | input_sync(spec->kb_dev); |
| 3876 | } |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3877 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3878 | static int alc_register_micmute_input_device(struct hda_codec *codec) |
| 3879 | { |
| 3880 | struct alc_spec *spec = codec->spec; |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 3881 | int i; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3882 | |
| 3883 | spec->kb_dev = input_allocate_device(); |
| 3884 | if (!spec->kb_dev) { |
| 3885 | codec_err(codec, "Out of memory (input_allocate_device)\n"); |
| 3886 | return -ENOMEM; |
| 3887 | } |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 3888 | |
| 3889 | spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE; |
| 3890 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3891 | spec->kb_dev->name = "Microphone Mute Button"; |
| 3892 | spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 3893 | spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]); |
| 3894 | spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map); |
| 3895 | spec->kb_dev->keycode = spec->alc_mute_keycode_map; |
| 3896 | for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++) |
| 3897 | set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3898 | |
| 3899 | if (input_register_device(spec->kb_dev)) { |
| 3900 | codec_err(codec, "input_register_device failed\n"); |
| 3901 | input_free_device(spec->kb_dev); |
| 3902 | spec->kb_dev = NULL; |
| 3903 | return -ENOMEM; |
| 3904 | } |
| 3905 | |
| 3906 | return 0; |
| 3907 | } |
| 3908 | |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3909 | static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, |
| 3910 | const struct hda_fixup *fix, int action) |
| 3911 | { |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3912 | /* GPIO1 = set according to SKU external amp |
| 3913 | GPIO2 = mic mute hotkey |
| 3914 | GPIO3 = mute LED |
| 3915 | GPIO4 = mic mute LED */ |
| 3916 | static const struct hda_verb gpio_init[] = { |
| 3917 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x1e }, |
| 3918 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x1a }, |
| 3919 | { 0x01, AC_VERB_SET_GPIO_DATA, 0x02 }, |
| 3920 | {} |
| 3921 | }; |
| 3922 | |
| 3923 | struct alc_spec *spec = codec->spec; |
| 3924 | |
| 3925 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 3926 | spec->init_amp = ALC_INIT_DEFAULT; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3927 | if (alc_register_micmute_input_device(codec) != 0) |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3928 | return; |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3929 | |
| 3930 | snd_hda_add_verbs(codec, gpio_init); |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 3931 | snd_hda_codec_write_cache(codec, codec->core.afg, 0, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3932 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 3933 | snd_hda_jack_detect_enable_callback(codec, codec->core.afg, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3934 | gpio2_mic_hotkey_event); |
| 3935 | |
| 3936 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3937 | spec->gpio_led = 0; |
| 3938 | spec->mute_led_polarity = 0; |
| 3939 | spec->gpio_mute_led_mask = 0x08; |
| 3940 | spec->gpio_mic_led_mask = 0x10; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3941 | snd_hda_gen_add_micmute_led(codec, alc_gpio_micmute_update); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3942 | return; |
| 3943 | } |
| 3944 | |
| 3945 | if (!spec->kb_dev) |
| 3946 | return; |
| 3947 | |
| 3948 | switch (action) { |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3949 | case HDA_FIXUP_ACT_FREE: |
| 3950 | input_unregister_device(spec->kb_dev); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3951 | spec->kb_dev = NULL; |
| 3952 | } |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3953 | } |
| 3954 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3955 | static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, |
| 3956 | const struct hda_fixup *fix, int action) |
| 3957 | { |
| 3958 | /* Line2 = mic mute hotkey |
| 3959 | GPIO2 = mic mute LED */ |
| 3960 | static const struct hda_verb gpio_init[] = { |
| 3961 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x04 }, |
| 3962 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04 }, |
| 3963 | {} |
| 3964 | }; |
| 3965 | |
| 3966 | struct alc_spec *spec = codec->spec; |
| 3967 | |
| 3968 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 3969 | spec->init_amp = ALC_INIT_DEFAULT; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3970 | if (alc_register_micmute_input_device(codec) != 0) |
| 3971 | return; |
| 3972 | |
| 3973 | snd_hda_add_verbs(codec, gpio_init); |
| 3974 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
| 3975 | gpio2_mic_hotkey_event); |
| 3976 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3977 | spec->gpio_led = 0; |
| 3978 | spec->mute_led_polarity = 0; |
| 3979 | spec->gpio_mic_led_mask = 0x04; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3980 | snd_hda_gen_add_micmute_led(codec, alc_gpio_micmute_update); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3981 | return; |
| 3982 | } |
| 3983 | |
| 3984 | if (!spec->kb_dev) |
| 3985 | return; |
| 3986 | |
| 3987 | switch (action) { |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3988 | case HDA_FIXUP_ACT_FREE: |
| 3989 | input_unregister_device(spec->kb_dev); |
| 3990 | spec->kb_dev = NULL; |
| 3991 | } |
| 3992 | } |
Takashi Iwai | c469652 | 2018-01-15 10:44:35 +0100 | [diff] [blame] | 3993 | #else /* INPUT */ |
| 3994 | #define alc280_fixup_hp_gpio2_mic_hotkey NULL |
| 3995 | #define alc233_fixup_lenovo_line2_mic_hotkey NULL |
| 3996 | #endif /* INPUT */ |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3997 | |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3998 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, |
| 3999 | const struct hda_fixup *fix, int action) |
| 4000 | { |
| 4001 | struct alc_spec *spec = codec->spec; |
| 4002 | |
Takashi Iwai | 1bce62a | 2018-06-19 23:15:59 +0200 | [diff] [blame] | 4003 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4004 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4005 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 4006 | snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4007 | } |
| 4008 | } |
| 4009 | |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4010 | static struct coef_fw alc225_pre_hsmode[] = { |
| 4011 | UPDATE_COEF(0x4a, 1<<8, 0), |
| 4012 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), |
| 4013 | UPDATE_COEF(0x63, 3<<14, 3<<14), |
| 4014 | UPDATE_COEF(0x4a, 3<<4, 2<<4), |
| 4015 | UPDATE_COEF(0x4a, 3<<10, 3<<10), |
| 4016 | UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), |
| 4017 | UPDATE_COEF(0x4a, 3<<10, 0), |
| 4018 | {} |
| 4019 | }; |
| 4020 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4021 | static void alc_headset_mode_unplugged(struct hda_codec *codec) |
| 4022 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4023 | static struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4024 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
| 4025 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 4026 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ |
| 4027 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ |
| 4028 | {} |
| 4029 | }; |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4030 | static struct coef_fw coef0255_1[] = { |
| 4031 | WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ |
| 4032 | {} |
| 4033 | }; |
| 4034 | static struct coef_fw coef0256[] = { |
| 4035 | WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */ |
| 4036 | {} |
| 4037 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4038 | static struct coef_fw coef0233[] = { |
| 4039 | WRITE_COEF(0x1b, 0x0c0b), |
| 4040 | WRITE_COEF(0x45, 0xc429), |
| 4041 | UPDATE_COEF(0x35, 0x4000, 0), |
| 4042 | WRITE_COEF(0x06, 0x2104), |
| 4043 | WRITE_COEF(0x1a, 0x0001), |
| 4044 | WRITE_COEF(0x26, 0x0004), |
| 4045 | WRITE_COEF(0x32, 0x42a3), |
| 4046 | {} |
| 4047 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4048 | static struct coef_fw coef0288[] = { |
| 4049 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
| 4050 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4051 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4052 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4053 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4054 | {} |
| 4055 | }; |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4056 | static struct coef_fw coef0298[] = { |
| 4057 | UPDATE_COEF(0x19, 0x1300, 0x0300), |
| 4058 | {} |
| 4059 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4060 | static struct coef_fw coef0292[] = { |
| 4061 | WRITE_COEF(0x76, 0x000e), |
| 4062 | WRITE_COEF(0x6c, 0x2400), |
| 4063 | WRITE_COEF(0x18, 0x7308), |
| 4064 | WRITE_COEF(0x6b, 0xc429), |
| 4065 | {} |
| 4066 | }; |
| 4067 | static struct coef_fw coef0293[] = { |
| 4068 | UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ |
| 4069 | UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ |
| 4070 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ |
| 4071 | UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ |
| 4072 | WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ |
| 4073 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 4074 | {} |
| 4075 | }; |
| 4076 | static struct coef_fw coef0668[] = { |
| 4077 | WRITE_COEF(0x15, 0x0d40), |
| 4078 | WRITE_COEF(0xb7, 0x802b), |
| 4079 | {} |
| 4080 | }; |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4081 | static struct coef_fw coef0225[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4082 | UPDATE_COEF(0x63, 3<<14, 0), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4083 | {} |
| 4084 | }; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4085 | static struct coef_fw coef0274[] = { |
| 4086 | UPDATE_COEF(0x4a, 0x0100, 0), |
| 4087 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0), |
| 4088 | UPDATE_COEF(0x6b, 0xf000, 0x5000), |
| 4089 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4090 | UPDATE_COEF(0x4a, 0x0c00, 0x0c00), |
| 4091 | WRITE_COEF(0x45, 0x5289), |
| 4092 | UPDATE_COEF(0x4a, 0x0c00, 0), |
| 4093 | {} |
| 4094 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4095 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4096 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4097 | case 0x10ec0255: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4098 | alc_process_coef_fw(codec, coef0255_1); |
| 4099 | alc_process_coef_fw(codec, coef0255); |
| 4100 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4101 | case 0x10ec0236: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4102 | case 0x10ec0256: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4103 | alc_process_coef_fw(codec, coef0256); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4104 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4105 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4106 | case 0x10ec0234: |
| 4107 | case 0x10ec0274: |
| 4108 | case 0x10ec0294: |
| 4109 | alc_process_coef_fw(codec, coef0274); |
| 4110 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4111 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4112 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4113 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4114 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4115 | case 0x10ec0286: |
| 4116 | case 0x10ec0288: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4117 | alc_process_coef_fw(codec, coef0288); |
| 4118 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4119 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4120 | alc_process_coef_fw(codec, coef0298); |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4121 | alc_process_coef_fw(codec, coef0288); |
| 4122 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4123 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4124 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4125 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4126 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4127 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4128 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4129 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4130 | alc_process_coef_fw(codec, coef0668); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4131 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4132 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4133 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4134 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4135 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4136 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4137 | case 0x10ec0299: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4138 | alc_process_coef_fw(codec, coef0225); |
| 4139 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4140 | case 0x10ec0867: |
| 4141 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4142 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4143 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4144 | codec_dbg(codec, "Headset jack set to unplugged mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4145 | } |
| 4146 | |
| 4147 | |
| 4148 | static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, |
| 4149 | hda_nid_t mic_pin) |
| 4150 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4151 | static struct coef_fw coef0255[] = { |
| 4152 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), |
| 4153 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ |
| 4154 | {} |
| 4155 | }; |
| 4156 | static struct coef_fw coef0233[] = { |
| 4157 | UPDATE_COEF(0x35, 0, 1<<14), |
| 4158 | WRITE_COEF(0x06, 0x2100), |
| 4159 | WRITE_COEF(0x1a, 0x0021), |
| 4160 | WRITE_COEF(0x26, 0x008c), |
| 4161 | {} |
| 4162 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4163 | static struct coef_fw coef0288[] = { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4164 | UPDATE_COEF(0x4f, 0x00c0, 0), |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4165 | UPDATE_COEF(0x50, 0x2000, 0), |
| 4166 | UPDATE_COEF(0x56, 0x0006, 0), |
| 4167 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
| 4168 | UPDATE_COEF(0x66, 0x0008, 0x0008), |
| 4169 | UPDATE_COEF(0x67, 0x2000, 0x2000), |
| 4170 | {} |
| 4171 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4172 | static struct coef_fw coef0292[] = { |
| 4173 | WRITE_COEF(0x19, 0xa208), |
| 4174 | WRITE_COEF(0x2e, 0xacf0), |
| 4175 | {} |
| 4176 | }; |
| 4177 | static struct coef_fw coef0293[] = { |
| 4178 | UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ |
| 4179 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ |
| 4180 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 4181 | {} |
| 4182 | }; |
| 4183 | static struct coef_fw coef0688[] = { |
| 4184 | WRITE_COEF(0xb7, 0x802b), |
| 4185 | WRITE_COEF(0xb5, 0x1040), |
| 4186 | UPDATE_COEF(0xc3, 0, 1<<12), |
| 4187 | {} |
| 4188 | }; |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4189 | static struct coef_fw coef0225[] = { |
| 4190 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), |
| 4191 | UPDATE_COEF(0x4a, 3<<4, 2<<4), |
| 4192 | UPDATE_COEF(0x63, 3<<14, 0), |
| 4193 | {} |
| 4194 | }; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4195 | static struct coef_fw coef0274[] = { |
| 4196 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000), |
| 4197 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4198 | UPDATE_COEF(0x6b, 0xf000, 0), |
| 4199 | {} |
| 4200 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4201 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4202 | switch (codec->core.vendor_id) { |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4203 | case 0x10ec0236: |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4204 | case 0x10ec0255: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4205 | case 0x10ec0256: |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4206 | alc_write_coef_idx(codec, 0x45, 0xc489); |
| 4207 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4208 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4209 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4210 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4211 | case 0x10ec0234: |
| 4212 | case 0x10ec0274: |
| 4213 | case 0x10ec0294: |
| 4214 | alc_write_coef_idx(codec, 0x45, 0x4689); |
| 4215 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4216 | alc_process_coef_fw(codec, coef0274); |
| 4217 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4218 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4219 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4220 | case 0x10ec0283: |
| 4221 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 4222 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4223 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4224 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4225 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4226 | case 0x10ec0286: |
| 4227 | case 0x10ec0288: |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4228 | case 0x10ec0298: |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4229 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4230 | alc_process_coef_fw(codec, coef0288); |
| 4231 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4232 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4233 | case 0x10ec0292: |
| 4234 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4235 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4236 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4237 | case 0x10ec0293: |
| 4238 | /* Set to TRS mode */ |
| 4239 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 4240 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4241 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4242 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4243 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4244 | case 0x10ec0867: |
| 4245 | alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); |
| 4246 | /* fallthru */ |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 4247 | case 0x10ec0221: |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 4248 | case 0x10ec0662: |
| 4249 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4250 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4251 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4252 | case 0x10ec0668: |
| 4253 | alc_write_coef_idx(codec, 0x11, 0x0001); |
| 4254 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4255 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4256 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4257 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4258 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4259 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4260 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4261 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4262 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4263 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4264 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4265 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); |
| 4266 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4267 | alc_process_coef_fw(codec, coef0225); |
| 4268 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4269 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4270 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4271 | codec_dbg(codec, "Headset jack set to mic-in mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4272 | } |
| 4273 | |
| 4274 | static void alc_headset_mode_default(struct hda_codec *codec) |
| 4275 | { |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4276 | static struct coef_fw coef0225[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4277 | UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10), |
| 4278 | UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10), |
| 4279 | UPDATE_COEF(0x49, 3<<8, 0<<8), |
| 4280 | UPDATE_COEF(0x4a, 3<<4, 3<<4), |
| 4281 | UPDATE_COEF(0x63, 3<<14, 0), |
| 4282 | UPDATE_COEF(0x67, 0xf000, 0x3000), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4283 | {} |
| 4284 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4285 | static struct coef_fw coef0255[] = { |
| 4286 | WRITE_COEF(0x45, 0xc089), |
| 4287 | WRITE_COEF(0x45, 0xc489), |
| 4288 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4289 | WRITE_COEF(0x49, 0x0049), |
| 4290 | {} |
| 4291 | }; |
| 4292 | static struct coef_fw coef0233[] = { |
| 4293 | WRITE_COEF(0x06, 0x2100), |
| 4294 | WRITE_COEF(0x32, 0x4ea3), |
| 4295 | {} |
| 4296 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4297 | static struct coef_fw coef0288[] = { |
| 4298 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ |
| 4299 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4300 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4301 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4302 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4303 | {} |
| 4304 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4305 | static struct coef_fw coef0292[] = { |
| 4306 | WRITE_COEF(0x76, 0x000e), |
| 4307 | WRITE_COEF(0x6c, 0x2400), |
| 4308 | WRITE_COEF(0x6b, 0xc429), |
| 4309 | WRITE_COEF(0x18, 0x7308), |
| 4310 | {} |
| 4311 | }; |
| 4312 | static struct coef_fw coef0293[] = { |
| 4313 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 4314 | WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ |
| 4315 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 4316 | {} |
| 4317 | }; |
| 4318 | static struct coef_fw coef0688[] = { |
| 4319 | WRITE_COEF(0x11, 0x0041), |
| 4320 | WRITE_COEF(0x15, 0x0d40), |
| 4321 | WRITE_COEF(0xb7, 0x802b), |
| 4322 | {} |
| 4323 | }; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4324 | static struct coef_fw coef0274[] = { |
| 4325 | WRITE_COEF(0x45, 0x4289), |
| 4326 | UPDATE_COEF(0x4a, 0x0010, 0x0010), |
| 4327 | UPDATE_COEF(0x6b, 0x0f00, 0), |
| 4328 | UPDATE_COEF(0x49, 0x0300, 0x0300), |
| 4329 | {} |
| 4330 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4331 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4332 | switch (codec->core.vendor_id) { |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4333 | case 0x10ec0215: |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4334 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4335 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4336 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4337 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4338 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4339 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4340 | alc_process_coef_fw(codec, coef0225); |
| 4341 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4342 | case 0x10ec0236: |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4343 | case 0x10ec0255: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4344 | case 0x10ec0256: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4345 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4346 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4347 | case 0x10ec0234: |
| 4348 | case 0x10ec0274: |
| 4349 | case 0x10ec0294: |
| 4350 | alc_process_coef_fw(codec, coef0274); |
| 4351 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4352 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4353 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4354 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4355 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4356 | case 0x10ec0286: |
| 4357 | case 0x10ec0288: |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4358 | case 0x10ec0298: |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4359 | alc_process_coef_fw(codec, coef0288); |
| 4360 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4361 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4362 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4363 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4364 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4365 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4366 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4367 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4368 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4369 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4370 | case 0x10ec0867: |
| 4371 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4372 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4373 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4374 | codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4375 | } |
| 4376 | |
| 4377 | /* Iphone type */ |
| 4378 | static void alc_headset_mode_ctia(struct hda_codec *codec) |
| 4379 | { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4380 | int val; |
| 4381 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4382 | static struct coef_fw coef0255[] = { |
| 4383 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
| 4384 | WRITE_COEF(0x1b, 0x0c2b), |
| 4385 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4386 | {} |
| 4387 | }; |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4388 | static struct coef_fw coef0256[] = { |
| 4389 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
| 4390 | WRITE_COEF(0x1b, 0x0c6b), |
| 4391 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4392 | {} |
| 4393 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4394 | static struct coef_fw coef0233[] = { |
| 4395 | WRITE_COEF(0x45, 0xd429), |
| 4396 | WRITE_COEF(0x1b, 0x0c2b), |
| 4397 | WRITE_COEF(0x32, 0x4ea3), |
| 4398 | {} |
| 4399 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4400 | static struct coef_fw coef0288[] = { |
| 4401 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4402 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4403 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4404 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4405 | {} |
| 4406 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4407 | static struct coef_fw coef0292[] = { |
| 4408 | WRITE_COEF(0x6b, 0xd429), |
| 4409 | WRITE_COEF(0x76, 0x0008), |
| 4410 | WRITE_COEF(0x18, 0x7388), |
| 4411 | {} |
| 4412 | }; |
| 4413 | static struct coef_fw coef0293[] = { |
| 4414 | WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ |
| 4415 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 4416 | {} |
| 4417 | }; |
| 4418 | static struct coef_fw coef0688[] = { |
| 4419 | WRITE_COEF(0x11, 0x0001), |
| 4420 | WRITE_COEF(0x15, 0x0d60), |
| 4421 | WRITE_COEF(0xc3, 0x0000), |
| 4422 | {} |
| 4423 | }; |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4424 | static struct coef_fw coef0225_1[] = { |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4425 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4426 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
| 4427 | {} |
| 4428 | }; |
| 4429 | static struct coef_fw coef0225_2[] = { |
| 4430 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
| 4431 | UPDATE_COEF(0x63, 3<<14, 1<<14), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4432 | {} |
| 4433 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4434 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4435 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4436 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4437 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4438 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4439 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4440 | case 0x10ec0256: |
| 4441 | alc_process_coef_fw(codec, coef0256); |
| 4442 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4443 | case 0x10ec0234: |
| 4444 | case 0x10ec0274: |
| 4445 | case 0x10ec0294: |
| 4446 | alc_write_coef_idx(codec, 0x45, 0xd689); |
| 4447 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4448 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4449 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4450 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4451 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4452 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4453 | val = alc_read_coef_idx(codec, 0x50); |
| 4454 | if (val & (1 << 12)) { |
| 4455 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); |
| 4456 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 4457 | msleep(300); |
| 4458 | } else { |
| 4459 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); |
| 4460 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 4461 | msleep(300); |
| 4462 | } |
| 4463 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4464 | case 0x10ec0286: |
| 4465 | case 0x10ec0288: |
| 4466 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 4467 | msleep(300); |
| 4468 | alc_process_coef_fw(codec, coef0288); |
| 4469 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4470 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4471 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4472 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4473 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4474 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4475 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4476 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4477 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4478 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4479 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4480 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4481 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4482 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4483 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4484 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4485 | val = alc_read_coef_idx(codec, 0x45); |
| 4486 | if (val & (1 << 9)) |
| 4487 | alc_process_coef_fw(codec, coef0225_2); |
| 4488 | else |
| 4489 | alc_process_coef_fw(codec, coef0225_1); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4490 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4491 | case 0x10ec0867: |
| 4492 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4493 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4494 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4495 | codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4496 | } |
| 4497 | |
| 4498 | /* Nokia type */ |
| 4499 | static void alc_headset_mode_omtp(struct hda_codec *codec) |
| 4500 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4501 | static struct coef_fw coef0255[] = { |
| 4502 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
| 4503 | WRITE_COEF(0x1b, 0x0c2b), |
| 4504 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4505 | {} |
| 4506 | }; |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4507 | static struct coef_fw coef0256[] = { |
| 4508 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
| 4509 | WRITE_COEF(0x1b, 0x0c6b), |
| 4510 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4511 | {} |
| 4512 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4513 | static struct coef_fw coef0233[] = { |
| 4514 | WRITE_COEF(0x45, 0xe429), |
| 4515 | WRITE_COEF(0x1b, 0x0c2b), |
| 4516 | WRITE_COEF(0x32, 0x4ea3), |
| 4517 | {} |
| 4518 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4519 | static struct coef_fw coef0288[] = { |
| 4520 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4521 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4522 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4523 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4524 | {} |
| 4525 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4526 | static struct coef_fw coef0292[] = { |
| 4527 | WRITE_COEF(0x6b, 0xe429), |
| 4528 | WRITE_COEF(0x76, 0x0008), |
| 4529 | WRITE_COEF(0x18, 0x7388), |
| 4530 | {} |
| 4531 | }; |
| 4532 | static struct coef_fw coef0293[] = { |
| 4533 | WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ |
| 4534 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 4535 | {} |
| 4536 | }; |
| 4537 | static struct coef_fw coef0688[] = { |
| 4538 | WRITE_COEF(0x11, 0x0001), |
| 4539 | WRITE_COEF(0x15, 0x0d50), |
| 4540 | WRITE_COEF(0xc3, 0x0000), |
| 4541 | {} |
| 4542 | }; |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4543 | static struct coef_fw coef0225[] = { |
| 4544 | UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4545 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4546 | {} |
| 4547 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4548 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4549 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4550 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4551 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4552 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4553 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4554 | case 0x10ec0256: |
| 4555 | alc_process_coef_fw(codec, coef0256); |
| 4556 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4557 | case 0x10ec0234: |
| 4558 | case 0x10ec0274: |
| 4559 | case 0x10ec0294: |
| 4560 | alc_write_coef_idx(codec, 0x45, 0xe689); |
| 4561 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4562 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4563 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4564 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4565 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4566 | case 0x10ec0298: |
| 4567 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4568 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
| 4569 | msleep(300); |
| 4570 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4571 | case 0x10ec0286: |
| 4572 | case 0x10ec0288: |
| 4573 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
| 4574 | msleep(300); |
| 4575 | alc_process_coef_fw(codec, coef0288); |
| 4576 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4577 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4578 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4579 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4580 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4581 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4582 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4583 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4584 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4585 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4586 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4587 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4588 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4589 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4590 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4591 | case 0x10ec0299: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4592 | alc_process_coef_fw(codec, coef0225); |
| 4593 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4594 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4595 | codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4596 | } |
| 4597 | |
| 4598 | static void alc_determine_headset_type(struct hda_codec *codec) |
| 4599 | { |
| 4600 | int val; |
| 4601 | bool is_ctia = false; |
| 4602 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4603 | static struct coef_fw coef0255[] = { |
| 4604 | WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ |
| 4605 | WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref |
| 4606 | conteol) */ |
| 4607 | {} |
| 4608 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4609 | static struct coef_fw coef0288[] = { |
| 4610 | UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ |
| 4611 | {} |
| 4612 | }; |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4613 | static struct coef_fw coef0298[] = { |
| 4614 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4615 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4616 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4617 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4618 | UPDATE_COEF(0x19, 0x1300, 0x1300), |
| 4619 | {} |
| 4620 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4621 | static struct coef_fw coef0293[] = { |
| 4622 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ |
| 4623 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ |
| 4624 | {} |
| 4625 | }; |
| 4626 | static struct coef_fw coef0688[] = { |
| 4627 | WRITE_COEF(0x11, 0x0001), |
| 4628 | WRITE_COEF(0xb7, 0x802b), |
| 4629 | WRITE_COEF(0x15, 0x0d60), |
| 4630 | WRITE_COEF(0xc3, 0x0c00), |
| 4631 | {} |
| 4632 | }; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4633 | static struct coef_fw coef0274[] = { |
| 4634 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4635 | UPDATE_COEF(0x4a, 0x8000, 0), |
| 4636 | WRITE_COEF(0x45, 0xd289), |
| 4637 | UPDATE_COEF(0x49, 0x0300, 0x0300), |
| 4638 | {} |
| 4639 | }; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4640 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4641 | switch (codec->core.vendor_id) { |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4642 | case 0x10ec0236: |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4643 | case 0x10ec0255: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4644 | case 0x10ec0256: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4645 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4646 | msleep(300); |
| 4647 | val = alc_read_coef_idx(codec, 0x46); |
| 4648 | is_ctia = (val & 0x0070) == 0x0070; |
| 4649 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4650 | case 0x10ec0234: |
| 4651 | case 0x10ec0274: |
| 4652 | case 0x10ec0294: |
| 4653 | alc_process_coef_fw(codec, coef0274); |
| 4654 | msleep(80); |
| 4655 | val = alc_read_coef_idx(codec, 0x46); |
| 4656 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 4657 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4658 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4659 | case 0x10ec0283: |
| 4660 | alc_write_coef_idx(codec, 0x45, 0xd029); |
| 4661 | msleep(300); |
| 4662 | val = alc_read_coef_idx(codec, 0x46); |
| 4663 | is_ctia = (val & 0x0070) == 0x0070; |
| 4664 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4665 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4666 | snd_hda_codec_write(codec, 0x21, 0, |
| 4667 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 4668 | msleep(100); |
| 4669 | snd_hda_codec_write(codec, 0x21, 0, |
| 4670 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 4671 | msleep(200); |
| 4672 | |
| 4673 | val = alc_read_coef_idx(codec, 0x50); |
| 4674 | if (val & (1 << 12)) { |
| 4675 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); |
| 4676 | alc_process_coef_fw(codec, coef0288); |
| 4677 | msleep(350); |
| 4678 | val = alc_read_coef_idx(codec, 0x50); |
| 4679 | is_ctia = (val & 0x0070) == 0x0070; |
| 4680 | } else { |
| 4681 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); |
| 4682 | alc_process_coef_fw(codec, coef0288); |
| 4683 | msleep(350); |
| 4684 | val = alc_read_coef_idx(codec, 0x50); |
| 4685 | is_ctia = (val & 0x0070) == 0x0070; |
| 4686 | } |
| 4687 | alc_process_coef_fw(codec, coef0298); |
| 4688 | snd_hda_codec_write(codec, 0x21, 0, |
| 4689 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); |
| 4690 | msleep(75); |
| 4691 | snd_hda_codec_write(codec, 0x21, 0, |
| 4692 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
| 4693 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4694 | case 0x10ec0286: |
| 4695 | case 0x10ec0288: |
| 4696 | alc_process_coef_fw(codec, coef0288); |
| 4697 | msleep(350); |
| 4698 | val = alc_read_coef_idx(codec, 0x50); |
| 4699 | is_ctia = (val & 0x0070) == 0x0070; |
| 4700 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4701 | case 0x10ec0292: |
| 4702 | alc_write_coef_idx(codec, 0x6b, 0xd429); |
| 4703 | msleep(300); |
| 4704 | val = alc_read_coef_idx(codec, 0x6c); |
| 4705 | is_ctia = (val & 0x001c) == 0x001c; |
| 4706 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4707 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4708 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4709 | msleep(300); |
| 4710 | val = alc_read_coef_idx(codec, 0x46); |
| 4711 | is_ctia = (val & 0x0070) == 0x0070; |
| 4712 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4713 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4714 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4715 | msleep(300); |
| 4716 | val = alc_read_coef_idx(codec, 0xbe); |
| 4717 | is_ctia = (val & 0x1c02) == 0x1c02; |
| 4718 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4719 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4720 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4721 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4722 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4723 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4724 | case 0x10ec0299: |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 4725 | snd_hda_codec_write(codec, 0x21, 0, |
| 4726 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 4727 | msleep(80); |
| 4728 | snd_hda_codec_write(codec, 0x21, 0, |
| 4729 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 4730 | |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4731 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
| 4732 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); |
| 4733 | val = alc_read_coef_idx(codec, 0x45); |
| 4734 | if (val & (1 << 9)) { |
| 4735 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); |
| 4736 | alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); |
| 4737 | msleep(800); |
| 4738 | val = alc_read_coef_idx(codec, 0x46); |
| 4739 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 4740 | } else { |
| 4741 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); |
| 4742 | alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); |
| 4743 | msleep(800); |
| 4744 | val = alc_read_coef_idx(codec, 0x46); |
| 4745 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 4746 | } |
| 4747 | alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); |
| 4748 | alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); |
| 4749 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 4750 | |
| 4751 | snd_hda_codec_write(codec, 0x21, 0, |
| 4752 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 4753 | msleep(80); |
| 4754 | snd_hda_codec_write(codec, 0x21, 0, |
| 4755 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4756 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4757 | case 0x10ec0867: |
| 4758 | is_ctia = true; |
| 4759 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4760 | } |
| 4761 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4762 | codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4763 | is_ctia ? "yes" : "no"); |
| 4764 | spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; |
| 4765 | } |
| 4766 | |
| 4767 | static void alc_update_headset_mode(struct hda_codec *codec) |
| 4768 | { |
| 4769 | struct alc_spec *spec = codec->spec; |
| 4770 | |
| 4771 | hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]]; |
| 4772 | hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 4773 | |
| 4774 | int new_headset_mode; |
| 4775 | |
| 4776 | if (!snd_hda_jack_detect(codec, hp_pin)) |
| 4777 | new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; |
| 4778 | else if (mux_pin == spec->headset_mic_pin) |
| 4779 | new_headset_mode = ALC_HEADSET_MODE_HEADSET; |
| 4780 | else if (mux_pin == spec->headphone_mic_pin) |
| 4781 | new_headset_mode = ALC_HEADSET_MODE_MIC; |
| 4782 | else |
| 4783 | new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; |
| 4784 | |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 4785 | if (new_headset_mode == spec->current_headset_mode) { |
| 4786 | snd_hda_gen_update_outputs(codec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4787 | return; |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 4788 | } |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4789 | |
| 4790 | switch (new_headset_mode) { |
| 4791 | case ALC_HEADSET_MODE_UNPLUGGED: |
| 4792 | alc_headset_mode_unplugged(codec); |
| 4793 | spec->gen.hp_jack_present = false; |
| 4794 | break; |
| 4795 | case ALC_HEADSET_MODE_HEADSET: |
| 4796 | if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) |
| 4797 | alc_determine_headset_type(codec); |
| 4798 | if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) |
| 4799 | alc_headset_mode_ctia(codec); |
| 4800 | else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) |
| 4801 | alc_headset_mode_omtp(codec); |
| 4802 | spec->gen.hp_jack_present = true; |
| 4803 | break; |
| 4804 | case ALC_HEADSET_MODE_MIC: |
| 4805 | alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); |
| 4806 | spec->gen.hp_jack_present = false; |
| 4807 | break; |
| 4808 | case ALC_HEADSET_MODE_HEADPHONE: |
| 4809 | alc_headset_mode_default(codec); |
| 4810 | spec->gen.hp_jack_present = true; |
| 4811 | break; |
| 4812 | } |
| 4813 | if (new_headset_mode != ALC_HEADSET_MODE_MIC) { |
| 4814 | snd_hda_set_pin_ctl_cache(codec, hp_pin, |
| 4815 | AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 4816 | if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4817 | snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, |
| 4818 | PIN_VREFHIZ); |
| 4819 | } |
| 4820 | spec->current_headset_mode = new_headset_mode; |
| 4821 | |
| 4822 | snd_hda_gen_update_outputs(codec); |
| 4823 | } |
| 4824 | |
| 4825 | static void alc_update_headset_mode_hook(struct hda_codec *codec, |
Takashi Iwai | 7fe3071 | 2014-01-30 17:59:02 +0100 | [diff] [blame] | 4826 | struct snd_kcontrol *kcontrol, |
| 4827 | struct snd_ctl_elem_value *ucontrol) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4828 | { |
| 4829 | alc_update_headset_mode(codec); |
| 4830 | } |
| 4831 | |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 4832 | static void alc_update_headset_jack_cb(struct hda_codec *codec, |
| 4833 | struct hda_jack_callback *jack) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4834 | { |
| 4835 | struct alc_spec *spec = codec->spec; |
David Henningsson | 5db4d34 | 2013-11-22 12:17:06 +0100 | [diff] [blame] | 4836 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4837 | snd_hda_gen_hp_automute(codec, jack); |
| 4838 | } |
| 4839 | |
| 4840 | static void alc_probe_headset_mode(struct hda_codec *codec) |
| 4841 | { |
| 4842 | int i; |
| 4843 | struct alc_spec *spec = codec->spec; |
| 4844 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 4845 | |
| 4846 | /* Find mic pins */ |
| 4847 | for (i = 0; i < cfg->num_inputs; i++) { |
| 4848 | if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) |
| 4849 | spec->headset_mic_pin = cfg->inputs[i].pin; |
| 4850 | if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) |
| 4851 | spec->headphone_mic_pin = cfg->inputs[i].pin; |
| 4852 | } |
| 4853 | |
Takashi Iwai | 0bed2aa | 2018-06-19 12:45:53 +0200 | [diff] [blame] | 4854 | WARN_ON(spec->gen.cap_sync_hook); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4855 | spec->gen.cap_sync_hook = alc_update_headset_mode_hook; |
| 4856 | spec->gen.automute_hook = alc_update_headset_mode; |
| 4857 | spec->gen.hp_automute_hook = alc_update_headset_jack_cb; |
| 4858 | } |
| 4859 | |
| 4860 | static void alc_fixup_headset_mode(struct hda_codec *codec, |
| 4861 | const struct hda_fixup *fix, int action) |
| 4862 | { |
| 4863 | struct alc_spec *spec = codec->spec; |
| 4864 | |
| 4865 | switch (action) { |
| 4866 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 4867 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; |
| 4868 | break; |
| 4869 | case HDA_FIXUP_ACT_PROBE: |
| 4870 | alc_probe_headset_mode(codec); |
| 4871 | break; |
| 4872 | case HDA_FIXUP_ACT_INIT: |
| 4873 | spec->current_headset_mode = 0; |
| 4874 | alc_update_headset_mode(codec); |
| 4875 | break; |
| 4876 | } |
| 4877 | } |
| 4878 | |
| 4879 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
| 4880 | const struct hda_fixup *fix, int action) |
| 4881 | { |
| 4882 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4883 | struct alc_spec *spec = codec->spec; |
| 4884 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 4885 | } |
| 4886 | else |
| 4887 | alc_fixup_headset_mode(codec, fix, action); |
| 4888 | } |
| 4889 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4890 | static void alc255_set_default_jack_type(struct hda_codec *codec) |
| 4891 | { |
| 4892 | /* Set to iphone type */ |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4893 | static struct coef_fw alc255fw[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4894 | WRITE_COEF(0x1b, 0x880b), |
| 4895 | WRITE_COEF(0x45, 0xd089), |
| 4896 | WRITE_COEF(0x1b, 0x080b), |
| 4897 | WRITE_COEF(0x46, 0x0004), |
| 4898 | WRITE_COEF(0x1b, 0x0c0b), |
| 4899 | {} |
| 4900 | }; |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4901 | static struct coef_fw alc256fw[] = { |
| 4902 | WRITE_COEF(0x1b, 0x884b), |
| 4903 | WRITE_COEF(0x45, 0xd089), |
| 4904 | WRITE_COEF(0x1b, 0x084b), |
| 4905 | WRITE_COEF(0x46, 0x0004), |
| 4906 | WRITE_COEF(0x1b, 0x0c4b), |
| 4907 | {} |
| 4908 | }; |
| 4909 | switch (codec->core.vendor_id) { |
| 4910 | case 0x10ec0255: |
| 4911 | alc_process_coef_fw(codec, alc255fw); |
| 4912 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4913 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4914 | case 0x10ec0256: |
| 4915 | alc_process_coef_fw(codec, alc256fw); |
| 4916 | break; |
| 4917 | } |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4918 | msleep(30); |
| 4919 | } |
| 4920 | |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4921 | static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, |
| 4922 | const struct hda_fixup *fix, int action) |
| 4923 | { |
| 4924 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4925 | alc255_set_default_jack_type(codec); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4926 | } |
| 4927 | alc_fixup_headset_mode(codec, fix, action); |
| 4928 | } |
| 4929 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4930 | static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, |
| 4931 | const struct hda_fixup *fix, int action) |
| 4932 | { |
| 4933 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4934 | struct alc_spec *spec = codec->spec; |
| 4935 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 4936 | alc255_set_default_jack_type(codec); |
| 4937 | } |
| 4938 | else |
| 4939 | alc_fixup_headset_mode(codec, fix, action); |
| 4940 | } |
| 4941 | |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 4942 | static void alc288_update_headset_jack_cb(struct hda_codec *codec, |
| 4943 | struct hda_jack_callback *jack) |
| 4944 | { |
| 4945 | struct alc_spec *spec = codec->spec; |
| 4946 | int present; |
| 4947 | |
| 4948 | alc_update_headset_jack_cb(codec, jack); |
| 4949 | /* Headset Mic enable or disable, only for Dell Dino */ |
| 4950 | present = spec->gen.hp_jack_present ? 0x40 : 0; |
| 4951 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
| 4952 | present); |
| 4953 | } |
| 4954 | |
| 4955 | static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, |
| 4956 | const struct hda_fixup *fix, int action) |
| 4957 | { |
| 4958 | alc_fixup_headset_mode(codec, fix, action); |
| 4959 | if (action == HDA_FIXUP_ACT_PROBE) { |
| 4960 | struct alc_spec *spec = codec->spec; |
| 4961 | spec->gen.hp_automute_hook = alc288_update_headset_jack_cb; |
| 4962 | } |
| 4963 | } |
| 4964 | |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 4965 | static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, |
| 4966 | const struct hda_fixup *fix, int action) |
| 4967 | { |
| 4968 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4969 | struct alc_spec *spec = codec->spec; |
| 4970 | spec->gen.auto_mute_via_amp = 1; |
| 4971 | } |
| 4972 | } |
| 4973 | |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 4974 | static void alc_no_shutup(struct hda_codec *codec) |
| 4975 | { |
| 4976 | } |
| 4977 | |
| 4978 | static void alc_fixup_no_shutup(struct hda_codec *codec, |
| 4979 | const struct hda_fixup *fix, int action) |
| 4980 | { |
Gabriele Mazzotta | 972aa2c | 2016-12-24 19:50:00 +0100 | [diff] [blame] | 4981 | if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 4982 | struct alc_spec *spec = codec->spec; |
| 4983 | spec->shutup = alc_no_shutup; |
| 4984 | } |
| 4985 | } |
| 4986 | |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 4987 | static void alc_fixup_disable_aamix(struct hda_codec *codec, |
| 4988 | const struct hda_fixup *fix, int action) |
| 4989 | { |
| 4990 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4991 | struct alc_spec *spec = codec->spec; |
| 4992 | /* Disable AA-loopback as it causes white noise */ |
| 4993 | spec->gen.mixer_nid = 0; |
| 4994 | } |
| 4995 | } |
| 4996 | |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 4997 | /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */ |
| 4998 | static void alc_fixup_tpt440_dock(struct hda_codec *codec, |
| 4999 | const struct hda_fixup *fix, int action) |
| 5000 | { |
| 5001 | static const struct hda_pintbl pincfgs[] = { |
| 5002 | { 0x16, 0x21211010 }, /* dock headphone */ |
| 5003 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 5004 | { } |
| 5005 | }; |
| 5006 | struct alc_spec *spec = codec->spec; |
| 5007 | |
| 5008 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 5009 | spec->reboot_notify = alc_d3_at_reboot; /* reduce noise */ |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 5010 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 5011 | codec->power_save_node = 0; /* avoid click noises */ |
| 5012 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 5013 | } |
| 5014 | } |
| 5015 | |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5016 | static void alc_fixup_tpt470_dock(struct hda_codec *codec, |
| 5017 | const struct hda_fixup *fix, int action) |
| 5018 | { |
| 5019 | static const struct hda_pintbl pincfgs[] = { |
| 5020 | { 0x17, 0x21211010 }, /* dock headphone */ |
| 5021 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 5022 | { } |
| 5023 | }; |
| 5024 | struct alc_spec *spec = codec->spec; |
| 5025 | |
| 5026 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5027 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
Takashi Iwai | 71db96d | 2018-02-26 15:36:38 +0100 | [diff] [blame] | 5028 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 5029 | } else if (action == HDA_FIXUP_ACT_INIT) { |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5030 | /* Enable DOCK device */ |
| 5031 | snd_hda_codec_write(codec, 0x17, 0, |
| 5032 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); |
| 5033 | /* Enable DOCK device */ |
| 5034 | snd_hda_codec_write(codec, 0x19, 0, |
| 5035 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5036 | } |
| 5037 | } |
| 5038 | |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5039 | static void alc_shutup_dell_xps13(struct hda_codec *codec) |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5040 | { |
| 5041 | struct alc_spec *spec = codec->spec; |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5042 | int hp_pin = spec->gen.autocfg.hp_pins[0]; |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5043 | |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5044 | /* Prevent pop noises when headphones are plugged in */ |
| 5045 | snd_hda_codec_write(codec, hp_pin, 0, |
| 5046 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5047 | msleep(20); |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5048 | } |
| 5049 | |
| 5050 | static void alc_fixup_dell_xps13(struct hda_codec *codec, |
| 5051 | const struct hda_fixup *fix, int action) |
| 5052 | { |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5053 | struct alc_spec *spec = codec->spec; |
| 5054 | struct hda_input_mux *imux = &spec->gen.input_mux; |
| 5055 | int i; |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 5056 | |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5057 | switch (action) { |
| 5058 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5059 | /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise |
| 5060 | * it causes a click noise at start up |
| 5061 | */ |
| 5062 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); |
| 5063 | break; |
| 5064 | case HDA_FIXUP_ACT_PROBE: |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5065 | spec->shutup = alc_shutup_dell_xps13; |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 5066 | |
| 5067 | /* Make the internal mic the default input source. */ |
| 5068 | for (i = 0; i < imux->num_items; i++) { |
| 5069 | if (spec->gen.imux_pins[i] == 0x12) { |
| 5070 | spec->gen.cur_mux[0] = i; |
| 5071 | break; |
| 5072 | } |
| 5073 | } |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5074 | break; |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5075 | } |
| 5076 | } |
| 5077 | |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 5078 | static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, |
| 5079 | const struct hda_fixup *fix, int action) |
| 5080 | { |
| 5081 | struct alc_spec *spec = codec->spec; |
| 5082 | |
| 5083 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5084 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5085 | spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */ |
David Henningsson | b40eda6 | 2015-05-28 09:40:23 +0200 | [diff] [blame] | 5086 | |
| 5087 | /* Disable boost for mic-in permanently. (This code is only called |
| 5088 | from quirks that guarantee that the headphone is at NID 0x1b.) */ |
| 5089 | snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); |
| 5090 | snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP); |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 5091 | } else |
| 5092 | alc_fixup_headset_mode(codec, fix, action); |
| 5093 | } |
| 5094 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5095 | static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, |
| 5096 | const struct hda_fixup *fix, int action) |
| 5097 | { |
| 5098 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5099 | alc_write_coef_idx(codec, 0xc4, 0x8000); |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5100 | alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5101 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
| 5102 | } |
| 5103 | alc_fixup_headset_mode(codec, fix, action); |
| 5104 | } |
| 5105 | |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5106 | /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ |
| 5107 | static int find_ext_mic_pin(struct hda_codec *codec) |
| 5108 | { |
| 5109 | struct alc_spec *spec = codec->spec; |
| 5110 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5111 | hda_nid_t nid; |
| 5112 | unsigned int defcfg; |
| 5113 | int i; |
| 5114 | |
| 5115 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5116 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 5117 | continue; |
| 5118 | nid = cfg->inputs[i].pin; |
| 5119 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 5120 | if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) |
| 5121 | continue; |
| 5122 | return nid; |
| 5123 | } |
| 5124 | |
| 5125 | return 0; |
| 5126 | } |
| 5127 | |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5128 | static void alc271_hp_gate_mic_jack(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5129 | const struct hda_fixup *fix, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5130 | int action) |
| 5131 | { |
| 5132 | struct alc_spec *spec = codec->spec; |
| 5133 | |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5134 | if (action == HDA_FIXUP_ACT_PROBE) { |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5135 | int mic_pin = find_ext_mic_pin(codec); |
| 5136 | int hp_pin = spec->gen.autocfg.hp_pins[0]; |
| 5137 | |
| 5138 | if (snd_BUG_ON(!mic_pin || !hp_pin)) |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5139 | return; |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5140 | snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5141 | } |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5142 | } |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5143 | |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 5144 | static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, |
| 5145 | const struct hda_fixup *fix, |
| 5146 | int action) |
| 5147 | { |
| 5148 | struct alc_spec *spec = codec->spec; |
| 5149 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5150 | int i; |
| 5151 | |
| 5152 | /* The mic boosts on level 2 and 3 are too noisy |
| 5153 | on the internal mic input. |
| 5154 | Therefore limit the boost to 0 or 1. */ |
| 5155 | |
| 5156 | if (action != HDA_FIXUP_ACT_PROBE) |
| 5157 | return; |
| 5158 | |
| 5159 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5160 | hda_nid_t nid = cfg->inputs[i].pin; |
| 5161 | unsigned int defcfg; |
| 5162 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 5163 | continue; |
| 5164 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 5165 | if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) |
| 5166 | continue; |
| 5167 | |
| 5168 | snd_hda_override_amp_caps(codec, nid, HDA_INPUT, |
| 5169 | (0x00 << AC_AMPCAP_OFFSET_SHIFT) | |
| 5170 | (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 5171 | (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 5172 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 5173 | } |
| 5174 | } |
| 5175 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5176 | static void alc283_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 5177 | struct hda_jack_callback *jack) |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5178 | { |
| 5179 | struct alc_spec *spec = codec->spec; |
| 5180 | int vref; |
| 5181 | |
| 5182 | msleep(200); |
| 5183 | snd_hda_gen_hp_automute(codec, jack); |
| 5184 | |
| 5185 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 5186 | |
| 5187 | msleep(600); |
| 5188 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 5189 | vref); |
| 5190 | } |
| 5191 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5192 | static void alc283_fixup_chromebook(struct hda_codec *codec, |
| 5193 | const struct hda_fixup *fix, int action) |
| 5194 | { |
| 5195 | struct alc_spec *spec = codec->spec; |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5196 | |
| 5197 | switch (action) { |
| 5198 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5199 | snd_hda_override_wcaps(codec, 0x03, 0); |
Takashi Iwai | d2e9270 | 2013-10-30 07:50:53 +0100 | [diff] [blame] | 5200 | /* Disable AA-loopback as it causes white noise */ |
| 5201 | spec->gen.mixer_nid = 0; |
Kailang Yang | 3807021 | 2013-11-01 15:57:35 +0800 | [diff] [blame] | 5202 | break; |
| 5203 | case HDA_FIXUP_ACT_INIT: |
Kailang Yang | de9481c | 2014-04-07 16:41:52 +0800 | [diff] [blame] | 5204 | /* MIC2-VREF control */ |
| 5205 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5206 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5207 | /* Enable Line1 input control by verb */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5208 | alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5209 | break; |
| 5210 | } |
| 5211 | } |
| 5212 | |
| 5213 | static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, |
| 5214 | const struct hda_fixup *fix, int action) |
| 5215 | { |
| 5216 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5217 | |
| 5218 | switch (action) { |
| 5219 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5220 | spec->gen.hp_automute_hook = alc283_hp_automute_hook; |
| 5221 | break; |
| 5222 | case HDA_FIXUP_ACT_INIT: |
| 5223 | /* MIC2-VREF control */ |
| 5224 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5225 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5226 | break; |
| 5227 | } |
| 5228 | } |
| 5229 | |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5230 | /* mute tablet speaker pin (0x14) via dock plugging in addition */ |
| 5231 | static void asus_tx300_automute(struct hda_codec *codec) |
| 5232 | { |
| 5233 | struct alc_spec *spec = codec->spec; |
| 5234 | snd_hda_gen_update_outputs(codec); |
| 5235 | if (snd_hda_jack_detect(codec, 0x1b)) |
| 5236 | spec->gen.mute_bits |= (1ULL << 0x14); |
| 5237 | } |
| 5238 | |
| 5239 | static void alc282_fixup_asus_tx300(struct hda_codec *codec, |
| 5240 | const struct hda_fixup *fix, int action) |
| 5241 | { |
| 5242 | struct alc_spec *spec = codec->spec; |
| 5243 | /* TX300 needs to set up GPIO2 for the speaker amp */ |
| 5244 | static const struct hda_verb gpio2_verbs[] = { |
| 5245 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x04 }, |
| 5246 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04 }, |
| 5247 | { 0x01, AC_VERB_SET_GPIO_DATA, 0x04 }, |
| 5248 | {} |
| 5249 | }; |
| 5250 | static const struct hda_pintbl dock_pins[] = { |
| 5251 | { 0x1b, 0x21114000 }, /* dock speaker pin */ |
| 5252 | {} |
| 5253 | }; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5254 | |
| 5255 | switch (action) { |
| 5256 | case HDA_FIXUP_ACT_PRE_PROBE: |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 5257 | spec->init_amp = ALC_INIT_DEFAULT; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5258 | snd_hda_add_verbs(codec, gpio2_verbs); |
| 5259 | snd_hda_apply_pincfgs(codec, dock_pins); |
| 5260 | spec->gen.auto_mute_via_amp = 1; |
| 5261 | spec->gen.automute_hook = asus_tx300_automute; |
| 5262 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5263 | snd_hda_gen_hp_automute); |
| 5264 | break; |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame^] | 5265 | case HDA_FIXUP_ACT_PROBE: |
| 5266 | spec->init_amp = ALC_INIT_DEFAULT; |
| 5267 | break; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5268 | case HDA_FIXUP_ACT_BUILD: |
| 5269 | /* this is a bit tricky; give more sane names for the main |
| 5270 | * (tablet) speaker and the dock speaker, respectively |
| 5271 | */ |
Takashi Iwai | 56798e6 | 2017-04-11 08:10:52 +0200 | [diff] [blame] | 5272 | rename_ctl(codec, "Speaker Playback Switch", |
| 5273 | "Dock Speaker Playback Switch"); |
| 5274 | rename_ctl(codec, "Bass Speaker Playback Switch", |
| 5275 | "Speaker Playback Switch"); |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5276 | break; |
| 5277 | } |
| 5278 | } |
| 5279 | |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5280 | static void alc290_fixup_mono_speakers(struct hda_codec *codec, |
| 5281 | const struct hda_fixup *fix, int action) |
| 5282 | { |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 5283 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5284 | /* DAC node 0x03 is giving mono output. We therefore want to |
| 5285 | make sure 0x14 (front speaker) and 0x15 (headphones) use the |
| 5286 | stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ |
| 5287 | hda_nid_t conn1[2] = { 0x0c }; |
| 5288 | snd_hda_override_conn_list(codec, 0x14, 1, conn1); |
| 5289 | snd_hda_override_conn_list(codec, 0x15, 1, conn1); |
| 5290 | } |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5291 | } |
| 5292 | |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 5293 | static void alc298_fixup_speaker_volume(struct hda_codec *codec, |
| 5294 | const struct hda_fixup *fix, int action) |
| 5295 | { |
| 5296 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5297 | /* The speaker is routed to the Node 0x06 by a mistake, as a result |
| 5298 | we can't adjust the speaker's volume since this node does not has |
| 5299 | Amp-out capability. we change the speaker's route to: |
| 5300 | Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 ( |
| 5301 | Pin Complex), since Node 0x02 has Amp-out caps, we can adjust |
| 5302 | speaker's volume now. */ |
| 5303 | |
| 5304 | hda_nid_t conn1[1] = { 0x0c }; |
| 5305 | snd_hda_override_conn_list(codec, 0x17, 1, conn1); |
| 5306 | } |
| 5307 | } |
| 5308 | |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 5309 | /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */ |
| 5310 | static void alc295_fixup_disable_dac3(struct hda_codec *codec, |
| 5311 | const struct hda_fixup *fix, int action) |
| 5312 | { |
| 5313 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5314 | hda_nid_t conn[2] = { 0x02, 0x03 }; |
| 5315 | snd_hda_override_conn_list(codec, 0x17, 2, conn); |
| 5316 | } |
| 5317 | } |
| 5318 | |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5319 | /* Hook to update amp GPIO4 for automute */ |
| 5320 | static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, |
| 5321 | struct hda_jack_callback *jack) |
| 5322 | { |
| 5323 | struct alc_spec *spec = codec->spec; |
| 5324 | |
| 5325 | snd_hda_gen_hp_automute(codec, jack); |
| 5326 | /* mute_led_polarity is set to 0, so we pass inverted value here */ |
| 5327 | alc_update_gpio_led(codec, 0x10, !spec->gen.hp_jack_present); |
| 5328 | } |
| 5329 | |
| 5330 | /* Manage GPIOs for HP EliteBook Folio 9480m. |
| 5331 | * |
| 5332 | * GPIO4 is the headphone amplifier power control |
| 5333 | * GPIO3 is the audio output mute indicator LED |
| 5334 | */ |
| 5335 | |
| 5336 | static void alc280_fixup_hp_9480m(struct hda_codec *codec, |
| 5337 | const struct hda_fixup *fix, |
| 5338 | int action) |
| 5339 | { |
| 5340 | struct alc_spec *spec = codec->spec; |
| 5341 | static const struct hda_verb gpio_init[] = { |
| 5342 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x18 }, |
| 5343 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x18 }, |
| 5344 | {} |
| 5345 | }; |
| 5346 | |
| 5347 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5348 | /* Set the hooks to turn the headphone amp on/off |
| 5349 | * as needed |
| 5350 | */ |
| 5351 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
| 5352 | spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook; |
| 5353 | |
| 5354 | /* The GPIOs are currently off */ |
| 5355 | spec->gpio_led = 0; |
| 5356 | |
| 5357 | /* GPIO3 is connected to the output mute LED, |
| 5358 | * high is on, low is off |
| 5359 | */ |
| 5360 | spec->mute_led_polarity = 0; |
| 5361 | spec->gpio_mute_led_mask = 0x08; |
| 5362 | |
| 5363 | /* Initialize GPIO configuration */ |
| 5364 | snd_hda_add_verbs(codec, gpio_init); |
| 5365 | } |
| 5366 | } |
| 5367 | |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 5368 | static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, |
| 5369 | const struct hda_fixup *fix, |
| 5370 | int action) |
| 5371 | { |
| 5372 | alc_fixup_dual_codecs(codec, fix, action); |
| 5373 | switch (action) { |
| 5374 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5375 | /* override card longname to provide a unique UCM profile */ |
| 5376 | strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); |
| 5377 | break; |
| 5378 | case HDA_FIXUP_ACT_BUILD: |
| 5379 | /* rename Capture controls depending on the codec */ |
| 5380 | rename_ctl(codec, "Capture Volume", |
| 5381 | codec->addr == 0 ? |
| 5382 | "Rear-Panel Capture Volume" : |
| 5383 | "Front-Panel Capture Volume"); |
| 5384 | rename_ctl(codec, "Capture Switch", |
| 5385 | codec->addr == 0 ? |
| 5386 | "Rear-Panel Capture Switch" : |
| 5387 | "Front-Panel Capture Switch"); |
| 5388 | break; |
| 5389 | } |
| 5390 | } |
| 5391 | |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 5392 | /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ |
| 5393 | static void alc274_fixup_bind_dacs(struct hda_codec *codec, |
| 5394 | const struct hda_fixup *fix, int action) |
| 5395 | { |
| 5396 | struct alc_spec *spec = codec->spec; |
| 5397 | static hda_nid_t preferred_pairs[] = { |
| 5398 | 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02, |
| 5399 | 0 |
| 5400 | }; |
| 5401 | |
| 5402 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 5403 | return; |
| 5404 | |
| 5405 | spec->gen.preferred_dacs = preferred_pairs; |
| 5406 | } |
| 5407 | |
Takashi Iwai | b317b03 | 2014-01-08 11:44:21 +0100 | [diff] [blame] | 5408 | /* for hda_fixup_thinkpad_acpi() */ |
| 5409 | #include "thinkpad_helper.c" |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 5410 | |
Takashi Iwai | d5a6cab | 2018-06-13 12:43:10 +0200 | [diff] [blame] | 5411 | static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, |
| 5412 | const struct hda_fixup *fix, int action) |
| 5413 | { |
| 5414 | alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ |
| 5415 | hda_fixup_thinkpad_acpi(codec, fix, action); |
| 5416 | } |
| 5417 | |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 5418 | /* for dell wmi mic mute led */ |
| 5419 | #include "dell_wmi_helper.c" |
| 5420 | |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 5421 | /* for alc295_fixup_hp_top_speakers */ |
| 5422 | #include "hp_x360_helper.c" |
| 5423 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5424 | enum { |
| 5425 | ALC269_FIXUP_SONY_VAIO, |
| 5426 | ALC275_FIXUP_SONY_VAIO_GPIO2, |
| 5427 | ALC269_FIXUP_DELL_M101Z, |
| 5428 | ALC269_FIXUP_SKU_IGNORE, |
| 5429 | ALC269_FIXUP_ASUS_G73JW, |
| 5430 | ALC269_FIXUP_LENOVO_EAPD, |
| 5431 | ALC275_FIXUP_SONY_HWEQ, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 5432 | ALC275_FIXUP_SONY_DISABLE_AAMIX, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5433 | ALC271_FIXUP_DMIC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 5434 | ALC269_FIXUP_PCM_44K, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 5435 | ALC269_FIXUP_STEREO_DMIC, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 5436 | ALC269_FIXUP_HEADSET_MIC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 5437 | ALC269_FIXUP_QUANTA_MUTE, |
| 5438 | ALC269_FIXUP_LIFEBOOK, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 5439 | ALC269_FIXUP_LIFEBOOK_EXTMIC, |
Takashi Iwai | cc7016a | 2015-04-08 20:47:55 +0200 | [diff] [blame] | 5440 | ALC269_FIXUP_LIFEBOOK_HP_PIN, |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 5441 | ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 5442 | ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5443 | ALC269_FIXUP_AMIC, |
| 5444 | ALC269_FIXUP_DMIC, |
| 5445 | ALC269VB_FIXUP_AMIC, |
| 5446 | ALC269VB_FIXUP_DMIC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5447 | ALC269_FIXUP_HP_MUTE_LED, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 5448 | ALC269_FIXUP_HP_MUTE_LED_MIC1, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5449 | ALC269_FIXUP_HP_MUTE_LED_MIC2, |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 5450 | ALC269_FIXUP_HP_MUTE_LED_MIC3, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 5451 | ALC269_FIXUP_HP_GPIO_LED, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 5452 | ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 5453 | ALC269_FIXUP_HP_LINE1_MIC1_LED, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5454 | ALC269_FIXUP_INV_DMIC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5455 | ALC269_FIXUP_LENOVO_DOCK, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5456 | ALC269_FIXUP_NO_SHUTUP, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 5457 | ALC286_FIXUP_SONY_MIC_NO_PRESENCE, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5458 | ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5459 | ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 5460 | ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5461 | ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 5462 | ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5463 | ALC269_FIXUP_HEADSET_MODE, |
| 5464 | ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 5465 | ALC269_FIXUP_ASPIRE_HEADSET_MIC, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 5466 | ALC269_FIXUP_ASUS_X101_FUNC, |
| 5467 | ALC269_FIXUP_ASUS_X101_VERB, |
| 5468 | ALC269_FIXUP_ASUS_X101, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5469 | ALC271_FIXUP_AMIC_MIC2, |
| 5470 | ALC271_FIXUP_HP_GATE_MIC_JACK, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 5471 | ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 5472 | ALC269_FIXUP_ACER_AC700, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 5473 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 5474 | ALC269VB_FIXUP_ASUS_ZENBOOK, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 5475 | ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 5476 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 5477 | ALC269VB_FIXUP_ORDISSIMO_EVE2, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5478 | ALC283_FIXUP_CHROME_BOOK, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5479 | ALC283_FIXUP_SENSE_COMBO_JACK, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5480 | ALC282_FIXUP_ASUS_TX300, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 5481 | ALC283_FIXUP_INT_MIC, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5482 | ALC290_FIXUP_MONO_SPEAKERS, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 5483 | ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 5484 | ALC290_FIXUP_SUBWOOFER, |
| 5485 | ALC290_FIXUP_SUBWOOFER_HSJACK, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 5486 | ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 5487 | ALC269_FIXUP_DMIC_THINKPAD_ACPI, |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 5488 | ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 5489 | ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5490 | ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5491 | ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5492 | ALC255_FIXUP_HEADSET_MODE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5493 | ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5494 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 5495 | ALC292_FIXUP_TPT440_DOCK, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 5496 | ALC292_FIXUP_TPT440, |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 5497 | ALC283_FIXUP_HEADSET_MIC, |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 5498 | ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 5499 | ALC282_FIXUP_ASPIRE_V5_PINS, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 5500 | ALC280_FIXUP_HP_GPIO4, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 5501 | ALC286_FIXUP_HP_GPIO_LED, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 5502 | ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 5503 | ALC280_FIXUP_HP_DOCK_PINS, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 5504 | ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5505 | ALC280_FIXUP_HP_9480M, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5506 | ALC288_FIXUP_DELL_HEADSET_MODE, |
| 5507 | ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 5508 | ALC288_FIXUP_DELL_XPS_13_GPIO6, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 5509 | ALC288_FIXUP_DELL_XPS_13, |
| 5510 | ALC288_FIXUP_DISABLE_AAMIX, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 5511 | ALC292_FIXUP_DELL_E7X, |
| 5512 | ALC292_FIXUP_DISABLE_AAMIX, |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 5513 | ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 5514 | ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 5515 | ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 5516 | ALC275_FIXUP_DELL_XPS, |
Hui Wang | 8c69729 | 2015-11-24 11:08:18 +0800 | [diff] [blame] | 5517 | ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE, |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 5518 | ALC293_FIXUP_LENOVO_SPK_NOISE, |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 5519 | ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
Kai-Heng Feng | 3b43b71 | 2016-02-25 15:19:38 +0800 | [diff] [blame] | 5520 | ALC255_FIXUP_DELL_SPK_NOISE, |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 5521 | ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 5522 | ALC295_FIXUP_DISABLE_DAC3, |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 5523 | ALC280_FIXUP_HP_HEADSET_MIC, |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 5524 | ALC221_FIXUP_HP_FRONT_MIC, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 5525 | ALC292_FIXUP_TPT460, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 5526 | ALC298_FIXUP_SPK_VOLUME, |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 5527 | ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 5528 | ALC269_FIXUP_ATIV_BOOK_8, |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 5529 | ALC221_FIXUP_HP_MIC_NO_PRESENCE, |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 5530 | ALC256_FIXUP_ASUS_HEADSET_MODE, |
| 5531 | ALC256_FIXUP_ASUS_MIC, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 5532 | ALC256_FIXUP_ASUS_AIO_GPIO2, |
Chris Chiu | 216d7ae | 2017-02-28 14:17:14 -0600 | [diff] [blame] | 5533 | ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 5534 | ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 5535 | ALC233_FIXUP_LENOVO_MULTI_CODECS, |
Hui Wang | f33f79f | 2017-07-07 12:08:29 +0800 | [diff] [blame] | 5536 | ALC294_FIXUP_LENOVO_MIC_LOCATION, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 5537 | ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 5538 | ALC700_FIXUP_INTEL_REFERENCE, |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 5539 | ALC274_FIXUP_DELL_BIND_DACS, |
| 5540 | ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5541 | ALC298_FIXUP_TPT470_DOCK, |
Kailang Yang | ae104a2 | 2018-02-05 16:07:20 +0800 | [diff] [blame] | 5542 | ALC255_FIXUP_DUMMY_LINEOUT_VERB, |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 5543 | ALC255_FIXUP_DELL_HEADSET_MIC, |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 5544 | ALC295_FIXUP_HP_X360, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5545 | }; |
| 5546 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5547 | static const struct hda_fixup alc269_fixups[] = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5548 | [ALC269_FIXUP_SONY_VAIO] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 5549 | .type = HDA_FIXUP_PINCTLS, |
| 5550 | .v.pins = (const struct hda_pintbl[]) { |
| 5551 | {0x19, PIN_VREFGRD}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5552 | {} |
| 5553 | } |
| 5554 | }, |
| 5555 | [ALC275_FIXUP_SONY_VAIO_GPIO2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5556 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5557 | .v.verbs = (const struct hda_verb[]) { |
| 5558 | {0x01, AC_VERB_SET_GPIO_MASK, 0x04}, |
| 5559 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04}, |
| 5560 | {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, |
| 5561 | { } |
| 5562 | }, |
| 5563 | .chained = true, |
| 5564 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 5565 | }, |
| 5566 | [ALC269_FIXUP_DELL_M101Z] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5567 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5568 | .v.verbs = (const struct hda_verb[]) { |
| 5569 | /* Enables internal speaker */ |
| 5570 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, |
| 5571 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, |
| 5572 | {} |
| 5573 | } |
| 5574 | }, |
| 5575 | [ALC269_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5576 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 5577 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5578 | }, |
| 5579 | [ALC269_FIXUP_ASUS_G73JW] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5580 | .type = HDA_FIXUP_PINS, |
| 5581 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5582 | { 0x17, 0x99130111 }, /* subwoofer */ |
| 5583 | { } |
| 5584 | } |
| 5585 | }, |
| 5586 | [ALC269_FIXUP_LENOVO_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5587 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5588 | .v.verbs = (const struct hda_verb[]) { |
| 5589 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 5590 | {} |
| 5591 | } |
| 5592 | }, |
| 5593 | [ALC275_FIXUP_SONY_HWEQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5594 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5595 | .v.func = alc269_fixup_hweq, |
| 5596 | .chained = true, |
| 5597 | .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 |
| 5598 | }, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 5599 | [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { |
| 5600 | .type = HDA_FIXUP_FUNC, |
| 5601 | .v.func = alc_fixup_disable_aamix, |
| 5602 | .chained = true, |
| 5603 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 5604 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5605 | [ALC271_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5606 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5607 | .v.func = alc271_fixup_dmic, |
| 5608 | }, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 5609 | [ALC269_FIXUP_PCM_44K] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5610 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 5611 | .v.func = alc269_fixup_pcm_44k, |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 5612 | .chained = true, |
| 5613 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 5614 | }, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 5615 | [ALC269_FIXUP_STEREO_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5616 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 5617 | .v.func = alc269_fixup_stereo_dmic, |
| 5618 | }, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 5619 | [ALC269_FIXUP_HEADSET_MIC] = { |
| 5620 | .type = HDA_FIXUP_FUNC, |
| 5621 | .v.func = alc269_fixup_headset_mic, |
| 5622 | }, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 5623 | [ALC269_FIXUP_QUANTA_MUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5624 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 5625 | .v.func = alc269_fixup_quanta_mute, |
| 5626 | }, |
| 5627 | [ALC269_FIXUP_LIFEBOOK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5628 | .type = HDA_FIXUP_PINS, |
| 5629 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 5630 | { 0x1a, 0x2101103f }, /* dock line-out */ |
| 5631 | { 0x1b, 0x23a11040 }, /* dock mic-in */ |
| 5632 | { } |
| 5633 | }, |
| 5634 | .chained = true, |
| 5635 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
| 5636 | }, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 5637 | [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { |
| 5638 | .type = HDA_FIXUP_PINS, |
| 5639 | .v.pins = (const struct hda_pintbl[]) { |
| 5640 | { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ |
| 5641 | { } |
| 5642 | }, |
| 5643 | }, |
Takashi Iwai | cc7016a | 2015-04-08 20:47:55 +0200 | [diff] [blame] | 5644 | [ALC269_FIXUP_LIFEBOOK_HP_PIN] = { |
| 5645 | .type = HDA_FIXUP_PINS, |
| 5646 | .v.pins = (const struct hda_pintbl[]) { |
| 5647 | { 0x21, 0x0221102f }, /* HP out */ |
| 5648 | { } |
| 5649 | }, |
| 5650 | }, |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 5651 | [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { |
| 5652 | .type = HDA_FIXUP_FUNC, |
| 5653 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
| 5654 | }, |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 5655 | [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { |
| 5656 | .type = HDA_FIXUP_FUNC, |
| 5657 | .v.func = alc269_fixup_pincfg_U7x7_headset_mic, |
| 5658 | }, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5659 | [ALC269_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5660 | .type = HDA_FIXUP_PINS, |
| 5661 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5662 | { 0x14, 0x99130110 }, /* speaker */ |
| 5663 | { 0x15, 0x0121401f }, /* HP out */ |
| 5664 | { 0x18, 0x01a19c20 }, /* mic */ |
| 5665 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 5666 | { } |
| 5667 | }, |
| 5668 | }, |
| 5669 | [ALC269_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5670 | .type = HDA_FIXUP_PINS, |
| 5671 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5672 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 5673 | { 0x14, 0x99130110 }, /* speaker */ |
| 5674 | { 0x15, 0x0121401f }, /* HP out */ |
| 5675 | { 0x18, 0x01a19c20 }, /* mic */ |
| 5676 | { } |
| 5677 | }, |
| 5678 | }, |
| 5679 | [ALC269VB_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5680 | .type = HDA_FIXUP_PINS, |
| 5681 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5682 | { 0x14, 0x99130110 }, /* speaker */ |
| 5683 | { 0x18, 0x01a19c20 }, /* mic */ |
| 5684 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 5685 | { 0x21, 0x0121401f }, /* HP out */ |
| 5686 | { } |
| 5687 | }, |
| 5688 | }, |
David Henningsson | 2267ea9 | 2012-01-03 08:45:56 +0100 | [diff] [blame] | 5689 | [ALC269VB_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5690 | .type = HDA_FIXUP_PINS, |
| 5691 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5692 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 5693 | { 0x14, 0x99130110 }, /* speaker */ |
| 5694 | { 0x18, 0x01a19c20 }, /* mic */ |
| 5695 | { 0x21, 0x0121401f }, /* HP out */ |
| 5696 | { } |
| 5697 | }, |
| 5698 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5699 | [ALC269_FIXUP_HP_MUTE_LED] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5700 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5701 | .v.func = alc269_fixup_hp_mute_led, |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 5702 | }, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 5703 | [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { |
| 5704 | .type = HDA_FIXUP_FUNC, |
| 5705 | .v.func = alc269_fixup_hp_mute_led_mic1, |
| 5706 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5707 | [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5708 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5709 | .v.func = alc269_fixup_hp_mute_led_mic2, |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 5710 | }, |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 5711 | [ALC269_FIXUP_HP_MUTE_LED_MIC3] = { |
| 5712 | .type = HDA_FIXUP_FUNC, |
| 5713 | .v.func = alc269_fixup_hp_mute_led_mic3, |
| 5714 | }, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 5715 | [ALC269_FIXUP_HP_GPIO_LED] = { |
| 5716 | .type = HDA_FIXUP_FUNC, |
| 5717 | .v.func = alc269_fixup_hp_gpio_led, |
| 5718 | }, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 5719 | [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { |
| 5720 | .type = HDA_FIXUP_FUNC, |
| 5721 | .v.func = alc269_fixup_hp_gpio_mic1_led, |
| 5722 | }, |
| 5723 | [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { |
| 5724 | .type = HDA_FIXUP_FUNC, |
| 5725 | .v.func = alc269_fixup_hp_line1_mic1_led, |
| 5726 | }, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5727 | [ALC269_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5728 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 5729 | .v.func = alc_fixup_inv_dmic, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5730 | }, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5731 | [ALC269_FIXUP_NO_SHUTUP] = { |
| 5732 | .type = HDA_FIXUP_FUNC, |
| 5733 | .v.func = alc_fixup_no_shutup, |
| 5734 | }, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5735 | [ALC269_FIXUP_LENOVO_DOCK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5736 | .type = HDA_FIXUP_PINS, |
| 5737 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5738 | { 0x19, 0x23a11040 }, /* dock mic */ |
| 5739 | { 0x1b, 0x2121103f }, /* dock headphone */ |
| 5740 | { } |
| 5741 | }, |
| 5742 | .chained = true, |
| 5743 | .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT |
| 5744 | }, |
| 5745 | [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5746 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5747 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
David Henningsson | 5212900 | 2013-11-19 10:25:53 +0100 | [diff] [blame] | 5748 | .chained = true, |
| 5749 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5750 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5751 | [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 5752 | .type = HDA_FIXUP_PINS, |
| 5753 | .v.pins = (const struct hda_pintbl[]) { |
| 5754 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 5755 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 5756 | { } |
| 5757 | }, |
| 5758 | .chained = true, |
| 5759 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 5760 | }, |
| 5761 | [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 5762 | .type = HDA_FIXUP_PINS, |
| 5763 | .v.pins = (const struct hda_pintbl[]) { |
| 5764 | { 0x16, 0x21014020 }, /* dock line out */ |
| 5765 | { 0x19, 0x21a19030 }, /* dock mic */ |
| 5766 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 5767 | { } |
| 5768 | }, |
| 5769 | .chained = true, |
| 5770 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 5771 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5772 | [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { |
| 5773 | .type = HDA_FIXUP_PINS, |
| 5774 | .v.pins = (const struct hda_pintbl[]) { |
| 5775 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 5776 | { } |
| 5777 | }, |
| 5778 | .chained = true, |
| 5779 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 5780 | }, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 5781 | [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = { |
| 5782 | .type = HDA_FIXUP_PINS, |
| 5783 | .v.pins = (const struct hda_pintbl[]) { |
| 5784 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 5785 | { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 5786 | { } |
| 5787 | }, |
| 5788 | .chained = true, |
| 5789 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 5790 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5791 | [ALC269_FIXUP_HEADSET_MODE] = { |
| 5792 | .type = HDA_FIXUP_FUNC, |
| 5793 | .v.func = alc_fixup_headset_mode, |
Hui Wang | 6676f30 | 2014-11-18 17:57:41 +0800 | [diff] [blame] | 5794 | .chained = true, |
| 5795 | .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5796 | }, |
| 5797 | [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 5798 | .type = HDA_FIXUP_FUNC, |
| 5799 | .v.func = alc_fixup_headset_mode_no_hp_mic, |
| 5800 | }, |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 5801 | [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { |
| 5802 | .type = HDA_FIXUP_PINS, |
| 5803 | .v.pins = (const struct hda_pintbl[]) { |
| 5804 | { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ |
| 5805 | { } |
| 5806 | }, |
| 5807 | .chained = true, |
| 5808 | .chain_id = ALC269_FIXUP_HEADSET_MODE, |
| 5809 | }, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 5810 | [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { |
| 5811 | .type = HDA_FIXUP_PINS, |
| 5812 | .v.pins = (const struct hda_pintbl[]) { |
| 5813 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 5814 | { } |
| 5815 | }, |
David Henningsson | fbc78ad | 2013-10-11 13:46:04 +0200 | [diff] [blame] | 5816 | .chained = true, |
| 5817 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 5818 | }, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 5819 | [ALC269_FIXUP_ASUS_X101_FUNC] = { |
| 5820 | .type = HDA_FIXUP_FUNC, |
| 5821 | .v.func = alc269_fixup_x101_headset_mic, |
| 5822 | }, |
| 5823 | [ALC269_FIXUP_ASUS_X101_VERB] = { |
| 5824 | .type = HDA_FIXUP_VERBS, |
| 5825 | .v.verbs = (const struct hda_verb[]) { |
| 5826 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, |
| 5827 | {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, |
| 5828 | {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, |
| 5829 | { } |
| 5830 | }, |
| 5831 | .chained = true, |
| 5832 | .chain_id = ALC269_FIXUP_ASUS_X101_FUNC |
| 5833 | }, |
| 5834 | [ALC269_FIXUP_ASUS_X101] = { |
| 5835 | .type = HDA_FIXUP_PINS, |
| 5836 | .v.pins = (const struct hda_pintbl[]) { |
| 5837 | { 0x18, 0x04a1182c }, /* Headset mic */ |
| 5838 | { } |
| 5839 | }, |
| 5840 | .chained = true, |
| 5841 | .chain_id = ALC269_FIXUP_ASUS_X101_VERB |
| 5842 | }, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5843 | [ALC271_FIXUP_AMIC_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5844 | .type = HDA_FIXUP_PINS, |
| 5845 | .v.pins = (const struct hda_pintbl[]) { |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5846 | { 0x14, 0x99130110 }, /* speaker */ |
| 5847 | { 0x19, 0x01a19c20 }, /* mic */ |
| 5848 | { 0x1b, 0x99a7012f }, /* int-mic */ |
| 5849 | { 0x21, 0x0121401f }, /* HP out */ |
| 5850 | { } |
| 5851 | }, |
| 5852 | }, |
| 5853 | [ALC271_FIXUP_HP_GATE_MIC_JACK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5854 | .type = HDA_FIXUP_FUNC, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5855 | .v.func = alc271_hp_gate_mic_jack, |
| 5856 | .chained = true, |
| 5857 | .chain_id = ALC271_FIXUP_AMIC_MIC2, |
| 5858 | }, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 5859 | [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { |
| 5860 | .type = HDA_FIXUP_FUNC, |
| 5861 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 5862 | .chained = true, |
| 5863 | .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, |
| 5864 | }, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 5865 | [ALC269_FIXUP_ACER_AC700] = { |
| 5866 | .type = HDA_FIXUP_PINS, |
| 5867 | .v.pins = (const struct hda_pintbl[]) { |
| 5868 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 5869 | { 0x14, 0x99130110 }, /* speaker */ |
| 5870 | { 0x18, 0x03a11c20 }, /* mic */ |
| 5871 | { 0x1e, 0x0346101e }, /* SPDIF1 */ |
| 5872 | { 0x21, 0x0321101f }, /* HP out */ |
| 5873 | { } |
| 5874 | }, |
| 5875 | .chained = true, |
| 5876 | .chain_id = ALC271_FIXUP_DMIC, |
| 5877 | }, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 5878 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { |
| 5879 | .type = HDA_FIXUP_FUNC, |
| 5880 | .v.func = alc269_fixup_limit_int_mic_boost, |
David Henningsson | 2793769 | 2013-11-18 11:51:47 +0100 | [diff] [blame] | 5881 | .chained = true, |
| 5882 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 5883 | }, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 5884 | [ALC269VB_FIXUP_ASUS_ZENBOOK] = { |
| 5885 | .type = HDA_FIXUP_FUNC, |
| 5886 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 5887 | .chained = true, |
| 5888 | .chain_id = ALC269VB_FIXUP_DMIC, |
| 5889 | }, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 5890 | [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { |
| 5891 | .type = HDA_FIXUP_VERBS, |
| 5892 | .v.verbs = (const struct hda_verb[]) { |
| 5893 | /* class-D output amp +5dB */ |
| 5894 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, |
| 5895 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, |
| 5896 | {} |
| 5897 | }, |
| 5898 | .chained = true, |
| 5899 | .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, |
| 5900 | }, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 5901 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { |
| 5902 | .type = HDA_FIXUP_FUNC, |
| 5903 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 5904 | .chained = true, |
| 5905 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, |
| 5906 | }, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 5907 | [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { |
| 5908 | .type = HDA_FIXUP_PINS, |
| 5909 | .v.pins = (const struct hda_pintbl[]) { |
| 5910 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 5911 | { 0x18, 0x03a11d20 }, /* mic */ |
| 5912 | { 0x19, 0x411111f0 }, /* Unused bogus pin */ |
| 5913 | { } |
| 5914 | }, |
| 5915 | }, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5916 | [ALC283_FIXUP_CHROME_BOOK] = { |
| 5917 | .type = HDA_FIXUP_FUNC, |
| 5918 | .v.func = alc283_fixup_chromebook, |
| 5919 | }, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5920 | [ALC283_FIXUP_SENSE_COMBO_JACK] = { |
| 5921 | .type = HDA_FIXUP_FUNC, |
| 5922 | .v.func = alc283_fixup_sense_combo_jack, |
| 5923 | .chained = true, |
| 5924 | .chain_id = ALC283_FIXUP_CHROME_BOOK, |
| 5925 | }, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5926 | [ALC282_FIXUP_ASUS_TX300] = { |
| 5927 | .type = HDA_FIXUP_FUNC, |
| 5928 | .v.func = alc282_fixup_asus_tx300, |
| 5929 | }, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 5930 | [ALC283_FIXUP_INT_MIC] = { |
| 5931 | .type = HDA_FIXUP_VERBS, |
| 5932 | .v.verbs = (const struct hda_verb[]) { |
| 5933 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, |
| 5934 | {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, |
| 5935 | { } |
| 5936 | }, |
| 5937 | .chained = true, |
| 5938 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 5939 | }, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 5940 | [ALC290_FIXUP_SUBWOOFER_HSJACK] = { |
| 5941 | .type = HDA_FIXUP_PINS, |
| 5942 | .v.pins = (const struct hda_pintbl[]) { |
| 5943 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 5944 | { } |
| 5945 | }, |
| 5946 | .chained = true, |
| 5947 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 5948 | }, |
| 5949 | [ALC290_FIXUP_SUBWOOFER] = { |
| 5950 | .type = HDA_FIXUP_PINS, |
| 5951 | .v.pins = (const struct hda_pintbl[]) { |
| 5952 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 5953 | { } |
| 5954 | }, |
| 5955 | .chained = true, |
| 5956 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS, |
| 5957 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5958 | [ALC290_FIXUP_MONO_SPEAKERS] = { |
| 5959 | .type = HDA_FIXUP_FUNC, |
| 5960 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 5961 | }, |
| 5962 | [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { |
| 5963 | .type = HDA_FIXUP_FUNC, |
| 5964 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5965 | .chained = true, |
| 5966 | .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
| 5967 | }, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 5968 | [ALC269_FIXUP_THINKPAD_ACPI] = { |
| 5969 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | d5a6cab | 2018-06-13 12:43:10 +0200 | [diff] [blame] | 5970 | .v.func = alc_fixup_thinkpad_acpi, |
Takashi Iwai | 09da111 | 2016-09-08 12:15:02 +0200 | [diff] [blame] | 5971 | .chained = true, |
| 5972 | .chain_id = ALC269_FIXUP_SKU_IGNORE, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 5973 | }, |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 5974 | [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = { |
| 5975 | .type = HDA_FIXUP_FUNC, |
| 5976 | .v.func = alc_fixup_inv_dmic, |
| 5977 | .chained = true, |
| 5978 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
| 5979 | }, |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 5980 | [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = { |
| 5981 | .type = HDA_FIXUP_PINS, |
| 5982 | .v.pins = (const struct hda_pintbl[]) { |
| 5983 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 5984 | { } |
| 5985 | }, |
| 5986 | .chained = true, |
| 5987 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 5988 | }, |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 5989 | [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 5990 | .type = HDA_FIXUP_PINS, |
| 5991 | .v.pins = (const struct hda_pintbl[]) { |
| 5992 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 5993 | { } |
| 5994 | }, |
| 5995 | .chained = true, |
| 5996 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 5997 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5998 | [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 5999 | .type = HDA_FIXUP_PINS, |
| 6000 | .v.pins = (const struct hda_pintbl[]) { |
| 6001 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6002 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6003 | { } |
| 6004 | }, |
| 6005 | .chained = true, |
| 6006 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 6007 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6008 | [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 6009 | .type = HDA_FIXUP_PINS, |
| 6010 | .v.pins = (const struct hda_pintbl[]) { |
| 6011 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6012 | { } |
| 6013 | }, |
| 6014 | .chained = true, |
| 6015 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6016 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6017 | [ALC255_FIXUP_HEADSET_MODE] = { |
| 6018 | .type = HDA_FIXUP_FUNC, |
| 6019 | .v.func = alc_fixup_headset_mode_alc255, |
Hui Wang | 4a83d42 | 2014-11-18 17:57:40 +0800 | [diff] [blame] | 6020 | .chained = true, |
| 6021 | .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6022 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6023 | [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 6024 | .type = HDA_FIXUP_FUNC, |
| 6025 | .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, |
| 6026 | }, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 6027 | [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6028 | .type = HDA_FIXUP_PINS, |
| 6029 | .v.pins = (const struct hda_pintbl[]) { |
| 6030 | { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6031 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6032 | { } |
| 6033 | }, |
| 6034 | .chained = true, |
| 6035 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6036 | }, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6037 | [ALC292_FIXUP_TPT440_DOCK] = { |
David Henningsson | ec56af6 | 2015-06-24 10:46:33 +0200 | [diff] [blame] | 6038 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 6039 | .v.func = alc_fixup_tpt440_dock, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6040 | .chained = true, |
| 6041 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 6042 | }, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6043 | [ALC292_FIXUP_TPT440] = { |
| 6044 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 157f0b7 | 2015-12-10 23:30:43 +0100 | [diff] [blame] | 6045 | .v.func = alc_fixup_disable_aamix, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6046 | .chained = true, |
| 6047 | .chain_id = ALC292_FIXUP_TPT440_DOCK, |
| 6048 | }, |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 6049 | [ALC283_FIXUP_HEADSET_MIC] = { |
Daniel Drake | 9dc1286 | 2014-07-22 10:58:29 +0100 | [diff] [blame] | 6050 | .type = HDA_FIXUP_PINS, |
| 6051 | .v.pins = (const struct hda_pintbl[]) { |
| 6052 | { 0x19, 0x04a110f0 }, |
| 6053 | { }, |
| 6054 | }, |
| 6055 | }, |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 6056 | [ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED] = { |
| 6057 | .type = HDA_FIXUP_FUNC, |
| 6058 | .v.func = alc_fixup_dell_wmi, |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 6059 | }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 6060 | [ALC282_FIXUP_ASPIRE_V5_PINS] = { |
| 6061 | .type = HDA_FIXUP_PINS, |
| 6062 | .v.pins = (const struct hda_pintbl[]) { |
| 6063 | { 0x12, 0x90a60130 }, |
| 6064 | { 0x14, 0x90170110 }, |
| 6065 | { 0x17, 0x40000008 }, |
| 6066 | { 0x18, 0x411111f0 }, |
Mateusz Sylwestrzak | 0420694 | 2015-07-19 17:38:56 +0200 | [diff] [blame] | 6067 | { 0x19, 0x01a1913c }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 6068 | { 0x1a, 0x411111f0 }, |
| 6069 | { 0x1b, 0x411111f0 }, |
| 6070 | { 0x1d, 0x40f89b2d }, |
| 6071 | { 0x1e, 0x411111f0 }, |
| 6072 | { 0x21, 0x0321101f }, |
| 6073 | { }, |
| 6074 | }, |
| 6075 | }, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 6076 | [ALC280_FIXUP_HP_GPIO4] = { |
| 6077 | .type = HDA_FIXUP_FUNC, |
| 6078 | .v.func = alc280_fixup_hp_gpio4, |
| 6079 | }, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 6080 | [ALC286_FIXUP_HP_GPIO_LED] = { |
| 6081 | .type = HDA_FIXUP_FUNC, |
| 6082 | .v.func = alc286_fixup_hp_gpio_led, |
| 6083 | }, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 6084 | [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = { |
| 6085 | .type = HDA_FIXUP_FUNC, |
| 6086 | .v.func = alc280_fixup_hp_gpio2_mic_hotkey, |
| 6087 | }, |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 6088 | [ALC280_FIXUP_HP_DOCK_PINS] = { |
| 6089 | .type = HDA_FIXUP_PINS, |
| 6090 | .v.pins = (const struct hda_pintbl[]) { |
| 6091 | { 0x1b, 0x21011020 }, /* line-out */ |
| 6092 | { 0x1a, 0x01a1903c }, /* headset mic */ |
| 6093 | { 0x18, 0x2181103f }, /* line-in */ |
| 6094 | { }, |
| 6095 | }, |
| 6096 | .chained = true, |
| 6097 | .chain_id = ALC280_FIXUP_HP_GPIO4 |
| 6098 | }, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 6099 | [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = { |
| 6100 | .type = HDA_FIXUP_PINS, |
| 6101 | .v.pins = (const struct hda_pintbl[]) { |
| 6102 | { 0x1b, 0x21011020 }, /* line-out */ |
| 6103 | { 0x18, 0x2181103f }, /* line-in */ |
| 6104 | { }, |
| 6105 | }, |
| 6106 | .chained = true, |
| 6107 | .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED |
| 6108 | }, |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6109 | [ALC280_FIXUP_HP_9480M] = { |
| 6110 | .type = HDA_FIXUP_FUNC, |
| 6111 | .v.func = alc280_fixup_hp_9480m, |
| 6112 | }, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6113 | [ALC288_FIXUP_DELL_HEADSET_MODE] = { |
| 6114 | .type = HDA_FIXUP_FUNC, |
| 6115 | .v.func = alc_fixup_headset_mode_dell_alc288, |
| 6116 | .chained = true, |
| 6117 | .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED |
| 6118 | }, |
| 6119 | [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6120 | .type = HDA_FIXUP_PINS, |
| 6121 | .v.pins = (const struct hda_pintbl[]) { |
| 6122 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6123 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6124 | { } |
| 6125 | }, |
| 6126 | .chained = true, |
| 6127 | .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE |
| 6128 | }, |
| 6129 | [ALC288_FIXUP_DELL_XPS_13_GPIO6] = { |
| 6130 | .type = HDA_FIXUP_VERBS, |
| 6131 | .v.verbs = (const struct hda_verb[]) { |
| 6132 | {0x01, AC_VERB_SET_GPIO_MASK, 0x40}, |
| 6133 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x40}, |
| 6134 | {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, |
| 6135 | { } |
| 6136 | }, |
| 6137 | .chained = true, |
| 6138 | .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6139 | }, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6140 | [ALC288_FIXUP_DISABLE_AAMIX] = { |
| 6141 | .type = HDA_FIXUP_FUNC, |
| 6142 | .v.func = alc_fixup_disable_aamix, |
| 6143 | .chained = true, |
| 6144 | .chain_id = ALC288_FIXUP_DELL_XPS_13_GPIO6 |
| 6145 | }, |
| 6146 | [ALC288_FIXUP_DELL_XPS_13] = { |
| 6147 | .type = HDA_FIXUP_FUNC, |
| 6148 | .v.func = alc_fixup_dell_xps13, |
| 6149 | .chained = true, |
| 6150 | .chain_id = ALC288_FIXUP_DISABLE_AAMIX |
| 6151 | }, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6152 | [ALC292_FIXUP_DISABLE_AAMIX] = { |
| 6153 | .type = HDA_FIXUP_FUNC, |
| 6154 | .v.func = alc_fixup_disable_aamix, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6155 | .chained = true, |
| 6156 | .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6157 | }, |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 6158 | [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = { |
| 6159 | .type = HDA_FIXUP_FUNC, |
| 6160 | .v.func = alc_fixup_disable_aamix, |
| 6161 | .chained = true, |
| 6162 | .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6163 | }, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6164 | [ALC292_FIXUP_DELL_E7X] = { |
| 6165 | .type = HDA_FIXUP_FUNC, |
| 6166 | .v.func = alc_fixup_dell_xps13, |
| 6167 | .chained = true, |
| 6168 | .chain_id = ALC292_FIXUP_DISABLE_AAMIX |
| 6169 | }, |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 6170 | [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6171 | .type = HDA_FIXUP_PINS, |
| 6172 | .v.pins = (const struct hda_pintbl[]) { |
| 6173 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6174 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6175 | { } |
| 6176 | }, |
| 6177 | .chained = true, |
| 6178 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6179 | }, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 6180 | [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = { |
| 6181 | .type = HDA_FIXUP_PINS, |
| 6182 | .v.pins = (const struct hda_pintbl[]) { |
| 6183 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6184 | { } |
| 6185 | }, |
| 6186 | .chained = true, |
| 6187 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6188 | }, |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 6189 | [ALC275_FIXUP_DELL_XPS] = { |
| 6190 | .type = HDA_FIXUP_VERBS, |
| 6191 | .v.verbs = (const struct hda_verb[]) { |
| 6192 | /* Enables internal speaker */ |
| 6193 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1f}, |
| 6194 | {0x20, AC_VERB_SET_PROC_COEF, 0x00c0}, |
| 6195 | {0x20, AC_VERB_SET_COEF_INDEX, 0x30}, |
| 6196 | {0x20, AC_VERB_SET_PROC_COEF, 0x00b1}, |
| 6197 | {} |
| 6198 | } |
| 6199 | }, |
Hui Wang | 8c69729 | 2015-11-24 11:08:18 +0800 | [diff] [blame] | 6200 | [ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE] = { |
| 6201 | .type = HDA_FIXUP_VERBS, |
| 6202 | .v.verbs = (const struct hda_verb[]) { |
| 6203 | /* Disable pass-through path for FRONT 14h */ |
| 6204 | {0x20, AC_VERB_SET_COEF_INDEX, 0x36}, |
| 6205 | {0x20, AC_VERB_SET_PROC_COEF, 0x1737}, |
| 6206 | {} |
| 6207 | }, |
| 6208 | .chained = true, |
| 6209 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6210 | }, |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 6211 | [ALC293_FIXUP_LENOVO_SPK_NOISE] = { |
| 6212 | .type = HDA_FIXUP_FUNC, |
| 6213 | .v.func = alc_fixup_disable_aamix, |
| 6214 | .chained = true, |
| 6215 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
| 6216 | }, |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 6217 | [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = { |
| 6218 | .type = HDA_FIXUP_FUNC, |
| 6219 | .v.func = alc233_fixup_lenovo_line2_mic_hotkey, |
| 6220 | }, |
Kai-Heng Feng | 3b43b71 | 2016-02-25 15:19:38 +0800 | [diff] [blame] | 6221 | [ALC255_FIXUP_DELL_SPK_NOISE] = { |
| 6222 | .type = HDA_FIXUP_FUNC, |
| 6223 | .v.func = alc_fixup_disable_aamix, |
| 6224 | .chained = true, |
| 6225 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6226 | }, |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 6227 | [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6228 | .type = HDA_FIXUP_VERBS, |
| 6229 | .v.verbs = (const struct hda_verb[]) { |
| 6230 | /* Disable pass-through path for FRONT 14h */ |
| 6231 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, |
| 6232 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, |
| 6233 | {} |
| 6234 | }, |
| 6235 | .chained = true, |
| 6236 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6237 | }, |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 6238 | [ALC280_FIXUP_HP_HEADSET_MIC] = { |
| 6239 | .type = HDA_FIXUP_FUNC, |
| 6240 | .v.func = alc_fixup_disable_aamix, |
| 6241 | .chained = true, |
| 6242 | .chain_id = ALC269_FIXUP_HEADSET_MIC, |
| 6243 | }, |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 6244 | [ALC221_FIXUP_HP_FRONT_MIC] = { |
| 6245 | .type = HDA_FIXUP_PINS, |
| 6246 | .v.pins = (const struct hda_pintbl[]) { |
| 6247 | { 0x19, 0x02a19020 }, /* Front Mic */ |
| 6248 | { } |
| 6249 | }, |
| 6250 | }, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 6251 | [ALC292_FIXUP_TPT460] = { |
| 6252 | .type = HDA_FIXUP_FUNC, |
| 6253 | .v.func = alc_fixup_tpt440_dock, |
| 6254 | .chained = true, |
| 6255 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, |
| 6256 | }, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6257 | [ALC298_FIXUP_SPK_VOLUME] = { |
| 6258 | .type = HDA_FIXUP_FUNC, |
| 6259 | .v.func = alc298_fixup_speaker_volume, |
Hui Wang | 59ec4b5 | 2016-08-04 15:28:04 +0800 | [diff] [blame] | 6260 | .chained = true, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 6261 | .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6262 | }, |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 6263 | [ALC295_FIXUP_DISABLE_DAC3] = { |
| 6264 | .type = HDA_FIXUP_FUNC, |
| 6265 | .v.func = alc295_fixup_disable_dac3, |
| 6266 | }, |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 6267 | [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { |
| 6268 | .type = HDA_FIXUP_PINS, |
| 6269 | .v.pins = (const struct hda_pintbl[]) { |
| 6270 | { 0x1b, 0x90170151 }, |
| 6271 | { } |
| 6272 | }, |
| 6273 | .chained = true, |
| 6274 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6275 | }, |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 6276 | [ALC269_FIXUP_ATIV_BOOK_8] = { |
| 6277 | .type = HDA_FIXUP_FUNC, |
| 6278 | .v.func = alc_fixup_auto_mute_via_amp, |
| 6279 | .chained = true, |
| 6280 | .chain_id = ALC269_FIXUP_NO_SHUTUP |
| 6281 | }, |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 6282 | [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { |
| 6283 | .type = HDA_FIXUP_PINS, |
| 6284 | .v.pins = (const struct hda_pintbl[]) { |
| 6285 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6286 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6287 | { } |
| 6288 | }, |
| 6289 | .chained = true, |
| 6290 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6291 | }, |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6292 | [ALC256_FIXUP_ASUS_HEADSET_MODE] = { |
| 6293 | .type = HDA_FIXUP_FUNC, |
| 6294 | .v.func = alc_fixup_headset_mode, |
| 6295 | }, |
| 6296 | [ALC256_FIXUP_ASUS_MIC] = { |
| 6297 | .type = HDA_FIXUP_PINS, |
| 6298 | .v.pins = (const struct hda_pintbl[]) { |
| 6299 | { 0x13, 0x90a60160 }, /* use as internal mic */ |
| 6300 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 6301 | { } |
| 6302 | }, |
| 6303 | .chained = true, |
| 6304 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 6305 | }, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 6306 | [ALC256_FIXUP_ASUS_AIO_GPIO2] = { |
| 6307 | .type = HDA_FIXUP_VERBS, |
| 6308 | .v.verbs = (const struct hda_verb[]) { |
| 6309 | /* Set up GPIO2 for the speaker amp */ |
| 6310 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x04 }, |
| 6311 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04 }, |
| 6312 | { 0x01, AC_VERB_SET_GPIO_DATA, 0x04 }, |
| 6313 | {} |
| 6314 | }, |
| 6315 | }, |
Chris Chiu | 216d7ae | 2017-02-28 14:17:14 -0600 | [diff] [blame] | 6316 | [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 6317 | .type = HDA_FIXUP_PINS, |
| 6318 | .v.pins = (const struct hda_pintbl[]) { |
| 6319 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6320 | { } |
| 6321 | }, |
| 6322 | .chained = true, |
| 6323 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 6324 | }, |
| 6325 | [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = { |
| 6326 | .type = HDA_FIXUP_VERBS, |
| 6327 | .v.verbs = (const struct hda_verb[]) { |
| 6328 | /* Enables internal speaker */ |
| 6329 | {0x20, AC_VERB_SET_COEF_INDEX, 0x40}, |
| 6330 | {0x20, AC_VERB_SET_PROC_COEF, 0x8800}, |
| 6331 | {} |
| 6332 | }, |
| 6333 | .chained = true, |
| 6334 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE |
| 6335 | }, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 6336 | [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { |
| 6337 | .type = HDA_FIXUP_FUNC, |
| 6338 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, |
| 6339 | }, |
Hui Wang | f33f79f | 2017-07-07 12:08:29 +0800 | [diff] [blame] | 6340 | [ALC294_FIXUP_LENOVO_MIC_LOCATION] = { |
| 6341 | .type = HDA_FIXUP_PINS, |
| 6342 | .v.pins = (const struct hda_pintbl[]) { |
| 6343 | /* Change the mic location from front to right, otherwise there are |
| 6344 | two front mics with the same name, pulseaudio can't handle them. |
| 6345 | This is just a temporary workaround, after applying this fixup, |
| 6346 | there will be one "Front Mic" and one "Mic" in this machine. |
| 6347 | */ |
| 6348 | { 0x1a, 0x04a19040 }, |
| 6349 | { } |
| 6350 | }, |
| 6351 | }, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 6352 | [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = { |
| 6353 | .type = HDA_FIXUP_PINS, |
| 6354 | .v.pins = (const struct hda_pintbl[]) { |
| 6355 | { 0x16, 0x0101102f }, /* Rear Headset HP */ |
| 6356 | { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */ |
| 6357 | { 0x1a, 0x01a19030 }, /* Rear Headset MIC */ |
| 6358 | { 0x1b, 0x02011020 }, |
| 6359 | { } |
| 6360 | }, |
| 6361 | .chained = true, |
| 6362 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6363 | }, |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 6364 | [ALC700_FIXUP_INTEL_REFERENCE] = { |
| 6365 | .type = HDA_FIXUP_VERBS, |
| 6366 | .v.verbs = (const struct hda_verb[]) { |
| 6367 | /* Enables internal speaker */ |
| 6368 | {0x20, AC_VERB_SET_COEF_INDEX, 0x45}, |
| 6369 | {0x20, AC_VERB_SET_PROC_COEF, 0x5289}, |
| 6370 | {0x20, AC_VERB_SET_COEF_INDEX, 0x4A}, |
| 6371 | {0x20, AC_VERB_SET_PROC_COEF, 0x001b}, |
| 6372 | {0x58, AC_VERB_SET_COEF_INDEX, 0x00}, |
| 6373 | {0x58, AC_VERB_SET_PROC_COEF, 0x3888}, |
| 6374 | {0x20, AC_VERB_SET_COEF_INDEX, 0x6f}, |
| 6375 | {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b}, |
| 6376 | {} |
| 6377 | } |
| 6378 | }, |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 6379 | [ALC274_FIXUP_DELL_BIND_DACS] = { |
| 6380 | .type = HDA_FIXUP_FUNC, |
| 6381 | .v.func = alc274_fixup_bind_dacs, |
| 6382 | .chained = true, |
| 6383 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6384 | }, |
| 6385 | [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = { |
| 6386 | .type = HDA_FIXUP_PINS, |
| 6387 | .v.pins = (const struct hda_pintbl[]) { |
| 6388 | { 0x1b, 0x0401102f }, |
| 6389 | { } |
| 6390 | }, |
| 6391 | .chained = true, |
| 6392 | .chain_id = ALC274_FIXUP_DELL_BIND_DACS |
| 6393 | }, |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6394 | [ALC298_FIXUP_TPT470_DOCK] = { |
| 6395 | .type = HDA_FIXUP_FUNC, |
| 6396 | .v.func = alc_fixup_tpt470_dock, |
| 6397 | .chained = true, |
| 6398 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE |
| 6399 | }, |
Kailang Yang | ae104a2 | 2018-02-05 16:07:20 +0800 | [diff] [blame] | 6400 | [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = { |
| 6401 | .type = HDA_FIXUP_PINS, |
| 6402 | .v.pins = (const struct hda_pintbl[]) { |
| 6403 | { 0x14, 0x0201101f }, |
| 6404 | { } |
| 6405 | }, |
| 6406 | .chained = true, |
| 6407 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6408 | }, |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 6409 | [ALC255_FIXUP_DELL_HEADSET_MIC] = { |
| 6410 | .type = HDA_FIXUP_PINS, |
| 6411 | .v.pins = (const struct hda_pintbl[]) { |
| 6412 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6413 | { } |
| 6414 | }, |
Hui Wang | 3ce0d5a | 2018-04-19 13:29:04 +0800 | [diff] [blame] | 6415 | .chained = true, |
| 6416 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 6417 | }, |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 6418 | [ALC295_FIXUP_HP_X360] = { |
| 6419 | .type = HDA_FIXUP_FUNC, |
| 6420 | .v.func = alc295_fixup_hp_top_speakers, |
| 6421 | .chained = true, |
| 6422 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3 |
| 6423 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6424 | }; |
| 6425 | |
| 6426 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
Marius Knaust | a6b92b6 | 2014-03-03 01:48:58 +0100 | [diff] [blame] | 6427 | SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6428 | SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), |
| 6429 | SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 6430 | SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 6431 | SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
| 6432 | SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 6433 | SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), |
| 6434 | SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), |
Simon South | 02322ac | 2016-03-02 23:10:44 -0500 | [diff] [blame] | 6435 | SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 6436 | 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] | 6437 | SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), |
Takashi Iwai | b9c2fa5 | 2015-11-19 16:39:50 +0100 | [diff] [blame] | 6438 | SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 6439 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 6440 | SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), |
Takashi Iwai | 86f799b | 2015-11-14 17:46:31 +0100 | [diff] [blame] | 6441 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | cf52103 | 2016-01-15 12:59:25 +0100 | [diff] [blame] | 6442 | SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6443 | SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X), |
| 6444 | SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6445 | SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6446 | SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 6447 | SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 6448 | SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6449 | SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
| 6450 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
Takashi Iwai | 9807057 | 2016-01-12 21:06:39 +0100 | [diff] [blame] | 6451 | SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | 4275554 | 2015-06-29 10:56:53 +0200 | [diff] [blame] | 6452 | SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6453 | 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] | 6454 | SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 6455 | SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6456 | SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13), |
Bastien Nocera | afecb14 | 2016-04-18 11:10:42 +0200 | [diff] [blame] | 6457 | SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
Takashi Iwai | 3a05d12 | 2015-07-29 09:04:52 +0200 | [diff] [blame] | 6458 | SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), |
Kailang Yang | 8b72415 | 2014-12-17 17:08:59 +0800 | [diff] [blame] | 6459 | SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
Kailang Yang | b734304 | 2014-12-02 14:50:45 +0800 | [diff] [blame] | 6460 | SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 6461 | SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 6462 | SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 6463 | SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 6464 | SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 6465 | SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 6466 | SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
Kai-Heng Feng | 423cd78 | 2016-05-20 15:47:23 +0800 | [diff] [blame] | 6467 | SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 6468 | SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), |
Kai-Heng Feng | 3b43b71 | 2016-02-25 15:19:38 +0800 | [diff] [blame] | 6469 | SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE), |
Kai-Heng Feng | 423cd78 | 2016-05-20 15:47:23 +0800 | [diff] [blame] | 6470 | SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6471 | SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 6472 | SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3), |
Takashi Iwai | 493de34 | 2017-02-28 17:27:57 +0100 | [diff] [blame] | 6473 | SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 6474 | SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE), |
Takashi Iwai | e4c9fd1 | 2018-01-10 08:34:28 +0100 | [diff] [blame] | 6475 | SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), |
Kailang Yang | 40e2c4e | 2018-02-02 15:13:09 +0800 | [diff] [blame] | 6476 | SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
| 6477 | SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 6478 | SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
| 6479 | SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
Kailang Yang | ae104a2 | 2018-02-05 16:07:20 +0800 | [diff] [blame] | 6480 | SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 6481 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 6482 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6483 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 6484 | SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 6485 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 6486 | SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6487 | /* ALC282 */ |
Hui Wang | 7976eb4 | 2015-02-13 11:14:41 +0800 | [diff] [blame] | 6488 | SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 6489 | SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 6490 | SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6491 | SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 6492 | SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 6493 | SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 6494 | SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6495 | SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6496 | SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6497 | SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6498 | SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 6499 | SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 6500 | SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED), |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 6501 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
TienFu Chen | 3271cb2 | 2015-02-10 09:09:41 +0100 | [diff] [blame] | 6502 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6503 | SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6504 | SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6505 | SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6506 | SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6507 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6508 | SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6509 | SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6510 | SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6511 | /* ALC290 */ |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6512 | SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6513 | SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6514 | SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6515 | SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6516 | SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6517 | SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6518 | SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6519 | SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6520 | SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 6521 | SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6522 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6523 | SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6524 | SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6525 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6526 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6527 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6528 | SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6529 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6530 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6531 | SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6532 | SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6533 | SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6534 | SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6535 | SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6536 | SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 6537 | SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6538 | SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6539 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6540 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 6541 | SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 6542 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 6543 | SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 6544 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
| 6545 | SND_PCI_QUIRK(0x103c, 0x82c0, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6546 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6547 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6548 | SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6549 | SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 4eab0ea | 2017-06-06 12:33:17 +0200 | [diff] [blame] | 6550 | SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6551 | SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Takashi Iwai | 4eab0ea | 2017-06-06 12:33:17 +0200 | [diff] [blame] | 6552 | SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
| 6553 | SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), |
| 6554 | SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6555 | SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), |
| 6556 | SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), |
| 6557 | SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 6558 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 6559 | 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] | 6560 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 6561 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
Chris Chiu | 28e8af8 | 2017-06-05 15:05:30 -0600 | [diff] [blame] | 6562 | SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6563 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 6564 | SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
Takashi Iwai | 4eab0ea | 2017-06-06 12:33:17 +0200 | [diff] [blame] | 6565 | SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6566 | SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 6567 | SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 6568 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), |
| 6569 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), |
| 6570 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
| 6571 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 6572 | SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), |
Takashi Iwai | f88abaa | 2014-02-07 12:07:59 +0100 | [diff] [blame] | 6573 | 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] | 6574 | 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] | 6575 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), |
| 6576 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
| 6577 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 6578 | 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] | 6579 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 6580 | SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT), |
Takashi Iwai | cc7016a | 2015-04-08 20:47:55 +0200 | [diff] [blame] | 6581 | SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
Takashi Iwai | 88776f3 | 2015-05-01 09:20:34 +0200 | [diff] [blame] | 6582 | SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 6583 | SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC), |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 6584 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 6585 | SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), |
David Henningsson | a33cc48 | 2014-10-07 10:18:41 +0200 | [diff] [blame] | 6586 | SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 6587 | SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 6588 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |
| 6589 | SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 6590 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6591 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
| 6592 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), |
| 6593 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), |
| 6594 | SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), |
| 6595 | SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), |
Takashi Iwai | 707fba3 | 2012-08-02 09:04:39 +0200 | [diff] [blame] | 6596 | SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK), |
Felix Kaechele | c8415a4 | 2012-08-06 23:02:01 +0200 | [diff] [blame] | 6597 | SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), |
Stefán Freyr | 84f98fd | 2012-10-19 22:46:00 +0200 | [diff] [blame] | 6598 | SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), |
Philipp A. Mohrenweiser | 4407be6 | 2012-08-06 13:14:18 +0200 | [diff] [blame] | 6599 | SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6600 | SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 6601 | SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6602 | SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440), |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6603 | SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | a12137e | 2014-06-27 12:14:35 +0200 | [diff] [blame] | 6604 | SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), |
Rick Sherman | 59a51a6 | 2015-08-18 21:04:30 -0500 | [diff] [blame] | 6605 | SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | 6d16941 | 2014-10-07 17:27:02 +0200 | [diff] [blame] | 6606 | SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), |
Lukas Bossard | 7c21539 | 2014-10-29 18:31:07 +0100 | [diff] [blame] | 6607 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 6608 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Takashi Iwai | b6903c0 | 2015-12-10 12:20:20 +0100 | [diff] [blame] | 6609 | SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK), |
Laura Abbott | d05ea7d | 2015-10-02 11:09:54 -0700 | [diff] [blame] | 6610 | SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), |
Yves-Alexis Perez | c027866 | 2015-04-11 09:31:35 +0200 | [diff] [blame] | 6611 | SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6612 | SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 6613 | SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Torsten Hilbrich | dab38e4 | 2016-06-07 13:14:21 +0200 | [diff] [blame] | 6614 | SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460), |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 6615 | SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6616 | SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK), |
| 6617 | SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 6618 | SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Dennis Wassenberg | e4c07b3 | 2018-03-08 13:17:54 +0100 | [diff] [blame] | 6619 | SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6620 | SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 6621 | SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 6622 | SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Benjamin Berg | 85981df | 2018-02-14 13:29:39 +0100 | [diff] [blame] | 6623 | SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 6624 | SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
Hui Wang | 6ef2f68 | 2016-03-11 12:04:02 +0800 | [diff] [blame] | 6625 | SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
Hui Wang | f33f79f | 2017-07-07 12:08:29 +0800 | [diff] [blame] | 6626 | SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Kailang Yang | 6581183 | 2018-04-25 17:07:27 +0800 | [diff] [blame] | 6627 | SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | a3dafb2 | 2018-04-19 13:29:05 +0800 | [diff] [blame] | 6628 | SND_PCI_QUIRK(0x17aa, 0x3138, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | 8da5bbf | 2017-12-22 11:17:46 +0800 | [diff] [blame] | 6629 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 6630 | SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
Takashi Iwai | fedb224 | 2014-11-13 07:11:38 +0100 | [diff] [blame] | 6631 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 6632 | SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 6633 | SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 6634 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), |
Takashi Iwai | c497d9f | 2014-10-08 12:14:40 +0200 | [diff] [blame] | 6635 | SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 6636 | SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Jo-Philipp Wich | f2aa111 | 2015-04-13 12:47:26 +0200 | [diff] [blame] | 6637 | SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), |
Sebastian Wicki | 80b311d | 2015-03-23 17:23:11 +0100 | [diff] [blame] | 6638 | SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), |
Ansgar Hegerfeld | 09ea997 | 2015-05-14 12:31:32 +0200 | [diff] [blame] | 6639 | SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), |
Conrad Kostecki | 037e119 | 2016-04-26 10:08:10 +0200 | [diff] [blame] | 6640 | SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK), |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 6641 | SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), |
Jaroslav Kysela | 0f087ee | 2016-06-24 15:13:16 +0200 | [diff] [blame] | 6642 | SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460), |
Torsten Hilbrich | 9cd2574 | 2016-07-05 10:40:22 +0200 | [diff] [blame] | 6643 | SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460), |
Jaroslav Kysela | 0f087ee | 2016-06-24 15:13:16 +0200 | [diff] [blame] | 6644 | SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6645 | SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 6646 | SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 6647 | SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 6648 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6649 | SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 6650 | SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 6651 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6652 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 6653 | 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] | 6654 | |
Takashi Iwai | a7f3eed | 2012-02-16 13:03:18 +0100 | [diff] [blame] | 6655 | #if 0 |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6656 | /* Below is a quirk table taken from the old code. |
| 6657 | * Basically the device should work as is without the fixup table. |
| 6658 | * If BIOS doesn't give a proper info, enable the corresponding |
| 6659 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 6660 | */ |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6661 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", |
| 6662 | ALC269_FIXUP_AMIC), |
| 6663 | SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6664 | SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), |
| 6665 | SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), |
| 6666 | SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), |
| 6667 | SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), |
| 6668 | SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), |
| 6669 | SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), |
| 6670 | SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), |
| 6671 | SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), |
| 6672 | SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), |
| 6673 | SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), |
| 6674 | SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), |
| 6675 | SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), |
| 6676 | SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), |
| 6677 | SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), |
| 6678 | SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), |
| 6679 | SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), |
| 6680 | SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), |
| 6681 | SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), |
| 6682 | SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), |
| 6683 | SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), |
| 6684 | SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), |
| 6685 | SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), |
| 6686 | SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), |
| 6687 | SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), |
| 6688 | SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), |
| 6689 | SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), |
| 6690 | SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), |
| 6691 | SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), |
| 6692 | SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), |
| 6693 | SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), |
| 6694 | SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), |
| 6695 | SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), |
| 6696 | SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), |
| 6697 | SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), |
| 6698 | SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), |
| 6699 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), |
| 6700 | SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), |
| 6701 | SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), |
| 6702 | #endif |
| 6703 | {} |
| 6704 | }; |
| 6705 | |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 6706 | static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = { |
| 6707 | SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), |
| 6708 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), |
| 6709 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), |
| 6710 | SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), |
| 6711 | {} |
| 6712 | }; |
| 6713 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6714 | static const struct hda_model_fixup alc269_fixup_models[] = { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6715 | {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, |
| 6716 | {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 6717 | {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, |
| 6718 | {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, |
| 6719 | {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 6720 | {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, |
Takashi Iwai | b016951 | 2015-05-19 10:20:13 +0200 | [diff] [blame] | 6721 | {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, |
| 6722 | {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"}, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6723 | {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 6724 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 6725 | {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"}, |
David Henningsson | e32aa85 | 2013-06-17 11:04:02 +0200 | [diff] [blame] | 6726 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
| 6727 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, |
Kailang Yang | be8ef16 | 2014-04-08 15:19:49 +0800 | [diff] [blame] | 6728 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 6729 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6730 | {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6731 | {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 6732 | {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 6733 | {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
Takashi Iwai | 28d1d6d | 2017-10-18 14:01:58 +0200 | [diff] [blame] | 6734 | {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6735 | {} |
| 6736 | }; |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 6737 | #define ALC225_STANDARD_PINS \ |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 6738 | {0x21, 0x04211020} |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6739 | |
Hui Wang | e8191a8 | 2015-04-24 13:39:59 +0800 | [diff] [blame] | 6740 | #define ALC256_STANDARD_PINS \ |
| 6741 | {0x12, 0x90a60140}, \ |
| 6742 | {0x14, 0x90170110}, \ |
Hui Wang | e8191a8 | 2015-04-24 13:39:59 +0800 | [diff] [blame] | 6743 | {0x21, 0x02211020} |
| 6744 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 6745 | #define ALC282_STANDARD_PINS \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 6746 | {0x14, 0x90170110} |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6747 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 6748 | #define ALC290_STANDARD_PINS \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 6749 | {0x12, 0x99a30130} |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 6750 | |
| 6751 | #define ALC292_STANDARD_PINS \ |
| 6752 | {0x14, 0x90170110}, \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 6753 | {0x15, 0x0221401f} |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 6754 | |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 6755 | #define ALC295_STANDARD_PINS \ |
| 6756 | {0x12, 0xb7a60130}, \ |
| 6757 | {0x14, 0x90170110}, \ |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 6758 | {0x21, 0x04211020} |
| 6759 | |
Woodrow Shen | 703867e | 2015-08-05 12:34:12 +0800 | [diff] [blame] | 6760 | #define ALC298_STANDARD_PINS \ |
| 6761 | {0x12, 0x90a60130}, \ |
| 6762 | {0x21, 0x03211020} |
| 6763 | |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 6764 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 6765 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
| 6766 | {0x12, 0x90a601c0}, |
| 6767 | {0x14, 0x90171120}, |
| 6768 | {0x21, 0x02211030}), |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 6769 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 6770 | {0x14, 0x90170110}, |
| 6771 | {0x1b, 0x90a70130}, |
| 6772 | {0x21, 0x03211020}), |
| 6773 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 6774 | {0x1a, 0x90a70130}, |
| 6775 | {0x1b, 0x90170110}, |
| 6776 | {0x21, 0x03211020}), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 6777 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 6778 | ALC225_STANDARD_PINS, |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 6779 | {0x12, 0xb7a60130}, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 6780 | {0x14, 0x901701a0}), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 6781 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 6782 | ALC225_STANDARD_PINS, |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 6783 | {0x12, 0xb7a60130}, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 6784 | {0x14, 0x901701b0}), |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 6785 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6786 | ALC225_STANDARD_PINS, |
| 6787 | {0x12, 0xb7a60150}, |
| 6788 | {0x14, 0x901701a0}), |
| 6789 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6790 | ALC225_STANDARD_PINS, |
| 6791 | {0x12, 0xb7a60150}, |
| 6792 | {0x14, 0x901701b0}), |
| 6793 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6794 | ALC225_STANDARD_PINS, |
| 6795 | {0x12, 0xb7a60130}, |
| 6796 | {0x1b, 0x90170110}), |
Kai-Heng Feng | 0ce48e1 | 2017-11-20 02:29:13 -0500 | [diff] [blame] | 6797 | SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6798 | {0x1b, 0x01111010}, |
| 6799 | {0x1e, 0x01451130}, |
| 6800 | {0x21, 0x02211020}), |
Hui Wang | 986376b | 2018-05-30 12:33:07 +0800 | [diff] [blame] | 6801 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
| 6802 | {0x12, 0x90a60140}, |
| 6803 | {0x14, 0x90170110}, |
| 6804 | {0x19, 0x02a11030}, |
| 6805 | {0x21, 0x02211020}), |
Hui Wang | f265788 | 2017-10-24 16:53:34 +0800 | [diff] [blame] | 6806 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6807 | {0x12, 0x90a60140}, |
| 6808 | {0x14, 0x90170110}, |
| 6809 | {0x21, 0x02211020}), |
| 6810 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6811 | {0x12, 0x90a60140}, |
| 6812 | {0x14, 0x90170150}, |
| 6813 | {0x21, 0x02211020}), |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 6814 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 6815 | {0x14, 0x90170110}, |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 6816 | {0x21, 0x02211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6817 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 86c72d1 | 2016-05-25 12:12:32 +0800 | [diff] [blame] | 6818 | {0x14, 0x90170130}, |
| 6819 | {0x21, 0x02211040}), |
| 6820 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6821 | {0x12, 0x90a60140}, |
| 6822 | {0x14, 0x90170110}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6823 | {0x21, 0x02211020}), |
| 6824 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6825 | {0x12, 0x90a60160}, |
| 6826 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6827 | {0x21, 0x02211030}), |
| 6828 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 392c9da | 2016-09-26 10:59:38 +0800 | [diff] [blame] | 6829 | {0x14, 0x90170110}, |
| 6830 | {0x1b, 0x02011020}, |
| 6831 | {0x21, 0x0221101f}), |
| 6832 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 6aecd87 | 2016-10-20 14:03:33 +0800 | [diff] [blame] | 6833 | {0x14, 0x90170110}, |
| 6834 | {0x1b, 0x01011020}, |
| 6835 | {0x21, 0x0221101f}), |
| 6836 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | cba5997 | 2015-07-22 10:00:25 +0200 | [diff] [blame] | 6837 | {0x14, 0x90170130}, |
David Henningsson | cba5997 | 2015-07-22 10:00:25 +0200 | [diff] [blame] | 6838 | {0x1b, 0x01014020}, |
David Henningsson | cba5997 | 2015-07-22 10:00:25 +0200 | [diff] [blame] | 6839 | {0x21, 0x0221103f}), |
| 6840 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 59ec4b5 | 2016-08-04 15:28:04 +0800 | [diff] [blame] | 6841 | {0x14, 0x90170130}, |
Hui Wang | 6aecd87 | 2016-10-20 14:03:33 +0800 | [diff] [blame] | 6842 | {0x1b, 0x01011020}, |
| 6843 | {0x21, 0x0221103f}), |
| 6844 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6845 | {0x14, 0x90170130}, |
Hui Wang | 59ec4b5 | 2016-08-04 15:28:04 +0800 | [diff] [blame] | 6846 | {0x1b, 0x02011020}, |
| 6847 | {0x21, 0x0221103f}), |
| 6848 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 6849 | {0x14, 0x90170150}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 6850 | {0x1b, 0x02011020}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 6851 | {0x21, 0x0221105f}), |
| 6852 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 6853 | {0x14, 0x90170110}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 6854 | {0x1b, 0x01014020}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 6855 | {0x21, 0x0221101f}), |
| 6856 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6857 | {0x12, 0x90a60160}, |
| 6858 | {0x14, 0x90170120}, |
| 6859 | {0x17, 0x90170140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6860 | {0x21, 0x0321102f}), |
| 6861 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6862 | {0x12, 0x90a60160}, |
| 6863 | {0x14, 0x90170130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6864 | {0x21, 0x02211040}), |
| 6865 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6866 | {0x12, 0x90a60160}, |
| 6867 | {0x14, 0x90170140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6868 | {0x21, 0x02211050}), |
| 6869 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6870 | {0x12, 0x90a60170}, |
| 6871 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6872 | {0x21, 0x02211030}), |
| 6873 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6874 | {0x12, 0x90a60170}, |
| 6875 | {0x14, 0x90170130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6876 | {0x21, 0x02211040}), |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 6877 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 6878 | {0x12, 0x90a60170}, |
Hui Wang | 0a1f90a | 2016-01-13 11:51:38 +0800 | [diff] [blame] | 6879 | {0x14, 0x90171130}, |
| 6880 | {0x21, 0x02211040}), |
| 6881 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6882 | {0x12, 0x90a60170}, |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 6883 | {0x14, 0x90170140}, |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 6884 | {0x21, 0x02211050}), |
David Henningsson | 9b5a4e3 | 2015-05-11 14:04:14 +0200 | [diff] [blame] | 6885 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | 9b5a4e3 | 2015-05-11 14:04:14 +0200 | [diff] [blame] | 6886 | {0x12, 0x90a60180}, |
| 6887 | {0x14, 0x90170130}, |
David Henningsson | 9b5a4e3 | 2015-05-11 14:04:14 +0200 | [diff] [blame] | 6888 | {0x21, 0x02211040}), |
AceLan Kao | f90d83b | 2016-06-03 14:45:25 +0800 | [diff] [blame] | 6889 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6890 | {0x12, 0x90a60180}, |
| 6891 | {0x14, 0x90170120}, |
| 6892 | {0x21, 0x02211030}), |
Hui Wang | 989dbe4 | 2016-11-23 16:05:38 +0800 | [diff] [blame] | 6893 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6894 | {0x1b, 0x01011020}, |
| 6895 | {0x21, 0x02211010}), |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 6896 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 285d5dd | 2017-12-22 11:17:45 +0800 | [diff] [blame] | 6897 | {0x12, 0x90a60130}, |
| 6898 | {0x14, 0x90170110}, |
| 6899 | {0x1b, 0x01011020}, |
| 6900 | {0x21, 0x0221101f}), |
| 6901 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Kailang Yang | 81a1231 | 2015-05-28 16:48:22 +0800 | [diff] [blame] | 6902 | {0x12, 0x90a60160}, |
| 6903 | {0x14, 0x90170120}, |
Kailang Yang | 81a1231 | 2015-05-28 16:48:22 +0800 | [diff] [blame] | 6904 | {0x21, 0x02211030}), |
| 6905 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Woodrow Shen | f83c329 | 2016-06-24 15:58:34 +0800 | [diff] [blame] | 6906 | {0x12, 0x90a60170}, |
| 6907 | {0x14, 0x90170120}, |
| 6908 | {0x21, 0x02211030}), |
Shrirang Bagul | 311042d | 2016-08-29 15:19:27 +0800 | [diff] [blame] | 6909 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6910 | {0x12, 0x90a60180}, |
| 6911 | {0x14, 0x90170120}, |
| 6912 | {0x21, 0x02211030}), |
Woodrow Shen | f83c329 | 2016-06-24 15:58:34 +0800 | [diff] [blame] | 6913 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 6914 | {0x12, 0xb7a60130}, |
| 6915 | {0x14, 0x90170110}, |
| 6916 | {0x21, 0x02211020}), |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 6917 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 3f2f7c5 | 2018-01-29 14:23:15 +0800 | [diff] [blame] | 6918 | {0x12, 0x90a60130}, |
| 6919 | {0x14, 0x90170110}, |
| 6920 | {0x14, 0x01011020}, |
| 6921 | {0x21, 0x0221101f}), |
| 6922 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 6923 | ALC256_STANDARD_PINS), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6924 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
| 6925 | {0x14, 0x90170110}, |
| 6926 | {0x1b, 0x90a70130}, |
| 6927 | {0x21, 0x04211020}), |
| 6928 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
| 6929 | {0x14, 0x90170110}, |
| 6930 | {0x1b, 0x90a70130}, |
| 6931 | {0x21, 0x03211020}), |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 6932 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
Hui Wang | 75ee94b | 2017-11-09 08:48:08 +0800 | [diff] [blame] | 6933 | {0x12, 0xb7a60130}, |
| 6934 | {0x13, 0xb8a61140}, |
| 6935 | {0x16, 0x90170110}, |
| 6936 | {0x21, 0x04211020}), |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 6937 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, |
| 6938 | {0x12, 0x90a60130}, |
| 6939 | {0x14, 0x90170110}, |
| 6940 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 6941 | {0x1a, 0x04a11020}), |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 6942 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 6943 | {0x12, 0x90a60140}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 6944 | {0x14, 0x90170110}, |
| 6945 | {0x15, 0x0421101f}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 6946 | {0x18, 0x02811030}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 6947 | {0x1a, 0x04a1103f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 6948 | {0x1b, 0x02011020}), |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 6949 | 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] | 6950 | ALC282_STANDARD_PINS, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 6951 | {0x12, 0x99a30130}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 6952 | {0x19, 0x03a11020}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 6953 | {0x21, 0x0321101f}), |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 6954 | 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] | 6955 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 6956 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 6957 | {0x19, 0x03a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 6958 | {0x21, 0x03211040}), |
| 6959 | 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] | 6960 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 6961 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 6962 | {0x19, 0x03a11030}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 6963 | {0x21, 0x03211020}), |
| 6964 | 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] | 6965 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 6966 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 6967 | {0x19, 0x04a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 6968 | {0x21, 0x0421101f}), |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 6969 | 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] | 6970 | ALC282_STANDARD_PINS, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 6971 | {0x12, 0x90a60140}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 6972 | {0x19, 0x04a11030}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 6973 | {0x21, 0x04211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6974 | 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] | 6975 | ALC282_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6976 | {0x12, 0x90a60130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6977 | {0x21, 0x0321101f}), |
| 6978 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6979 | {0x12, 0x90a60160}, |
| 6980 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 6981 | {0x21, 0x02211030}), |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 6982 | 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] | 6983 | ALC282_STANDARD_PINS, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 6984 | {0x12, 0x90a60130}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 6985 | {0x19, 0x03a11020}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 6986 | {0x21, 0x0321101f}), |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6987 | SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL_XPS_13_GPIO6, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6988 | {0x12, 0x90a60120}, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6989 | {0x14, 0x90170110}, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6990 | {0x21, 0x0321101f}), |
Hui Wang | d507819 | 2018-03-02 13:05:36 +0800 | [diff] [blame] | 6991 | SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
Hui Wang | 3f2f7c5 | 2018-01-29 14:23:15 +0800 | [diff] [blame] | 6992 | {0x12, 0xb7a60130}, |
| 6993 | {0x14, 0x90170110}, |
| 6994 | {0x21, 0x04211020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 6995 | 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] | 6996 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 6997 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 6998 | {0x18, 0x90170112}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 6999 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7000 | 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] | 7001 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7002 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7003 | {0x18, 0x90170110}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7004 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7005 | 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] | 7006 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7007 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7008 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7009 | 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] | 7010 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7011 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7012 | {0x1a, 0x04a11040}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7013 | 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] | 7014 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7015 | {0x14, 0x90170110}, |
| 7016 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7017 | {0x1a, 0x04a11040}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7018 | 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] | 7019 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7020 | {0x14, 0x90170110}, |
| 7021 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7022 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7023 | 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] | 7024 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7025 | {0x14, 0x90170110}, |
| 7026 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7027 | {0x1a, 0x04a11020}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7028 | 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] | 7029 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7030 | {0x12, 0x90a60140}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7031 | {0x16, 0x01014020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7032 | {0x19, 0x01a19030}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7033 | 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] | 7034 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7035 | {0x12, 0x90a60140}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7036 | {0x16, 0x01014020}, |
| 7037 | {0x18, 0x02a19031}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7038 | {0x19, 0x01a1903e}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7039 | 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] | 7040 | ALC292_STANDARD_PINS, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7041 | {0x12, 0x90a60140}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7042 | 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] | 7043 | ALC292_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7044 | {0x13, 0x90a60140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7045 | {0x16, 0x21014020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7046 | {0x19, 0x21a19030}), |
David Henningsson | e03fdbd | 2014-06-27 08:41:59 +0200 | [diff] [blame] | 7047 | 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] | 7048 | ALC292_STANDARD_PINS, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7049 | {0x13, 0x90a60140}), |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 7050 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | f771d5b | 2016-10-18 10:59:09 +0800 | [diff] [blame] | 7051 | ALC295_STANDARD_PINS, |
| 7052 | {0x17, 0x21014020}, |
| 7053 | {0x18, 0x21a19030}), |
| 7054 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7055 | ALC295_STANDARD_PINS, |
| 7056 | {0x17, 0x21014040}, |
| 7057 | {0x18, 0x21a19050}), |
Hui Wang | 3f30783 | 2017-03-23 10:00:25 +0800 | [diff] [blame] | 7058 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7059 | ALC295_STANDARD_PINS), |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 7060 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
Woodrow Shen | 703867e | 2015-08-05 12:34:12 +0800 | [diff] [blame] | 7061 | ALC298_STANDARD_PINS, |
Takashi Iwai | 9f502ff | 2015-08-05 12:09:45 +0200 | [diff] [blame] | 7062 | {0x17, 0x90170110}), |
| 7063 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7064 | ALC298_STANDARD_PINS, |
Woodrow Shen | 703867e | 2015-08-05 12:34:12 +0800 | [diff] [blame] | 7065 | {0x17, 0x90170140}), |
| 7066 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7067 | ALC298_STANDARD_PINS, |
Takashi Iwai | 9f502ff | 2015-08-05 12:09:45 +0200 | [diff] [blame] | 7068 | {0x17, 0x90170150}), |
Kai-Heng Feng | 9f1bc2c4 | 2017-02-16 15:26:54 +0800 | [diff] [blame] | 7069 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME, |
| 7070 | {0x12, 0xb7a60140}, |
| 7071 | {0x13, 0xb7a60150}, |
| 7072 | {0x17, 0x90170110}, |
| 7073 | {0x1a, 0x03011020}, |
| 7074 | {0x21, 0x03211030}), |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 7075 | SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
| 7076 | ALC225_STANDARD_PINS, |
| 7077 | {0x12, 0xb7a60130}, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 7078 | {0x17, 0x90170110}), |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 7079 | {} |
| 7080 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7081 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 7082 | static void alc269_fill_coef(struct hda_codec *codec) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7083 | { |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 7084 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7085 | int val; |
| 7086 | |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 7087 | if (spec->codec_variant != ALC269_TYPE_ALC269VB) |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 7088 | return; |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 7089 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7090 | if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7091 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 7092 | alc_write_coef_idx(codec, 0xe, 0x8817); |
| 7093 | } |
| 7094 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7095 | if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7096 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 7097 | alc_write_coef_idx(codec, 0xe, 0x8814); |
| 7098 | } |
| 7099 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7100 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7101 | /* Power up output pin */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 7102 | alc_update_coef_idx(codec, 0x04, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7103 | } |
| 7104 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7105 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7106 | val = alc_read_coef_idx(codec, 0xd); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 7107 | if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7108 | /* Capless ramp up clock control */ |
| 7109 | alc_write_coef_idx(codec, 0xd, val | (1<<10)); |
| 7110 | } |
| 7111 | val = alc_read_coef_idx(codec, 0x17); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 7112 | if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7113 | /* Class D power on reset */ |
| 7114 | alc_write_coef_idx(codec, 0x17, val | (1<<7)); |
| 7115 | } |
| 7116 | } |
| 7117 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 7118 | /* HP */ |
| 7119 | alc_update_coef_idx(codec, 0x4, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7120 | } |
| 7121 | |
| 7122 | /* |
| 7123 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7124 | static int patch_alc269(struct hda_codec *codec) |
| 7125 | { |
| 7126 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7127 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7128 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7129 | err = alc_alloc_spec(codec, 0x0b); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7130 | if (err < 0) |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7131 | return err; |
| 7132 | |
| 7133 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 7134 | spec->gen.shared_mic_vref_pin = 0x18; |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 7135 | codec->power_save_node = 1; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7136 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 7137 | #ifdef CONFIG_PM |
| 7138 | codec->patch_ops.suspend = alc269_suspend; |
| 7139 | codec->patch_ops.resume = alc269_resume; |
| 7140 | #endif |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 7141 | spec->shutup = alc_default_shutup; |
| 7142 | spec->init_hook = alc_default_init; |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 7143 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7144 | snd_hda_pick_fixup(codec, alc269_fixup_models, |
Herton Ronaldo Krzesinski | 9f720bb9 | 2012-09-27 10:38:14 -0300 | [diff] [blame] | 7145 | alc269_fixup_tbl, alc269_fixups); |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 7146 | snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups); |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 7147 | snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, |
| 7148 | alc269_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7149 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Herton Ronaldo Krzesinski | 9f720bb9 | 2012-09-27 10:38:14 -0300 | [diff] [blame] | 7150 | |
| 7151 | alc_auto_parse_customize_define(codec); |
| 7152 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 7153 | if (has_cdefine_beep(codec)) |
| 7154 | spec->gen.beep_nid = 0x01; |
| 7155 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 7156 | switch (codec->core.vendor_id) { |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 7157 | case 0x10ec0269: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7158 | spec->codec_variant = ALC269_TYPE_ALC269VA; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7159 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 7160 | case 0x0010: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 7161 | if (codec->bus->pci && |
| 7162 | codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7163 | spec->cdefine.platform_type == 1) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 7164 | err = alc_codec_rename(codec, "ALC271X"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7165 | spec->codec_variant = ALC269_TYPE_ALC269VB; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7166 | break; |
| 7167 | case 0x0020: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 7168 | if (codec->bus->pci && |
| 7169 | codec->bus->pci->subsystem_vendor == 0x17aa && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7170 | codec->bus->pci->subsystem_device == 0x21f3) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 7171 | err = alc_codec_rename(codec, "ALC3202"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7172 | spec->codec_variant = ALC269_TYPE_ALC269VC; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7173 | break; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 7174 | case 0x0030: |
| 7175 | spec->codec_variant = ALC269_TYPE_ALC269VD; |
| 7176 | break; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7177 | default: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7178 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7179 | } |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7180 | if (err < 0) |
| 7181 | goto error; |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 7182 | spec->shutup = alc269_shutup; |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 7183 | spec->init_hook = alc269_fill_coef; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7184 | alc269_fill_coef(codec); |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 7185 | break; |
| 7186 | |
| 7187 | case 0x10ec0280: |
| 7188 | case 0x10ec0290: |
| 7189 | spec->codec_variant = ALC269_TYPE_ALC280; |
| 7190 | break; |
| 7191 | case 0x10ec0282: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 7192 | spec->codec_variant = ALC269_TYPE_ALC282; |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 7193 | spec->shutup = alc282_shutup; |
| 7194 | spec->init_hook = alc282_init; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 7195 | break; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 7196 | case 0x10ec0233: |
| 7197 | case 0x10ec0283: |
| 7198 | spec->codec_variant = ALC269_TYPE_ALC283; |
| 7199 | spec->shutup = alc283_shutup; |
| 7200 | spec->init_hook = alc283_init; |
| 7201 | break; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 7202 | case 0x10ec0284: |
| 7203 | case 0x10ec0292: |
| 7204 | spec->codec_variant = ALC269_TYPE_ALC284; |
| 7205 | break; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 7206 | case 0x10ec0293: |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 7207 | spec->codec_variant = ALC269_TYPE_ALC293; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 7208 | break; |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 7209 | case 0x10ec0286: |
Kailang Yang | 7c66593 | 2014-04-14 15:09:44 +0800 | [diff] [blame] | 7210 | case 0x10ec0288: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 7211 | spec->codec_variant = ALC269_TYPE_ALC286; |
Kailang Yang | f7ae9ba | 2014-06-30 16:10:37 +0800 | [diff] [blame] | 7212 | spec->shutup = alc286_shutup; |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 7213 | break; |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 7214 | case 0x10ec0298: |
| 7215 | spec->codec_variant = ALC269_TYPE_ALC298; |
| 7216 | break; |
Kailang Yang | ea04a1d | 2018-04-25 15:31:52 +0800 | [diff] [blame] | 7217 | case 0x10ec0235: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 7218 | case 0x10ec0255: |
| 7219 | spec->codec_variant = ALC269_TYPE_ALC255; |
Kailang Yang | ab3b8e5 | 2018-04-25 16:05:27 +0800 | [diff] [blame] | 7220 | spec->shutup = alc256_shutup; |
| 7221 | spec->init_hook = alc256_init; |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 7222 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 7223 | case 0x10ec0236: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 7224 | case 0x10ec0256: |
| 7225 | spec->codec_variant = ALC269_TYPE_ALC256; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 7226 | spec->shutup = alc256_shutup; |
| 7227 | spec->init_hook = alc256_init; |
David Henningsson | 7d1b6e2 | 2015-04-21 10:48:46 +0200 | [diff] [blame] | 7228 | spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */ |
Kailang Yang | d32b666 | 2015-04-23 15:10:53 +0800 | [diff] [blame] | 7229 | alc_update_coef_idx(codec, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/ |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 7230 | break; |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 7231 | case 0x10ec0257: |
| 7232 | spec->codec_variant = ALC269_TYPE_ALC257; |
Kailang Yang | 88d42b2 | 2018-03-14 16:08:57 +0800 | [diff] [blame] | 7233 | spec->shutup = alc256_shutup; |
| 7234 | spec->init_hook = alc256_init; |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 7235 | spec->gen.mixer_nid = 0; |
| 7236 | break; |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 7237 | case 0x10ec0215: |
| 7238 | case 0x10ec0285: |
| 7239 | case 0x10ec0289: |
| 7240 | spec->codec_variant = ALC269_TYPE_ALC215; |
Kailang Yang | 1b6832be | 2018-01-17 15:32:03 +0800 | [diff] [blame] | 7241 | spec->shutup = alc225_shutup; |
| 7242 | spec->init_hook = alc225_init; |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 7243 | spec->gen.mixer_nid = 0; |
| 7244 | break; |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 7245 | case 0x10ec0225: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 7246 | case 0x10ec0295: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 7247 | case 0x10ec0299: |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 7248 | spec->codec_variant = ALC269_TYPE_ALC225; |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 7249 | spec->shutup = alc225_shutup; |
| 7250 | spec->init_hook = alc225_init; |
Takashi Iwai | c1350bf | 2017-12-27 09:03:45 +0100 | [diff] [blame] | 7251 | spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */ |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 7252 | break; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 7253 | case 0x10ec0234: |
| 7254 | case 0x10ec0274: |
| 7255 | case 0x10ec0294: |
| 7256 | spec->codec_variant = ALC269_TYPE_ALC294; |
Hui Wang | 532a778 | 2017-06-26 12:30:32 +0800 | [diff] [blame] | 7257 | spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */ |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 7258 | alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */ |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 7259 | break; |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 7260 | case 0x10ec0700: |
| 7261 | case 0x10ec0701: |
| 7262 | case 0x10ec0703: |
| 7263 | spec->codec_variant = ALC269_TYPE_ALC700; |
| 7264 | spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */ |
Kailang Yang | 2d7fe61 | 2017-11-22 15:21:32 +0800 | [diff] [blame] | 7265 | alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */ |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 7266 | break; |
| 7267 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7268 | } |
| 7269 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 7270 | 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] | 7271 | spec->has_alc5505_dsp = 1; |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 7272 | spec->init_hook = alc5505_dsp_init; |
| 7273 | } |
| 7274 | |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7275 | /* automatic parse from the BIOS config */ |
| 7276 | err = alc269_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7277 | if (err < 0) |
| 7278 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7279 | |
David Henningsson | 7d1b6e2 | 2015-04-21 10:48:46 +0200 | [diff] [blame] | 7280 | if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) |
| 7281 | set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7282 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7283 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 7284 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7285 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7286 | |
| 7287 | error: |
| 7288 | alc_free(codec); |
| 7289 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7290 | } |
| 7291 | |
| 7292 | /* |
| 7293 | * ALC861 |
| 7294 | */ |
| 7295 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7296 | static int alc861_parse_auto_config(struct hda_codec *codec) |
| 7297 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7298 | static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 7299 | static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; |
| 7300 | return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7301 | } |
| 7302 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7303 | /* Pin config fixes */ |
| 7304 | enum { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7305 | ALC861_FIXUP_FSC_AMILO_PI1505, |
| 7306 | ALC861_FIXUP_AMP_VREF_0F, |
| 7307 | ALC861_FIXUP_NO_JACK_DETECT, |
| 7308 | ALC861_FIXUP_ASUS_A6RP, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 7309 | ALC660_FIXUP_ASUS_W7J, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7310 | }; |
| 7311 | |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7312 | /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ |
| 7313 | static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7314 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7315 | { |
| 7316 | struct alc_spec *spec = codec->spec; |
| 7317 | unsigned int val; |
| 7318 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7319 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7320 | return; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 7321 | val = snd_hda_codec_get_pin_target(codec, 0x0f); |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7322 | if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) |
| 7323 | val |= AC_PINCTL_IN_EN; |
| 7324 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 7325 | snd_hda_set_pin_ctl(codec, 0x0f, val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 7326 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7327 | } |
| 7328 | |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7329 | /* suppress the jack-detection */ |
| 7330 | static void alc_fixup_no_jack_detect(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7331 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7332 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7333 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7334 | codec->no_jack_detect = 1; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 7335 | } |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7336 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7337 | static const struct hda_fixup alc861_fixups[] = { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7338 | [ALC861_FIXUP_FSC_AMILO_PI1505] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7339 | .type = HDA_FIXUP_PINS, |
| 7340 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7341 | { 0x0b, 0x0221101f }, /* HP */ |
| 7342 | { 0x0f, 0x90170310 }, /* speaker */ |
| 7343 | { } |
| 7344 | } |
| 7345 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7346 | [ALC861_FIXUP_AMP_VREF_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7347 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7348 | .v.func = alc861_fixup_asus_amp_vref_0f, |
Takashi Iwai | 3b25eb6 | 2012-01-25 09:55:46 +0100 | [diff] [blame] | 7349 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7350 | [ALC861_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7351 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7352 | .v.func = alc_fixup_no_jack_detect, |
| 7353 | }, |
| 7354 | [ALC861_FIXUP_ASUS_A6RP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7355 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7356 | .v.func = alc861_fixup_asus_amp_vref_0f, |
| 7357 | .chained = true, |
| 7358 | .chain_id = ALC861_FIXUP_NO_JACK_DETECT, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 7359 | }, |
| 7360 | [ALC660_FIXUP_ASUS_W7J] = { |
| 7361 | .type = HDA_FIXUP_VERBS, |
| 7362 | .v.verbs = (const struct hda_verb[]) { |
| 7363 | /* ASUS W7J needs a magic pin setup on unused NID 0x10 |
| 7364 | * for enabling outputs |
| 7365 | */ |
| 7366 | {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, |
| 7367 | { } |
| 7368 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7369 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7370 | }; |
| 7371 | |
| 7372 | static const struct snd_pci_quirk alc861_fixup_tbl[] = { |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 7373 | SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e7ca237 | 2013-12-02 15:27:19 +0100 | [diff] [blame] | 7374 | SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7375 | SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), |
| 7376 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), |
| 7377 | SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), |
| 7378 | SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F), |
| 7379 | SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F), |
| 7380 | 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] | 7381 | {} |
| 7382 | }; |
| 7383 | |
| 7384 | /* |
| 7385 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7386 | static int patch_alc861(struct hda_codec *codec) |
| 7387 | { |
| 7388 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7389 | int err; |
| 7390 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7391 | err = alc_alloc_spec(codec, 0x15); |
| 7392 | if (err < 0) |
| 7393 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7394 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7395 | spec = codec->spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 7396 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7397 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 7398 | #ifdef CONFIG_PM |
| 7399 | spec->power_hook = alc_power_eapd; |
| 7400 | #endif |
| 7401 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7402 | snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); |
| 7403 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7404 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 7405 | /* automatic parse from the BIOS config */ |
| 7406 | err = alc861_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7407 | if (err < 0) |
| 7408 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7409 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 7410 | if (!spec->gen.no_analog) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 7411 | set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7412 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7413 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 7414 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7415 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7416 | |
| 7417 | error: |
| 7418 | alc_free(codec); |
| 7419 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7420 | } |
| 7421 | |
| 7422 | /* |
| 7423 | * ALC861-VD support |
| 7424 | * |
| 7425 | * Based on ALC882 |
| 7426 | * |
| 7427 | * In addition, an independent DAC |
| 7428 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7429 | static int alc861vd_parse_auto_config(struct hda_codec *codec) |
| 7430 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7431 | static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 7432 | static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 7433 | return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7434 | } |
| 7435 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7436 | enum { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7437 | ALC660VD_FIX_ASUS_GPIO1, |
| 7438 | ALC861VD_FIX_DALLAS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7439 | }; |
| 7440 | |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7441 | /* exclude VREF80 */ |
| 7442 | static void alc861vd_fixup_dallas(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7443 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7444 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7445 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | b78562b | 2012-12-17 20:06:49 +0100 | [diff] [blame] | 7446 | snd_hda_override_pin_caps(codec, 0x18, 0x00000734); |
| 7447 | snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7448 | } |
| 7449 | } |
| 7450 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7451 | static const struct hda_fixup alc861vd_fixups[] = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7452 | [ALC660VD_FIX_ASUS_GPIO1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7453 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7454 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7455 | /* reset GPIO1 */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7456 | {0x01, AC_VERB_SET_GPIO_MASK, 0x03}, |
| 7457 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01}, |
| 7458 | {0x01, AC_VERB_SET_GPIO_DATA, 0x01}, |
| 7459 | { } |
| 7460 | } |
| 7461 | }, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7462 | [ALC861VD_FIX_DALLAS] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7463 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7464 | .v.func = alc861vd_fixup_dallas, |
| 7465 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7466 | }; |
| 7467 | |
| 7468 | static const struct snd_pci_quirk alc861vd_fixup_tbl[] = { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7469 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7470 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7471 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7472 | {} |
| 7473 | }; |
| 7474 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7475 | /* |
| 7476 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7477 | static int patch_alc861vd(struct hda_codec *codec) |
| 7478 | { |
| 7479 | struct alc_spec *spec; |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 7480 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7481 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7482 | err = alc_alloc_spec(codec, 0x0b); |
| 7483 | if (err < 0) |
| 7484 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7485 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7486 | spec = codec->spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 7487 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7488 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 7489 | spec->shutup = alc_eapd_shutup; |
| 7490 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7491 | snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); |
| 7492 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7493 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 7494 | /* automatic parse from the BIOS config */ |
| 7495 | err = alc861vd_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7496 | if (err < 0) |
| 7497 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7498 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 7499 | if (!spec->gen.no_analog) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 7500 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7501 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7502 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 7503 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7504 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7505 | |
| 7506 | error: |
| 7507 | alc_free(codec); |
| 7508 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7509 | } |
| 7510 | |
| 7511 | /* |
| 7512 | * ALC662 support |
| 7513 | * |
| 7514 | * ALC662 is almost identical with ALC880 but has cleaner and more flexible |
| 7515 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 7516 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 7517 | * 6-channel independent captures. |
| 7518 | * |
| 7519 | * In addition, an independent DAC for the multi-playback (not used in this |
| 7520 | * driver yet). |
| 7521 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7522 | |
| 7523 | /* |
| 7524 | * BIOS auto configuration |
| 7525 | */ |
| 7526 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 7527 | static int alc662_parse_auto_config(struct hda_codec *codec) |
| 7528 | { |
Takashi Iwai | 4c6d72d | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 7529 | static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 7530 | static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; |
| 7531 | static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 7532 | const hda_nid_t *ssids; |
Takashi Iwai | ee979a14 | 2008-09-02 15:42:20 +0200 | [diff] [blame] | 7533 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 7534 | if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || |
| 7535 | codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || |
| 7536 | codec->core.vendor_id == 0x10ec0671) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 7537 | ssids = alc663_ssids; |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 7538 | else |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 7539 | ssids = alc662_ssids; |
| 7540 | return alc_parse_auto_config(codec, alc662_ignore, ssids); |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 7541 | } |
| 7542 | |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 7543 | static void alc272_fixup_mario(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7544 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 7545 | { |
Takashi Iwai | 9bb1f06 | 2013-01-10 17:14:29 +0100 | [diff] [blame] | 7546 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 7547 | return; |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 7548 | if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, |
| 7549 | (0x3b << AC_AMPCAP_OFFSET_SHIFT) | |
| 7550 | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 7551 | (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 7552 | (0 << AC_AMPCAP_MUTE_SHIFT))) |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 7553 | codec_warn(codec, "failed to override amp caps for NID 0x2\n"); |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 7554 | } |
| 7555 | |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 7556 | static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { |
| 7557 | { .channels = 2, |
| 7558 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, |
| 7559 | { .channels = 4, |
| 7560 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, |
| 7561 | SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ |
| 7562 | { } |
| 7563 | }; |
| 7564 | |
| 7565 | /* override the 2.1 chmap */ |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 7566 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 7567 | const struct hda_fixup *fix, int action) |
| 7568 | { |
| 7569 | if (action == HDA_FIXUP_ACT_BUILD) { |
| 7570 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | bbbc7e8 | 2015-02-27 17:43:19 +0100 | [diff] [blame] | 7571 | spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps; |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 7572 | } |
| 7573 | } |
| 7574 | |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 7575 | /* avoid D3 for keeping GPIO up */ |
| 7576 | static unsigned int gpio_led_power_filter(struct hda_codec *codec, |
| 7577 | hda_nid_t nid, |
| 7578 | unsigned int power_state) |
| 7579 | { |
| 7580 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 7581 | if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_led) |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 7582 | return AC_PWRST_D0; |
| 7583 | return power_state; |
| 7584 | } |
| 7585 | |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 7586 | static void alc662_fixup_led_gpio1(struct hda_codec *codec, |
| 7587 | const struct hda_fixup *fix, int action) |
| 7588 | { |
| 7589 | struct alc_spec *spec = codec->spec; |
| 7590 | static const struct hda_verb gpio_init[] = { |
| 7591 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x01 }, |
| 7592 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01 }, |
| 7593 | {} |
| 7594 | }; |
| 7595 | |
| 7596 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 7597 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 7598 | spec->gpio_led = 0; |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 7599 | spec->mute_led_polarity = 1; |
| 7600 | spec->gpio_mute_led_mask = 0x01; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 7601 | snd_hda_add_verbs(codec, gpio_init); |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 7602 | codec->power_filter = gpio_led_power_filter; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 7603 | } |
| 7604 | } |
| 7605 | |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 7606 | static void alc662_usi_automute_hook(struct hda_codec *codec, |
| 7607 | struct hda_jack_callback *jack) |
| 7608 | { |
| 7609 | struct alc_spec *spec = codec->spec; |
| 7610 | int vref; |
| 7611 | msleep(200); |
| 7612 | snd_hda_gen_hp_automute(codec, jack); |
| 7613 | |
| 7614 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 7615 | msleep(100); |
| 7616 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 7617 | vref); |
| 7618 | } |
| 7619 | |
| 7620 | static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, |
| 7621 | const struct hda_fixup *fix, int action) |
| 7622 | { |
| 7623 | struct alc_spec *spec = codec->spec; |
| 7624 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 7625 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 7626 | spec->gen.hp_automute_hook = alc662_usi_automute_hook; |
| 7627 | } |
| 7628 | } |
| 7629 | |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 7630 | static struct coef_fw alc668_coefs[] = { |
| 7631 | WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), |
| 7632 | WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), |
| 7633 | WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), |
| 7634 | WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), |
| 7635 | WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), |
| 7636 | WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), |
| 7637 | WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), |
| 7638 | WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), |
| 7639 | WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), |
| 7640 | WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), |
| 7641 | WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), |
| 7642 | WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), |
| 7643 | WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), |
| 7644 | WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), |
| 7645 | WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), |
| 7646 | WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), |
| 7647 | WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), |
| 7648 | WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), |
| 7649 | WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), |
| 7650 | WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), |
| 7651 | {} |
| 7652 | }; |
| 7653 | |
| 7654 | static void alc668_restore_default_value(struct hda_codec *codec) |
| 7655 | { |
| 7656 | alc_process_coef_fw(codec, alc668_coefs); |
| 7657 | } |
| 7658 | |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 7659 | enum { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 7660 | ALC662_FIXUP_ASPIRE, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 7661 | ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 7662 | ALC662_FIXUP_IDEAPAD, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 7663 | ALC272_FIXUP_MARIO, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 7664 | ALC662_FIXUP_CZC_P10T, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 7665 | ALC662_FIXUP_SKU_IGNORE, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 7666 | ALC662_FIXUP_HP_RP5800, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 7667 | ALC662_FIXUP_ASUS_MODE1, |
| 7668 | ALC662_FIXUP_ASUS_MODE2, |
| 7669 | ALC662_FIXUP_ASUS_MODE3, |
| 7670 | ALC662_FIXUP_ASUS_MODE4, |
| 7671 | ALC662_FIXUP_ASUS_MODE5, |
| 7672 | ALC662_FIXUP_ASUS_MODE6, |
| 7673 | ALC662_FIXUP_ASUS_MODE7, |
| 7674 | ALC662_FIXUP_ASUS_MODE8, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 7675 | ALC662_FIXUP_NO_JACK_DETECT, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 7676 | ALC662_FIXUP_ZOTAC_Z68, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 7677 | ALC662_FIXUP_INV_DMIC, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 7678 | ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 7679 | ALC668_FIXUP_DELL_MIC_NO_PRESENCE, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 7680 | ALC662_FIXUP_HEADSET_MODE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 7681 | ALC668_FIXUP_HEADSET_MODE, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 7682 | ALC662_FIXUP_BASS_MODE4_CHMAP, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 7683 | ALC662_FIXUP_BASS_16, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 7684 | ALC662_FIXUP_BASS_1A, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 7685 | ALC662_FIXUP_BASS_CHMAP, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 7686 | ALC668_FIXUP_AUTO_MUTE, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 7687 | ALC668_FIXUP_DELL_DISABLE_AAMIX, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 7688 | ALC668_FIXUP_DELL_XPS13, |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 7689 | ALC662_FIXUP_ASUS_Nx50, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 7690 | ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 7691 | ALC668_FIXUP_ASUS_Nx51, |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 7692 | ALC891_FIXUP_HEADSET_MODE, |
| 7693 | ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 7694 | ALC662_FIXUP_ACER_VERITON, |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 7695 | ALC892_FIXUP_ASROCK_MOBO, |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 7696 | ALC662_FIXUP_USI_FUNC, |
| 7697 | ALC662_FIXUP_USI_HEADSET_MODE, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 7698 | ALC662_FIXUP_LENOVO_MULTI_CODECS, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 7699 | }; |
| 7700 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7701 | static const struct hda_fixup alc662_fixups[] = { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 7702 | [ALC662_FIXUP_ASPIRE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7703 | .type = HDA_FIXUP_PINS, |
| 7704 | .v.pins = (const struct hda_pintbl[]) { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 7705 | { 0x15, 0x99130112 }, /* subwoofer */ |
| 7706 | { } |
| 7707 | } |
| 7708 | }, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 7709 | [ALC662_FIXUP_LED_GPIO1] = { |
| 7710 | .type = HDA_FIXUP_FUNC, |
| 7711 | .v.func = alc662_fixup_led_gpio1, |
| 7712 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 7713 | [ALC662_FIXUP_IDEAPAD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7714 | .type = HDA_FIXUP_PINS, |
| 7715 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 7716 | { 0x17, 0x99130112 }, /* subwoofer */ |
| 7717 | { } |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 7718 | }, |
| 7719 | .chained = true, |
| 7720 | .chain_id = ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 7721 | }, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 7722 | [ALC272_FIXUP_MARIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7723 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | b5bfbc6 | 2011-01-13 14:22:32 +0100 | [diff] [blame] | 7724 | .v.func = alc272_fixup_mario, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 7725 | }, |
| 7726 | [ALC662_FIXUP_CZC_P10T] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7727 | .type = HDA_FIXUP_VERBS, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 7728 | .v.verbs = (const struct hda_verb[]) { |
| 7729 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 7730 | {} |
| 7731 | } |
| 7732 | }, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 7733 | [ALC662_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7734 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 7735 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | c6b3587 | 2011-03-28 12:05:31 +0200 | [diff] [blame] | 7736 | }, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 7737 | [ALC662_FIXUP_HP_RP5800] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7738 | .type = HDA_FIXUP_PINS, |
| 7739 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 7740 | { 0x14, 0x0221201f }, /* HP out */ |
| 7741 | { } |
| 7742 | }, |
| 7743 | .chained = true, |
| 7744 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 7745 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 7746 | [ALC662_FIXUP_ASUS_MODE1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7747 | .type = HDA_FIXUP_PINS, |
| 7748 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 7749 | { 0x14, 0x99130110 }, /* speaker */ |
| 7750 | { 0x18, 0x01a19c20 }, /* mic */ |
| 7751 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 7752 | { 0x21, 0x0121401f }, /* HP out */ |
| 7753 | { } |
| 7754 | }, |
| 7755 | .chained = true, |
| 7756 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 7757 | }, |
| 7758 | [ALC662_FIXUP_ASUS_MODE2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7759 | .type = HDA_FIXUP_PINS, |
| 7760 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 7761 | { 0x14, 0x99130110 }, /* speaker */ |
| 7762 | { 0x18, 0x01a19820 }, /* mic */ |
| 7763 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 7764 | { 0x1b, 0x0121401f }, /* HP out */ |
| 7765 | { } |
| 7766 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 7767 | .chained = true, |
| 7768 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 7769 | }, |
| 7770 | [ALC662_FIXUP_ASUS_MODE3] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7771 | .type = HDA_FIXUP_PINS, |
| 7772 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 7773 | { 0x14, 0x99130110 }, /* speaker */ |
| 7774 | { 0x15, 0x0121441f }, /* HP */ |
| 7775 | { 0x18, 0x01a19840 }, /* mic */ |
| 7776 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 7777 | { 0x21, 0x01211420 }, /* HP2 */ |
| 7778 | { } |
| 7779 | }, |
| 7780 | .chained = true, |
| 7781 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 7782 | }, |
| 7783 | [ALC662_FIXUP_ASUS_MODE4] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7784 | .type = HDA_FIXUP_PINS, |
| 7785 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 7786 | { 0x14, 0x99130110 }, /* speaker */ |
| 7787 | { 0x16, 0x99130111 }, /* speaker */ |
| 7788 | { 0x18, 0x01a19840 }, /* mic */ |
| 7789 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 7790 | { 0x21, 0x0121441f }, /* HP */ |
| 7791 | { } |
| 7792 | }, |
| 7793 | .chained = true, |
| 7794 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 7795 | }, |
| 7796 | [ALC662_FIXUP_ASUS_MODE5] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7797 | .type = HDA_FIXUP_PINS, |
| 7798 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 7799 | { 0x14, 0x99130110 }, /* speaker */ |
| 7800 | { 0x15, 0x0121441f }, /* HP */ |
| 7801 | { 0x16, 0x99130111 }, /* speaker */ |
| 7802 | { 0x18, 0x01a19840 }, /* mic */ |
| 7803 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 7804 | { } |
| 7805 | }, |
| 7806 | .chained = true, |
| 7807 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 7808 | }, |
| 7809 | [ALC662_FIXUP_ASUS_MODE6] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7810 | .type = HDA_FIXUP_PINS, |
| 7811 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 7812 | { 0x14, 0x99130110 }, /* speaker */ |
| 7813 | { 0x15, 0x01211420 }, /* HP2 */ |
| 7814 | { 0x18, 0x01a19840 }, /* mic */ |
| 7815 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 7816 | { 0x1b, 0x0121441f }, /* HP */ |
| 7817 | { } |
| 7818 | }, |
| 7819 | .chained = true, |
| 7820 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 7821 | }, |
| 7822 | [ALC662_FIXUP_ASUS_MODE7] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7823 | .type = HDA_FIXUP_PINS, |
| 7824 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 7825 | { 0x14, 0x99130110 }, /* speaker */ |
| 7826 | { 0x17, 0x99130111 }, /* speaker */ |
| 7827 | { 0x18, 0x01a19840 }, /* mic */ |
| 7828 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 7829 | { 0x1b, 0x01214020 }, /* HP */ |
| 7830 | { 0x21, 0x0121401f }, /* HP */ |
| 7831 | { } |
| 7832 | }, |
| 7833 | .chained = true, |
| 7834 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 7835 | }, |
| 7836 | [ALC662_FIXUP_ASUS_MODE8] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7837 | .type = HDA_FIXUP_PINS, |
| 7838 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 7839 | { 0x14, 0x99130110 }, /* speaker */ |
| 7840 | { 0x12, 0x99a30970 }, /* int-mic */ |
| 7841 | { 0x15, 0x01214020 }, /* HP */ |
| 7842 | { 0x17, 0x99130111 }, /* speaker */ |
| 7843 | { 0x18, 0x01a19840 }, /* mic */ |
| 7844 | { 0x21, 0x0121401f }, /* HP */ |
| 7845 | { } |
| 7846 | }, |
| 7847 | .chained = true, |
| 7848 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 7849 | }, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 7850 | [ALC662_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7851 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 7852 | .v.func = alc_fixup_no_jack_detect, |
| 7853 | }, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 7854 | [ALC662_FIXUP_ZOTAC_Z68] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7855 | .type = HDA_FIXUP_PINS, |
| 7856 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 7857 | { 0x1b, 0x02214020 }, /* Front HP */ |
| 7858 | { } |
| 7859 | } |
| 7860 | }, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 7861 | [ALC662_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7862 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 7863 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 7864 | }, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 7865 | [ALC668_FIXUP_DELL_XPS13] = { |
| 7866 | .type = HDA_FIXUP_FUNC, |
| 7867 | .v.func = alc_fixup_dell_xps13, |
| 7868 | .chained = true, |
| 7869 | .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX |
| 7870 | }, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 7871 | [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { |
| 7872 | .type = HDA_FIXUP_FUNC, |
| 7873 | .v.func = alc_fixup_disable_aamix, |
| 7874 | .chained = true, |
| 7875 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 7876 | }, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 7877 | [ALC668_FIXUP_AUTO_MUTE] = { |
| 7878 | .type = HDA_FIXUP_FUNC, |
| 7879 | .v.func = alc_fixup_auto_mute_via_amp, |
| 7880 | .chained = true, |
| 7881 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 7882 | }, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 7883 | [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 7884 | .type = HDA_FIXUP_PINS, |
| 7885 | .v.pins = (const struct hda_pintbl[]) { |
| 7886 | { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 7887 | /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */ |
| 7888 | { } |
| 7889 | }, |
| 7890 | .chained = true, |
| 7891 | .chain_id = ALC662_FIXUP_HEADSET_MODE |
| 7892 | }, |
| 7893 | [ALC662_FIXUP_HEADSET_MODE] = { |
| 7894 | .type = HDA_FIXUP_FUNC, |
| 7895 | .v.func = alc_fixup_headset_mode_alc662, |
| 7896 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 7897 | [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 7898 | .type = HDA_FIXUP_PINS, |
| 7899 | .v.pins = (const struct hda_pintbl[]) { |
| 7900 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 7901 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 7902 | { } |
| 7903 | }, |
| 7904 | .chained = true, |
| 7905 | .chain_id = ALC668_FIXUP_HEADSET_MODE |
| 7906 | }, |
| 7907 | [ALC668_FIXUP_HEADSET_MODE] = { |
| 7908 | .type = HDA_FIXUP_FUNC, |
| 7909 | .v.func = alc_fixup_headset_mode_alc668, |
| 7910 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 7911 | [ALC662_FIXUP_BASS_MODE4_CHMAP] = { |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 7912 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 7913 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 7914 | .chained = true, |
| 7915 | .chain_id = ALC662_FIXUP_ASUS_MODE4 |
| 7916 | }, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 7917 | [ALC662_FIXUP_BASS_16] = { |
| 7918 | .type = HDA_FIXUP_PINS, |
| 7919 | .v.pins = (const struct hda_pintbl[]) { |
| 7920 | {0x16, 0x80106111}, /* bass speaker */ |
| 7921 | {} |
| 7922 | }, |
| 7923 | .chained = true, |
| 7924 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
| 7925 | }, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 7926 | [ALC662_FIXUP_BASS_1A] = { |
| 7927 | .type = HDA_FIXUP_PINS, |
| 7928 | .v.pins = (const struct hda_pintbl[]) { |
| 7929 | {0x1a, 0x80106111}, /* bass speaker */ |
| 7930 | {} |
| 7931 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 7932 | .chained = true, |
| 7933 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 7934 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 7935 | [ALC662_FIXUP_BASS_CHMAP] = { |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 7936 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 7937 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 7938 | }, |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 7939 | [ALC662_FIXUP_ASUS_Nx50] = { |
| 7940 | .type = HDA_FIXUP_FUNC, |
| 7941 | .v.func = alc_fixup_auto_mute_via_amp, |
| 7942 | .chained = true, |
| 7943 | .chain_id = ALC662_FIXUP_BASS_1A |
| 7944 | }, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 7945 | [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = { |
| 7946 | .type = HDA_FIXUP_FUNC, |
| 7947 | .v.func = alc_fixup_headset_mode_alc668, |
| 7948 | .chain_id = ALC662_FIXUP_BASS_CHMAP |
| 7949 | }, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 7950 | [ALC668_FIXUP_ASUS_Nx51] = { |
| 7951 | .type = HDA_FIXUP_PINS, |
| 7952 | .v.pins = (const struct hda_pintbl[]) { |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 7953 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 7954 | { 0x1a, 0x90170151 }, /* bass speaker */ |
| 7955 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 7956 | {} |
| 7957 | }, |
| 7958 | .chained = true, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 7959 | .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 7960 | }, |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 7961 | [ALC891_FIXUP_HEADSET_MODE] = { |
| 7962 | .type = HDA_FIXUP_FUNC, |
| 7963 | .v.func = alc_fixup_headset_mode, |
| 7964 | }, |
| 7965 | [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 7966 | .type = HDA_FIXUP_PINS, |
| 7967 | .v.pins = (const struct hda_pintbl[]) { |
| 7968 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 7969 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 7970 | { } |
| 7971 | }, |
| 7972 | .chained = true, |
| 7973 | .chain_id = ALC891_FIXUP_HEADSET_MODE |
| 7974 | }, |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 7975 | [ALC662_FIXUP_ACER_VERITON] = { |
| 7976 | .type = HDA_FIXUP_PINS, |
| 7977 | .v.pins = (const struct hda_pintbl[]) { |
| 7978 | { 0x15, 0x50170120 }, /* no internal speaker */ |
| 7979 | { } |
| 7980 | } |
| 7981 | }, |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 7982 | [ALC892_FIXUP_ASROCK_MOBO] = { |
| 7983 | .type = HDA_FIXUP_PINS, |
| 7984 | .v.pins = (const struct hda_pintbl[]) { |
| 7985 | { 0x15, 0x40f000f0 }, /* disabled */ |
| 7986 | { 0x16, 0x40f000f0 }, /* disabled */ |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 7987 | { } |
| 7988 | } |
| 7989 | }, |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 7990 | [ALC662_FIXUP_USI_FUNC] = { |
| 7991 | .type = HDA_FIXUP_FUNC, |
| 7992 | .v.func = alc662_fixup_usi_headset_mic, |
| 7993 | }, |
| 7994 | [ALC662_FIXUP_USI_HEADSET_MODE] = { |
| 7995 | .type = HDA_FIXUP_PINS, |
| 7996 | .v.pins = (const struct hda_pintbl[]) { |
| 7997 | { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */ |
| 7998 | { 0x18, 0x01a1903d }, |
| 7999 | { } |
| 8000 | }, |
| 8001 | .chained = true, |
| 8002 | .chain_id = ALC662_FIXUP_USI_FUNC |
| 8003 | }, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 8004 | [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { |
| 8005 | .type = HDA_FIXUP_FUNC, |
| 8006 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, |
| 8007 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8008 | }; |
| 8009 | |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 8010 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8011 | SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), |
Takashi Iwai | d3d3835 | 2013-08-19 20:05:50 +0200 | [diff] [blame] | 8012 | SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), |
David Henningsson | 02f6ff9 | 2015-12-07 11:29:31 +0100 | [diff] [blame] | 8013 | SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), |
David Henningsson | a6c47a8 | 2011-02-10 15:39:19 +0100 | [diff] [blame] | 8014 | SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 8015 | SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 8016 | SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), |
Takashi Iwai | 1801928 | 2013-08-16 08:17:05 +0200 | [diff] [blame] | 8017 | SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 8018 | SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 8019 | SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 8020 | SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | c5d019c | 2014-07-22 17:33:32 +0200 | [diff] [blame] | 8021 | SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 8022 | SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), |
Niranjan Sivakumar | 467e143 | 2015-09-05 18:20:35 +0200 | [diff] [blame] | 8023 | SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13), |
David Henningsson | 09d2014 | 2013-11-20 11:43:30 +0100 | [diff] [blame] | 8024 | SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
David Henningsson | ad8ff99e | 2013-11-07 09:28:59 +0100 | [diff] [blame] | 8025 | SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 8dc9abb | 2014-04-16 15:53:12 +0800 | [diff] [blame] | 8026 | SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 8027 | SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 6a98e34 | 2014-10-27 16:20:30 +0800 | [diff] [blame] | 8028 | SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 8029 | SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), |
Kaho Ng | 2da2dc9 | 2016-05-09 00:27:49 +0800 | [diff] [blame] | 8030 | SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), |
Bobi Mihalca | 83a9efb | 2016-03-23 13:32:33 +0200 | [diff] [blame] | 8031 | SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), |
Takashi Iwai | db8948e | 2016-01-18 09:17:30 +0100 | [diff] [blame] | 8032 | SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 8033 | SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8034 | SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 8035 | SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 8036 | SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51), |
| 8037 | SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51), |
Takashi Iwai | c7efff9 | 2017-01-04 21:38:16 +0100 | [diff] [blame] | 8038 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 8039 | SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8040 | SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 8041 | SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8042 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), |
Daniel T Chen | a0e90ac | 2010-11-20 10:20:35 -0500 | [diff] [blame] | 8043 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 8044 | SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 8045 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), |
Valentine Sinitsyn | d411858 | 2010-10-01 22:24:08 +0600 | [diff] [blame] | 8046 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8047 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 8048 | SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 8049 | SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 8050 | SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 8051 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8052 | |
| 8053 | #if 0 |
| 8054 | /* Below is a quirk table taken from the old code. |
| 8055 | * Basically the device should work as is without the fixup table. |
| 8056 | * If BIOS doesn't give a proper info, enable the corresponding |
| 8057 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 8058 | */ |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8059 | SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), |
| 8060 | SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), |
| 8061 | SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), |
| 8062 | SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), |
| 8063 | SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 8064 | SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8065 | SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 8066 | SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), |
| 8067 | SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), |
| 8068 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8069 | SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), |
| 8070 | SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), |
| 8071 | SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), |
| 8072 | SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), |
| 8073 | SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), |
| 8074 | SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8075 | SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), |
| 8076 | SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), |
| 8077 | SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8078 | SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 8079 | SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 8080 | SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8081 | SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), |
| 8082 | SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), |
| 8083 | SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), |
| 8084 | SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8085 | SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), |
| 8086 | SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 8087 | SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8088 | SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), |
| 8089 | SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8090 | SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8091 | SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), |
| 8092 | SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), |
| 8093 | SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), |
| 8094 | SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), |
| 8095 | SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), |
| 8096 | SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), |
| 8097 | SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), |
| 8098 | SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8099 | SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), |
| 8100 | SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), |
| 8101 | SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 8102 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), |
| 8103 | SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), |
| 8104 | SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), |
| 8105 | SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), |
| 8106 | SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), |
| 8107 | SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 8108 | SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), |
| 8109 | #endif |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8110 | {} |
| 8111 | }; |
| 8112 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8113 | static const struct hda_model_fixup alc662_fixup_models[] = { |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8114 | {.id = ALC272_FIXUP_MARIO, .name = "mario"}, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8115 | {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, |
| 8116 | {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, |
| 8117 | {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, |
| 8118 | {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, |
| 8119 | {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, |
| 8120 | {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, |
| 8121 | {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, |
| 8122 | {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 8123 | {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
David Henningsson | e32aa85 | 2013-06-17 11:04:02 +0200 | [diff] [blame] | 8124 | {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 8125 | {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8126 | {} |
| 8127 | }; |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8128 | |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 8129 | static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 8130 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
| 8131 | {0x17, 0x02211010}, |
| 8132 | {0x18, 0x01a19030}, |
| 8133 | {0x1a, 0x01813040}, |
| 8134 | {0x21, 0x01014020}), |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8135 | SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8136 | {0x14, 0x01014010}, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8137 | {0x18, 0x01a19020}, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8138 | {0x1a, 0x0181302f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8139 | {0x1b, 0x0221401f}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8140 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 8141 | {0x12, 0x99a30130}, |
| 8142 | {0x14, 0x90170110}, |
| 8143 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8144 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8145 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 8146 | {0x12, 0x99a30140}, |
| 8147 | {0x14, 0x90170110}, |
| 8148 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8149 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8150 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 8151 | {0x12, 0x99a30150}, |
| 8152 | {0x14, 0x90170110}, |
| 8153 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8154 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8155 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8156 | {0x14, 0x90170110}, |
| 8157 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8158 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8159 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, |
| 8160 | {0x12, 0x90a60130}, |
| 8161 | {0x14, 0x90170110}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8162 | {0x15, 0x0321101f}), |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 8163 | {} |
| 8164 | }; |
| 8165 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8166 | /* |
| 8167 | */ |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8168 | static int patch_alc662(struct hda_codec *codec) |
| 8169 | { |
| 8170 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8171 | int err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8172 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8173 | err = alc_alloc_spec(codec, 0x0b); |
| 8174 | if (err < 0) |
| 8175 | return err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8176 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8177 | spec = codec->spec; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 8178 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 8179 | spec->shutup = alc_eapd_shutup; |
| 8180 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8181 | /* handle multiple HPs as is */ |
| 8182 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 8183 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 8184 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
| 8185 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 8186 | switch (codec->core.vendor_id) { |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 8187 | case 0x10ec0668: |
| 8188 | spec->init_hook = alc668_restore_default_value; |
| 8189 | break; |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 8190 | } |
Kailang Yang | 8663ff7 | 2012-06-29 09:35:52 +0200 | [diff] [blame] | 8191 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8192 | snd_hda_pick_fixup(codec, alc662_fixup_models, |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 8193 | alc662_fixup_tbl, alc662_fixups); |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 8194 | snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8195 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 8196 | |
| 8197 | alc_auto_parse_customize_define(codec); |
| 8198 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 8199 | if (has_cdefine_beep(codec)) |
| 8200 | spec->gen.beep_nid = 0x01; |
| 8201 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8202 | if ((alc_get_coef0(codec) & (1 << 14)) && |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 8203 | codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8204 | spec->cdefine.platform_type == 1) { |
Wei Yongjun | 6134b1a | 2013-04-18 11:12:59 +0800 | [diff] [blame] | 8205 | err = alc_codec_rename(codec, "ALC272X"); |
| 8206 | if (err < 0) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8207 | goto error; |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 8208 | } |
Kailang Yang | 274693f | 2009-12-03 10:07:50 +0100 | [diff] [blame] | 8209 | |
Takashi Iwai | b9c5106 | 2011-08-24 18:08:07 +0200 | [diff] [blame] | 8210 | /* automatic parse from the BIOS config */ |
| 8211 | err = alc662_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8212 | if (err < 0) |
| 8213 | goto error; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8214 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 8215 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 8216 | switch (codec->core.vendor_id) { |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 8217 | case 0x10ec0662: |
| 8218 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 8219 | break; |
| 8220 | case 0x10ec0272: |
| 8221 | case 0x10ec0663: |
| 8222 | case 0x10ec0665: |
Kailang Yang | 9ad5454 | 2013-11-26 15:41:40 +0800 | [diff] [blame] | 8223 | case 0x10ec0668: |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 8224 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
| 8225 | break; |
| 8226 | case 0x10ec0273: |
| 8227 | set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); |
| 8228 | break; |
| 8229 | } |
Kailang Yang | cec27c8 | 2010-02-04 14:18:18 +0100 | [diff] [blame] | 8230 | } |
Takashi Iwai | 2134ea4 | 2008-01-10 16:53:55 +0100 | [diff] [blame] | 8231 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8232 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 8233 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8234 | return 0; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8235 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8236 | error: |
| 8237 | alc_free(codec); |
| 8238 | return err; |
Kailang Yang | b478b99 | 2011-05-18 11:51:15 +0200 | [diff] [blame] | 8239 | } |
| 8240 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8241 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8242 | * ALC680 support |
| 8243 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8244 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8245 | static int alc680_parse_auto_config(struct hda_codec *codec) |
| 8246 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8247 | return alc_parse_auto_config(codec, NULL, NULL); |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8248 | } |
| 8249 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8250 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8251 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8252 | static int patch_alc680(struct hda_codec *codec) |
| 8253 | { |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8254 | int err; |
| 8255 | |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 8256 | /* ALC680 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8257 | err = alc_alloc_spec(codec, 0); |
| 8258 | if (err < 0) |
| 8259 | return err; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 8260 | |
Takashi Iwai | 1ebec5f | 2011-08-15 13:21:48 +0200 | [diff] [blame] | 8261 | /* automatic parse from the BIOS config */ |
| 8262 | err = alc680_parse_auto_config(codec); |
| 8263 | if (err < 0) { |
| 8264 | alc_free(codec); |
| 8265 | return err; |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8266 | } |
| 8267 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8268 | return 0; |
| 8269 | } |
| 8270 | |
| 8271 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8272 | * patch entries |
| 8273 | */ |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8274 | static const struct hda_device_id snd_hda_id_realtek[] = { |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 8275 | HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8276 | HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269), |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 8277 | HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8278 | HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269), |
| 8279 | HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 8280 | HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8281 | HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269), |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 8282 | HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8283 | HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269), |
| 8284 | HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269), |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 8285 | HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8286 | HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260), |
| 8287 | HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262), |
| 8288 | HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268), |
| 8289 | HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268), |
| 8290 | HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269), |
| 8291 | HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269), |
| 8292 | HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 8293 | HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8294 | HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269), |
| 8295 | HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269), |
| 8296 | HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269), |
| 8297 | HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269), |
| 8298 | HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269), |
| 8299 | HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269), |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 8300 | HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8301 | HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269), |
| 8302 | HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269), |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 8303 | HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8304 | HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269), |
| 8305 | HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269), |
| 8306 | HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 8307 | HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 8308 | HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8309 | HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 8310 | HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8311 | HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), |
| 8312 | HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), |
| 8313 | HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), |
| 8314 | HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd), |
| 8315 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882), |
| 8316 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662), |
| 8317 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662), |
| 8318 | HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662), |
| 8319 | HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662), |
| 8320 | HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662), |
| 8321 | HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662), |
| 8322 | HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662), |
| 8323 | HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662), |
| 8324 | HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680), |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 8325 | HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269), |
| 8326 | HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269), |
| 8327 | HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269), |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 8328 | HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8329 | HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880), |
| 8330 | HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882), |
| 8331 | HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882), |
| 8332 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882), |
| 8333 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882), |
| 8334 | HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882), |
| 8335 | HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882), |
| 8336 | HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882), |
| 8337 | HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882), |
| 8338 | HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882), |
| 8339 | HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662), |
| 8340 | HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882), |
| 8341 | HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882), |
Kailang Yang | 65553b1 | 2017-07-11 15:15:47 +0800 | [diff] [blame] | 8342 | HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 8343 | HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8344 | {} /* terminator */ |
| 8345 | }; |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8346 | MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 8347 | |
| 8348 | MODULE_LICENSE("GPL"); |
| 8349 | MODULE_DESCRIPTION("Realtek HD-audio codec"); |
| 8350 | |
Takashi Iwai | d8a766a | 2015-02-17 15:25:37 +0100 | [diff] [blame] | 8351 | static struct hda_codec_driver realtek_driver = { |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8352 | .id = snd_hda_id_realtek, |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 8353 | }; |
| 8354 | |
Takashi Iwai | d8a766a | 2015-02-17 15:25:37 +0100 | [diff] [blame] | 8355 | module_hda_codec_driver(realtek_driver); |