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> |
Pierre-Louis Bossart | be57bff | 2018-08-22 15:24:57 -0500 | [diff] [blame] | 35 | #include <sound/hda_codec.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 */ |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 86 | struct alc_customize_define cdefine; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 87 | unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */ |
| 88 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 89 | /* GPIO bits */ |
| 90 | unsigned int gpio_mask; |
| 91 | unsigned int gpio_dir; |
| 92 | unsigned int gpio_data; |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 93 | bool gpio_write_delay; /* add a delay before writing gpio_data */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 94 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 95 | /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */ |
| 96 | int mute_led_polarity; |
| 97 | hda_nid_t mute_led_nid; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 98 | hda_nid_t cap_mute_led_nid; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 99 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 100 | unsigned int gpio_mute_led_mask; |
| 101 | unsigned int gpio_mic_led_mask; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 102 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 103 | hda_nid_t headset_mic_pin; |
| 104 | hda_nid_t headphone_mic_pin; |
| 105 | int current_headset_mode; |
| 106 | int current_headset_type; |
| 107 | |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 108 | /* hooks */ |
| 109 | void (*init_hook)(struct hda_codec *codec); |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 110 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 111 | void (*power_hook)(struct hda_codec *codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 112 | #endif |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 113 | void (*shutup)(struct hda_codec *codec); |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 114 | void (*reboot_notify)(struct hda_codec *codec); |
Takashi Iwai | d922b51 | 2011-04-28 12:18:53 +0200 | [diff] [blame] | 115 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 116 | int init_amp; |
Takashi Iwai | d433a67 | 2010-09-20 15:11:54 +0200 | [diff] [blame] | 117 | int codec_variant; /* flag for other variants */ |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 118 | unsigned int has_alc5505_dsp:1; |
| 119 | unsigned int no_depop_delay:1; |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 120 | unsigned int done_hp_init:1; |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 121 | unsigned int no_shutup_pins:1; |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 122 | unsigned int ultra_low_power:1; |
Takashi Iwai | e64f14f | 2009-01-20 18:32:55 +0100 | [diff] [blame] | 123 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 124 | /* for PLL fix */ |
| 125 | hda_nid_t pll_nid; |
| 126 | unsigned int pll_coef_idx, pll_coef_bit; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 127 | unsigned int coef0; |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 128 | struct input_dev *kb_dev; |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 129 | u8 alc_mute_keycode_map[1]; |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 130 | }; |
| 131 | |
Takashi Iwai | 23f0c04 | 2009-02-26 13:03:58 +0100 | [diff] [blame] | 132 | /* |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 133 | * COEF access helper functions |
| 134 | */ |
| 135 | |
| 136 | static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 137 | unsigned int coef_idx) |
| 138 | { |
| 139 | unsigned int val; |
| 140 | |
| 141 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 142 | val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); |
| 143 | return val; |
| 144 | } |
| 145 | |
| 146 | #define alc_read_coef_idx(codec, coef_idx) \ |
| 147 | alc_read_coefex_idx(codec, 0x20, coef_idx) |
| 148 | |
| 149 | static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 150 | unsigned int coef_idx, unsigned int coef_val) |
| 151 | { |
| 152 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 153 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); |
| 154 | } |
| 155 | |
| 156 | #define alc_write_coef_idx(codec, coef_idx, coef_val) \ |
| 157 | alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) |
| 158 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 159 | static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 160 | unsigned int coef_idx, unsigned int mask, |
| 161 | unsigned int bits_set) |
| 162 | { |
| 163 | unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx); |
| 164 | |
| 165 | if (val != -1) |
| 166 | alc_write_coefex_idx(codec, nid, coef_idx, |
| 167 | (val & ~mask) | bits_set); |
| 168 | } |
| 169 | |
| 170 | #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ |
| 171 | alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) |
| 172 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 173 | /* a special bypass for COEF 0; read the cached value at the second time */ |
| 174 | static unsigned int alc_get_coef0(struct hda_codec *codec) |
| 175 | { |
| 176 | struct alc_spec *spec = codec->spec; |
| 177 | |
| 178 | if (!spec->coef0) |
| 179 | spec->coef0 = alc_read_coef_idx(codec, 0); |
| 180 | return spec->coef0; |
| 181 | } |
| 182 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 183 | /* coef writes/updates batch */ |
| 184 | struct coef_fw { |
| 185 | unsigned char nid; |
| 186 | unsigned char idx; |
| 187 | unsigned short mask; |
| 188 | unsigned short val; |
| 189 | }; |
| 190 | |
| 191 | #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ |
| 192 | { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } |
| 193 | #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) |
| 194 | #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) |
| 195 | #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) |
| 196 | |
| 197 | static void alc_process_coef_fw(struct hda_codec *codec, |
| 198 | const struct coef_fw *fw) |
| 199 | { |
| 200 | for (; fw->nid; fw++) { |
| 201 | if (fw->mask == (unsigned short)-1) |
| 202 | alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); |
| 203 | else |
| 204 | alc_update_coefex_idx(codec, fw->nid, fw->idx, |
| 205 | fw->mask, fw->val); |
| 206 | } |
| 207 | } |
| 208 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 209 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 210 | * GPIO setup tables, used in initialization |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 211 | */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 212 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 213 | /* Enable GPIO mask and set output */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 214 | static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask) |
| 215 | { |
| 216 | struct alc_spec *spec = codec->spec; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 217 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 218 | spec->gpio_mask |= mask; |
| 219 | spec->gpio_dir |= mask; |
| 220 | spec->gpio_data |= mask; |
| 221 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 222 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 223 | static void alc_write_gpio_data(struct hda_codec *codec) |
| 224 | { |
| 225 | struct alc_spec *spec = codec->spec; |
| 226 | |
| 227 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
| 228 | spec->gpio_data); |
| 229 | } |
| 230 | |
Takashi Iwai | aaf312d | 2018-06-19 22:28:22 +0200 | [diff] [blame] | 231 | static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask, |
| 232 | bool on) |
| 233 | { |
| 234 | struct alc_spec *spec = codec->spec; |
| 235 | unsigned int oldval = spec->gpio_data; |
| 236 | |
| 237 | if (on) |
| 238 | spec->gpio_data |= mask; |
| 239 | else |
| 240 | spec->gpio_data &= ~mask; |
| 241 | if (oldval != spec->gpio_data) |
| 242 | alc_write_gpio_data(codec); |
| 243 | } |
| 244 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 245 | static void alc_write_gpio(struct hda_codec *codec) |
| 246 | { |
| 247 | struct alc_spec *spec = codec->spec; |
| 248 | |
| 249 | if (!spec->gpio_mask) |
| 250 | return; |
| 251 | |
| 252 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 253 | AC_VERB_SET_GPIO_MASK, spec->gpio_mask); |
| 254 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 255 | AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir); |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 256 | if (spec->gpio_write_delay) |
| 257 | msleep(1); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 258 | alc_write_gpio_data(codec); |
| 259 | } |
| 260 | |
| 261 | static void alc_fixup_gpio(struct hda_codec *codec, int action, |
| 262 | unsigned int mask) |
| 263 | { |
| 264 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 265 | alc_setup_gpio(codec, mask); |
| 266 | } |
| 267 | |
| 268 | static void alc_fixup_gpio1(struct hda_codec *codec, |
| 269 | const struct hda_fixup *fix, int action) |
| 270 | { |
| 271 | alc_fixup_gpio(codec, action, 0x01); |
| 272 | } |
| 273 | |
| 274 | static void alc_fixup_gpio2(struct hda_codec *codec, |
| 275 | const struct hda_fixup *fix, int action) |
| 276 | { |
| 277 | alc_fixup_gpio(codec, action, 0x02); |
| 278 | } |
| 279 | |
| 280 | static void alc_fixup_gpio3(struct hda_codec *codec, |
| 281 | const struct hda_fixup *fix, int action) |
| 282 | { |
| 283 | alc_fixup_gpio(codec, action, 0x03); |
| 284 | } |
Kailang Yang | bdd148a | 2007-05-08 15:19:08 +0200 | [diff] [blame] | 285 | |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 286 | static void alc_fixup_gpio4(struct hda_codec *codec, |
| 287 | const struct hda_fixup *fix, int action) |
| 288 | { |
| 289 | alc_fixup_gpio(codec, action, 0x04); |
| 290 | } |
| 291 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 292 | /* |
| 293 | * Fix hardware PLL issue |
| 294 | * On some codecs, the analog PLL gating control must be off while |
| 295 | * the default value is 1. |
| 296 | */ |
| 297 | static void alc_fix_pll(struct hda_codec *codec) |
| 298 | { |
| 299 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 300 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 301 | if (spec->pll_nid) |
| 302 | alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, |
| 303 | 1 << spec->pll_coef_bit, 0); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 304 | } |
| 305 | |
| 306 | static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, |
| 307 | unsigned int coef_idx, unsigned int coef_bit) |
| 308 | { |
| 309 | struct alc_spec *spec = codec->spec; |
| 310 | spec->pll_nid = nid; |
| 311 | spec->pll_coef_idx = coef_idx; |
| 312 | spec->pll_coef_bit = coef_bit; |
| 313 | alc_fix_pll(codec); |
| 314 | } |
| 315 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 316 | /* update the master volume per volume-knob's unsol event */ |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 317 | static void alc_update_knob_master(struct hda_codec *codec, |
| 318 | struct hda_jack_callback *jack) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 319 | { |
| 320 | unsigned int val; |
| 321 | struct snd_kcontrol *kctl; |
| 322 | struct snd_ctl_elem_value *uctl; |
| 323 | |
| 324 | kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); |
| 325 | if (!kctl) |
| 326 | return; |
| 327 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); |
| 328 | if (!uctl) |
| 329 | return; |
Takashi Iwai | 2ebab40 | 2016-02-09 10:23:52 +0100 | [diff] [blame] | 330 | val = snd_hda_codec_read(codec, jack->nid, 0, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 331 | AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); |
| 332 | val &= HDA_AMP_VOLMASK; |
| 333 | uctl->value.integer.value[0] = val; |
| 334 | uctl->value.integer.value[1] = val; |
| 335 | kctl->put(kctl, uctl); |
| 336 | kfree(uctl); |
| 337 | } |
| 338 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 339 | static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 340 | { |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 341 | /* For some reason, the res given from ALC880 is broken. |
| 342 | Here we adjust it properly. */ |
| 343 | snd_hda_jack_unsol_event(codec, res >> 2); |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 344 | } |
| 345 | |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 346 | /* Change EAPD to verb control */ |
| 347 | static void alc_fill_eapd_coef(struct hda_codec *codec) |
| 348 | { |
| 349 | int coef; |
| 350 | |
| 351 | coef = alc_get_coef0(codec); |
| 352 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 353 | switch (codec->core.vendor_id) { |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 354 | case 0x10ec0262: |
| 355 | alc_update_coef_idx(codec, 0x7, 0, 1<<5); |
| 356 | break; |
| 357 | case 0x10ec0267: |
| 358 | case 0x10ec0268: |
| 359 | alc_update_coef_idx(codec, 0x7, 0, 1<<13); |
| 360 | break; |
| 361 | case 0x10ec0269: |
| 362 | if ((coef & 0x00f0) == 0x0010) |
| 363 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); |
| 364 | if ((coef & 0x00f0) == 0x0020) |
| 365 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 366 | if ((coef & 0x00f0) == 0x0030) |
| 367 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 368 | break; |
| 369 | case 0x10ec0280: |
| 370 | case 0x10ec0284: |
| 371 | case 0x10ec0290: |
| 372 | case 0x10ec0292: |
| 373 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 374 | break; |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 375 | case 0x10ec0225: |
Takashi Iwai | 44be77c | 2017-12-27 08:53:59 +0100 | [diff] [blame] | 376 | case 0x10ec0295: |
| 377 | case 0x10ec0299: |
| 378 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); |
| 379 | /* fallthrough */ |
| 380 | case 0x10ec0215: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 381 | case 0x10ec0233: |
Kailang Yang | ea04a1d | 2018-04-25 15:31:52 +0800 | [diff] [blame] | 382 | case 0x10ec0235: |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 383 | case 0x10ec0236: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 384 | case 0x10ec0255: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 385 | case 0x10ec0256: |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 386 | case 0x10ec0257: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 387 | case 0x10ec0282: |
| 388 | case 0x10ec0283: |
| 389 | case 0x10ec0286: |
| 390 | case 0x10ec0288: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 391 | case 0x10ec0285: |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 392 | case 0x10ec0298: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 393 | case 0x10ec0289: |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 394 | case 0x10ec0300: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 395 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 396 | break; |
Kailang Yang | 3aabf94 | 2017-11-08 15:28:33 +0800 | [diff] [blame] | 397 | case 0x10ec0275: |
| 398 | alc_update_coef_idx(codec, 0xe, 0, 1<<0); |
| 399 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 400 | case 0x10ec0293: |
| 401 | alc_update_coef_idx(codec, 0xa, 1<<13, 0); |
| 402 | break; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 403 | case 0x10ec0234: |
| 404 | case 0x10ec0274: |
| 405 | case 0x10ec0294: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 406 | case 0x10ec0700: |
| 407 | case 0x10ec0701: |
| 408 | case 0x10ec0703: |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 409 | alc_update_coef_idx(codec, 0x10, 1<<15, 0); |
| 410 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 411 | case 0x10ec0662: |
| 412 | if ((coef & 0x00f0) == 0x0030) |
| 413 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ |
| 414 | break; |
| 415 | case 0x10ec0272: |
| 416 | case 0x10ec0273: |
| 417 | case 0x10ec0663: |
| 418 | case 0x10ec0665: |
| 419 | case 0x10ec0670: |
| 420 | case 0x10ec0671: |
| 421 | case 0x10ec0672: |
| 422 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ |
| 423 | break; |
| 424 | case 0x10ec0668: |
| 425 | alc_update_coef_idx(codec, 0x7, 3<<13, 0); |
| 426 | break; |
| 427 | case 0x10ec0867: |
| 428 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); |
| 429 | break; |
| 430 | case 0x10ec0888: |
| 431 | if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030) |
| 432 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 433 | break; |
| 434 | case 0x10ec0892: |
| 435 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 436 | break; |
| 437 | case 0x10ec0899: |
| 438 | case 0x10ec0900: |
Kailang Yang | 65553b1 | 2017-07-11 15:15:47 +0800 | [diff] [blame] | 439 | case 0x10ec1168: |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 440 | case 0x10ec1220: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 441 | alc_update_coef_idx(codec, 0x7, 1<<1, 0); |
| 442 | break; |
| 443 | } |
| 444 | } |
| 445 | |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 446 | /* additional initialization for ALC888 variants */ |
| 447 | static void alc888_coef_init(struct hda_codec *codec) |
| 448 | { |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 449 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 450 | /* alc888-VA */ |
| 451 | case 0x00: |
| 452 | /* alc888-VB */ |
| 453 | case 0x10: |
| 454 | alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ |
| 455 | break; |
| 456 | } |
Jaroslav Kysela | 87a8c37 | 2009-07-23 10:58:29 +0200 | [diff] [blame] | 457 | } |
| 458 | |
Takashi Iwai | 3fb4a50 | 2010-01-19 15:46:37 +0100 | [diff] [blame] | 459 | /* turn on/off EAPD control (only if available) */ |
| 460 | static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) |
| 461 | { |
| 462 | if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) |
| 463 | return; |
| 464 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) |
| 465 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, |
| 466 | on ? 2 : 0); |
| 467 | } |
| 468 | |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 469 | /* turn on/off EAPD controls of the codec */ |
| 470 | static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) |
| 471 | { |
| 472 | /* We currently only handle front, HP */ |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 473 | static hda_nid_t pins[] = { |
Hui Wang | af95b41 | 2015-03-26 17:14:55 +0800 | [diff] [blame] | 474 | 0x0f, 0x10, 0x14, 0x15, 0x17, 0 |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 475 | }; |
| 476 | hda_nid_t *p; |
| 477 | for (p = pins; *p; p++) |
| 478 | set_eapd(codec, *p, on); |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 479 | } |
| 480 | |
Kailang Yang | dad3197 | 2019-05-10 16:28:57 +0800 | [diff] [blame] | 481 | static int find_ext_mic_pin(struct hda_codec *codec); |
| 482 | |
| 483 | static void alc_headset_mic_no_shutup(struct hda_codec *codec) |
| 484 | { |
| 485 | const struct hda_pincfg *pin; |
| 486 | int mic_pin = find_ext_mic_pin(codec); |
| 487 | int i; |
| 488 | |
| 489 | /* don't shut up pins when unloading the driver; otherwise it breaks |
| 490 | * the default pin setup at the next load of the driver |
| 491 | */ |
| 492 | if (codec->bus->shutdown) |
| 493 | return; |
| 494 | |
| 495 | snd_array_for_each(&codec->init_pins, i, pin) { |
| 496 | /* use read here for syncing after issuing each verb */ |
| 497 | if (pin->nid != mic_pin) |
| 498 | snd_hda_codec_read(codec, pin->nid, 0, |
| 499 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); |
| 500 | } |
| 501 | |
| 502 | codec->pins_shutup = 1; |
| 503 | } |
| 504 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 505 | static void alc_shutup_pins(struct hda_codec *codec) |
| 506 | { |
| 507 | struct alc_spec *spec = codec->spec; |
| 508 | |
Kailang Yang | dad3197 | 2019-05-10 16:28:57 +0800 | [diff] [blame] | 509 | switch (codec->core.vendor_id) { |
| 510 | case 0x10ec0286: |
| 511 | case 0x10ec0288: |
| 512 | case 0x10ec0298: |
| 513 | alc_headset_mic_no_shutup(codec); |
| 514 | break; |
| 515 | default: |
| 516 | if (!spec->no_shutup_pins) |
| 517 | snd_hda_shutup_pins(codec); |
| 518 | break; |
| 519 | } |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 520 | } |
| 521 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 522 | /* generic shutup callback; |
Lars-Peter Clausen | 4ce8e6a | 2016-11-08 15:48:06 +0100 | [diff] [blame] | 523 | * just turning off EAPD and a little pause for avoiding pop-noise |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 524 | */ |
| 525 | static void alc_eapd_shutup(struct hda_codec *codec) |
| 526 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 527 | struct alc_spec *spec = codec->spec; |
| 528 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 529 | alc_auto_setup_eapd(codec, false); |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 530 | if (!spec->no_depop_delay) |
| 531 | msleep(200); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 532 | alc_shutup_pins(codec); |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 533 | } |
| 534 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 535 | /* generic EAPD initialization */ |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 536 | static void alc_auto_init_amp(struct hda_codec *codec, int type) |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 537 | { |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 538 | alc_auto_setup_eapd(codec, true); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 539 | alc_write_gpio(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 540 | switch (type) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 541 | case ALC_INIT_DEFAULT: |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 542 | switch (codec->core.vendor_id) { |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 543 | case 0x10ec0260: |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 544 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 545 | break; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 546 | case 0x10ec0880: |
| 547 | case 0x10ec0882: |
| 548 | case 0x10ec0883: |
| 549 | case 0x10ec0885: |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 550 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 551 | break; |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 552 | case 0x10ec0888: |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 553 | alc888_coef_init(codec); |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 554 | break; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 555 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 556 | break; |
| 557 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 558 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 559 | |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 560 | /* get a primary headphone pin if available */ |
| 561 | static hda_nid_t alc_get_hp_pin(struct alc_spec *spec) |
| 562 | { |
| 563 | if (spec->gen.autocfg.hp_pins[0]) |
| 564 | return spec->gen.autocfg.hp_pins[0]; |
| 565 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) |
| 566 | return spec->gen.autocfg.line_out_pins[0]; |
| 567 | return 0; |
| 568 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 569 | |
| 570 | /* |
| 571 | * Realtek SSID verification |
| 572 | */ |
| 573 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 574 | /* Could be any non-zero and even value. When used as fixup, tells |
| 575 | * the driver to ignore any present sku defines. |
| 576 | */ |
| 577 | #define ALC_FIXUP_SKU_IGNORE (2) |
| 578 | |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 579 | static void alc_fixup_sku_ignore(struct hda_codec *codec, |
| 580 | const struct hda_fixup *fix, int action) |
| 581 | { |
| 582 | struct alc_spec *spec = codec->spec; |
| 583 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 584 | spec->cdefine.fixup = 1; |
| 585 | spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; |
| 586 | } |
| 587 | } |
| 588 | |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 589 | static void alc_fixup_no_depop_delay(struct hda_codec *codec, |
| 590 | const struct hda_fixup *fix, int action) |
| 591 | { |
| 592 | struct alc_spec *spec = codec->spec; |
| 593 | |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 594 | if (action == HDA_FIXUP_ACT_PROBE) { |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 595 | spec->no_depop_delay = 1; |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 596 | codec->depop_delay = 0; |
| 597 | } |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 598 | } |
| 599 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 600 | static int alc_auto_parse_customize_define(struct hda_codec *codec) |
| 601 | { |
| 602 | unsigned int ass, tmp, i; |
Takashi Iwai | 7fb5622 | 2010-03-22 17:09:47 +0100 | [diff] [blame] | 603 | unsigned nid = 0; |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 604 | struct alc_spec *spec = codec->spec; |
| 605 | |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 606 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ |
| 607 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 608 | if (spec->cdefine.fixup) { |
| 609 | ass = spec->cdefine.sku_cfg; |
| 610 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 611 | return -1; |
| 612 | goto do_sku; |
| 613 | } |
| 614 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 615 | if (!codec->bus->pci) |
| 616 | return -1; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 617 | ass = codec->core.subsystem_id & 0xffff; |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 618 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 619 | goto do_sku; |
| 620 | |
| 621 | nid = 0x1d; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 622 | if (codec->core.vendor_id == 0x10ec0260) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 623 | nid = 0x17; |
| 624 | ass = snd_hda_codec_get_pincfg(codec, nid); |
| 625 | |
| 626 | if (!(ass & 1)) { |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 627 | codec_info(codec, "%s: SKU not ready 0x%08x\n", |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 628 | codec->core.chip_name, ass); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 629 | return -1; |
| 630 | } |
| 631 | |
| 632 | /* check sum */ |
| 633 | tmp = 0; |
| 634 | for (i = 1; i < 16; i++) { |
| 635 | if ((ass >> i) & 1) |
| 636 | tmp++; |
| 637 | } |
| 638 | if (((ass >> 16) & 0xf) != tmp) |
| 639 | return -1; |
| 640 | |
| 641 | spec->cdefine.port_connectivity = ass >> 30; |
| 642 | spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; |
| 643 | spec->cdefine.check_sum = (ass >> 16) & 0xf; |
| 644 | spec->cdefine.customization = ass >> 8; |
| 645 | do_sku: |
| 646 | spec->cdefine.sku_cfg = ass; |
| 647 | spec->cdefine.external_amp = (ass & 0x38) >> 3; |
| 648 | spec->cdefine.platform_type = (ass & 0x4) >> 2; |
| 649 | spec->cdefine.swap = (ass & 0x2) >> 1; |
| 650 | spec->cdefine.override = ass & 0x1; |
| 651 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 652 | codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 653 | nid, spec->cdefine.sku_cfg); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 654 | codec_dbg(codec, "SKU: port_connectivity=0x%x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 655 | spec->cdefine.port_connectivity); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 656 | codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); |
| 657 | codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); |
| 658 | codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); |
| 659 | codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); |
| 660 | codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); |
| 661 | codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); |
| 662 | codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 663 | |
| 664 | return 0; |
| 665 | } |
| 666 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 667 | /* return the position of NID in the list, or -1 if not found */ |
| 668 | static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 669 | { |
| 670 | int i; |
| 671 | for (i = 0; i < nums; i++) |
| 672 | if (list[i] == nid) |
| 673 | return i; |
| 674 | return -1; |
| 675 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 676 | /* return true if the given NID is found in the list */ |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 677 | static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 678 | { |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 679 | return find_idx_in_nid_list(nid, list, nums) >= 0; |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 680 | } |
| 681 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 682 | /* check subsystem ID and set up device-specific initialization; |
| 683 | * return 1 if initialized, 0 if invalid SSID |
| 684 | */ |
| 685 | /* 32-bit subsystem ID for BIOS loading in HD Audio codec. |
| 686 | * 31 ~ 16 : Manufacture ID |
| 687 | * 15 ~ 8 : SKU ID |
| 688 | * 7 ~ 0 : Assembly ID |
| 689 | * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 |
| 690 | */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 691 | 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] | 692 | { |
| 693 | unsigned int ass, tmp, i; |
| 694 | unsigned nid; |
| 695 | struct alc_spec *spec = codec->spec; |
| 696 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 697 | if (spec->cdefine.fixup) { |
| 698 | ass = spec->cdefine.sku_cfg; |
| 699 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 700 | return 0; |
| 701 | goto do_sku; |
| 702 | } |
| 703 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 704 | ass = codec->core.subsystem_id & 0xffff; |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 705 | if (codec->bus->pci && |
| 706 | ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 707 | goto do_sku; |
| 708 | |
| 709 | /* invalid SSID, check the special NID pin defcfg instead */ |
| 710 | /* |
Sasha Alexandr | def319f | 2009-06-16 16:00:15 -0400 | [diff] [blame] | 711 | * 31~30 : port connectivity |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 712 | * 29~21 : reserve |
| 713 | * 20 : PCBEEP input |
| 714 | * 19~16 : Check sum (15:1) |
| 715 | * 15~1 : Custom |
| 716 | * 0 : override |
| 717 | */ |
| 718 | nid = 0x1d; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 719 | if (codec->core.vendor_id == 0x10ec0260) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 720 | nid = 0x17; |
| 721 | ass = snd_hda_codec_get_pincfg(codec, nid); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 722 | codec_dbg(codec, |
| 723 | "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] | 724 | ass, nid); |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 725 | if (!(ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 726 | return 0; |
| 727 | if ((ass >> 30) != 1) /* no physical connection */ |
| 728 | return 0; |
| 729 | |
| 730 | /* check sum */ |
| 731 | tmp = 0; |
| 732 | for (i = 1; i < 16; i++) { |
| 733 | if ((ass >> i) & 1) |
| 734 | tmp++; |
| 735 | } |
| 736 | if (((ass >> 16) & 0xf) != tmp) |
| 737 | return 0; |
| 738 | do_sku: |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 739 | 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] | 740 | ass & 0xffff, codec->core.vendor_id); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 741 | /* |
| 742 | * 0 : override |
| 743 | * 1 : Swap Jack |
| 744 | * 2 : 0 --> Desktop, 1 --> Laptop |
| 745 | * 3~5 : External Amplifier control |
| 746 | * 7~6 : Reserved |
| 747 | */ |
| 748 | tmp = (ass & 0x38) >> 3; /* external Amp control */ |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 749 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
| 750 | switch (tmp) { |
| 751 | case 1: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 752 | alc_setup_gpio(codec, 0x01); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 753 | break; |
| 754 | case 3: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 755 | alc_setup_gpio(codec, 0x02); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 756 | break; |
| 757 | case 7: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 758 | alc_setup_gpio(codec, 0x03); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 759 | break; |
| 760 | case 5: |
| 761 | default: |
| 762 | spec->init_amp = ALC_INIT_DEFAULT; |
| 763 | break; |
| 764 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 765 | } |
| 766 | |
| 767 | /* is laptop or Desktop and enable the function "Mute internal speaker |
| 768 | * when the external headphone out jack is plugged" |
| 769 | */ |
| 770 | if (!(ass & 0x8000)) |
| 771 | return 1; |
| 772 | /* |
| 773 | * 10~8 : Jack location |
| 774 | * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered |
| 775 | * 14~13: Resvered |
| 776 | * 15 : 1 --> enable the function "Mute internal speaker |
| 777 | * when the external headphone out jack is plugged" |
| 778 | */ |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 779 | if (!alc_get_hp_pin(spec)) { |
Takashi Iwai | 01d4825 | 2009-10-06 13:21:54 +0200 | [diff] [blame] | 780 | hda_nid_t nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 781 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 782 | nid = ports[tmp]; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 783 | if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, |
| 784 | spec->gen.autocfg.line_outs)) |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 785 | return 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 786 | spec->gen.autocfg.hp_pins[0] = nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 787 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 788 | return 1; |
| 789 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 790 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 791 | /* Check the validity of ALC subsystem-id |
| 792 | * ports contains an array of 4 pin NIDs for port-A, E, D and I */ |
| 793 | 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] | 794 | { |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 795 | if (!alc_subsystem_id(codec, ports)) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 796 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 797 | codec_dbg(codec, |
| 798 | "realtek: Enable default setup for auto mode as fallback\n"); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 799 | spec->init_amp = ALC_INIT_DEFAULT; |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 800 | } |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 801 | } |
Takashi Iwai | 1a1455d | 2011-04-28 17:36:18 +0200 | [diff] [blame] | 802 | |
Takashi Iwai | 41e41f1 | 2005-06-08 14:48:49 +0200 | [diff] [blame] | 803 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 804 | */ |
| 805 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 806 | static void alc_fixup_inv_dmic(struct hda_codec *codec, |
| 807 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 808 | { |
| 809 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 668d1e9 | 2012-11-29 14:10:17 +0100 | [diff] [blame] | 810 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 811 | spec->gen.inv_dmic_split = 1; |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 812 | } |
| 813 | |
Takashi Iwai | 603c401 | 2008-07-30 15:01:44 +0200 | [diff] [blame] | 814 | |
Takashi Iwai | 2eab694 | 2012-12-18 15:30:41 +0100 | [diff] [blame] | 815 | static int alc_build_controls(struct hda_codec *codec) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 816 | { |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 817 | int err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 818 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 819 | err = snd_hda_gen_build_controls(codec); |
| 820 | if (err < 0) |
| 821 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 822 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 823 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 824 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 825 | } |
| 826 | |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 827 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 828 | /* |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 829 | * Common callbacks |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 830 | */ |
Takashi Iwai | 16ded52 | 2005-06-10 19:58:24 +0200 | [diff] [blame] | 831 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 832 | static void alc_pre_init(struct hda_codec *codec) |
| 833 | { |
| 834 | alc_fill_eapd_coef(codec); |
| 835 | } |
| 836 | |
| 837 | #define is_s4_resume(codec) \ |
| 838 | ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE) |
| 839 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 840 | static int alc_init(struct hda_codec *codec) |
| 841 | { |
| 842 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 843 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 844 | /* hibernation resume needs the full chip initialization */ |
| 845 | if (is_s4_resume(codec)) |
| 846 | alc_pre_init(codec); |
| 847 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 848 | if (spec->init_hook) |
| 849 | spec->init_hook(codec); |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 850 | |
Kailang Yang | 607ca3b | 2019-04-26 16:35:41 +0800 | [diff] [blame] | 851 | snd_hda_gen_init(codec); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 852 | alc_fix_pll(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 853 | alc_auto_init_amp(codec, spec->init_amp); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 854 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 855 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); |
Takashi Iwai | e08a007 | 2006-09-07 17:52:14 +0200 | [diff] [blame] | 856 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 857 | return 0; |
| 858 | } |
| 859 | |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 860 | static inline void alc_shutup(struct hda_codec *codec) |
| 861 | { |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 862 | struct alc_spec *spec = codec->spec; |
| 863 | |
Takashi Iwai | c7273bd | 2018-06-12 16:09:57 +0200 | [diff] [blame] | 864 | if (!snd_hda_get_bool_hint(codec, "shutup")) |
| 865 | return; /* disabled explicitly by hints */ |
| 866 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 867 | if (spec && spec->shutup) |
| 868 | spec->shutup(codec); |
Takashi Iwai | 9bfb284 | 2013-07-24 14:31:50 +0200 | [diff] [blame] | 869 | else |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 870 | alc_shutup_pins(codec); |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 871 | } |
| 872 | |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 873 | static void alc_reboot_notify(struct hda_codec *codec) |
| 874 | { |
| 875 | struct alc_spec *spec = codec->spec; |
| 876 | |
| 877 | if (spec && spec->reboot_notify) |
| 878 | spec->reboot_notify(codec); |
| 879 | else |
| 880 | alc_shutup(codec); |
| 881 | } |
| 882 | |
| 883 | /* power down codec to D3 at reboot/shutdown; set as reboot_notify ops */ |
| 884 | static void alc_d3_at_reboot(struct hda_codec *codec) |
| 885 | { |
| 886 | snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3); |
| 887 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 888 | AC_VERB_SET_POWER_STATE, AC_PWRST_D3); |
| 889 | msleep(10); |
| 890 | } |
| 891 | |
Takashi Iwai | 8a02c0c | 2014-02-10 18:09:45 +0100 | [diff] [blame] | 892 | #define alc_free snd_hda_gen_free |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 893 | |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 894 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 895 | static void alc_power_eapd(struct hda_codec *codec) |
| 896 | { |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 897 | alc_auto_setup_eapd(codec, false); |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 898 | } |
| 899 | |
Takashi Iwai | 68cb2b5 | 2012-07-02 15:20:37 +0200 | [diff] [blame] | 900 | static int alc_suspend(struct hda_codec *codec) |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 901 | { |
| 902 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 903 | alc_shutup(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 904 | if (spec && spec->power_hook) |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 905 | spec->power_hook(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 906 | return 0; |
| 907 | } |
| 908 | #endif |
| 909 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 910 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 911 | static int alc_resume(struct hda_codec *codec) |
| 912 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 913 | struct alc_spec *spec = codec->spec; |
| 914 | |
| 915 | if (!spec->no_depop_delay) |
| 916 | msleep(150); /* to avoid pop noise */ |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 917 | codec->patch_ops.init(codec); |
Takashi Iwai | eeecd9d | 2015-02-25 15:18:50 +0100 | [diff] [blame] | 918 | regcache_sync(codec->core.regmap); |
Takashi Iwai | 9e5341b | 2010-09-21 09:57:06 +0200 | [diff] [blame] | 919 | hda_call_check_power_status(codec, 0x01); |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 920 | return 0; |
| 921 | } |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 922 | #endif |
| 923 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 924 | /* |
| 925 | */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 926 | static const struct hda_codec_ops alc_patch_ops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 927 | .build_controls = alc_build_controls, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 928 | .build_pcms = snd_hda_gen_build_pcms, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 929 | .init = alc_init, |
| 930 | .free = alc_free, |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 931 | .unsol_event = snd_hda_jack_unsol_event, |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 932 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 933 | .resume = alc_resume, |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 934 | .suspend = alc_suspend, |
Takashi Iwai | fce52a3 | 2013-01-07 12:42:48 +0100 | [diff] [blame] | 935 | .check_power_status = snd_hda_gen_check_power_status, |
Takashi Iwai | cb53c62 | 2007-08-10 17:21:45 +0200 | [diff] [blame] | 936 | #endif |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 937 | .reboot_notify = alc_reboot_notify, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 938 | }; |
| 939 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 940 | |
Takashi Iwai | ded255b | 2015-10-01 17:59:43 +0200 | [diff] [blame] | 941 | #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] | 942 | |
Takashi Iwai | 2fa522b | 2005-05-12 14:51:12 +0200 | [diff] [blame] | 943 | /* |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 944 | * Rename codecs appropriately from COEF value or subvendor id |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 945 | */ |
| 946 | struct alc_codec_rename_table { |
| 947 | unsigned int vendor_id; |
| 948 | unsigned short coef_mask; |
| 949 | unsigned short coef_bits; |
| 950 | const char *name; |
| 951 | }; |
| 952 | |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 953 | struct alc_codec_rename_pci_table { |
| 954 | unsigned int codec_vendor_id; |
| 955 | unsigned short pci_subvendor; |
| 956 | unsigned short pci_subdevice; |
| 957 | const char *name; |
| 958 | }; |
| 959 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 960 | static struct alc_codec_rename_table rename_tbl[] = { |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 961 | { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 962 | { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, |
| 963 | { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, |
| 964 | { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, |
| 965 | { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, |
| 966 | { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, |
| 967 | { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, |
| 968 | { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 969 | { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 970 | { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 971 | { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, |
| 972 | { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, |
| 973 | { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, |
| 974 | { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, |
| 975 | { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, |
| 976 | { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, |
| 977 | { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, |
| 978 | { } /* terminator */ |
| 979 | }; |
| 980 | |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 981 | static struct alc_codec_rename_pci_table rename_pci_tbl[] = { |
| 982 | { 0x10ec0280, 0x1028, 0, "ALC3220" }, |
| 983 | { 0x10ec0282, 0x1028, 0, "ALC3221" }, |
| 984 | { 0x10ec0283, 0x1028, 0, "ALC3223" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 985 | { 0x10ec0288, 0x1028, 0, "ALC3263" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 986 | { 0x10ec0292, 0x1028, 0, "ALC3226" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 987 | { 0x10ec0293, 0x1028, 0, "ALC3235" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 988 | { 0x10ec0255, 0x1028, 0, "ALC3234" }, |
| 989 | { 0x10ec0668, 0x1028, 0, "ALC3661" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 990 | { 0x10ec0275, 0x1028, 0, "ALC3260" }, |
| 991 | { 0x10ec0899, 0x1028, 0, "ALC3861" }, |
Kailang Yang | 2c674fa | 2015-05-05 15:02:42 +0800 | [diff] [blame] | 992 | { 0x10ec0298, 0x1028, 0, "ALC3266" }, |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 993 | { 0x10ec0236, 0x1028, 0, "ALC3204" }, |
Kailang Yang | 8232450 | 2015-05-25 17:16:49 +0800 | [diff] [blame] | 994 | { 0x10ec0256, 0x1028, 0, "ALC3246" }, |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 995 | { 0x10ec0225, 0x1028, 0, "ALC3253" }, |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 996 | { 0x10ec0295, 0x1028, 0, "ALC3254" }, |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 997 | { 0x10ec0299, 0x1028, 0, "ALC3271" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 998 | { 0x10ec0670, 0x1025, 0, "ALC669X" }, |
| 999 | { 0x10ec0676, 0x1025, 0, "ALC679X" }, |
| 1000 | { 0x10ec0282, 0x1043, 0, "ALC3229" }, |
| 1001 | { 0x10ec0233, 0x1043, 0, "ALC3236" }, |
| 1002 | { 0x10ec0280, 0x103c, 0, "ALC3228" }, |
| 1003 | { 0x10ec0282, 0x103c, 0, "ALC3227" }, |
| 1004 | { 0x10ec0286, 0x103c, 0, "ALC3242" }, |
| 1005 | { 0x10ec0290, 0x103c, 0, "ALC3241" }, |
| 1006 | { 0x10ec0668, 0x103c, 0, "ALC3662" }, |
| 1007 | { 0x10ec0283, 0x17aa, 0, "ALC3239" }, |
| 1008 | { 0x10ec0292, 0x17aa, 0, "ALC3232" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1009 | { } /* terminator */ |
| 1010 | }; |
| 1011 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1012 | static int alc_codec_rename_from_preset(struct hda_codec *codec) |
| 1013 | { |
| 1014 | const struct alc_codec_rename_table *p; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1015 | const struct alc_codec_rename_pci_table *q; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1016 | |
| 1017 | for (p = rename_tbl; p->vendor_id; p++) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1018 | if (p->vendor_id != codec->core.vendor_id) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1019 | continue; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 1020 | if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1021 | return alc_codec_rename(codec, p->name); |
| 1022 | } |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1023 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 1024 | if (!codec->bus->pci) |
| 1025 | return 0; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1026 | for (q = rename_pci_tbl; q->codec_vendor_id; q++) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 1027 | if (q->codec_vendor_id != codec->core.vendor_id) |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 1028 | continue; |
| 1029 | if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) |
| 1030 | continue; |
| 1031 | if (!q->pci_subdevice || |
| 1032 | q->pci_subdevice == codec->bus->pci->subsystem_device) |
| 1033 | return alc_codec_rename(codec, q->name); |
| 1034 | } |
| 1035 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1036 | return 0; |
| 1037 | } |
| 1038 | |
Takashi Iwai | e477062 | 2011-07-08 11:11:35 +0200 | [diff] [blame] | 1039 | |
| 1040 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1041 | * Digital-beep handlers |
| 1042 | */ |
| 1043 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1044 | |
| 1045 | /* additional beep mixers; private_value will be overwritten */ |
| 1046 | static const struct snd_kcontrol_new alc_beep_mixer[] = { |
| 1047 | HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), |
| 1048 | HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), |
| 1049 | }; |
| 1050 | |
| 1051 | /* set up and create beep controls */ |
| 1052 | static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid, |
| 1053 | int idx, int dir) |
| 1054 | { |
| 1055 | struct snd_kcontrol_new *knew; |
| 1056 | unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir); |
| 1057 | int i; |
| 1058 | |
| 1059 | for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) { |
| 1060 | knew = snd_hda_gen_add_kctl(&spec->gen, NULL, |
| 1061 | &alc_beep_mixer[i]); |
| 1062 | if (!knew) |
| 1063 | return -ENOMEM; |
| 1064 | knew->private_value = beep_amp; |
| 1065 | } |
| 1066 | return 0; |
| 1067 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1068 | |
| 1069 | static const struct snd_pci_quirk beep_white_list[] = { |
Duncan Roe | 7110005 | 2012-10-10 14:19:50 +0200 | [diff] [blame] | 1070 | SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), |
W. Trevor King | a4b7f21d | 2014-03-29 17:47:24 -0700 | [diff] [blame] | 1071 | SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1072 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), |
Takashi Iwai | 8554ee4 | 2013-02-25 09:54:43 +0100 | [diff] [blame] | 1073 | SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1074 | SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), |
| 1075 | SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), |
| 1076 | SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), |
Takashi Iwai | 78f8baf | 2012-03-06 14:02:32 +0100 | [diff] [blame] | 1077 | SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1078 | SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), |
| 1079 | {} |
| 1080 | }; |
| 1081 | |
| 1082 | static inline int has_cdefine_beep(struct hda_codec *codec) |
| 1083 | { |
| 1084 | struct alc_spec *spec = codec->spec; |
| 1085 | const struct snd_pci_quirk *q; |
| 1086 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list); |
| 1087 | if (q) |
| 1088 | return q->value; |
| 1089 | return spec->cdefine.enable_pcbeep; |
| 1090 | } |
| 1091 | #else |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1092 | #define set_beep_amp(spec, nid, idx, dir) 0 |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1093 | #define has_cdefine_beep(codec) 0 |
| 1094 | #endif |
| 1095 | |
| 1096 | /* parse the BIOS configuration and set up the alc_spec */ |
| 1097 | /* return 1 if successful, 0 if the proper config is not found, |
| 1098 | * or a negative error code |
| 1099 | */ |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1100 | static int alc_parse_auto_config(struct hda_codec *codec, |
| 1101 | const hda_nid_t *ignore_nids, |
| 1102 | const hda_nid_t *ssid_nids) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1103 | { |
| 1104 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1105 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1106 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1107 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 1108 | err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, |
| 1109 | spec->parse_flags); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1110 | if (err < 0) |
| 1111 | return err; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1112 | |
| 1113 | if (ssid_nids) |
| 1114 | alc_ssid_check(codec, ssid_nids); |
| 1115 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1116 | err = snd_hda_gen_parse_auto_config(codec, cfg); |
| 1117 | if (err < 0) |
| 1118 | return err; |
Takashi Iwai | 070cff4 | 2012-02-21 12:54:17 +0100 | [diff] [blame] | 1119 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1120 | return 1; |
| 1121 | } |
| 1122 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1123 | /* common preparation job for alc_spec */ |
| 1124 | static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) |
| 1125 | { |
| 1126 | struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
| 1127 | int err; |
| 1128 | |
| 1129 | if (!spec) |
| 1130 | return -ENOMEM; |
| 1131 | codec->spec = spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1132 | snd_hda_gen_spec_init(&spec->gen); |
| 1133 | spec->gen.mixer_nid = mixer_nid; |
| 1134 | spec->gen.own_eapd_ctl = 1; |
Takashi Iwai | 1098b7c | 2012-12-17 20:03:15 +0100 | [diff] [blame] | 1135 | codec->single_adc_amp = 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1136 | /* FIXME: do we need this for all Realtek codec models? */ |
| 1137 | codec->spdif_status_reset = 1; |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1138 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1139 | |
| 1140 | err = alc_codec_rename_from_preset(codec); |
| 1141 | if (err < 0) { |
| 1142 | kfree(spec); |
| 1143 | return err; |
| 1144 | } |
| 1145 | return 0; |
| 1146 | } |
| 1147 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1148 | static int alc880_parse_auto_config(struct hda_codec *codec) |
| 1149 | { |
| 1150 | static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 1151 | static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1152 | return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); |
| 1153 | } |
| 1154 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1155 | /* |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1156 | * ALC880 fix-ups |
| 1157 | */ |
| 1158 | enum { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1159 | ALC880_FIXUP_GPIO1, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1160 | ALC880_FIXUP_GPIO2, |
| 1161 | ALC880_FIXUP_MEDION_RIM, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1162 | ALC880_FIXUP_LG, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1163 | ALC880_FIXUP_LG_LW25, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1164 | ALC880_FIXUP_W810, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1165 | ALC880_FIXUP_EAPD_COEF, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1166 | ALC880_FIXUP_TCL_S700, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1167 | ALC880_FIXUP_VOL_KNOB, |
| 1168 | ALC880_FIXUP_FUJITSU, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1169 | ALC880_FIXUP_F1734, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1170 | ALC880_FIXUP_UNIWILL, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1171 | ALC880_FIXUP_UNIWILL_DIG, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1172 | ALC880_FIXUP_Z71V, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1173 | ALC880_FIXUP_ASUS_W5A, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1174 | ALC880_FIXUP_3ST_BASE, |
| 1175 | ALC880_FIXUP_3ST, |
| 1176 | ALC880_FIXUP_3ST_DIG, |
| 1177 | ALC880_FIXUP_5ST_BASE, |
| 1178 | ALC880_FIXUP_5ST, |
| 1179 | ALC880_FIXUP_5ST_DIG, |
| 1180 | ALC880_FIXUP_6ST_BASE, |
| 1181 | ALC880_FIXUP_6ST, |
| 1182 | ALC880_FIXUP_6ST_DIG, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1183 | ALC880_FIXUP_6ST_AUTOMUTE, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1184 | }; |
| 1185 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1186 | /* enable the volume-knob widget support on NID 0x21 */ |
| 1187 | static void alc880_fixup_vol_knob(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1188 | const struct hda_fixup *fix, int action) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1189 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1190 | if (action == HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1191 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
| 1192 | alc_update_knob_master); |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1193 | } |
| 1194 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1195 | static const struct hda_fixup alc880_fixups[] = { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1196 | [ALC880_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1197 | .type = HDA_FIXUP_FUNC, |
| 1198 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1199 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1200 | [ALC880_FIXUP_GPIO2] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1201 | .type = HDA_FIXUP_FUNC, |
| 1202 | .v.func = alc_fixup_gpio2, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1203 | }, |
| 1204 | [ALC880_FIXUP_MEDION_RIM] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1205 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1206 | .v.verbs = (const struct hda_verb[]) { |
| 1207 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1208 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1209 | { } |
| 1210 | }, |
| 1211 | .chained = true, |
| 1212 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1213 | }, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1214 | [ALC880_FIXUP_LG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1215 | .type = HDA_FIXUP_PINS, |
| 1216 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1217 | /* disable bogus unused pins */ |
| 1218 | { 0x16, 0x411111f0 }, |
| 1219 | { 0x18, 0x411111f0 }, |
| 1220 | { 0x1a, 0x411111f0 }, |
| 1221 | { } |
| 1222 | } |
| 1223 | }, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1224 | [ALC880_FIXUP_LG_LW25] = { |
| 1225 | .type = HDA_FIXUP_PINS, |
| 1226 | .v.pins = (const struct hda_pintbl[]) { |
| 1227 | { 0x1a, 0x0181344f }, /* line-in */ |
| 1228 | { 0x1b, 0x0321403f }, /* headphone */ |
| 1229 | { } |
| 1230 | } |
| 1231 | }, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1232 | [ALC880_FIXUP_W810] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1233 | .type = HDA_FIXUP_PINS, |
| 1234 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1235 | /* disable bogus unused pins */ |
| 1236 | { 0x17, 0x411111f0 }, |
| 1237 | { } |
| 1238 | }, |
| 1239 | .chained = true, |
| 1240 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1241 | }, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1242 | [ALC880_FIXUP_EAPD_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1243 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1244 | .v.verbs = (const struct hda_verb[]) { |
| 1245 | /* change to EAPD mode */ |
| 1246 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1247 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1248 | {} |
| 1249 | }, |
| 1250 | }, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1251 | [ALC880_FIXUP_TCL_S700] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1252 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1253 | .v.verbs = (const struct hda_verb[]) { |
| 1254 | /* change to EAPD mode */ |
| 1255 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1256 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 1257 | {} |
| 1258 | }, |
| 1259 | .chained = true, |
| 1260 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1261 | }, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1262 | [ALC880_FIXUP_VOL_KNOB] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1263 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1264 | .v.func = alc880_fixup_vol_knob, |
| 1265 | }, |
| 1266 | [ALC880_FIXUP_FUJITSU] = { |
| 1267 | /* override all pins as BIOS on old Amilo is broken */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1268 | .type = HDA_FIXUP_PINS, |
| 1269 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | bb148bd | 2015-08-13 18:02:39 +0200 | [diff] [blame] | 1270 | { 0x14, 0x0121401f }, /* HP */ |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1271 | { 0x15, 0x99030120 }, /* speaker */ |
| 1272 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1273 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1274 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1275 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1276 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1277 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1278 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1279 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1280 | { 0x1e, 0x01454140 }, /* SPDIF out */ |
| 1281 | { } |
| 1282 | }, |
| 1283 | .chained = true, |
| 1284 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1285 | }, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1286 | [ALC880_FIXUP_F1734] = { |
| 1287 | /* almost compatible with FUJITSU, but no bass and SPDIF */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1288 | .type = HDA_FIXUP_PINS, |
| 1289 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | bb148bd | 2015-08-13 18:02:39 +0200 | [diff] [blame] | 1290 | { 0x14, 0x0121401f }, /* HP */ |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1291 | { 0x15, 0x99030120 }, /* speaker */ |
| 1292 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1293 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1294 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1295 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1296 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1297 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1298 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1299 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1300 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1301 | { } |
| 1302 | }, |
| 1303 | .chained = true, |
| 1304 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1305 | }, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1306 | [ALC880_FIXUP_UNIWILL] = { |
| 1307 | /* need to fix HP and speaker pins to be parsed correctly */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1308 | .type = HDA_FIXUP_PINS, |
| 1309 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1310 | { 0x14, 0x0121411f }, /* HP */ |
| 1311 | { 0x15, 0x99030120 }, /* speaker */ |
| 1312 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1313 | { } |
| 1314 | }, |
| 1315 | }, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1316 | [ALC880_FIXUP_UNIWILL_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1317 | .type = HDA_FIXUP_PINS, |
| 1318 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1319 | /* disable bogus unused pins */ |
| 1320 | { 0x17, 0x411111f0 }, |
| 1321 | { 0x19, 0x411111f0 }, |
| 1322 | { 0x1b, 0x411111f0 }, |
| 1323 | { 0x1f, 0x411111f0 }, |
| 1324 | { } |
| 1325 | } |
| 1326 | }, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1327 | [ALC880_FIXUP_Z71V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1328 | .type = HDA_FIXUP_PINS, |
| 1329 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1330 | /* set up the whole pins as BIOS is utterly broken */ |
| 1331 | { 0x14, 0x99030120 }, /* speaker */ |
| 1332 | { 0x15, 0x0121411f }, /* HP */ |
| 1333 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1334 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1335 | { 0x18, 0x01a19950 }, /* mic-in */ |
| 1336 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1337 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1338 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1339 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1340 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1341 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1342 | { } |
| 1343 | } |
| 1344 | }, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1345 | [ALC880_FIXUP_ASUS_W5A] = { |
| 1346 | .type = HDA_FIXUP_PINS, |
| 1347 | .v.pins = (const struct hda_pintbl[]) { |
| 1348 | /* set up the whole pins as BIOS is utterly broken */ |
| 1349 | { 0x14, 0x0121411f }, /* HP */ |
| 1350 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1351 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1352 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1353 | { 0x18, 0x90a60160 }, /* mic */ |
| 1354 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1355 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1356 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1357 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1358 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1359 | { 0x1e, 0xb743111e }, /* SPDIF out */ |
| 1360 | { } |
| 1361 | }, |
| 1362 | .chained = true, |
| 1363 | .chain_id = ALC880_FIXUP_GPIO1, |
| 1364 | }, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1365 | [ALC880_FIXUP_3ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1366 | .type = HDA_FIXUP_PINS, |
| 1367 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1368 | { 0x14, 0x01014010 }, /* line-out */ |
| 1369 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1370 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1371 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1372 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1373 | { 0x19, 0x0121411f }, /* HP */ |
| 1374 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1375 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1376 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1377 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1378 | /* 0x1e is filled in below */ |
| 1379 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1380 | { } |
| 1381 | } |
| 1382 | }, |
| 1383 | [ALC880_FIXUP_3ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1384 | .type = HDA_FIXUP_PINS, |
| 1385 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1386 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1387 | { } |
| 1388 | }, |
| 1389 | .chained = true, |
| 1390 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1391 | }, |
| 1392 | [ALC880_FIXUP_3ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1393 | .type = HDA_FIXUP_PINS, |
| 1394 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1395 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1396 | { } |
| 1397 | }, |
| 1398 | .chained = true, |
| 1399 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1400 | }, |
| 1401 | [ALC880_FIXUP_5ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1402 | .type = HDA_FIXUP_PINS, |
| 1403 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1404 | { 0x14, 0x01014010 }, /* front */ |
| 1405 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1406 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1407 | { 0x17, 0x01016412 }, /* surr */ |
| 1408 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1409 | { 0x19, 0x0121411f }, /* HP */ |
| 1410 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1411 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1412 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1413 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1414 | /* 0x1e is filled in below */ |
| 1415 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1416 | { } |
| 1417 | } |
| 1418 | }, |
| 1419 | [ALC880_FIXUP_5ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1420 | .type = HDA_FIXUP_PINS, |
| 1421 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1422 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1423 | { } |
| 1424 | }, |
| 1425 | .chained = true, |
| 1426 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1427 | }, |
| 1428 | [ALC880_FIXUP_5ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1429 | .type = HDA_FIXUP_PINS, |
| 1430 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1431 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1432 | { } |
| 1433 | }, |
| 1434 | .chained = true, |
| 1435 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1436 | }, |
| 1437 | [ALC880_FIXUP_6ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1438 | .type = HDA_FIXUP_PINS, |
| 1439 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1440 | { 0x14, 0x01014010 }, /* front */ |
| 1441 | { 0x15, 0x01016412 }, /* surr */ |
| 1442 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1443 | { 0x17, 0x01012414 }, /* side */ |
| 1444 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1445 | { 0x19, 0x02a19c40 }, /* front-mic */ |
| 1446 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1447 | { 0x1b, 0x0121411f }, /* HP */ |
| 1448 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1449 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1450 | /* 0x1e is filled in below */ |
| 1451 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1452 | { } |
| 1453 | } |
| 1454 | }, |
| 1455 | [ALC880_FIXUP_6ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1456 | .type = HDA_FIXUP_PINS, |
| 1457 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1458 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1459 | { } |
| 1460 | }, |
| 1461 | .chained = true, |
| 1462 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1463 | }, |
| 1464 | [ALC880_FIXUP_6ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1465 | .type = HDA_FIXUP_PINS, |
| 1466 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1467 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1468 | { } |
| 1469 | }, |
| 1470 | .chained = true, |
| 1471 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1472 | }, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1473 | [ALC880_FIXUP_6ST_AUTOMUTE] = { |
| 1474 | .type = HDA_FIXUP_PINS, |
| 1475 | .v.pins = (const struct hda_pintbl[]) { |
| 1476 | { 0x1b, 0x0121401f }, /* HP with jack detect */ |
| 1477 | { } |
| 1478 | }, |
| 1479 | .chained_before = true, |
| 1480 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1481 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1482 | }; |
| 1483 | |
| 1484 | static const struct snd_pci_quirk alc880_fixup_tbl[] = { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1485 | SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1486 | SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1487 | SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1488 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), |
David Henningsson | 6538de0 | 2014-06-10 10:52:50 +0200 | [diff] [blame] | 1489 | SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1490 | SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1491 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1492 | SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1493 | SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1494 | SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), |
Takashi Iwai | 7833c7e | 2012-02-20 17:11:38 +0100 | [diff] [blame] | 1495 | SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1496 | SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1497 | SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1498 | SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | a161574 | 2015-08-13 18:05:06 +0200 | [diff] [blame] | 1499 | SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1500 | SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1501 | SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1502 | SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1503 | SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), |
| 1504 | SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), |
| 1505 | SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1506 | SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1507 | SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1508 | |
| 1509 | /* Below is the copied entries from alc880_quirks.c. |
| 1510 | * It's not quite sure whether BIOS sets the correct pin-config table |
| 1511 | * on these machines, thus they are kept to be compatible with |
| 1512 | * the old static quirks. Once when it's confirmed to work without |
| 1513 | * these overrides, it'd be better to remove. |
| 1514 | */ |
| 1515 | SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), |
| 1516 | SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), |
| 1517 | SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1518 | SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1519 | SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1520 | SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1521 | SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1522 | SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), |
| 1523 | SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), |
| 1524 | SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), |
| 1525 | SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), |
| 1526 | SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), |
| 1527 | SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), |
| 1528 | SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), |
| 1529 | SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), |
| 1530 | SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), |
| 1531 | SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), |
| 1532 | SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), |
| 1533 | SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), |
| 1534 | SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), |
| 1535 | SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), |
| 1536 | SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ |
| 1537 | SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), |
| 1538 | SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1539 | SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1540 | SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1541 | SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1542 | SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1543 | SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1544 | SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1545 | SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1546 | SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1547 | SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1548 | /* default Intel */ |
| 1549 | SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), |
| 1550 | SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), |
| 1551 | SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), |
| 1552 | {} |
| 1553 | }; |
| 1554 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1555 | static const struct hda_model_fixup alc880_fixup_models[] = { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1556 | {.id = ALC880_FIXUP_3ST, .name = "3stack"}, |
| 1557 | {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, |
| 1558 | {.id = ALC880_FIXUP_5ST, .name = "5stack"}, |
| 1559 | {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, |
| 1560 | {.id = ALC880_FIXUP_6ST, .name = "6stack"}, |
| 1561 | {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1562 | {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1563 | {} |
| 1564 | }; |
| 1565 | |
| 1566 | |
| 1567 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1568 | * OK, here we have finally the patch for ALC880 |
| 1569 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1570 | static int patch_alc880(struct hda_codec *codec) |
| 1571 | { |
| 1572 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1573 | int err; |
| 1574 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1575 | err = alc_alloc_spec(codec, 0x0b); |
| 1576 | if (err < 0) |
| 1577 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1578 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1579 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1580 | spec->gen.need_dac_fix = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1581 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1582 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1583 | codec->patch_ops.unsol_event = alc880_unsol_event; |
| 1584 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 1585 | alc_pre_init(codec); |
| 1586 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1587 | snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1588 | alc880_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1589 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1590 | |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1591 | /* automatic parse from the BIOS config */ |
| 1592 | err = alc880_parse_auto_config(codec); |
| 1593 | if (err < 0) |
| 1594 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1595 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1596 | if (!spec->gen.no_analog) { |
| 1597 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 1598 | if (err < 0) |
| 1599 | goto error; |
| 1600 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1601 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1602 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1603 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1604 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1605 | |
| 1606 | error: |
| 1607 | alc_free(codec); |
| 1608 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1609 | } |
| 1610 | |
| 1611 | |
| 1612 | /* |
| 1613 | * ALC260 support |
| 1614 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1615 | static int alc260_parse_auto_config(struct hda_codec *codec) |
| 1616 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1617 | static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1618 | static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; |
| 1619 | return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1620 | } |
| 1621 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1622 | /* |
| 1623 | * Pin config fixes |
| 1624 | */ |
| 1625 | enum { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1626 | ALC260_FIXUP_HP_DC5750, |
| 1627 | ALC260_FIXUP_HP_PIN_0F, |
| 1628 | ALC260_FIXUP_COEF, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1629 | ALC260_FIXUP_GPIO1, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1630 | ALC260_FIXUP_GPIO1_TOGGLE, |
| 1631 | ALC260_FIXUP_REPLACER, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1632 | ALC260_FIXUP_HP_B1900, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1633 | ALC260_FIXUP_KN1, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1634 | ALC260_FIXUP_FSC_S7020, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1635 | ALC260_FIXUP_FSC_S7020_JWSE, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1636 | ALC260_FIXUP_VAIO_PINS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1637 | }; |
| 1638 | |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1639 | static void alc260_gpio1_automute(struct hda_codec *codec) |
| 1640 | { |
| 1641 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | aaf312d | 2018-06-19 22:28:22 +0200 | [diff] [blame] | 1642 | |
| 1643 | alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1644 | } |
| 1645 | |
| 1646 | static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1647 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1648 | { |
| 1649 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1650 | if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1651 | /* although the machine has only one output pin, we need to |
| 1652 | * toggle GPIO1 according to the jack state |
| 1653 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1654 | spec->gen.automute_hook = alc260_gpio1_automute; |
| 1655 | spec->gen.detect_hp = 1; |
| 1656 | spec->gen.automute_speaker = 1; |
| 1657 | spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1658 | snd_hda_jack_detect_enable_callback(codec, 0x0f, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1659 | snd_hda_gen_hp_automute); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1660 | alc_setup_gpio(codec, 0x01); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1661 | } |
| 1662 | } |
| 1663 | |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1664 | static void alc260_fixup_kn1(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1665 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1666 | { |
| 1667 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1668 | static const struct hda_pintbl pincfgs[] = { |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1669 | { 0x0f, 0x02214000 }, /* HP/speaker */ |
| 1670 | { 0x12, 0x90a60160 }, /* int mic */ |
| 1671 | { 0x13, 0x02a19000 }, /* ext mic */ |
| 1672 | { 0x18, 0x01446000 }, /* SPDIF out */ |
| 1673 | /* disable bogus I/O pins */ |
| 1674 | { 0x10, 0x411111f0 }, |
| 1675 | { 0x11, 0x411111f0 }, |
| 1676 | { 0x14, 0x411111f0 }, |
| 1677 | { 0x15, 0x411111f0 }, |
| 1678 | { 0x16, 0x411111f0 }, |
| 1679 | { 0x17, 0x411111f0 }, |
| 1680 | { 0x19, 0x411111f0 }, |
| 1681 | { } |
| 1682 | }; |
| 1683 | |
| 1684 | switch (action) { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1685 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 1686 | snd_hda_apply_pincfgs(codec, pincfgs); |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1687 | spec->init_amp = ALC_INIT_NONE; |
| 1688 | break; |
| 1689 | } |
| 1690 | } |
| 1691 | |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1692 | static void alc260_fixup_fsc_s7020(struct hda_codec *codec, |
| 1693 | const struct hda_fixup *fix, int action) |
| 1694 | { |
| 1695 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 1696 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1697 | spec->init_amp = ALC_INIT_NONE; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1698 | } |
| 1699 | |
| 1700 | static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, |
| 1701 | const struct hda_fixup *fix, int action) |
| 1702 | { |
| 1703 | struct alc_spec *spec = codec->spec; |
| 1704 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | f811c3c | 2013-03-07 18:32:59 +0100 | [diff] [blame] | 1705 | spec->gen.add_jack_modes = 1; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1706 | spec->gen.hp_mic = 1; |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1707 | } |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1708 | } |
| 1709 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1710 | static const struct hda_fixup alc260_fixups[] = { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1711 | [ALC260_FIXUP_HP_DC5750] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1712 | .type = HDA_FIXUP_PINS, |
| 1713 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1714 | { 0x11, 0x90130110 }, /* speaker */ |
| 1715 | { } |
| 1716 | } |
| 1717 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1718 | [ALC260_FIXUP_HP_PIN_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1719 | .type = HDA_FIXUP_PINS, |
| 1720 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1721 | { 0x0f, 0x01214000 }, /* HP */ |
| 1722 | { } |
| 1723 | } |
| 1724 | }, |
| 1725 | [ALC260_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1726 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1727 | .v.verbs = (const struct hda_verb[]) { |
Ronan Marquet | e30cf2d | 2014-06-01 18:38:53 +0200 | [diff] [blame] | 1728 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1729 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1730 | { } |
| 1731 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1732 | }, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1733 | [ALC260_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1734 | .type = HDA_FIXUP_FUNC, |
| 1735 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1736 | }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1737 | [ALC260_FIXUP_GPIO1_TOGGLE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1738 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1739 | .v.func = alc260_fixup_gpio1_toggle, |
| 1740 | .chained = true, |
| 1741 | .chain_id = ALC260_FIXUP_HP_PIN_0F, |
| 1742 | }, |
| 1743 | [ALC260_FIXUP_REPLACER] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1744 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1745 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | 192a98e | 2014-06-02 15:16:07 +0200 | [diff] [blame] | 1746 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1747 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1748 | { } |
| 1749 | }, |
| 1750 | .chained = true, |
| 1751 | .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, |
| 1752 | }, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1753 | [ALC260_FIXUP_HP_B1900] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1754 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1755 | .v.func = alc260_fixup_gpio1_toggle, |
| 1756 | .chained = true, |
| 1757 | .chain_id = ALC260_FIXUP_COEF, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1758 | }, |
| 1759 | [ALC260_FIXUP_KN1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1760 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1761 | .v.func = alc260_fixup_kn1, |
| 1762 | }, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1763 | [ALC260_FIXUP_FSC_S7020] = { |
| 1764 | .type = HDA_FIXUP_FUNC, |
| 1765 | .v.func = alc260_fixup_fsc_s7020, |
| 1766 | }, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1767 | [ALC260_FIXUP_FSC_S7020_JWSE] = { |
| 1768 | .type = HDA_FIXUP_FUNC, |
| 1769 | .v.func = alc260_fixup_fsc_s7020_jwse, |
| 1770 | .chained = true, |
| 1771 | .chain_id = ALC260_FIXUP_FSC_S7020, |
| 1772 | }, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1773 | [ALC260_FIXUP_VAIO_PINS] = { |
| 1774 | .type = HDA_FIXUP_PINS, |
| 1775 | .v.pins = (const struct hda_pintbl[]) { |
| 1776 | /* Pin configs are missing completely on some VAIOs */ |
| 1777 | { 0x0f, 0x01211020 }, |
| 1778 | { 0x10, 0x0001003f }, |
| 1779 | { 0x11, 0x411111f0 }, |
| 1780 | { 0x12, 0x01a15930 }, |
| 1781 | { 0x13, 0x411111f0 }, |
| 1782 | { 0x14, 0x411111f0 }, |
| 1783 | { 0x15, 0x411111f0 }, |
| 1784 | { 0x16, 0x411111f0 }, |
| 1785 | { 0x17, 0x411111f0 }, |
| 1786 | { 0x18, 0x411111f0 }, |
| 1787 | { 0x19, 0x411111f0 }, |
| 1788 | { } |
| 1789 | } |
| 1790 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1791 | }; |
| 1792 | |
| 1793 | static const struct snd_pci_quirk alc260_fixup_tbl[] = { |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1794 | SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1795 | SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1796 | SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1797 | SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1798 | SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1799 | SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), |
Takashi Iwai | 0f5a5b8 | 2013-11-21 09:12:52 +0100 | [diff] [blame] | 1800 | 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] | 1801 | SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), |
Takashi Iwai | b1f5808 | 2012-02-16 12:45:03 +0100 | [diff] [blame] | 1802 | SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1803 | SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1804 | SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1805 | SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1806 | {} |
| 1807 | }; |
| 1808 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1809 | static const struct hda_model_fixup alc260_fixup_models[] = { |
| 1810 | {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, |
| 1811 | {.id = ALC260_FIXUP_COEF, .name = "coef"}, |
| 1812 | {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, |
| 1813 | {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, |
| 1814 | {} |
| 1815 | }; |
| 1816 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1817 | /* |
| 1818 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1819 | static int patch_alc260(struct hda_codec *codec) |
| 1820 | { |
| 1821 | struct alc_spec *spec; |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1822 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1823 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1824 | err = alc_alloc_spec(codec, 0x07); |
| 1825 | if (err < 0) |
| 1826 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1827 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1828 | spec = codec->spec; |
Takashi Iwai | ea46c3c | 2013-01-15 18:45:53 +0100 | [diff] [blame] | 1829 | /* as quite a few machines require HP amp for speaker outputs, |
| 1830 | * it's easier to enable it unconditionally; even if it's unneeded, |
| 1831 | * it's almost harmless. |
| 1832 | */ |
| 1833 | spec->gen.prefer_hp_amp = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1834 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1835 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1836 | spec->shutup = alc_eapd_shutup; |
| 1837 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 1838 | alc_pre_init(codec); |
| 1839 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1840 | snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, |
| 1841 | alc260_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1842 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1843 | |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1844 | /* automatic parse from the BIOS config */ |
| 1845 | err = alc260_parse_auto_config(codec); |
| 1846 | if (err < 0) |
| 1847 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1848 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1849 | if (!spec->gen.no_analog) { |
| 1850 | err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); |
| 1851 | if (err < 0) |
| 1852 | goto error; |
| 1853 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1854 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1855 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1856 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1857 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1858 | |
| 1859 | error: |
| 1860 | alc_free(codec); |
| 1861 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1862 | } |
| 1863 | |
| 1864 | |
| 1865 | /* |
| 1866 | * ALC882/883/885/888/889 support |
| 1867 | * |
| 1868 | * ALC882 is almost identical with ALC880 but has cleaner and more flexible |
| 1869 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 1870 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 1871 | * 6-channel independent captures. |
| 1872 | * |
| 1873 | * In addition, an independent DAC for the multi-playback (not used in this |
| 1874 | * driver yet). |
| 1875 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1876 | |
| 1877 | /* |
| 1878 | * Pin config fixes |
| 1879 | */ |
| 1880 | enum { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1881 | ALC882_FIXUP_ABIT_AW9D_MAX, |
| 1882 | ALC882_FIXUP_LENOVO_Y530, |
| 1883 | ALC882_FIXUP_PB_M5210, |
| 1884 | ALC882_FIXUP_ACER_ASPIRE_7736, |
| 1885 | ALC882_FIXUP_ASUS_W90V, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 1886 | ALC889_FIXUP_CD, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 1887 | ALC889_FIXUP_FRONT_HP_NO_PRESENCE, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1888 | ALC889_FIXUP_VAIO_TT, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 1889 | ALC888_FIXUP_EEE1601, |
Takashi Iwai | 177943a | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 1890 | ALC882_FIXUP_EAPD, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 1891 | ALC883_FIXUP_EAPD, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 1892 | ALC883_FIXUP_ACER_EAPD, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1893 | ALC882_FIXUP_GPIO1, |
| 1894 | ALC882_FIXUP_GPIO2, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 1895 | ALC882_FIXUP_GPIO3, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1896 | ALC889_FIXUP_COEF, |
| 1897 | ALC882_FIXUP_ASUS_W2JC, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 1898 | ALC882_FIXUP_ACER_ASPIRE_4930G, |
| 1899 | ALC882_FIXUP_ACER_ASPIRE_8930G, |
| 1900 | ALC882_FIXUP_ASPIRE_8930G_VERBS, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1901 | ALC885_FIXUP_MACPRO_GPIO, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1902 | ALC889_FIXUP_DAC_ROUTE, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1903 | ALC889_FIXUP_MBP_VREF, |
| 1904 | ALC889_FIXUP_IMAC91_VREF, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 1905 | ALC889_FIXUP_MBA11_VREF, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1906 | ALC889_FIXUP_MBA21_VREF, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 1907 | ALC889_FIXUP_MP11_VREF, |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 1908 | ALC889_FIXUP_MP41_VREF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 1909 | ALC882_FIXUP_INV_DMIC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1910 | ALC882_FIXUP_NO_PRIMARY_HP, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 1911 | ALC887_FIXUP_ASUS_BASS, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 1912 | ALC887_FIXUP_BASS_CHMAP, |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 1913 | ALC1220_FIXUP_GB_DUAL_CODECS, |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 1914 | ALC1220_FIXUP_CLEVO_P950, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 1915 | ALC1220_FIXUP_CLEVO_PB51ED, |
| 1916 | ALC1220_FIXUP_CLEVO_PB51ED_PINS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1917 | }; |
| 1918 | |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1919 | static void alc889_fixup_coef(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1920 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1921 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1922 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1923 | return; |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 1924 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1925 | } |
| 1926 | |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1927 | /* set up GPIO at initialization */ |
| 1928 | static void alc885_fixup_macpro_gpio(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1929 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1930 | { |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 1931 | struct alc_spec *spec = codec->spec; |
| 1932 | |
| 1933 | spec->gpio_write_delay = true; |
| 1934 | alc_fixup_gpio3(codec, fix, action); |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1935 | } |
| 1936 | |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1937 | /* Fix the connection of some pins for ALC889: |
| 1938 | * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't |
| 1939 | * work correctly (bko#42740) |
| 1940 | */ |
| 1941 | static void alc889_fixup_dac_route(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1942 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1943 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1944 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1945 | /* fake the connections during parsing the tree */ |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1946 | hda_nid_t conn1[2] = { 0x0c, 0x0d }; |
| 1947 | hda_nid_t conn2[2] = { 0x0e, 0x0f }; |
| 1948 | snd_hda_override_conn_list(codec, 0x14, 2, conn1); |
| 1949 | snd_hda_override_conn_list(codec, 0x15, 2, conn1); |
| 1950 | snd_hda_override_conn_list(codec, 0x18, 2, conn2); |
| 1951 | snd_hda_override_conn_list(codec, 0x1a, 2, conn2); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1952 | } else if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1953 | /* restore the connections */ |
| 1954 | hda_nid_t conn[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; |
| 1955 | snd_hda_override_conn_list(codec, 0x14, 5, conn); |
| 1956 | snd_hda_override_conn_list(codec, 0x15, 5, conn); |
| 1957 | snd_hda_override_conn_list(codec, 0x18, 5, conn); |
| 1958 | snd_hda_override_conn_list(codec, 0x1a, 5, conn); |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1959 | } |
| 1960 | } |
| 1961 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1962 | /* Set VREF on HP pin */ |
| 1963 | static void alc889_fixup_mbp_vref(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1964 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1965 | { |
| 1966 | struct alc_spec *spec = codec->spec; |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 1967 | static hda_nid_t nids[3] = { 0x14, 0x15, 0x19 }; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1968 | int i; |
| 1969 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1970 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1971 | return; |
| 1972 | for (i = 0; i < ARRAY_SIZE(nids); i++) { |
| 1973 | unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); |
| 1974 | if (get_defcfg_device(val) != AC_JACK_HP_OUT) |
| 1975 | continue; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 1976 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1977 | val |= AC_PINCTL_VREF_80; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 1978 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1979 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1980 | break; |
| 1981 | } |
| 1982 | } |
| 1983 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1984 | static void alc889_fixup_mac_pins(struct hda_codec *codec, |
| 1985 | const hda_nid_t *nids, int num_nids) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1986 | { |
| 1987 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1988 | int i; |
| 1989 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1990 | for (i = 0; i < num_nids; i++) { |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1991 | unsigned int val; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 1992 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1993 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 1994 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1995 | } |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1996 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1997 | } |
| 1998 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1999 | /* Set VREF on speaker pins on imac91 */ |
| 2000 | static void alc889_fixup_imac91_vref(struct hda_codec *codec, |
| 2001 | const struct hda_fixup *fix, int action) |
| 2002 | { |
| 2003 | static hda_nid_t nids[2] = { 0x18, 0x1a }; |
| 2004 | |
| 2005 | if (action == HDA_FIXUP_ACT_INIT) |
| 2006 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 2007 | } |
| 2008 | |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2009 | /* Set VREF on speaker pins on mba11 */ |
| 2010 | static void alc889_fixup_mba11_vref(struct hda_codec *codec, |
| 2011 | const struct hda_fixup *fix, int action) |
| 2012 | { |
| 2013 | static hda_nid_t nids[1] = { 0x18 }; |
| 2014 | |
| 2015 | if (action == HDA_FIXUP_ACT_INIT) |
| 2016 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 2017 | } |
| 2018 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2019 | /* Set VREF on speaker pins on mba21 */ |
| 2020 | static void alc889_fixup_mba21_vref(struct hda_codec *codec, |
| 2021 | const struct hda_fixup *fix, int action) |
| 2022 | { |
| 2023 | static hda_nid_t nids[2] = { 0x18, 0x19 }; |
| 2024 | |
| 2025 | if (action == HDA_FIXUP_ACT_INIT) |
| 2026 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 2027 | } |
| 2028 | |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2029 | /* Don't take HP output as primary |
Fernando Luis Vázquez Cao | d911149 | 2013-02-12 16:49:46 +0900 | [diff] [blame] | 2030 | * Strangely, the speaker output doesn't work on Vaio Z and some Vaio |
| 2031 | * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2032 | */ |
| 2033 | static void alc882_fixup_no_primary_hp(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2034 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2035 | { |
| 2036 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 2037 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2038 | spec->gen.no_primary_hp = 1; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 2039 | spec->gen.no_multi_io = 1; |
| 2040 | } |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2041 | } |
| 2042 | |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2043 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
| 2044 | const struct hda_fixup *fix, int action); |
| 2045 | |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 2046 | /* For dual-codec configuration, we need to disable some features to avoid |
| 2047 | * conflicts of kctls and PCM streams |
| 2048 | */ |
| 2049 | static void alc_fixup_dual_codecs(struct hda_codec *codec, |
| 2050 | const struct hda_fixup *fix, int action) |
| 2051 | { |
| 2052 | struct alc_spec *spec = codec->spec; |
| 2053 | |
| 2054 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2055 | return; |
| 2056 | /* disable vmaster */ |
| 2057 | spec->gen.suppress_vmaster = 1; |
| 2058 | /* auto-mute and auto-mic switch don't work with multiple codecs */ |
| 2059 | spec->gen.suppress_auto_mute = 1; |
| 2060 | spec->gen.suppress_auto_mic = 1; |
| 2061 | /* disable aamix as well */ |
| 2062 | spec->gen.mixer_nid = 0; |
| 2063 | /* add location prefix to avoid conflicts */ |
| 2064 | codec->force_pin_prefix = 1; |
| 2065 | } |
| 2066 | |
| 2067 | static void rename_ctl(struct hda_codec *codec, const char *oldname, |
| 2068 | const char *newname) |
| 2069 | { |
| 2070 | struct snd_kcontrol *kctl; |
| 2071 | |
| 2072 | kctl = snd_hda_find_mixer_ctl(codec, oldname); |
| 2073 | if (kctl) |
| 2074 | strcpy(kctl->id.name, newname); |
| 2075 | } |
| 2076 | |
| 2077 | static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, |
| 2078 | const struct hda_fixup *fix, |
| 2079 | int action) |
| 2080 | { |
| 2081 | alc_fixup_dual_codecs(codec, fix, action); |
| 2082 | switch (action) { |
| 2083 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 2084 | /* override card longname to provide a unique UCM profile */ |
| 2085 | strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); |
| 2086 | break; |
| 2087 | case HDA_FIXUP_ACT_BUILD: |
| 2088 | /* rename Capture controls depending on the codec */ |
| 2089 | rename_ctl(codec, "Capture Volume", |
| 2090 | codec->addr == 0 ? |
| 2091 | "Rear-Panel Capture Volume" : |
| 2092 | "Front-Panel Capture Volume"); |
| 2093 | rename_ctl(codec, "Capture Switch", |
| 2094 | codec->addr == 0 ? |
| 2095 | "Rear-Panel Capture Switch" : |
| 2096 | "Front-Panel Capture Switch"); |
| 2097 | break; |
| 2098 | } |
| 2099 | } |
| 2100 | |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2101 | static void alc1220_fixup_clevo_p950(struct hda_codec *codec, |
| 2102 | const struct hda_fixup *fix, |
| 2103 | int action) |
| 2104 | { |
| 2105 | hda_nid_t conn1[1] = { 0x0c }; |
| 2106 | |
| 2107 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2108 | return; |
| 2109 | |
| 2110 | alc_update_coef_idx(codec, 0x7, 0, 0x3c3); |
| 2111 | /* We therefore want to make sure 0x14 (front headphone) and |
| 2112 | * 0x1b (speakers) use the stereo DAC 0x02 |
| 2113 | */ |
| 2114 | snd_hda_override_conn_list(codec, 0x14, 1, conn1); |
| 2115 | snd_hda_override_conn_list(codec, 0x1b, 1, conn1); |
| 2116 | } |
| 2117 | |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2118 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
| 2119 | const struct hda_fixup *fix, int action); |
| 2120 | |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2121 | static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2122 | const struct hda_fixup *fix, |
| 2123 | int action) |
| 2124 | { |
| 2125 | alc1220_fixup_clevo_p950(codec, fix, action); |
| 2126 | alc_fixup_headset_mode_no_hp_mic(codec, fix, action); |
| 2127 | } |
| 2128 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2129 | static const struct hda_fixup alc882_fixups[] = { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2130 | [ALC882_FIXUP_ABIT_AW9D_MAX] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2131 | .type = HDA_FIXUP_PINS, |
| 2132 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2133 | { 0x15, 0x01080104 }, /* side */ |
| 2134 | { 0x16, 0x01011012 }, /* rear */ |
| 2135 | { 0x17, 0x01016011 }, /* clfe */ |
| 2136 | { } |
| 2137 | } |
| 2138 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2139 | [ALC882_FIXUP_LENOVO_Y530] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2140 | .type = HDA_FIXUP_PINS, |
| 2141 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2142 | { 0x15, 0x99130112 }, /* rear int speakers */ |
| 2143 | { 0x16, 0x99130111 }, /* subwoofer */ |
| 2144 | { } |
| 2145 | } |
| 2146 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2147 | [ALC882_FIXUP_PB_M5210] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2148 | .type = HDA_FIXUP_PINCTLS, |
| 2149 | .v.pins = (const struct hda_pintbl[]) { |
| 2150 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2151 | {} |
| 2152 | } |
| 2153 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2154 | [ALC882_FIXUP_ACER_ASPIRE_7736] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2155 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 2156 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2157 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2158 | [ALC882_FIXUP_ASUS_W90V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2159 | .type = HDA_FIXUP_PINS, |
| 2160 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5cdf745 | 2011-10-26 23:04:08 +0200 | [diff] [blame] | 2161 | { 0x16, 0x99130110 }, /* fix sequence for CLFE */ |
| 2162 | { } |
| 2163 | } |
| 2164 | }, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2165 | [ALC889_FIXUP_CD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2166 | .type = HDA_FIXUP_PINS, |
| 2167 | .v.pins = (const struct hda_pintbl[]) { |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2168 | { 0x1c, 0x993301f0 }, /* CD */ |
| 2169 | { } |
| 2170 | } |
| 2171 | }, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2172 | [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { |
| 2173 | .type = HDA_FIXUP_PINS, |
| 2174 | .v.pins = (const struct hda_pintbl[]) { |
| 2175 | { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ |
| 2176 | { } |
| 2177 | }, |
| 2178 | .chained = true, |
| 2179 | .chain_id = ALC889_FIXUP_CD, |
| 2180 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2181 | [ALC889_FIXUP_VAIO_TT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2182 | .type = HDA_FIXUP_PINS, |
| 2183 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2184 | { 0x17, 0x90170111 }, /* hidden surround speaker */ |
| 2185 | { } |
| 2186 | } |
| 2187 | }, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2188 | [ALC888_FIXUP_EEE1601] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2189 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2190 | .v.verbs = (const struct hda_verb[]) { |
| 2191 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2192 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, |
| 2193 | { } |
| 2194 | } |
Takashi Iwai | 177943a | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2195 | }, |
| 2196 | [ALC882_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2197 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 177943a | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2198 | .v.verbs = (const struct hda_verb[]) { |
| 2199 | /* change to EAPD mode */ |
| 2200 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2201 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 2202 | { } |
| 2203 | } |
| 2204 | }, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2205 | [ALC883_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2206 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2207 | .v.verbs = (const struct hda_verb[]) { |
| 2208 | /* change to EAPD mode */ |
| 2209 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2210 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2211 | { } |
| 2212 | } |
| 2213 | }, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2214 | [ALC883_FIXUP_ACER_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2215 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2216 | .v.verbs = (const struct hda_verb[]) { |
| 2217 | /* eanable EAPD on Acer laptops */ |
| 2218 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2219 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2220 | { } |
| 2221 | } |
| 2222 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2223 | [ALC882_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2224 | .type = HDA_FIXUP_FUNC, |
| 2225 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2226 | }, |
| 2227 | [ALC882_FIXUP_GPIO2] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2228 | .type = HDA_FIXUP_FUNC, |
| 2229 | .v.func = alc_fixup_gpio2, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2230 | }, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2231 | [ALC882_FIXUP_GPIO3] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2232 | .type = HDA_FIXUP_FUNC, |
| 2233 | .v.func = alc_fixup_gpio3, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2234 | }, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2235 | [ALC882_FIXUP_ASUS_W2JC] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2236 | .type = HDA_FIXUP_FUNC, |
| 2237 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2238 | .chained = true, |
| 2239 | .chain_id = ALC882_FIXUP_EAPD, |
| 2240 | }, |
| 2241 | [ALC889_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2242 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2243 | .v.func = alc889_fixup_coef, |
| 2244 | }, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2245 | [ALC882_FIXUP_ACER_ASPIRE_4930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2246 | .type = HDA_FIXUP_PINS, |
| 2247 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2248 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2249 | { 0x17, 0x99130112 }, /* surround speaker */ |
| 2250 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2251 | }, |
| 2252 | .chained = true, |
| 2253 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2254 | }, |
| 2255 | [ALC882_FIXUP_ACER_ASPIRE_8930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2256 | .type = HDA_FIXUP_PINS, |
| 2257 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2258 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2259 | { 0x1b, 0x99130112 }, /* surround speaker */ |
| 2260 | { } |
| 2261 | }, |
| 2262 | .chained = true, |
| 2263 | .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, |
| 2264 | }, |
| 2265 | [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { |
| 2266 | /* additional init verbs for Acer Aspire 8930G */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2267 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2268 | .v.verbs = (const struct hda_verb[]) { |
| 2269 | /* Enable all DACs */ |
| 2270 | /* DAC DISABLE/MUTE 1? */ |
| 2271 | /* setting bits 1-5 disables DAC nids 0x02-0x06 |
| 2272 | * apparently. Init=0x38 */ |
| 2273 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, |
| 2274 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2275 | /* DAC DISABLE/MUTE 2? */ |
| 2276 | /* some bit here disables the other DACs. |
| 2277 | * Init=0x4900 */ |
| 2278 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, |
| 2279 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2280 | /* DMIC fix |
| 2281 | * This laptop has a stereo digital microphone. |
| 2282 | * The mics are only 1cm apart which makes the stereo |
| 2283 | * useless. However, either the mic or the ALC889 |
| 2284 | * makes the signal become a difference/sum signal |
| 2285 | * instead of standard stereo, which is annoying. |
| 2286 | * So instead we flip this bit which makes the |
| 2287 | * codec replicate the sum signal to both channels, |
| 2288 | * turning it into a normal mono mic. |
| 2289 | */ |
| 2290 | /* DMIC_CONTROL? Init value = 0x0001 */ |
| 2291 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2292 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, |
| 2293 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2294 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2295 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2296 | }, |
| 2297 | .chained = true, |
| 2298 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2299 | }, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2300 | [ALC885_FIXUP_MACPRO_GPIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2301 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2302 | .v.func = alc885_fixup_macpro_gpio, |
| 2303 | }, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2304 | [ALC889_FIXUP_DAC_ROUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2305 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2306 | .v.func = alc889_fixup_dac_route, |
| 2307 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2308 | [ALC889_FIXUP_MBP_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2309 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2310 | .v.func = alc889_fixup_mbp_vref, |
| 2311 | .chained = true, |
| 2312 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2313 | }, |
| 2314 | [ALC889_FIXUP_IMAC91_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2315 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2316 | .v.func = alc889_fixup_imac91_vref, |
| 2317 | .chained = true, |
| 2318 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2319 | }, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2320 | [ALC889_FIXUP_MBA11_VREF] = { |
| 2321 | .type = HDA_FIXUP_FUNC, |
| 2322 | .v.func = alc889_fixup_mba11_vref, |
| 2323 | .chained = true, |
| 2324 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2325 | }, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2326 | [ALC889_FIXUP_MBA21_VREF] = { |
| 2327 | .type = HDA_FIXUP_FUNC, |
| 2328 | .v.func = alc889_fixup_mba21_vref, |
| 2329 | .chained = true, |
| 2330 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2331 | }, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2332 | [ALC889_FIXUP_MP11_VREF] = { |
| 2333 | .type = HDA_FIXUP_FUNC, |
| 2334 | .v.func = alc889_fixup_mba11_vref, |
| 2335 | .chained = true, |
| 2336 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2337 | }, |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 2338 | [ALC889_FIXUP_MP41_VREF] = { |
| 2339 | .type = HDA_FIXUP_FUNC, |
| 2340 | .v.func = alc889_fixup_mbp_vref, |
| 2341 | .chained = true, |
| 2342 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2343 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2344 | [ALC882_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2345 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2346 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2347 | }, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2348 | [ALC882_FIXUP_NO_PRIMARY_HP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2349 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2350 | .v.func = alc882_fixup_no_primary_hp, |
| 2351 | }, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2352 | [ALC887_FIXUP_ASUS_BASS] = { |
| 2353 | .type = HDA_FIXUP_PINS, |
| 2354 | .v.pins = (const struct hda_pintbl[]) { |
| 2355 | {0x16, 0x99130130}, /* bass speaker */ |
| 2356 | {} |
| 2357 | }, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2358 | .chained = true, |
| 2359 | .chain_id = ALC887_FIXUP_BASS_CHMAP, |
| 2360 | }, |
| 2361 | [ALC887_FIXUP_BASS_CHMAP] = { |
| 2362 | .type = HDA_FIXUP_FUNC, |
| 2363 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2364 | }, |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 2365 | [ALC1220_FIXUP_GB_DUAL_CODECS] = { |
| 2366 | .type = HDA_FIXUP_FUNC, |
| 2367 | .v.func = alc1220_fixup_gb_dual_codecs, |
| 2368 | }, |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2369 | [ALC1220_FIXUP_CLEVO_P950] = { |
| 2370 | .type = HDA_FIXUP_FUNC, |
| 2371 | .v.func = alc1220_fixup_clevo_p950, |
| 2372 | }, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2373 | [ALC1220_FIXUP_CLEVO_PB51ED] = { |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2374 | .type = HDA_FIXUP_FUNC, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2375 | .v.func = alc1220_fixup_clevo_pb51ed, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2376 | }, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2377 | [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = { |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2378 | .type = HDA_FIXUP_PINS, |
| 2379 | .v.pins = (const struct hda_pintbl[]) { |
| 2380 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 2381 | {} |
| 2382 | }, |
| 2383 | .chained = true, |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2384 | .chain_id = ALC1220_FIXUP_CLEVO_PB51ED, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2385 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2386 | }; |
| 2387 | |
| 2388 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2389 | SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), |
| 2390 | SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | b5d724b | 2015-06-02 19:57:08 +0200 | [diff] [blame] | 2391 | SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2392 | SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), |
| 2393 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
| 2394 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), |
| 2395 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2396 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", |
| 2397 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2398 | SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", |
| 2399 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2400 | SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", |
| 2401 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2402 | SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", |
| 2403 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2404 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", |
| 2405 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2406 | SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", |
| 2407 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2408 | SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", |
| 2409 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2410 | SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), |
Takashi Iwai | f5c53d8 | 2012-05-07 10:07:33 +0200 | [diff] [blame] | 2411 | SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", |
| 2412 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2413 | SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), |
Takashi Iwai | fe97da1 | 2012-04-12 08:00:19 +0200 | [diff] [blame] | 2414 | 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] | 2415 | SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), |
Takashi Iwai | 177943a | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2416 | SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2417 | SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2418 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2419 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2420 | SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), |
Takashi Iwai | 85bcf96 | 2016-12-06 16:20:36 +0100 | [diff] [blame] | 2421 | SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2422 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2423 | 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] | 2424 | 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] | 2425 | 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] | 2426 | 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] | 2427 | |
| 2428 | /* All Apple entries are in codec SSIDs */ |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2429 | SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), |
| 2430 | SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), |
| 2431 | SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2432 | SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2433 | SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), |
| 2434 | SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2435 | SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), |
| 2436 | SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2437 | SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2438 | SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2439 | SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2440 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), |
| 2441 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2442 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2443 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2444 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2445 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 2446 | 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] | 2447 | SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2448 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), |
| 2449 | 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] | 2450 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2451 | |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2452 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2453 | 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] | 2454 | 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] | 2455 | SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), |
Takashi Iwai | 6369158 | 2017-05-22 16:32:46 +0200 | [diff] [blame] | 2456 | 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] | 2457 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2458 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2459 | SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | f3d737b | 2018-07-17 17:08:32 +0200 | [diff] [blame] | 2460 | SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), |
Jeremy Soller | 2f0d520 | 2018-05-07 09:28:45 -0600 | [diff] [blame] | 2461 | SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), |
Richard Sailer | 80690a2 | 2019-04-02 15:52:04 +0200 | [diff] [blame] | 2462 | SND_PCI_QUIRK(0x1558, 0x96e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
| 2463 | SND_PCI_QUIRK(0x1558, 0x97e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
| 2464 | SND_PCI_QUIRK(0x1558, 0x65d1, "Tuxedo Book XC1509", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2465 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), |
| 2466 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2467 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2468 | SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2469 | {} |
| 2470 | }; |
| 2471 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2472 | static const struct hda_model_fixup alc882_fixup_models[] = { |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2473 | {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"}, |
| 2474 | {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"}, |
| 2475 | {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"}, |
| 2476 | {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"}, |
| 2477 | {.id = ALC889_FIXUP_CD, .name = "cd"}, |
| 2478 | {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"}, |
| 2479 | {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"}, |
| 2480 | {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"}, |
| 2481 | {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"}, |
| 2482 | {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"}, |
| 2483 | {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"}, |
| 2484 | {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"}, |
| 2485 | {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"}, |
| 2486 | {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"}, |
| 2487 | {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"}, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2488 | {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, |
| 2489 | {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, |
| 2490 | {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2491 | {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"}, |
| 2492 | {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"}, |
| 2493 | {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"}, |
| 2494 | {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"}, |
| 2495 | {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"}, |
| 2496 | {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"}, |
| 2497 | {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"}, |
| 2498 | {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2499 | {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2500 | {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2501 | {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 2502 | {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2503 | {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"}, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2504 | {} |
| 2505 | }; |
| 2506 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2507 | /* |
| 2508 | * BIOS auto configuration |
| 2509 | */ |
| 2510 | /* almost identical with ALC880 parser... */ |
| 2511 | static int alc882_parse_auto_config(struct hda_codec *codec) |
| 2512 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2513 | static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2514 | static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2515 | return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2516 | } |
| 2517 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2518 | /* |
| 2519 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2520 | static int patch_alc882(struct hda_codec *codec) |
| 2521 | { |
| 2522 | struct alc_spec *spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2523 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2524 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2525 | err = alc_alloc_spec(codec, 0x0b); |
| 2526 | if (err < 0) |
| 2527 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2528 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2529 | spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2530 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 2531 | switch (codec->core.vendor_id) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2532 | case 0x10ec0882: |
| 2533 | case 0x10ec0885: |
Takashi Iwai | acf0808 | 2014-09-02 07:21:56 +0200 | [diff] [blame] | 2534 | case 0x10ec0900: |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 2535 | case 0x10ec1220: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2536 | break; |
| 2537 | default: |
| 2538 | /* ALC883 and variants */ |
| 2539 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2540 | break; |
| 2541 | } |
| 2542 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 2543 | alc_pre_init(codec); |
| 2544 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2545 | snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2546 | alc882_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2547 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2548 | |
| 2549 | alc_auto_parse_customize_define(codec); |
| 2550 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2551 | if (has_cdefine_beep(codec)) |
| 2552 | spec->gen.beep_nid = 0x01; |
| 2553 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2554 | /* automatic parse from the BIOS config */ |
| 2555 | err = alc882_parse_auto_config(codec); |
| 2556 | if (err < 0) |
| 2557 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2558 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 2559 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
| 2560 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2561 | if (err < 0) |
| 2562 | goto error; |
| 2563 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2564 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2565 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2566 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2567 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2568 | |
| 2569 | error: |
| 2570 | alc_free(codec); |
| 2571 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2572 | } |
| 2573 | |
| 2574 | |
| 2575 | /* |
| 2576 | * ALC262 support |
| 2577 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2578 | static int alc262_parse_auto_config(struct hda_codec *codec) |
| 2579 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2580 | static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2581 | static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2582 | return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2583 | } |
| 2584 | |
| 2585 | /* |
| 2586 | * Pin config fixes |
| 2587 | */ |
| 2588 | enum { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2589 | ALC262_FIXUP_FSC_H270, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2590 | ALC262_FIXUP_FSC_S7110, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2591 | ALC262_FIXUP_HP_Z200, |
| 2592 | ALC262_FIXUP_TYAN, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2593 | ALC262_FIXUP_LENOVO_3000, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2594 | ALC262_FIXUP_BENQ, |
| 2595 | ALC262_FIXUP_BENQ_T31, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2596 | ALC262_FIXUP_INV_DMIC, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2597 | ALC262_FIXUP_INTEL_BAYLEYBAY, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2598 | }; |
| 2599 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2600 | static const struct hda_fixup alc262_fixups[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2601 | [ALC262_FIXUP_FSC_H270] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2602 | .type = HDA_FIXUP_PINS, |
| 2603 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2604 | { 0x14, 0x99130110 }, /* speaker */ |
| 2605 | { 0x15, 0x0221142f }, /* front HP */ |
| 2606 | { 0x1b, 0x0121141f }, /* rear HP */ |
| 2607 | { } |
| 2608 | } |
| 2609 | }, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2610 | [ALC262_FIXUP_FSC_S7110] = { |
| 2611 | .type = HDA_FIXUP_PINS, |
| 2612 | .v.pins = (const struct hda_pintbl[]) { |
| 2613 | { 0x15, 0x90170110 }, /* speaker */ |
| 2614 | { } |
| 2615 | }, |
| 2616 | .chained = true, |
| 2617 | .chain_id = ALC262_FIXUP_BENQ, |
| 2618 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2619 | [ALC262_FIXUP_HP_Z200] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2620 | .type = HDA_FIXUP_PINS, |
| 2621 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2622 | { 0x16, 0x99130120 }, /* internal speaker */ |
| 2623 | { } |
| 2624 | } |
| 2625 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2626 | [ALC262_FIXUP_TYAN] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2627 | .type = HDA_FIXUP_PINS, |
| 2628 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2629 | { 0x14, 0x1993e1f0 }, /* int AUX */ |
| 2630 | { } |
| 2631 | } |
| 2632 | }, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2633 | [ALC262_FIXUP_LENOVO_3000] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2634 | .type = HDA_FIXUP_PINCTLS, |
| 2635 | .v.pins = (const struct hda_pintbl[]) { |
| 2636 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2637 | {} |
| 2638 | }, |
| 2639 | .chained = true, |
| 2640 | .chain_id = ALC262_FIXUP_BENQ, |
| 2641 | }, |
| 2642 | [ALC262_FIXUP_BENQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2643 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2644 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2645 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2646 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2647 | {} |
| 2648 | } |
| 2649 | }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2650 | [ALC262_FIXUP_BENQ_T31] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2651 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2652 | .v.verbs = (const struct hda_verb[]) { |
| 2653 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2654 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2655 | {} |
| 2656 | } |
| 2657 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2658 | [ALC262_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2659 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2660 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2661 | }, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2662 | [ALC262_FIXUP_INTEL_BAYLEYBAY] = { |
| 2663 | .type = HDA_FIXUP_FUNC, |
| 2664 | .v.func = alc_fixup_no_depop_delay, |
| 2665 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2666 | }; |
| 2667 | |
| 2668 | static const struct snd_pci_quirk alc262_fixup_tbl[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2669 | SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2670 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), |
Takashi Iwai | 3dcd3be | 2011-11-07 14:59:40 +0100 | [diff] [blame] | 2671 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2672 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), |
Takashi Iwai | 275ec0c | 2018-06-22 12:17:45 +0200 | [diff] [blame] | 2673 | SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270), |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2674 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2675 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2676 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), |
| 2677 | SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2678 | SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2679 | {} |
| 2680 | }; |
| 2681 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2682 | static const struct hda_model_fixup alc262_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2683 | {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | e43c44d | 2018-06-26 17:02:08 +0200 | [diff] [blame] | 2684 | {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"}, |
| 2685 | {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"}, |
| 2686 | {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"}, |
| 2687 | {.id = ALC262_FIXUP_TYAN, .name = "tyan"}, |
| 2688 | {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"}, |
| 2689 | {.id = ALC262_FIXUP_BENQ, .name = "benq"}, |
| 2690 | {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"}, |
| 2691 | {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2692 | {} |
| 2693 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2694 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2695 | /* |
| 2696 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2697 | static int patch_alc262(struct hda_codec *codec) |
| 2698 | { |
| 2699 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2700 | int err; |
| 2701 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2702 | err = alc_alloc_spec(codec, 0x0b); |
| 2703 | if (err < 0) |
| 2704 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2705 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2706 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2707 | spec->gen.shared_mic_vref_pin = 0x18; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2708 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 2709 | spec->shutup = alc_eapd_shutup; |
| 2710 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2711 | #if 0 |
| 2712 | /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is |
| 2713 | * under-run |
| 2714 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2715 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2716 | #endif |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2717 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2718 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 2719 | alc_pre_init(codec); |
| 2720 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2721 | snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2722 | alc262_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2723 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2724 | |
Takashi Iwai | af741c1 | 2012-05-07 18:09:48 +0200 | [diff] [blame] | 2725 | alc_auto_parse_customize_define(codec); |
| 2726 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2727 | if (has_cdefine_beep(codec)) |
| 2728 | spec->gen.beep_nid = 0x01; |
| 2729 | |
Takashi Iwai | 42399f7 | 2011-11-07 17:18:44 +0100 | [diff] [blame] | 2730 | /* automatic parse from the BIOS config */ |
| 2731 | err = alc262_parse_auto_config(codec); |
| 2732 | if (err < 0) |
| 2733 | goto error; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2734 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 2735 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
| 2736 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2737 | if (err < 0) |
| 2738 | goto error; |
| 2739 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2740 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2741 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2742 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2743 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2744 | |
| 2745 | error: |
| 2746 | alc_free(codec); |
| 2747 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2748 | } |
| 2749 | |
| 2750 | /* |
| 2751 | * ALC268 |
| 2752 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2753 | /* bind Beep switches of both NID 0x0f and 0x10 */ |
Takashi Iwai | a717777 | 2017-05-10 12:04:08 +0200 | [diff] [blame] | 2754 | static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol, |
| 2755 | struct snd_ctl_elem_value *ucontrol) |
| 2756 | { |
| 2757 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 2758 | unsigned long pval; |
| 2759 | int err; |
| 2760 | |
| 2761 | mutex_lock(&codec->control_mutex); |
| 2762 | pval = kcontrol->private_value; |
| 2763 | kcontrol->private_value = (pval & ~0xff) | 0x0f; |
| 2764 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); |
| 2765 | if (err >= 0) { |
| 2766 | kcontrol->private_value = (pval & ~0xff) | 0x10; |
| 2767 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); |
| 2768 | } |
| 2769 | kcontrol->private_value = pval; |
| 2770 | mutex_unlock(&codec->control_mutex); |
| 2771 | return err; |
| 2772 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2773 | |
| 2774 | static const struct snd_kcontrol_new alc268_beep_mixer[] = { |
| 2775 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), |
Takashi Iwai | a717777 | 2017-05-10 12:04:08 +0200 | [diff] [blame] | 2776 | { |
| 2777 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
| 2778 | .name = "Beep Playback Switch", |
| 2779 | .subdevice = HDA_SUBDEV_AMP_FLAG, |
| 2780 | .info = snd_hda_mixer_amp_switch_info, |
| 2781 | .get = snd_hda_mixer_amp_switch_get, |
| 2782 | .put = alc268_beep_switch_put, |
| 2783 | .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT) |
| 2784 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2785 | }; |
| 2786 | |
| 2787 | /* set PCBEEP vol = 0, mute connections */ |
| 2788 | static const struct hda_verb alc268_beep_init_verbs[] = { |
| 2789 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
| 2790 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2791 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2792 | { } |
| 2793 | }; |
| 2794 | |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2795 | enum { |
| 2796 | ALC268_FIXUP_INV_DMIC, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2797 | ALC268_FIXUP_HP_EAPD, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2798 | ALC268_FIXUP_SPDIF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2799 | }; |
| 2800 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2801 | static const struct hda_fixup alc268_fixups[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2802 | [ALC268_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2803 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2804 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2805 | }, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2806 | [ALC268_FIXUP_HP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2807 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2808 | .v.verbs = (const struct hda_verb[]) { |
| 2809 | {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 2810 | {} |
| 2811 | } |
| 2812 | }, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2813 | [ALC268_FIXUP_SPDIF] = { |
| 2814 | .type = HDA_FIXUP_PINS, |
| 2815 | .v.pins = (const struct hda_pintbl[]) { |
| 2816 | { 0x1e, 0x014b1180 }, /* enable SPDIF out */ |
| 2817 | {} |
| 2818 | } |
| 2819 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2820 | }; |
| 2821 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2822 | static const struct hda_model_fixup alc268_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2823 | {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2824 | {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, |
Takashi Iwai | 03bf11c | 2018-06-26 16:56:41 +0200 | [diff] [blame] | 2825 | {.id = ALC268_FIXUP_SPDIF, .name = "spdif"}, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2826 | {} |
| 2827 | }; |
| 2828 | |
| 2829 | static const struct snd_pci_quirk alc268_fixup_tbl[] = { |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2830 | SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), |
David Henningsson | fcd8f3b | 2013-01-28 05:45:47 +0100 | [diff] [blame] | 2831 | 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] | 2832 | /* below is codec SSID since multiple Toshiba laptops have the |
| 2833 | * same PCI SSID 1179:ff00 |
| 2834 | */ |
| 2835 | SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2836 | {} |
| 2837 | }; |
| 2838 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2839 | /* |
| 2840 | * BIOS auto configuration |
| 2841 | */ |
| 2842 | static int alc268_parse_auto_config(struct hda_codec *codec) |
| 2843 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2844 | static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2845 | return alc_parse_auto_config(codec, NULL, alc268_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2846 | } |
| 2847 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2848 | /* |
| 2849 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2850 | static int patch_alc268(struct hda_codec *codec) |
| 2851 | { |
| 2852 | struct alc_spec *spec; |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 2853 | int i, err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2854 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2855 | /* ALC268 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2856 | err = alc_alloc_spec(codec, 0); |
| 2857 | if (err < 0) |
| 2858 | return err; |
| 2859 | |
| 2860 | spec = codec->spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2861 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2862 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 2863 | spec->shutup = alc_eapd_shutup; |
| 2864 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 2865 | alc_pre_init(codec); |
| 2866 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2867 | snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); |
| 2868 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2869 | |
Takashi Iwai | 6ebb805 | 2011-08-16 15:15:40 +0200 | [diff] [blame] | 2870 | /* automatic parse from the BIOS config */ |
| 2871 | err = alc268_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2872 | if (err < 0) |
| 2873 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2874 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2875 | if (err > 0 && !spec->gen.no_analog && |
| 2876 | spec->gen.autocfg.speaker_pins[0] != 0x1d) { |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 2877 | for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) { |
| 2878 | if (!snd_hda_gen_add_kctl(&spec->gen, NULL, |
| 2879 | &alc268_beep_mixer[i])) { |
| 2880 | err = -ENOMEM; |
| 2881 | goto error; |
| 2882 | } |
| 2883 | } |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2884 | snd_hda_add_verbs(codec, alc268_beep_init_verbs); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2885 | if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) |
| 2886 | /* override the amp caps for beep generator */ |
| 2887 | snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, |
| 2888 | (0x0c << AC_AMPCAP_OFFSET_SHIFT) | |
| 2889 | (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 2890 | (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 2891 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 2892 | } |
| 2893 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2894 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2895 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2896 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2897 | |
| 2898 | error: |
| 2899 | alc_free(codec); |
| 2900 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2901 | } |
| 2902 | |
| 2903 | /* |
| 2904 | * ALC269 |
| 2905 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2906 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2907 | static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2908 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2909 | }; |
| 2910 | |
| 2911 | static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2912 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2913 | }; |
| 2914 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2915 | /* different alc269-variants */ |
| 2916 | enum { |
| 2917 | ALC269_TYPE_ALC269VA, |
| 2918 | ALC269_TYPE_ALC269VB, |
| 2919 | ALC269_TYPE_ALC269VC, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2920 | ALC269_TYPE_ALC269VD, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2921 | ALC269_TYPE_ALC280, |
| 2922 | ALC269_TYPE_ALC282, |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2923 | ALC269_TYPE_ALC283, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2924 | ALC269_TYPE_ALC284, |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 2925 | ALC269_TYPE_ALC293, |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 2926 | ALC269_TYPE_ALC286, |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 2927 | ALC269_TYPE_ALC298, |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 2928 | ALC269_TYPE_ALC255, |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 2929 | ALC269_TYPE_ALC256, |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 2930 | ALC269_TYPE_ALC257, |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 2931 | ALC269_TYPE_ALC215, |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 2932 | ALC269_TYPE_ALC225, |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 2933 | ALC269_TYPE_ALC294, |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 2934 | ALC269_TYPE_ALC300, |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 2935 | ALC269_TYPE_ALC700, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2936 | }; |
| 2937 | |
| 2938 | /* |
| 2939 | * BIOS auto configuration |
| 2940 | */ |
| 2941 | static int alc269_parse_auto_config(struct hda_codec *codec) |
| 2942 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2943 | static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2944 | static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; |
| 2945 | static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2946 | struct alc_spec *spec = codec->spec; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2947 | const hda_nid_t *ssids; |
| 2948 | |
| 2949 | switch (spec->codec_variant) { |
| 2950 | case ALC269_TYPE_ALC269VA: |
| 2951 | case ALC269_TYPE_ALC269VC: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2952 | case ALC269_TYPE_ALC280: |
| 2953 | case ALC269_TYPE_ALC284: |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 2954 | case ALC269_TYPE_ALC293: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2955 | ssids = alc269va_ssids; |
| 2956 | break; |
| 2957 | case ALC269_TYPE_ALC269VB: |
| 2958 | case ALC269_TYPE_ALC269VD: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2959 | case ALC269_TYPE_ALC282: |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2960 | case ALC269_TYPE_ALC283: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 2961 | case ALC269_TYPE_ALC286: |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 2962 | case ALC269_TYPE_ALC298: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 2963 | case ALC269_TYPE_ALC255: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 2964 | case ALC269_TYPE_ALC256: |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 2965 | case ALC269_TYPE_ALC257: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 2966 | case ALC269_TYPE_ALC215: |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 2967 | case ALC269_TYPE_ALC225: |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 2968 | case ALC269_TYPE_ALC294: |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 2969 | case ALC269_TYPE_ALC300: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 2970 | case ALC269_TYPE_ALC700: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2971 | ssids = alc269_ssids; |
| 2972 | break; |
| 2973 | default: |
| 2974 | ssids = alc269_ssids; |
| 2975 | break; |
| 2976 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2977 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2978 | return alc_parse_auto_config(codec, alc269_ignore, ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2979 | } |
| 2980 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 2981 | 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] | 2982 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2983 | 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] | 2984 | } |
| 2985 | |
| 2986 | static void alc269_shutup(struct hda_codec *codec) |
| 2987 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2988 | struct alc_spec *spec = codec->spec; |
| 2989 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 2990 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 2991 | alc269vb_toggle_power_output(codec, 0); |
| 2992 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
| 2993 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2994 | msleep(150); |
| 2995 | } |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 2996 | alc_shutup_pins(codec); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2997 | } |
| 2998 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2999 | static struct coef_fw alc282_coefs[] = { |
| 3000 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 32fa7e4 | 2014-10-24 16:26:01 +0800 | [diff] [blame] | 3001 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3002 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 3003 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 3004 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 3005 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 3006 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 3007 | WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ |
| 3008 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 3009 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 3010 | WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ |
| 3011 | UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ |
| 3012 | WRITE_COEF(0x34, 0xa0c0), /* ANC */ |
| 3013 | UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ |
| 3014 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 3015 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 3016 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 3017 | WRITE_COEF(0x63, 0x2902), /* PLL */ |
| 3018 | WRITE_COEF(0x68, 0xa080), /* capless control 2 */ |
| 3019 | WRITE_COEF(0x69, 0x3400), /* capless control 3 */ |
| 3020 | WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ |
| 3021 | WRITE_COEF(0x6b, 0x0), /* capless control 5 */ |
| 3022 | UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ |
| 3023 | WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ |
| 3024 | UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ |
| 3025 | WRITE_COEF(0x71, 0x0014), /* class D test 6 */ |
| 3026 | WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ |
| 3027 | UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ |
| 3028 | WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ |
| 3029 | {} |
| 3030 | }; |
| 3031 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3032 | static void alc282_restore_default_value(struct hda_codec *codec) |
| 3033 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3034 | alc_process_coef_fw(codec, alc282_coefs); |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3035 | } |
| 3036 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3037 | static void alc282_init(struct hda_codec *codec) |
| 3038 | { |
| 3039 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3040 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3041 | bool hp_pin_sense; |
| 3042 | int coef78; |
| 3043 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3044 | alc282_restore_default_value(codec); |
| 3045 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3046 | if (!hp_pin) |
| 3047 | return; |
| 3048 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3049 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 3050 | |
| 3051 | /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ |
| 3052 | /* Headphone capless set to high power mode */ |
| 3053 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 3054 | |
| 3055 | if (hp_pin_sense) |
| 3056 | msleep(2); |
| 3057 | |
| 3058 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3059 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3060 | |
| 3061 | if (hp_pin_sense) |
| 3062 | msleep(85); |
| 3063 | |
| 3064 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3065 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3066 | |
| 3067 | if (hp_pin_sense) |
| 3068 | msleep(100); |
| 3069 | |
| 3070 | /* Headphone capless set to normal mode */ |
| 3071 | alc_write_coef_idx(codec, 0x78, coef78); |
| 3072 | } |
| 3073 | |
| 3074 | static void alc282_shutup(struct hda_codec *codec) |
| 3075 | { |
| 3076 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3077 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3078 | bool hp_pin_sense; |
| 3079 | int coef78; |
| 3080 | |
| 3081 | if (!hp_pin) { |
| 3082 | alc269_shutup(codec); |
| 3083 | return; |
| 3084 | } |
| 3085 | |
| 3086 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3087 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 3088 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 3089 | |
| 3090 | if (hp_pin_sense) |
| 3091 | msleep(2); |
| 3092 | |
| 3093 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3094 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3095 | |
| 3096 | if (hp_pin_sense) |
| 3097 | msleep(85); |
| 3098 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3099 | if (!spec->no_shutup_pins) |
| 3100 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3101 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3102 | |
| 3103 | if (hp_pin_sense) |
| 3104 | msleep(100); |
| 3105 | |
| 3106 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3107 | alc_shutup_pins(codec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3108 | alc_write_coef_idx(codec, 0x78, coef78); |
| 3109 | } |
| 3110 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3111 | static struct coef_fw alc283_coefs[] = { |
| 3112 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 3113 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3114 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 3115 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 3116 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 3117 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 3118 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 3119 | WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ |
| 3120 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 3121 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 3122 | WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ |
| 3123 | UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ |
| 3124 | WRITE_COEF(0x22, 0xa0c0), /* ANC */ |
| 3125 | UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ |
| 3126 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 3127 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 3128 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 3129 | WRITE_COEF(0x2e, 0x2902), /* PLL */ |
| 3130 | WRITE_COEF(0x33, 0xa080), /* capless control 2 */ |
| 3131 | WRITE_COEF(0x34, 0x3400), /* capless control 3 */ |
| 3132 | WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ |
| 3133 | WRITE_COEF(0x36, 0x0), /* capless control 5 */ |
| 3134 | UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ |
| 3135 | WRITE_COEF(0x39, 0x110a), /* class D test 3 */ |
| 3136 | UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ |
| 3137 | WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ |
| 3138 | WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ |
| 3139 | UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ |
| 3140 | WRITE_COEF(0x49, 0x0), /* test mode */ |
| 3141 | UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ |
| 3142 | UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ |
| 3143 | WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 3144 | UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3145 | {} |
| 3146 | }; |
| 3147 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3148 | static void alc283_restore_default_value(struct hda_codec *codec) |
| 3149 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3150 | alc_process_coef_fw(codec, alc283_coefs); |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3151 | } |
| 3152 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3153 | static void alc283_init(struct hda_codec *codec) |
| 3154 | { |
| 3155 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3156 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3157 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3158 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3159 | alc283_restore_default_value(codec); |
| 3160 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3161 | if (!hp_pin) |
| 3162 | return; |
Kailang Yang | a59d719 | 2015-04-08 16:34:00 +0800 | [diff] [blame] | 3163 | |
| 3164 | msleep(30); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3165 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3166 | |
| 3167 | /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ |
| 3168 | /* Headphone capless set to high power mode */ |
| 3169 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 3170 | |
| 3171 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3172 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3173 | |
| 3174 | if (hp_pin_sense) |
| 3175 | msleep(85); |
| 3176 | |
| 3177 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3178 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3179 | |
| 3180 | if (hp_pin_sense) |
| 3181 | msleep(85); |
| 3182 | /* Index 0x46 Combo jack auto switch control 2 */ |
| 3183 | /* 3k pull low control for Headset jack. */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3184 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3185 | /* Headphone capless set to normal mode */ |
| 3186 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3187 | } |
| 3188 | |
| 3189 | static void alc283_shutup(struct hda_codec *codec) |
| 3190 | { |
| 3191 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3192 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3193 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3194 | |
| 3195 | if (!hp_pin) { |
| 3196 | alc269_shutup(codec); |
| 3197 | return; |
| 3198 | } |
| 3199 | |
| 3200 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3201 | |
| 3202 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 3203 | |
Harsha Priya | b450b17 | 2014-10-09 11:04:56 +0000 | [diff] [blame] | 3204 | /*depop hp during suspend*/ |
| 3205 | alc_write_coef_idx(codec, 0x06, 0x2100); |
| 3206 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3207 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3208 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3209 | |
| 3210 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3211 | msleep(100); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3212 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3213 | if (!spec->no_shutup_pins) |
| 3214 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3215 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3216 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3217 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3218 | |
| 3219 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3220 | msleep(100); |
Kailang Yang | 0435b3f | 2014-04-08 17:14:14 +0800 | [diff] [blame] | 3221 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3222 | alc_shutup_pins(codec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3223 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3224 | } |
| 3225 | |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3226 | static void alc256_init(struct hda_codec *codec) |
| 3227 | { |
| 3228 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3229 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3230 | bool hp_pin_sense; |
| 3231 | |
| 3232 | if (!hp_pin) |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3233 | hp_pin = 0x21; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3234 | |
| 3235 | msleep(30); |
| 3236 | |
| 3237 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3238 | |
| 3239 | if (hp_pin_sense) |
| 3240 | msleep(2); |
| 3241 | |
| 3242 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3243 | if (spec->ultra_low_power) { |
| 3244 | alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1); |
| 3245 | alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2); |
| 3246 | alc_update_coef_idx(codec, 0x08, 7<<4, 0); |
| 3247 | alc_update_coef_idx(codec, 0x3b, 1<<15, 0); |
| 3248 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); |
| 3249 | msleep(30); |
| 3250 | } |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3251 | |
| 3252 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3253 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3254 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3255 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3256 | msleep(85); |
| 3257 | |
| 3258 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3259 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3260 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3261 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3262 | msleep(100); |
| 3263 | |
| 3264 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
| 3265 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ |
Kailang Yang | 88d42b2 | 2018-03-14 16:08:57 +0800 | [diff] [blame] | 3266 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ |
| 3267 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3268 | } |
| 3269 | |
| 3270 | static void alc256_shutup(struct hda_codec *codec) |
| 3271 | { |
| 3272 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3273 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3274 | bool hp_pin_sense; |
| 3275 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3276 | if (!hp_pin) |
| 3277 | hp_pin = 0x21; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3278 | |
| 3279 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3280 | |
| 3281 | if (hp_pin_sense) |
| 3282 | msleep(2); |
| 3283 | |
| 3284 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3285 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3286 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3287 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3288 | msleep(85); |
| 3289 | |
Takashi Iwai | 1c9609e | 2018-01-19 14:18:34 +0100 | [diff] [blame] | 3290 | /* 3k pull low control for Headset jack. */ |
| 3291 | /* NOTE: call this before clearing the pin, otherwise codec stalls */ |
| 3292 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
| 3293 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3294 | if (!spec->no_shutup_pins) |
| 3295 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3296 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3297 | |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3298 | if (hp_pin_sense || spec->ultra_low_power) |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3299 | msleep(100); |
| 3300 | |
| 3301 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3302 | alc_shutup_pins(codec); |
Kailang Yang | 6447c96 | 2019-05-08 16:27:03 +0800 | [diff] [blame] | 3303 | if (spec->ultra_low_power) { |
| 3304 | msleep(50); |
| 3305 | alc_update_coef_idx(codec, 0x03, 1<<1, 0); |
| 3306 | alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4); |
| 3307 | alc_update_coef_idx(codec, 0x08, 3<<2, 0); |
| 3308 | alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15); |
| 3309 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); |
| 3310 | msleep(30); |
| 3311 | } |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3312 | } |
| 3313 | |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3314 | static void alc225_init(struct hda_codec *codec) |
| 3315 | { |
| 3316 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3317 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3318 | bool hp1_pin_sense, hp2_pin_sense; |
| 3319 | |
| 3320 | if (!hp_pin) |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3321 | hp_pin = 0x21; |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3322 | msleep(30); |
| 3323 | |
| 3324 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3325 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); |
| 3326 | |
| 3327 | if (hp1_pin_sense || hp2_pin_sense) |
| 3328 | msleep(2); |
| 3329 | |
| 3330 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3331 | if (spec->ultra_low_power) { |
| 3332 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2); |
| 3333 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); |
| 3334 | alc_update_coef_idx(codec, 0x33, 1<<11, 0); |
| 3335 | msleep(30); |
| 3336 | } |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3337 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3338 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3339 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3340 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3341 | if (hp2_pin_sense) |
| 3342 | snd_hda_codec_write(codec, 0x16, 0, |
| 3343 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3344 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3345 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3346 | msleep(85); |
| 3347 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3348 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3349 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3350 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3351 | if (hp2_pin_sense) |
| 3352 | snd_hda_codec_write(codec, 0x16, 0, |
| 3353 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3354 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3355 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3356 | msleep(100); |
| 3357 | |
| 3358 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); |
| 3359 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ |
| 3360 | } |
| 3361 | |
| 3362 | static void alc225_shutup(struct hda_codec *codec) |
| 3363 | { |
| 3364 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3365 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3366 | bool hp1_pin_sense, hp2_pin_sense; |
| 3367 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3368 | if (!hp_pin) |
| 3369 | hp_pin = 0x21; |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3370 | /* 3k pull low control for Headset jack. */ |
| 3371 | alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); |
| 3372 | |
| 3373 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3374 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); |
| 3375 | |
| 3376 | if (hp1_pin_sense || hp2_pin_sense) |
| 3377 | msleep(2); |
| 3378 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3379 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3380 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3381 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3382 | if (hp2_pin_sense) |
| 3383 | snd_hda_codec_write(codec, 0x16, 0, |
| 3384 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3385 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3386 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3387 | msleep(85); |
| 3388 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3389 | if (hp1_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3390 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3391 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3392 | if (hp2_pin_sense) |
| 3393 | snd_hda_codec_write(codec, 0x16, 0, |
| 3394 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3395 | |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3396 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3397 | msleep(100); |
| 3398 | |
| 3399 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3400 | alc_shutup_pins(codec); |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 3401 | if (spec->ultra_low_power) { |
| 3402 | msleep(50); |
| 3403 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2); |
| 3404 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); |
| 3405 | alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11); |
| 3406 | alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4); |
| 3407 | msleep(30); |
| 3408 | } |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3409 | } |
| 3410 | |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3411 | static void alc_default_init(struct hda_codec *codec) |
| 3412 | { |
| 3413 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3414 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3415 | bool hp_pin_sense; |
| 3416 | |
| 3417 | if (!hp_pin) |
| 3418 | return; |
| 3419 | |
| 3420 | msleep(30); |
| 3421 | |
| 3422 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3423 | |
| 3424 | if (hp_pin_sense) |
| 3425 | msleep(2); |
| 3426 | |
| 3427 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3428 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3429 | |
| 3430 | if (hp_pin_sense) |
| 3431 | msleep(85); |
| 3432 | |
| 3433 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3434 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3435 | |
| 3436 | if (hp_pin_sense) |
| 3437 | msleep(100); |
| 3438 | } |
| 3439 | |
| 3440 | static void alc_default_shutup(struct hda_codec *codec) |
| 3441 | { |
| 3442 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3443 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3444 | bool hp_pin_sense; |
| 3445 | |
| 3446 | if (!hp_pin) { |
| 3447 | alc269_shutup(codec); |
| 3448 | return; |
| 3449 | } |
| 3450 | |
| 3451 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3452 | |
| 3453 | if (hp_pin_sense) |
| 3454 | msleep(2); |
| 3455 | |
| 3456 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3457 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3458 | |
| 3459 | if (hp_pin_sense) |
| 3460 | msleep(85); |
| 3461 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3462 | if (!spec->no_shutup_pins) |
| 3463 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3464 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3465 | |
| 3466 | if (hp_pin_sense) |
| 3467 | msleep(100); |
| 3468 | |
| 3469 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3470 | alc_shutup_pins(codec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3471 | } |
| 3472 | |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3473 | static void alc294_hp_init(struct hda_codec *codec) |
| 3474 | { |
| 3475 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3476 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3477 | int i, val; |
| 3478 | |
| 3479 | if (!hp_pin) |
| 3480 | return; |
| 3481 | |
| 3482 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3483 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3484 | |
| 3485 | msleep(100); |
| 3486 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3487 | if (!spec->no_shutup_pins) |
| 3488 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3489 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3490 | |
| 3491 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ |
| 3492 | alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ |
| 3493 | |
| 3494 | /* Wait for depop procedure finish */ |
| 3495 | val = alc_read_coefex_idx(codec, 0x58, 0x01); |
| 3496 | for (i = 0; i < 20 && val & 0x0080; i++) { |
| 3497 | msleep(50); |
| 3498 | val = alc_read_coefex_idx(codec, 0x58, 0x01); |
| 3499 | } |
| 3500 | /* Set HP depop to auto mode */ |
| 3501 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b); |
| 3502 | msleep(50); |
| 3503 | } |
| 3504 | |
| 3505 | static void alc294_init(struct hda_codec *codec) |
| 3506 | { |
| 3507 | struct alc_spec *spec = codec->spec; |
| 3508 | |
Takashi Iwai | f6ef4e0 | 2019-01-29 14:14:51 +0100 | [diff] [blame] | 3509 | /* required only at boot or S4 resume time */ |
| 3510 | if (!spec->done_hp_init || |
| 3511 | codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) { |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3512 | alc294_hp_init(codec); |
| 3513 | spec->done_hp_init = true; |
| 3514 | } |
| 3515 | alc_default_init(codec); |
| 3516 | } |
| 3517 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3518 | static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, |
| 3519 | unsigned int val) |
| 3520 | { |
| 3521 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3522 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ |
| 3523 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ |
| 3524 | } |
| 3525 | |
| 3526 | static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) |
| 3527 | { |
| 3528 | unsigned int val; |
| 3529 | |
| 3530 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3531 | val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3532 | & 0xffff; |
| 3533 | val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3534 | << 16; |
| 3535 | return val; |
| 3536 | } |
| 3537 | |
| 3538 | static void alc5505_dsp_halt(struct hda_codec *codec) |
| 3539 | { |
| 3540 | unsigned int val; |
| 3541 | |
| 3542 | alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ |
| 3543 | alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ |
| 3544 | alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ |
| 3545 | alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ |
| 3546 | alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ |
| 3547 | alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ |
| 3548 | alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ |
| 3549 | val = alc5505_coef_get(codec, 0x6220); |
| 3550 | alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ |
| 3551 | } |
| 3552 | |
| 3553 | static void alc5505_dsp_back_from_halt(struct hda_codec *codec) |
| 3554 | { |
| 3555 | alc5505_coef_set(codec, 0x61b8, 0x04133302); |
| 3556 | alc5505_coef_set(codec, 0x61b0, 0x00005b16); |
| 3557 | alc5505_coef_set(codec, 0x61b4, 0x040a2b02); |
| 3558 | alc5505_coef_set(codec, 0x6230, 0xf80d4011); |
| 3559 | alc5505_coef_set(codec, 0x6220, 0x2002010f); |
| 3560 | alc5505_coef_set(codec, 0x880c, 0x00000004); |
| 3561 | } |
| 3562 | |
| 3563 | static void alc5505_dsp_init(struct hda_codec *codec) |
| 3564 | { |
| 3565 | unsigned int val; |
| 3566 | |
| 3567 | alc5505_dsp_halt(codec); |
| 3568 | alc5505_dsp_back_from_halt(codec); |
| 3569 | alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ |
| 3570 | alc5505_coef_set(codec, 0x61b0, 0x5b16); |
| 3571 | alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ |
| 3572 | alc5505_coef_set(codec, 0x61b4, 0x04132b02); |
| 3573 | alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ |
| 3574 | alc5505_coef_set(codec, 0x61b8, 0x041f3302); |
| 3575 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ |
| 3576 | alc5505_coef_set(codec, 0x61b8, 0x041b3302); |
| 3577 | alc5505_coef_set(codec, 0x61b8, 0x04173302); |
| 3578 | alc5505_coef_set(codec, 0x61b8, 0x04163302); |
| 3579 | alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ |
| 3580 | alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ |
| 3581 | alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ |
| 3582 | |
| 3583 | val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ |
| 3584 | if (val <= 3) |
| 3585 | alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ |
| 3586 | else |
| 3587 | alc5505_coef_set(codec, 0x6220, 0x6002018f); |
| 3588 | |
| 3589 | alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ |
| 3590 | alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ |
| 3591 | alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ |
| 3592 | alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ |
| 3593 | alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ |
| 3594 | alc5505_coef_set(codec, 0x880c, 0x00000003); |
| 3595 | alc5505_coef_set(codec, 0x880c, 0x00000010); |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3596 | |
| 3597 | #ifdef HALT_REALTEK_ALC5505 |
| 3598 | alc5505_dsp_halt(codec); |
| 3599 | #endif |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3600 | } |
| 3601 | |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3602 | #ifdef HALT_REALTEK_ALC5505 |
| 3603 | #define alc5505_dsp_suspend(codec) /* NOP */ |
| 3604 | #define alc5505_dsp_resume(codec) /* NOP */ |
| 3605 | #else |
| 3606 | #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) |
| 3607 | #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) |
| 3608 | #endif |
| 3609 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3610 | #ifdef CONFIG_PM |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3611 | static int alc269_suspend(struct hda_codec *codec) |
| 3612 | { |
| 3613 | struct alc_spec *spec = codec->spec; |
| 3614 | |
| 3615 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3616 | alc5505_dsp_suspend(codec); |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3617 | return alc_suspend(codec); |
| 3618 | } |
| 3619 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3620 | static int alc269_resume(struct hda_codec *codec) |
| 3621 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3622 | struct alc_spec *spec = codec->spec; |
| 3623 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3624 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3625 | alc269vb_toggle_power_output(codec, 0); |
| 3626 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3627 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3628 | msleep(150); |
| 3629 | } |
| 3630 | |
| 3631 | codec->patch_ops.init(codec); |
| 3632 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3633 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3634 | alc269vb_toggle_power_output(codec, 1); |
| 3635 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3636 | (alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3637 | msleep(200); |
| 3638 | } |
| 3639 | |
Takashi Iwai | eeecd9d | 2015-02-25 15:18:50 +0100 | [diff] [blame] | 3640 | regcache_sync(codec->core.regmap); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3641 | hda_call_check_power_status(codec, 0x01); |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 3642 | |
| 3643 | /* on some machine, the BIOS will clear the codec gpio data when enter |
| 3644 | * suspend, and won't restore the data after resume, so we restore it |
| 3645 | * in the driver. |
| 3646 | */ |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 3647 | if (spec->gpio_data) |
| 3648 | alc_write_gpio_data(codec); |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 3649 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3650 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3651 | alc5505_dsp_resume(codec); |
Kailang Yang | c5177c8 | 2013-07-24 14:39:49 +0200 | [diff] [blame] | 3652 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3653 | return 0; |
| 3654 | } |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3655 | #endif /* CONFIG_PM */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3656 | |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3657 | 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] | 3658 | const struct hda_fixup *fix, int action) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3659 | { |
| 3660 | struct alc_spec *spec = codec->spec; |
| 3661 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3662 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3663 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 3664 | } |
| 3665 | |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 3666 | static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, |
| 3667 | const struct hda_fixup *fix, |
| 3668 | int action) |
| 3669 | { |
| 3670 | unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); |
| 3671 | unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); |
| 3672 | |
| 3673 | if (cfg_headphone && cfg_headset_mic == 0x411111f0) |
| 3674 | snd_hda_codec_set_pincfg(codec, 0x19, |
| 3675 | (cfg_headphone & ~AC_DEFCFG_DEVICE) | |
| 3676 | (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT)); |
| 3677 | } |
| 3678 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3679 | static void alc269_fixup_hweq(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3680 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3681 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3682 | if (action == HDA_FIXUP_ACT_INIT) |
| 3683 | alc_update_coef_idx(codec, 0x1e, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3684 | } |
| 3685 | |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 3686 | static void alc269_fixup_headset_mic(struct hda_codec *codec, |
| 3687 | const struct hda_fixup *fix, int action) |
| 3688 | { |
| 3689 | struct alc_spec *spec = codec->spec; |
| 3690 | |
| 3691 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 3692 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3693 | } |
| 3694 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3695 | static void alc271_fixup_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3696 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3697 | { |
| 3698 | static const struct hda_verb verbs[] = { |
| 3699 | {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, |
| 3700 | {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, |
| 3701 | {} |
| 3702 | }; |
| 3703 | unsigned int cfg; |
| 3704 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 3705 | if (strcmp(codec->core.chip_name, "ALC271X") && |
| 3706 | strcmp(codec->core.chip_name, "ALC269VB")) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3707 | return; |
| 3708 | cfg = snd_hda_codec_get_pincfg(codec, 0x12); |
| 3709 | if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) |
| 3710 | snd_hda_sequence_write(codec, verbs); |
| 3711 | } |
| 3712 | |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3713 | static void alc269_fixup_pcm_44k(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3714 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3715 | { |
| 3716 | struct alc_spec *spec = codec->spec; |
| 3717 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3718 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3719 | return; |
| 3720 | |
| 3721 | /* Due to a hardware problem on Lenovo Ideadpad, we need to |
| 3722 | * fix the sample rate of analog I/O to 44.1kHz |
| 3723 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3724 | spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; |
| 3725 | spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3726 | } |
| 3727 | |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3728 | static void alc269_fixup_stereo_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3729 | const struct hda_fixup *fix, int action) |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3730 | { |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3731 | /* The digital-mic unit sends PDM (differential signal) instead of |
| 3732 | * the standard PCM, thus you can't record a valid mono stream as is. |
| 3733 | * Below is a workaround specific to ALC269 to control the dmic |
| 3734 | * signal source as mono. |
| 3735 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3736 | if (action == HDA_FIXUP_ACT_INIT) |
| 3737 | alc_update_coef_idx(codec, 0x07, 0, 0x80); |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3738 | } |
| 3739 | |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3740 | static void alc269_quanta_automute(struct hda_codec *codec) |
| 3741 | { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3742 | snd_hda_gen_update_outputs(codec); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3743 | |
Takashi Iwai | 1687ccc | 2014-08-18 13:49:35 +0200 | [diff] [blame] | 3744 | alc_write_coef_idx(codec, 0x0c, 0x680); |
| 3745 | alc_write_coef_idx(codec, 0x0c, 0x480); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3746 | } |
| 3747 | |
| 3748 | static void alc269_fixup_quanta_mute(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3749 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3750 | { |
| 3751 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3752 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3753 | return; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3754 | spec->gen.automute_hook = alc269_quanta_automute; |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3755 | } |
| 3756 | |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3757 | static void alc269_x101_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 3758 | struct hda_jack_callback *jack) |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3759 | { |
| 3760 | struct alc_spec *spec = codec->spec; |
| 3761 | int vref; |
| 3762 | msleep(200); |
| 3763 | snd_hda_gen_hp_automute(codec, jack); |
| 3764 | |
| 3765 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 3766 | msleep(100); |
| 3767 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 3768 | vref); |
| 3769 | msleep(500); |
| 3770 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 3771 | vref); |
| 3772 | } |
| 3773 | |
| 3774 | static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, |
| 3775 | const struct hda_fixup *fix, int action) |
| 3776 | { |
| 3777 | struct alc_spec *spec = codec->spec; |
| 3778 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3779 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3780 | spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; |
| 3781 | } |
| 3782 | } |
| 3783 | |
| 3784 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3785 | /* update mute-LED according to the speaker mute state via mic VREF pin */ |
| 3786 | static void alc269_fixup_mic_mute_hook(void *private_data, int enabled) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3787 | { |
| 3788 | struct hda_codec *codec = private_data; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3789 | struct alc_spec *spec = codec->spec; |
| 3790 | unsigned int pinval; |
| 3791 | |
| 3792 | if (spec->mute_led_polarity) |
| 3793 | enabled = !enabled; |
Takashi Iwai | 415d555 | 2014-04-03 11:51:21 +0200 | [diff] [blame] | 3794 | pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid); |
| 3795 | pinval &= ~AC_PINCTL_VREFEN; |
| 3796 | pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80; |
Takashi Iwai | e40bdb0 | 2018-03-17 22:40:18 +0100 | [diff] [blame] | 3797 | if (spec->mute_led_nid) { |
| 3798 | /* temporarily power up/down for setting VREF */ |
| 3799 | snd_hda_power_up_pm(codec); |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3800 | snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval); |
Takashi Iwai | e40bdb0 | 2018-03-17 22:40:18 +0100 | [diff] [blame] | 3801 | snd_hda_power_down_pm(codec); |
| 3802 | } |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3803 | } |
| 3804 | |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3805 | /* Make sure the led works even in runtime suspend */ |
| 3806 | static unsigned int led_power_filter(struct hda_codec *codec, |
| 3807 | hda_nid_t nid, |
| 3808 | unsigned int power_state) |
| 3809 | { |
| 3810 | struct alc_spec *spec = codec->spec; |
| 3811 | |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 3812 | if (power_state != AC_PWRST_D3 || nid == 0 || |
| 3813 | (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3814 | return power_state; |
| 3815 | |
| 3816 | /* Set pin ctl again, it might have just been set to 0 */ |
| 3817 | snd_hda_set_pin_ctl(codec, nid, |
| 3818 | snd_hda_codec_get_pin_target(codec, nid)); |
| 3819 | |
Takashi Iwai | cffd396 | 2015-04-09 10:30:25 +0200 | [diff] [blame] | 3820 | return snd_hda_gen_path_power_filter(codec, nid, power_state); |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3821 | } |
| 3822 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3823 | static void alc269_fixup_hp_mute_led(struct hda_codec *codec, |
| 3824 | const struct hda_fixup *fix, int action) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3825 | { |
| 3826 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3827 | const struct dmi_device *dev = NULL; |
| 3828 | |
| 3829 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 3830 | return; |
| 3831 | |
| 3832 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { |
| 3833 | int pol, pin; |
| 3834 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) |
| 3835 | continue; |
| 3836 | if (pin < 0x0a || pin >= 0x10) |
| 3837 | break; |
| 3838 | spec->mute_led_polarity = pol; |
| 3839 | spec->mute_led_nid = pin - 0x0a + 0x18; |
| 3840 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
Takashi Iwai | fd25a97 | 2012-12-20 14:57:18 +0100 | [diff] [blame] | 3841 | spec->gen.vmaster_mute_enum = 1; |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3842 | codec->power_filter = led_power_filter; |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3843 | codec_dbg(codec, |
| 3844 | "Detected mute LED for %x:%d\n", spec->mute_led_nid, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3845 | spec->mute_led_polarity); |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3846 | break; |
| 3847 | } |
| 3848 | } |
| 3849 | |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3850 | static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, |
| 3851 | const struct hda_fixup *fix, |
| 3852 | int action, hda_nid_t pin) |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3853 | { |
| 3854 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3855 | |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3856 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3857 | spec->mute_led_polarity = 0; |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3858 | spec->mute_led_nid = pin; |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3859 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
| 3860 | spec->gen.vmaster_mute_enum = 1; |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3861 | codec->power_filter = led_power_filter; |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3862 | } |
| 3863 | } |
| 3864 | |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3865 | static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, |
| 3866 | const struct hda_fixup *fix, int action) |
| 3867 | { |
| 3868 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); |
| 3869 | } |
| 3870 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3871 | static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, |
| 3872 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 3873 | { |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3874 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 3875 | } |
| 3876 | |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 3877 | static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, |
| 3878 | const struct hda_fixup *fix, int action) |
| 3879 | { |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3880 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 3881 | } |
| 3882 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3883 | /* update LED status via GPIO */ |
| 3884 | static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask, |
| 3885 | bool enabled) |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3886 | { |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3887 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3888 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3889 | if (spec->mute_led_polarity) |
| 3890 | enabled = !enabled; |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 3891 | alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */ |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3892 | } |
| 3893 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3894 | /* turn on/off mute LED via GPIO per vmaster hook */ |
| 3895 | static void alc_fixup_gpio_mute_hook(void *private_data, int enabled) |
| 3896 | { |
| 3897 | struct hda_codec *codec = private_data; |
| 3898 | struct alc_spec *spec = codec->spec; |
| 3899 | |
| 3900 | alc_update_gpio_led(codec, spec->gpio_mute_led_mask, enabled); |
| 3901 | } |
| 3902 | |
| 3903 | /* turn on/off mic-mute LED via GPIO per capture hook */ |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3904 | static void alc_gpio_micmute_update(struct hda_codec *codec) |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3905 | { |
| 3906 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3907 | |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3908 | alc_update_gpio_led(codec, spec->gpio_mic_led_mask, |
| 3909 | spec->gen.micmute_led.led_value); |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3910 | } |
| 3911 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 3912 | /* setup mute and mic-mute GPIO bits, add hooks appropriately */ |
| 3913 | static void alc_fixup_hp_gpio_led(struct hda_codec *codec, |
| 3914 | int action, |
| 3915 | unsigned int mute_mask, |
| 3916 | unsigned int micmute_mask) |
| 3917 | { |
| 3918 | struct alc_spec *spec = codec->spec; |
| 3919 | |
| 3920 | alc_fixup_gpio(codec, action, mute_mask | micmute_mask); |
| 3921 | |
| 3922 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 3923 | return; |
| 3924 | if (mute_mask) { |
| 3925 | spec->gpio_mute_led_mask = mute_mask; |
| 3926 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
| 3927 | } |
| 3928 | if (micmute_mask) { |
| 3929 | spec->gpio_mic_led_mask = micmute_mask; |
| 3930 | snd_hda_gen_add_micmute_led(codec, alc_gpio_micmute_update); |
| 3931 | } |
| 3932 | } |
| 3933 | |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3934 | static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, |
| 3935 | const struct hda_fixup *fix, int action) |
| 3936 | { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 3937 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3938 | } |
| 3939 | |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 3940 | static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, |
| 3941 | const struct hda_fixup *fix, int action) |
| 3942 | { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 3943 | alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3944 | } |
| 3945 | |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3946 | /* turn on/off mic-mute LED per capture hook */ |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3947 | static void alc_cap_micmute_update(struct hda_codec *codec) |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3948 | { |
| 3949 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3950 | unsigned int pinval; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3951 | |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3952 | if (!spec->cap_mute_led_nid) |
| 3953 | return; |
Hui Wang | fc1fad9 | 2014-07-08 17:56:14 +0800 | [diff] [blame] | 3954 | 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] | 3955 | pinval &= ~AC_PINCTL_VREFEN; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3956 | if (spec->gen.micmute_led.led_value) |
| 3957 | pinval |= AC_PINCTL_VREF_80; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3958 | else |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3959 | pinval |= AC_PINCTL_VREF_HIZ; |
| 3960 | 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] | 3961 | } |
| 3962 | |
| 3963 | static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, |
| 3964 | const struct hda_fixup *fix, int action) |
| 3965 | { |
| 3966 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3967 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 3968 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3969 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 3970 | /* Like hp_gpio_mic1_led, but also needs GPIO4 low to |
| 3971 | * enable headphone amp |
| 3972 | */ |
| 3973 | spec->gpio_mask |= 0x10; |
| 3974 | spec->gpio_dir |= 0x10; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3975 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3976 | snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update); |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 3977 | codec->power_filter = led_power_filter; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3978 | } |
| 3979 | } |
| 3980 | |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3981 | static void alc280_fixup_hp_gpio4(struct hda_codec *codec, |
| 3982 | const struct hda_fixup *fix, int action) |
| 3983 | { |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3984 | struct alc_spec *spec = codec->spec; |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3985 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 3986 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3987 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3988 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3989 | snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update); |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3990 | codec->power_filter = led_power_filter; |
| 3991 | } |
| 3992 | } |
| 3993 | |
Takashi Iwai | 6a30aba | 2018-04-27 17:17:35 +0200 | [diff] [blame] | 3994 | #if IS_REACHABLE(CONFIG_INPUT) |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3995 | static void gpio2_mic_hotkey_event(struct hda_codec *codec, |
| 3996 | struct hda_jack_callback *event) |
| 3997 | { |
| 3998 | struct alc_spec *spec = codec->spec; |
| 3999 | |
| 4000 | /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore |
| 4001 | send both key on and key off event for every interrupt. */ |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4002 | 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] | 4003 | input_sync(spec->kb_dev); |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4004 | 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] | 4005 | input_sync(spec->kb_dev); |
| 4006 | } |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4007 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4008 | static int alc_register_micmute_input_device(struct hda_codec *codec) |
| 4009 | { |
| 4010 | struct alc_spec *spec = codec->spec; |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4011 | int i; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4012 | |
| 4013 | spec->kb_dev = input_allocate_device(); |
| 4014 | if (!spec->kb_dev) { |
| 4015 | codec_err(codec, "Out of memory (input_allocate_device)\n"); |
| 4016 | return -ENOMEM; |
| 4017 | } |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4018 | |
| 4019 | spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE; |
| 4020 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4021 | spec->kb_dev->name = "Microphone Mute Button"; |
| 4022 | spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 4023 | spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]); |
| 4024 | spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map); |
| 4025 | spec->kb_dev->keycode = spec->alc_mute_keycode_map; |
| 4026 | for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++) |
| 4027 | set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4028 | |
| 4029 | if (input_register_device(spec->kb_dev)) { |
| 4030 | codec_err(codec, "input_register_device failed\n"); |
| 4031 | input_free_device(spec->kb_dev); |
| 4032 | spec->kb_dev = NULL; |
| 4033 | return -ENOMEM; |
| 4034 | } |
| 4035 | |
| 4036 | return 0; |
| 4037 | } |
| 4038 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4039 | /* GPIO1 = set according to SKU external amp |
| 4040 | * GPIO2 = mic mute hotkey |
| 4041 | * GPIO3 = mute LED |
| 4042 | * GPIO4 = mic mute LED |
| 4043 | */ |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4044 | static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, |
| 4045 | const struct hda_fixup *fix, int action) |
| 4046 | { |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4047 | struct alc_spec *spec = codec->spec; |
| 4048 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4049 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4050 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 4051 | spec->init_amp = ALC_INIT_DEFAULT; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4052 | if (alc_register_micmute_input_device(codec) != 0) |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4053 | return; |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4054 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4055 | spec->gpio_mask |= 0x06; |
| 4056 | spec->gpio_dir |= 0x02; |
| 4057 | spec->gpio_data |= 0x02; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4058 | snd_hda_codec_write_cache(codec, codec->core.afg, 0, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4059 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4060 | snd_hda_jack_detect_enable_callback(codec, codec->core.afg, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4061 | gpio2_mic_hotkey_event); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4062 | return; |
| 4063 | } |
| 4064 | |
| 4065 | if (!spec->kb_dev) |
| 4066 | return; |
| 4067 | |
| 4068 | switch (action) { |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4069 | case HDA_FIXUP_ACT_FREE: |
| 4070 | input_unregister_device(spec->kb_dev); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4071 | spec->kb_dev = NULL; |
| 4072 | } |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4073 | } |
| 4074 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4075 | /* Line2 = mic mute hotkey |
| 4076 | * GPIO2 = mic mute LED |
| 4077 | */ |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4078 | static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, |
| 4079 | const struct hda_fixup *fix, int action) |
| 4080 | { |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4081 | struct alc_spec *spec = codec->spec; |
| 4082 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4083 | alc_fixup_hp_gpio_led(codec, action, 0, 0x04); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4084 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 4085 | spec->init_amp = ALC_INIT_DEFAULT; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4086 | if (alc_register_micmute_input_device(codec) != 0) |
| 4087 | return; |
| 4088 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4089 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
| 4090 | gpio2_mic_hotkey_event); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4091 | return; |
| 4092 | } |
| 4093 | |
| 4094 | if (!spec->kb_dev) |
| 4095 | return; |
| 4096 | |
| 4097 | switch (action) { |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4098 | case HDA_FIXUP_ACT_FREE: |
| 4099 | input_unregister_device(spec->kb_dev); |
| 4100 | spec->kb_dev = NULL; |
| 4101 | } |
| 4102 | } |
Takashi Iwai | c469652 | 2018-01-15 10:44:35 +0100 | [diff] [blame] | 4103 | #else /* INPUT */ |
| 4104 | #define alc280_fixup_hp_gpio2_mic_hotkey NULL |
| 4105 | #define alc233_fixup_lenovo_line2_mic_hotkey NULL |
| 4106 | #endif /* INPUT */ |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4107 | |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4108 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, |
| 4109 | const struct hda_fixup *fix, int action) |
| 4110 | { |
| 4111 | struct alc_spec *spec = codec->spec; |
| 4112 | |
Takashi Iwai | 1bce62a | 2018-06-19 23:15:59 +0200 | [diff] [blame] | 4113 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4114 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4115 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 4116 | snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4117 | } |
| 4118 | } |
| 4119 | |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4120 | static struct coef_fw alc225_pre_hsmode[] = { |
| 4121 | UPDATE_COEF(0x4a, 1<<8, 0), |
| 4122 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), |
| 4123 | UPDATE_COEF(0x63, 3<<14, 3<<14), |
| 4124 | UPDATE_COEF(0x4a, 3<<4, 2<<4), |
| 4125 | UPDATE_COEF(0x4a, 3<<10, 3<<10), |
| 4126 | UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), |
| 4127 | UPDATE_COEF(0x4a, 3<<10, 0), |
| 4128 | {} |
| 4129 | }; |
| 4130 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4131 | static void alc_headset_mode_unplugged(struct hda_codec *codec) |
| 4132 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4133 | static struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4134 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
| 4135 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 4136 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ |
| 4137 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ |
| 4138 | {} |
| 4139 | }; |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4140 | static struct coef_fw coef0255_1[] = { |
| 4141 | WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ |
| 4142 | {} |
| 4143 | }; |
| 4144 | static struct coef_fw coef0256[] = { |
| 4145 | WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */ |
| 4146 | {} |
| 4147 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4148 | static struct coef_fw coef0233[] = { |
| 4149 | WRITE_COEF(0x1b, 0x0c0b), |
| 4150 | WRITE_COEF(0x45, 0xc429), |
| 4151 | UPDATE_COEF(0x35, 0x4000, 0), |
| 4152 | WRITE_COEF(0x06, 0x2104), |
| 4153 | WRITE_COEF(0x1a, 0x0001), |
| 4154 | WRITE_COEF(0x26, 0x0004), |
| 4155 | WRITE_COEF(0x32, 0x42a3), |
| 4156 | {} |
| 4157 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4158 | static struct coef_fw coef0288[] = { |
| 4159 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
| 4160 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4161 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4162 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4163 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4164 | {} |
| 4165 | }; |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4166 | static struct coef_fw coef0298[] = { |
| 4167 | UPDATE_COEF(0x19, 0x1300, 0x0300), |
| 4168 | {} |
| 4169 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4170 | static struct coef_fw coef0292[] = { |
| 4171 | WRITE_COEF(0x76, 0x000e), |
| 4172 | WRITE_COEF(0x6c, 0x2400), |
| 4173 | WRITE_COEF(0x18, 0x7308), |
| 4174 | WRITE_COEF(0x6b, 0xc429), |
| 4175 | {} |
| 4176 | }; |
| 4177 | static struct coef_fw coef0293[] = { |
| 4178 | UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ |
| 4179 | UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ |
| 4180 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ |
| 4181 | UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ |
| 4182 | WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ |
| 4183 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 4184 | {} |
| 4185 | }; |
| 4186 | static struct coef_fw coef0668[] = { |
| 4187 | WRITE_COEF(0x15, 0x0d40), |
| 4188 | WRITE_COEF(0xb7, 0x802b), |
| 4189 | {} |
| 4190 | }; |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4191 | static struct coef_fw coef0225[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4192 | UPDATE_COEF(0x63, 3<<14, 0), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4193 | {} |
| 4194 | }; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4195 | static struct coef_fw coef0274[] = { |
| 4196 | UPDATE_COEF(0x4a, 0x0100, 0), |
| 4197 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0), |
| 4198 | UPDATE_COEF(0x6b, 0xf000, 0x5000), |
| 4199 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4200 | UPDATE_COEF(0x4a, 0x0c00, 0x0c00), |
| 4201 | WRITE_COEF(0x45, 0x5289), |
| 4202 | UPDATE_COEF(0x4a, 0x0c00, 0), |
| 4203 | {} |
| 4204 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4205 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4206 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4207 | case 0x10ec0255: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4208 | alc_process_coef_fw(codec, coef0255_1); |
| 4209 | alc_process_coef_fw(codec, coef0255); |
| 4210 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4211 | case 0x10ec0236: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4212 | case 0x10ec0256: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4213 | alc_process_coef_fw(codec, coef0256); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4214 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4215 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4216 | case 0x10ec0234: |
| 4217 | case 0x10ec0274: |
| 4218 | case 0x10ec0294: |
| 4219 | alc_process_coef_fw(codec, coef0274); |
| 4220 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4221 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4222 | case 0x10ec0283: |
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 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4225 | case 0x10ec0286: |
| 4226 | case 0x10ec0288: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4227 | alc_process_coef_fw(codec, coef0288); |
| 4228 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4229 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4230 | alc_process_coef_fw(codec, coef0298); |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4231 | alc_process_coef_fw(codec, coef0288); |
| 4232 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4233 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4234 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4235 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4236 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4237 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4238 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4239 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4240 | alc_process_coef_fw(codec, coef0668); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4241 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4242 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4243 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4244 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4245 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4246 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4247 | case 0x10ec0299: |
Kailang Yang | 4d4b0c5 | 2019-01-09 16:23:37 +0800 | [diff] [blame] | 4248 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4249 | alc_process_coef_fw(codec, coef0225); |
| 4250 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4251 | case 0x10ec0867: |
| 4252 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4253 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4254 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4255 | codec_dbg(codec, "Headset jack set to unplugged mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4256 | } |
| 4257 | |
| 4258 | |
| 4259 | static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, |
| 4260 | hda_nid_t mic_pin) |
| 4261 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4262 | static struct coef_fw coef0255[] = { |
| 4263 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), |
| 4264 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ |
| 4265 | {} |
| 4266 | }; |
| 4267 | static struct coef_fw coef0233[] = { |
| 4268 | UPDATE_COEF(0x35, 0, 1<<14), |
| 4269 | WRITE_COEF(0x06, 0x2100), |
| 4270 | WRITE_COEF(0x1a, 0x0021), |
| 4271 | WRITE_COEF(0x26, 0x008c), |
| 4272 | {} |
| 4273 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4274 | static struct coef_fw coef0288[] = { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4275 | UPDATE_COEF(0x4f, 0x00c0, 0), |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4276 | UPDATE_COEF(0x50, 0x2000, 0), |
| 4277 | UPDATE_COEF(0x56, 0x0006, 0), |
| 4278 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
| 4279 | UPDATE_COEF(0x66, 0x0008, 0x0008), |
| 4280 | UPDATE_COEF(0x67, 0x2000, 0x2000), |
| 4281 | {} |
| 4282 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4283 | static struct coef_fw coef0292[] = { |
| 4284 | WRITE_COEF(0x19, 0xa208), |
| 4285 | WRITE_COEF(0x2e, 0xacf0), |
| 4286 | {} |
| 4287 | }; |
| 4288 | static struct coef_fw coef0293[] = { |
| 4289 | UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ |
| 4290 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ |
| 4291 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 4292 | {} |
| 4293 | }; |
| 4294 | static struct coef_fw coef0688[] = { |
| 4295 | WRITE_COEF(0xb7, 0x802b), |
| 4296 | WRITE_COEF(0xb5, 0x1040), |
| 4297 | UPDATE_COEF(0xc3, 0, 1<<12), |
| 4298 | {} |
| 4299 | }; |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4300 | static struct coef_fw coef0225[] = { |
| 4301 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), |
| 4302 | UPDATE_COEF(0x4a, 3<<4, 2<<4), |
| 4303 | UPDATE_COEF(0x63, 3<<14, 0), |
| 4304 | {} |
| 4305 | }; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4306 | static struct coef_fw coef0274[] = { |
| 4307 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000), |
| 4308 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4309 | UPDATE_COEF(0x6b, 0xf000, 0), |
| 4310 | {} |
| 4311 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4312 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4313 | switch (codec->core.vendor_id) { |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4314 | case 0x10ec0236: |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4315 | case 0x10ec0255: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4316 | case 0x10ec0256: |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4317 | alc_write_coef_idx(codec, 0x45, 0xc489); |
| 4318 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4319 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4320 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4321 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4322 | case 0x10ec0234: |
| 4323 | case 0x10ec0274: |
| 4324 | case 0x10ec0294: |
| 4325 | alc_write_coef_idx(codec, 0x45, 0x4689); |
| 4326 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4327 | alc_process_coef_fw(codec, coef0274); |
| 4328 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4329 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4330 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4331 | case 0x10ec0283: |
| 4332 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 4333 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4334 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4335 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4336 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4337 | case 0x10ec0286: |
| 4338 | case 0x10ec0288: |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4339 | case 0x10ec0298: |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4340 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4341 | alc_process_coef_fw(codec, coef0288); |
| 4342 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4343 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4344 | case 0x10ec0292: |
| 4345 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4346 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4347 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4348 | case 0x10ec0293: |
| 4349 | /* Set to TRS mode */ |
| 4350 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 4351 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4352 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4353 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4354 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4355 | case 0x10ec0867: |
| 4356 | alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); |
| 4357 | /* fallthru */ |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 4358 | case 0x10ec0221: |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 4359 | case 0x10ec0662: |
| 4360 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4361 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4362 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4363 | case 0x10ec0668: |
| 4364 | alc_write_coef_idx(codec, 0x11, 0x0001); |
| 4365 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4366 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4367 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4368 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4369 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4370 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4371 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4372 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4373 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4374 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4375 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4376 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); |
| 4377 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4378 | alc_process_coef_fw(codec, coef0225); |
| 4379 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4380 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4381 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4382 | codec_dbg(codec, "Headset jack set to mic-in mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4383 | } |
| 4384 | |
| 4385 | static void alc_headset_mode_default(struct hda_codec *codec) |
| 4386 | { |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4387 | static struct coef_fw coef0225[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4388 | UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10), |
| 4389 | UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10), |
| 4390 | UPDATE_COEF(0x49, 3<<8, 0<<8), |
| 4391 | UPDATE_COEF(0x4a, 3<<4, 3<<4), |
| 4392 | UPDATE_COEF(0x63, 3<<14, 0), |
| 4393 | UPDATE_COEF(0x67, 0xf000, 0x3000), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4394 | {} |
| 4395 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4396 | static struct coef_fw coef0255[] = { |
| 4397 | WRITE_COEF(0x45, 0xc089), |
| 4398 | WRITE_COEF(0x45, 0xc489), |
| 4399 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4400 | WRITE_COEF(0x49, 0x0049), |
| 4401 | {} |
| 4402 | }; |
| 4403 | static struct coef_fw coef0233[] = { |
| 4404 | WRITE_COEF(0x06, 0x2100), |
| 4405 | WRITE_COEF(0x32, 0x4ea3), |
| 4406 | {} |
| 4407 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4408 | static struct coef_fw coef0288[] = { |
| 4409 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ |
| 4410 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4411 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4412 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4413 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4414 | {} |
| 4415 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4416 | static struct coef_fw coef0292[] = { |
| 4417 | WRITE_COEF(0x76, 0x000e), |
| 4418 | WRITE_COEF(0x6c, 0x2400), |
| 4419 | WRITE_COEF(0x6b, 0xc429), |
| 4420 | WRITE_COEF(0x18, 0x7308), |
| 4421 | {} |
| 4422 | }; |
| 4423 | static struct coef_fw coef0293[] = { |
| 4424 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 4425 | WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ |
| 4426 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 4427 | {} |
| 4428 | }; |
| 4429 | static struct coef_fw coef0688[] = { |
| 4430 | WRITE_COEF(0x11, 0x0041), |
| 4431 | WRITE_COEF(0x15, 0x0d40), |
| 4432 | WRITE_COEF(0xb7, 0x802b), |
| 4433 | {} |
| 4434 | }; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4435 | static struct coef_fw coef0274[] = { |
| 4436 | WRITE_COEF(0x45, 0x4289), |
| 4437 | UPDATE_COEF(0x4a, 0x0010, 0x0010), |
| 4438 | UPDATE_COEF(0x6b, 0x0f00, 0), |
| 4439 | UPDATE_COEF(0x49, 0x0300, 0x0300), |
| 4440 | {} |
| 4441 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4442 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4443 | switch (codec->core.vendor_id) { |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4444 | case 0x10ec0215: |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4445 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4446 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4447 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4448 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4449 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4450 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4451 | alc_process_coef_fw(codec, coef0225); |
| 4452 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4453 | case 0x10ec0236: |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4454 | case 0x10ec0255: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4455 | case 0x10ec0256: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4456 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4457 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4458 | case 0x10ec0234: |
| 4459 | case 0x10ec0274: |
| 4460 | case 0x10ec0294: |
| 4461 | alc_process_coef_fw(codec, coef0274); |
| 4462 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4463 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4464 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4465 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4466 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4467 | case 0x10ec0286: |
| 4468 | case 0x10ec0288: |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4469 | case 0x10ec0298: |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4470 | alc_process_coef_fw(codec, coef0288); |
| 4471 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4472 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4473 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4474 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4475 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4476 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4477 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4478 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4479 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4480 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4481 | case 0x10ec0867: |
| 4482 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4483 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4484 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4485 | codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4486 | } |
| 4487 | |
| 4488 | /* Iphone type */ |
| 4489 | static void alc_headset_mode_ctia(struct hda_codec *codec) |
| 4490 | { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4491 | int val; |
| 4492 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4493 | static struct coef_fw coef0255[] = { |
| 4494 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
| 4495 | WRITE_COEF(0x1b, 0x0c2b), |
| 4496 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4497 | {} |
| 4498 | }; |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4499 | static struct coef_fw coef0256[] = { |
| 4500 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
| 4501 | WRITE_COEF(0x1b, 0x0c6b), |
| 4502 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4503 | {} |
| 4504 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4505 | static struct coef_fw coef0233[] = { |
| 4506 | WRITE_COEF(0x45, 0xd429), |
| 4507 | WRITE_COEF(0x1b, 0x0c2b), |
| 4508 | WRITE_COEF(0x32, 0x4ea3), |
| 4509 | {} |
| 4510 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4511 | static struct coef_fw coef0288[] = { |
| 4512 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4513 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4514 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4515 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4516 | {} |
| 4517 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4518 | static struct coef_fw coef0292[] = { |
| 4519 | WRITE_COEF(0x6b, 0xd429), |
| 4520 | WRITE_COEF(0x76, 0x0008), |
| 4521 | WRITE_COEF(0x18, 0x7388), |
| 4522 | {} |
| 4523 | }; |
| 4524 | static struct coef_fw coef0293[] = { |
| 4525 | WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ |
| 4526 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 4527 | {} |
| 4528 | }; |
| 4529 | static struct coef_fw coef0688[] = { |
| 4530 | WRITE_COEF(0x11, 0x0001), |
| 4531 | WRITE_COEF(0x15, 0x0d60), |
| 4532 | WRITE_COEF(0xc3, 0x0000), |
| 4533 | {} |
| 4534 | }; |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4535 | static struct coef_fw coef0225_1[] = { |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4536 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4537 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
| 4538 | {} |
| 4539 | }; |
| 4540 | static struct coef_fw coef0225_2[] = { |
| 4541 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
| 4542 | UPDATE_COEF(0x63, 3<<14, 1<<14), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4543 | {} |
| 4544 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4545 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4546 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4547 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4548 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4549 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4550 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4551 | case 0x10ec0256: |
| 4552 | alc_process_coef_fw(codec, coef0256); |
| 4553 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4554 | case 0x10ec0234: |
| 4555 | case 0x10ec0274: |
| 4556 | case 0x10ec0294: |
| 4557 | alc_write_coef_idx(codec, 0x45, 0xd689); |
| 4558 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4559 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4560 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4561 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4562 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4563 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4564 | val = alc_read_coef_idx(codec, 0x50); |
| 4565 | if (val & (1 << 12)) { |
| 4566 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); |
| 4567 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 4568 | msleep(300); |
| 4569 | } else { |
| 4570 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); |
| 4571 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 4572 | msleep(300); |
| 4573 | } |
| 4574 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4575 | case 0x10ec0286: |
| 4576 | case 0x10ec0288: |
| 4577 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 4578 | msleep(300); |
| 4579 | alc_process_coef_fw(codec, coef0288); |
| 4580 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4581 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4582 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4583 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4584 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4585 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4586 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4587 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4588 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4589 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4590 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4591 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4592 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4593 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4594 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4595 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4596 | val = alc_read_coef_idx(codec, 0x45); |
| 4597 | if (val & (1 << 9)) |
| 4598 | alc_process_coef_fw(codec, coef0225_2); |
| 4599 | else |
| 4600 | alc_process_coef_fw(codec, coef0225_1); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4601 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4602 | case 0x10ec0867: |
| 4603 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4604 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4605 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4606 | codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4607 | } |
| 4608 | |
| 4609 | /* Nokia type */ |
| 4610 | static void alc_headset_mode_omtp(struct hda_codec *codec) |
| 4611 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4612 | static struct coef_fw coef0255[] = { |
| 4613 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
| 4614 | WRITE_COEF(0x1b, 0x0c2b), |
| 4615 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4616 | {} |
| 4617 | }; |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4618 | static struct coef_fw coef0256[] = { |
| 4619 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
| 4620 | WRITE_COEF(0x1b, 0x0c6b), |
| 4621 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4622 | {} |
| 4623 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4624 | static struct coef_fw coef0233[] = { |
| 4625 | WRITE_COEF(0x45, 0xe429), |
| 4626 | WRITE_COEF(0x1b, 0x0c2b), |
| 4627 | WRITE_COEF(0x32, 0x4ea3), |
| 4628 | {} |
| 4629 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4630 | static struct coef_fw coef0288[] = { |
| 4631 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4632 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4633 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4634 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4635 | {} |
| 4636 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4637 | static struct coef_fw coef0292[] = { |
| 4638 | WRITE_COEF(0x6b, 0xe429), |
| 4639 | WRITE_COEF(0x76, 0x0008), |
| 4640 | WRITE_COEF(0x18, 0x7388), |
| 4641 | {} |
| 4642 | }; |
| 4643 | static struct coef_fw coef0293[] = { |
| 4644 | WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ |
| 4645 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 4646 | {} |
| 4647 | }; |
| 4648 | static struct coef_fw coef0688[] = { |
| 4649 | WRITE_COEF(0x11, 0x0001), |
| 4650 | WRITE_COEF(0x15, 0x0d50), |
| 4651 | WRITE_COEF(0xc3, 0x0000), |
| 4652 | {} |
| 4653 | }; |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4654 | static struct coef_fw coef0225[] = { |
| 4655 | UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4656 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4657 | {} |
| 4658 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4659 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4660 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4661 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4662 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4663 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4664 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4665 | case 0x10ec0256: |
| 4666 | alc_process_coef_fw(codec, coef0256); |
| 4667 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4668 | case 0x10ec0234: |
| 4669 | case 0x10ec0274: |
| 4670 | case 0x10ec0294: |
| 4671 | alc_write_coef_idx(codec, 0x45, 0xe689); |
| 4672 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4673 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4674 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4675 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4676 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4677 | case 0x10ec0298: |
| 4678 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4679 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
| 4680 | msleep(300); |
| 4681 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4682 | case 0x10ec0286: |
| 4683 | case 0x10ec0288: |
| 4684 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
| 4685 | msleep(300); |
| 4686 | alc_process_coef_fw(codec, coef0288); |
| 4687 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4688 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4689 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4690 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4691 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4692 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4693 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4694 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4695 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4696 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4697 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4698 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4699 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4700 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4701 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4702 | case 0x10ec0299: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4703 | alc_process_coef_fw(codec, coef0225); |
| 4704 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4705 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4706 | codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4707 | } |
| 4708 | |
| 4709 | static void alc_determine_headset_type(struct hda_codec *codec) |
| 4710 | { |
| 4711 | int val; |
| 4712 | bool is_ctia = false; |
| 4713 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4714 | static struct coef_fw coef0255[] = { |
| 4715 | WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ |
| 4716 | WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref |
| 4717 | conteol) */ |
| 4718 | {} |
| 4719 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4720 | static struct coef_fw coef0288[] = { |
| 4721 | UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ |
| 4722 | {} |
| 4723 | }; |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4724 | static struct coef_fw coef0298[] = { |
| 4725 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4726 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4727 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4728 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4729 | UPDATE_COEF(0x19, 0x1300, 0x1300), |
| 4730 | {} |
| 4731 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4732 | static struct coef_fw coef0293[] = { |
| 4733 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ |
| 4734 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ |
| 4735 | {} |
| 4736 | }; |
| 4737 | static struct coef_fw coef0688[] = { |
| 4738 | WRITE_COEF(0x11, 0x0001), |
| 4739 | WRITE_COEF(0xb7, 0x802b), |
| 4740 | WRITE_COEF(0x15, 0x0d60), |
| 4741 | WRITE_COEF(0xc3, 0x0c00), |
| 4742 | {} |
| 4743 | }; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4744 | static struct coef_fw coef0274[] = { |
| 4745 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4746 | UPDATE_COEF(0x4a, 0x8000, 0), |
| 4747 | WRITE_COEF(0x45, 0xd289), |
| 4748 | UPDATE_COEF(0x49, 0x0300, 0x0300), |
| 4749 | {} |
| 4750 | }; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4751 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4752 | switch (codec->core.vendor_id) { |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4753 | case 0x10ec0236: |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4754 | case 0x10ec0255: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4755 | case 0x10ec0256: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4756 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4757 | msleep(300); |
| 4758 | val = alc_read_coef_idx(codec, 0x46); |
| 4759 | is_ctia = (val & 0x0070) == 0x0070; |
| 4760 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4761 | case 0x10ec0234: |
| 4762 | case 0x10ec0274: |
| 4763 | case 0x10ec0294: |
| 4764 | alc_process_coef_fw(codec, coef0274); |
| 4765 | msleep(80); |
| 4766 | val = alc_read_coef_idx(codec, 0x46); |
| 4767 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 4768 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4769 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4770 | case 0x10ec0283: |
| 4771 | alc_write_coef_idx(codec, 0x45, 0xd029); |
| 4772 | msleep(300); |
| 4773 | val = alc_read_coef_idx(codec, 0x46); |
| 4774 | is_ctia = (val & 0x0070) == 0x0070; |
| 4775 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4776 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4777 | snd_hda_codec_write(codec, 0x21, 0, |
| 4778 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 4779 | msleep(100); |
| 4780 | snd_hda_codec_write(codec, 0x21, 0, |
| 4781 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 4782 | msleep(200); |
| 4783 | |
| 4784 | val = alc_read_coef_idx(codec, 0x50); |
| 4785 | if (val & (1 << 12)) { |
| 4786 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); |
| 4787 | alc_process_coef_fw(codec, coef0288); |
| 4788 | msleep(350); |
| 4789 | val = alc_read_coef_idx(codec, 0x50); |
| 4790 | is_ctia = (val & 0x0070) == 0x0070; |
| 4791 | } else { |
| 4792 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); |
| 4793 | alc_process_coef_fw(codec, coef0288); |
| 4794 | msleep(350); |
| 4795 | val = alc_read_coef_idx(codec, 0x50); |
| 4796 | is_ctia = (val & 0x0070) == 0x0070; |
| 4797 | } |
| 4798 | alc_process_coef_fw(codec, coef0298); |
| 4799 | snd_hda_codec_write(codec, 0x21, 0, |
| 4800 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); |
| 4801 | msleep(75); |
| 4802 | snd_hda_codec_write(codec, 0x21, 0, |
| 4803 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
| 4804 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4805 | case 0x10ec0286: |
| 4806 | case 0x10ec0288: |
| 4807 | alc_process_coef_fw(codec, coef0288); |
| 4808 | msleep(350); |
| 4809 | val = alc_read_coef_idx(codec, 0x50); |
| 4810 | is_ctia = (val & 0x0070) == 0x0070; |
| 4811 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4812 | case 0x10ec0292: |
| 4813 | alc_write_coef_idx(codec, 0x6b, 0xd429); |
| 4814 | msleep(300); |
| 4815 | val = alc_read_coef_idx(codec, 0x6c); |
| 4816 | is_ctia = (val & 0x001c) == 0x001c; |
| 4817 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4818 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4819 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4820 | msleep(300); |
| 4821 | val = alc_read_coef_idx(codec, 0x46); |
| 4822 | is_ctia = (val & 0x0070) == 0x0070; |
| 4823 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4824 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4825 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4826 | msleep(300); |
| 4827 | val = alc_read_coef_idx(codec, 0xbe); |
| 4828 | is_ctia = (val & 0x1c02) == 0x1c02; |
| 4829 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4830 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4831 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4832 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4833 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4834 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4835 | case 0x10ec0299: |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 4836 | snd_hda_codec_write(codec, 0x21, 0, |
| 4837 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 4838 | msleep(80); |
| 4839 | snd_hda_codec_write(codec, 0x21, 0, |
| 4840 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 4841 | |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4842 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
| 4843 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); |
| 4844 | val = alc_read_coef_idx(codec, 0x45); |
| 4845 | if (val & (1 << 9)) { |
| 4846 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); |
| 4847 | alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); |
| 4848 | msleep(800); |
| 4849 | val = alc_read_coef_idx(codec, 0x46); |
| 4850 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 4851 | } else { |
| 4852 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); |
| 4853 | alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); |
| 4854 | msleep(800); |
| 4855 | val = alc_read_coef_idx(codec, 0x46); |
| 4856 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 4857 | } |
| 4858 | alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); |
| 4859 | alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); |
| 4860 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 4861 | |
| 4862 | snd_hda_codec_write(codec, 0x21, 0, |
| 4863 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 4864 | msleep(80); |
| 4865 | snd_hda_codec_write(codec, 0x21, 0, |
| 4866 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4867 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4868 | case 0x10ec0867: |
| 4869 | is_ctia = true; |
| 4870 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4871 | } |
| 4872 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4873 | codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4874 | is_ctia ? "yes" : "no"); |
| 4875 | spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; |
| 4876 | } |
| 4877 | |
| 4878 | static void alc_update_headset_mode(struct hda_codec *codec) |
| 4879 | { |
| 4880 | struct alc_spec *spec = codec->spec; |
| 4881 | |
| 4882 | hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]]; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 4883 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4884 | |
| 4885 | int new_headset_mode; |
| 4886 | |
| 4887 | if (!snd_hda_jack_detect(codec, hp_pin)) |
| 4888 | new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; |
| 4889 | else if (mux_pin == spec->headset_mic_pin) |
| 4890 | new_headset_mode = ALC_HEADSET_MODE_HEADSET; |
| 4891 | else if (mux_pin == spec->headphone_mic_pin) |
| 4892 | new_headset_mode = ALC_HEADSET_MODE_MIC; |
| 4893 | else |
| 4894 | new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; |
| 4895 | |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 4896 | if (new_headset_mode == spec->current_headset_mode) { |
| 4897 | snd_hda_gen_update_outputs(codec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4898 | return; |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 4899 | } |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4900 | |
| 4901 | switch (new_headset_mode) { |
| 4902 | case ALC_HEADSET_MODE_UNPLUGGED: |
| 4903 | alc_headset_mode_unplugged(codec); |
| 4904 | spec->gen.hp_jack_present = false; |
| 4905 | break; |
| 4906 | case ALC_HEADSET_MODE_HEADSET: |
| 4907 | if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) |
| 4908 | alc_determine_headset_type(codec); |
| 4909 | if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) |
| 4910 | alc_headset_mode_ctia(codec); |
| 4911 | else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) |
| 4912 | alc_headset_mode_omtp(codec); |
| 4913 | spec->gen.hp_jack_present = true; |
| 4914 | break; |
| 4915 | case ALC_HEADSET_MODE_MIC: |
| 4916 | alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); |
| 4917 | spec->gen.hp_jack_present = false; |
| 4918 | break; |
| 4919 | case ALC_HEADSET_MODE_HEADPHONE: |
| 4920 | alc_headset_mode_default(codec); |
| 4921 | spec->gen.hp_jack_present = true; |
| 4922 | break; |
| 4923 | } |
| 4924 | if (new_headset_mode != ALC_HEADSET_MODE_MIC) { |
| 4925 | snd_hda_set_pin_ctl_cache(codec, hp_pin, |
| 4926 | AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 4927 | if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4928 | snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, |
| 4929 | PIN_VREFHIZ); |
| 4930 | } |
| 4931 | spec->current_headset_mode = new_headset_mode; |
| 4932 | |
| 4933 | snd_hda_gen_update_outputs(codec); |
| 4934 | } |
| 4935 | |
| 4936 | static void alc_update_headset_mode_hook(struct hda_codec *codec, |
Takashi Iwai | 7fe3071 | 2014-01-30 17:59:02 +0100 | [diff] [blame] | 4937 | struct snd_kcontrol *kcontrol, |
| 4938 | struct snd_ctl_elem_value *ucontrol) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4939 | { |
| 4940 | alc_update_headset_mode(codec); |
| 4941 | } |
| 4942 | |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 4943 | static void alc_update_headset_jack_cb(struct hda_codec *codec, |
| 4944 | struct hda_jack_callback *jack) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4945 | { |
| 4946 | struct alc_spec *spec = codec->spec; |
David Henningsson | 5db4d34 | 2013-11-22 12:17:06 +0100 | [diff] [blame] | 4947 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4948 | snd_hda_gen_hp_automute(codec, jack); |
| 4949 | } |
| 4950 | |
| 4951 | static void alc_probe_headset_mode(struct hda_codec *codec) |
| 4952 | { |
| 4953 | int i; |
| 4954 | struct alc_spec *spec = codec->spec; |
| 4955 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 4956 | |
| 4957 | /* Find mic pins */ |
| 4958 | for (i = 0; i < cfg->num_inputs; i++) { |
| 4959 | if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) |
| 4960 | spec->headset_mic_pin = cfg->inputs[i].pin; |
| 4961 | if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) |
| 4962 | spec->headphone_mic_pin = cfg->inputs[i].pin; |
| 4963 | } |
| 4964 | |
Takashi Iwai | 0bed2aa | 2018-06-19 12:45:53 +0200 | [diff] [blame] | 4965 | WARN_ON(spec->gen.cap_sync_hook); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4966 | spec->gen.cap_sync_hook = alc_update_headset_mode_hook; |
| 4967 | spec->gen.automute_hook = alc_update_headset_mode; |
| 4968 | spec->gen.hp_automute_hook = alc_update_headset_jack_cb; |
| 4969 | } |
| 4970 | |
| 4971 | static void alc_fixup_headset_mode(struct hda_codec *codec, |
| 4972 | const struct hda_fixup *fix, int action) |
| 4973 | { |
| 4974 | struct alc_spec *spec = codec->spec; |
| 4975 | |
| 4976 | switch (action) { |
| 4977 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 4978 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; |
| 4979 | break; |
| 4980 | case HDA_FIXUP_ACT_PROBE: |
| 4981 | alc_probe_headset_mode(codec); |
| 4982 | break; |
| 4983 | case HDA_FIXUP_ACT_INIT: |
| 4984 | spec->current_headset_mode = 0; |
| 4985 | alc_update_headset_mode(codec); |
| 4986 | break; |
| 4987 | } |
| 4988 | } |
| 4989 | |
| 4990 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
| 4991 | const struct hda_fixup *fix, int action) |
| 4992 | { |
| 4993 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4994 | struct alc_spec *spec = codec->spec; |
| 4995 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 4996 | } |
| 4997 | else |
| 4998 | alc_fixup_headset_mode(codec, fix, action); |
| 4999 | } |
| 5000 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5001 | static void alc255_set_default_jack_type(struct hda_codec *codec) |
| 5002 | { |
| 5003 | /* Set to iphone type */ |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5004 | static struct coef_fw alc255fw[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 5005 | WRITE_COEF(0x1b, 0x880b), |
| 5006 | WRITE_COEF(0x45, 0xd089), |
| 5007 | WRITE_COEF(0x1b, 0x080b), |
| 5008 | WRITE_COEF(0x46, 0x0004), |
| 5009 | WRITE_COEF(0x1b, 0x0c0b), |
| 5010 | {} |
| 5011 | }; |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5012 | static struct coef_fw alc256fw[] = { |
| 5013 | WRITE_COEF(0x1b, 0x884b), |
| 5014 | WRITE_COEF(0x45, 0xd089), |
| 5015 | WRITE_COEF(0x1b, 0x084b), |
| 5016 | WRITE_COEF(0x46, 0x0004), |
| 5017 | WRITE_COEF(0x1b, 0x0c4b), |
| 5018 | {} |
| 5019 | }; |
| 5020 | switch (codec->core.vendor_id) { |
| 5021 | case 0x10ec0255: |
| 5022 | alc_process_coef_fw(codec, alc255fw); |
| 5023 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 5024 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 5025 | case 0x10ec0256: |
| 5026 | alc_process_coef_fw(codec, alc256fw); |
| 5027 | break; |
| 5028 | } |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5029 | msleep(30); |
| 5030 | } |
| 5031 | |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5032 | static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, |
| 5033 | const struct hda_fixup *fix, int action) |
| 5034 | { |
| 5035 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5036 | alc255_set_default_jack_type(codec); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5037 | } |
| 5038 | alc_fixup_headset_mode(codec, fix, action); |
| 5039 | } |
| 5040 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5041 | static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, |
| 5042 | const struct hda_fixup *fix, int action) |
| 5043 | { |
| 5044 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5045 | struct alc_spec *spec = codec->spec; |
| 5046 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5047 | alc255_set_default_jack_type(codec); |
| 5048 | } |
| 5049 | else |
| 5050 | alc_fixup_headset_mode(codec, fix, action); |
| 5051 | } |
| 5052 | |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5053 | static void alc288_update_headset_jack_cb(struct hda_codec *codec, |
| 5054 | struct hda_jack_callback *jack) |
| 5055 | { |
| 5056 | struct alc_spec *spec = codec->spec; |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5057 | |
| 5058 | alc_update_headset_jack_cb(codec, jack); |
| 5059 | /* Headset Mic enable or disable, only for Dell Dino */ |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 5060 | alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present); |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5061 | } |
| 5062 | |
| 5063 | static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, |
| 5064 | const struct hda_fixup *fix, int action) |
| 5065 | { |
| 5066 | alc_fixup_headset_mode(codec, fix, action); |
| 5067 | if (action == HDA_FIXUP_ACT_PROBE) { |
| 5068 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 5069 | /* toggled via hp_automute_hook */ |
| 5070 | spec->gpio_mask |= 0x40; |
| 5071 | spec->gpio_dir |= 0x40; |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5072 | spec->gen.hp_automute_hook = alc288_update_headset_jack_cb; |
| 5073 | } |
| 5074 | } |
| 5075 | |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 5076 | static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, |
| 5077 | const struct hda_fixup *fix, int action) |
| 5078 | { |
| 5079 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5080 | struct alc_spec *spec = codec->spec; |
| 5081 | spec->gen.auto_mute_via_amp = 1; |
| 5082 | } |
| 5083 | } |
| 5084 | |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5085 | static void alc_fixup_no_shutup(struct hda_codec *codec, |
| 5086 | const struct hda_fixup *fix, int action) |
| 5087 | { |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 5088 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5089 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 5090 | spec->no_shutup_pins = 1; |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5091 | } |
| 5092 | } |
| 5093 | |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 5094 | static void alc_fixup_disable_aamix(struct hda_codec *codec, |
| 5095 | const struct hda_fixup *fix, int action) |
| 5096 | { |
| 5097 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5098 | struct alc_spec *spec = codec->spec; |
| 5099 | /* Disable AA-loopback as it causes white noise */ |
| 5100 | spec->gen.mixer_nid = 0; |
| 5101 | } |
| 5102 | } |
| 5103 | |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 5104 | /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */ |
| 5105 | static void alc_fixup_tpt440_dock(struct hda_codec *codec, |
| 5106 | const struct hda_fixup *fix, int action) |
| 5107 | { |
| 5108 | static const struct hda_pintbl pincfgs[] = { |
| 5109 | { 0x16, 0x21211010 }, /* dock headphone */ |
| 5110 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 5111 | { } |
| 5112 | }; |
| 5113 | struct alc_spec *spec = codec->spec; |
| 5114 | |
| 5115 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 5116 | spec->reboot_notify = alc_d3_at_reboot; /* reduce noise */ |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 5117 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 5118 | codec->power_save_node = 0; /* avoid click noises */ |
| 5119 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 5120 | } |
| 5121 | } |
| 5122 | |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5123 | static void alc_fixup_tpt470_dock(struct hda_codec *codec, |
| 5124 | const struct hda_fixup *fix, int action) |
| 5125 | { |
| 5126 | static const struct hda_pintbl pincfgs[] = { |
| 5127 | { 0x17, 0x21211010 }, /* dock headphone */ |
| 5128 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 5129 | { } |
| 5130 | }; |
Takashi Iwai | 54947cd | 2018-12-03 10:44:15 +0100 | [diff] [blame] | 5131 | /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise |
| 5132 | * the speaker output becomes too low by some reason on Thinkpads with |
| 5133 | * ALC298 codec |
| 5134 | */ |
| 5135 | static hda_nid_t preferred_pairs[] = { |
| 5136 | 0x14, 0x03, 0x17, 0x02, 0x21, 0x02, |
| 5137 | 0 |
| 5138 | }; |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5139 | struct alc_spec *spec = codec->spec; |
| 5140 | |
| 5141 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 54947cd | 2018-12-03 10:44:15 +0100 | [diff] [blame] | 5142 | spec->gen.preferred_dacs = preferred_pairs; |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5143 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
Takashi Iwai | 71db96d | 2018-02-26 15:36:38 +0100 | [diff] [blame] | 5144 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 5145 | } else if (action == HDA_FIXUP_ACT_INIT) { |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5146 | /* Enable DOCK device */ |
| 5147 | snd_hda_codec_write(codec, 0x17, 0, |
| 5148 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); |
| 5149 | /* Enable DOCK device */ |
| 5150 | snd_hda_codec_write(codec, 0x19, 0, |
| 5151 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5152 | } |
| 5153 | } |
| 5154 | |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5155 | static void alc_shutup_dell_xps13(struct hda_codec *codec) |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5156 | { |
| 5157 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 5158 | int hp_pin = alc_get_hp_pin(spec); |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5159 | |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5160 | /* Prevent pop noises when headphones are plugged in */ |
| 5161 | snd_hda_codec_write(codec, hp_pin, 0, |
| 5162 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5163 | msleep(20); |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5164 | } |
| 5165 | |
| 5166 | static void alc_fixup_dell_xps13(struct hda_codec *codec, |
| 5167 | const struct hda_fixup *fix, int action) |
| 5168 | { |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5169 | struct alc_spec *spec = codec->spec; |
| 5170 | struct hda_input_mux *imux = &spec->gen.input_mux; |
| 5171 | int i; |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 5172 | |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5173 | switch (action) { |
| 5174 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5175 | /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise |
| 5176 | * it causes a click noise at start up |
| 5177 | */ |
| 5178 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 5179 | spec->shutup = alc_shutup_dell_xps13; |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5180 | break; |
| 5181 | case HDA_FIXUP_ACT_PROBE: |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 5182 | /* Make the internal mic the default input source. */ |
| 5183 | for (i = 0; i < imux->num_items; i++) { |
| 5184 | if (spec->gen.imux_pins[i] == 0x12) { |
| 5185 | spec->gen.cur_mux[0] = i; |
| 5186 | break; |
| 5187 | } |
| 5188 | } |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5189 | break; |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5190 | } |
| 5191 | } |
| 5192 | |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 5193 | static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, |
| 5194 | const struct hda_fixup *fix, int action) |
| 5195 | { |
| 5196 | struct alc_spec *spec = codec->spec; |
| 5197 | |
| 5198 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5199 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5200 | spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */ |
David Henningsson | b40eda6 | 2015-05-28 09:40:23 +0200 | [diff] [blame] | 5201 | |
| 5202 | /* Disable boost for mic-in permanently. (This code is only called |
| 5203 | from quirks that guarantee that the headphone is at NID 0x1b.) */ |
| 5204 | snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); |
| 5205 | 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] | 5206 | } else |
| 5207 | alc_fixup_headset_mode(codec, fix, action); |
| 5208 | } |
| 5209 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5210 | static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, |
| 5211 | const struct hda_fixup *fix, int action) |
| 5212 | { |
| 5213 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5214 | alc_write_coef_idx(codec, 0xc4, 0x8000); |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5215 | alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5216 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
| 5217 | } |
| 5218 | alc_fixup_headset_mode(codec, fix, action); |
| 5219 | } |
| 5220 | |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5221 | /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ |
| 5222 | static int find_ext_mic_pin(struct hda_codec *codec) |
| 5223 | { |
| 5224 | struct alc_spec *spec = codec->spec; |
| 5225 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5226 | hda_nid_t nid; |
| 5227 | unsigned int defcfg; |
| 5228 | int i; |
| 5229 | |
| 5230 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5231 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 5232 | continue; |
| 5233 | nid = cfg->inputs[i].pin; |
| 5234 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 5235 | if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) |
| 5236 | continue; |
| 5237 | return nid; |
| 5238 | } |
| 5239 | |
| 5240 | return 0; |
| 5241 | } |
| 5242 | |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5243 | static void alc271_hp_gate_mic_jack(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5244 | const struct hda_fixup *fix, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5245 | int action) |
| 5246 | { |
| 5247 | struct alc_spec *spec = codec->spec; |
| 5248 | |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5249 | if (action == HDA_FIXUP_ACT_PROBE) { |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5250 | int mic_pin = find_ext_mic_pin(codec); |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 5251 | int hp_pin = alc_get_hp_pin(spec); |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5252 | |
| 5253 | if (snd_BUG_ON(!mic_pin || !hp_pin)) |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5254 | return; |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5255 | snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5256 | } |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5257 | } |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5258 | |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 5259 | static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, |
| 5260 | const struct hda_fixup *fix, |
| 5261 | int action) |
| 5262 | { |
| 5263 | struct alc_spec *spec = codec->spec; |
| 5264 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5265 | int i; |
| 5266 | |
| 5267 | /* The mic boosts on level 2 and 3 are too noisy |
| 5268 | on the internal mic input. |
| 5269 | Therefore limit the boost to 0 or 1. */ |
| 5270 | |
| 5271 | if (action != HDA_FIXUP_ACT_PROBE) |
| 5272 | return; |
| 5273 | |
| 5274 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5275 | hda_nid_t nid = cfg->inputs[i].pin; |
| 5276 | unsigned int defcfg; |
| 5277 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 5278 | continue; |
| 5279 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 5280 | if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) |
| 5281 | continue; |
| 5282 | |
| 5283 | snd_hda_override_amp_caps(codec, nid, HDA_INPUT, |
| 5284 | (0x00 << AC_AMPCAP_OFFSET_SHIFT) | |
| 5285 | (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 5286 | (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 5287 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 5288 | } |
| 5289 | } |
| 5290 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5291 | static void alc283_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 5292 | struct hda_jack_callback *jack) |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5293 | { |
| 5294 | struct alc_spec *spec = codec->spec; |
| 5295 | int vref; |
| 5296 | |
| 5297 | msleep(200); |
| 5298 | snd_hda_gen_hp_automute(codec, jack); |
| 5299 | |
| 5300 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 5301 | |
| 5302 | msleep(600); |
| 5303 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 5304 | vref); |
| 5305 | } |
| 5306 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5307 | static void alc283_fixup_chromebook(struct hda_codec *codec, |
| 5308 | const struct hda_fixup *fix, int action) |
| 5309 | { |
| 5310 | struct alc_spec *spec = codec->spec; |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5311 | |
| 5312 | switch (action) { |
| 5313 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5314 | snd_hda_override_wcaps(codec, 0x03, 0); |
Takashi Iwai | d2e9270 | 2013-10-30 07:50:53 +0100 | [diff] [blame] | 5315 | /* Disable AA-loopback as it causes white noise */ |
| 5316 | spec->gen.mixer_nid = 0; |
Kailang Yang | 3807021 | 2013-11-01 15:57:35 +0800 | [diff] [blame] | 5317 | break; |
| 5318 | case HDA_FIXUP_ACT_INIT: |
Kailang Yang | de9481c | 2014-04-07 16:41:52 +0800 | [diff] [blame] | 5319 | /* MIC2-VREF control */ |
| 5320 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5321 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5322 | /* Enable Line1 input control by verb */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5323 | alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5324 | break; |
| 5325 | } |
| 5326 | } |
| 5327 | |
| 5328 | static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, |
| 5329 | const struct hda_fixup *fix, int action) |
| 5330 | { |
| 5331 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5332 | |
| 5333 | switch (action) { |
| 5334 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5335 | spec->gen.hp_automute_hook = alc283_hp_automute_hook; |
| 5336 | break; |
| 5337 | case HDA_FIXUP_ACT_INIT: |
| 5338 | /* MIC2-VREF control */ |
| 5339 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5340 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5341 | break; |
| 5342 | } |
| 5343 | } |
| 5344 | |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5345 | /* mute tablet speaker pin (0x14) via dock plugging in addition */ |
| 5346 | static void asus_tx300_automute(struct hda_codec *codec) |
| 5347 | { |
| 5348 | struct alc_spec *spec = codec->spec; |
| 5349 | snd_hda_gen_update_outputs(codec); |
| 5350 | if (snd_hda_jack_detect(codec, 0x1b)) |
| 5351 | spec->gen.mute_bits |= (1ULL << 0x14); |
| 5352 | } |
| 5353 | |
| 5354 | static void alc282_fixup_asus_tx300(struct hda_codec *codec, |
| 5355 | const struct hda_fixup *fix, int action) |
| 5356 | { |
| 5357 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5358 | static const struct hda_pintbl dock_pins[] = { |
| 5359 | { 0x1b, 0x21114000 }, /* dock speaker pin */ |
| 5360 | {} |
| 5361 | }; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5362 | |
| 5363 | switch (action) { |
| 5364 | case HDA_FIXUP_ACT_PRE_PROBE: |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 5365 | spec->init_amp = ALC_INIT_DEFAULT; |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 5366 | /* TX300 needs to set up GPIO2 for the speaker amp */ |
| 5367 | alc_setup_gpio(codec, 0x04); |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5368 | snd_hda_apply_pincfgs(codec, dock_pins); |
| 5369 | spec->gen.auto_mute_via_amp = 1; |
| 5370 | spec->gen.automute_hook = asus_tx300_automute; |
| 5371 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5372 | snd_hda_gen_hp_automute); |
| 5373 | break; |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 5374 | case HDA_FIXUP_ACT_PROBE: |
| 5375 | spec->init_amp = ALC_INIT_DEFAULT; |
| 5376 | break; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5377 | case HDA_FIXUP_ACT_BUILD: |
| 5378 | /* this is a bit tricky; give more sane names for the main |
| 5379 | * (tablet) speaker and the dock speaker, respectively |
| 5380 | */ |
Takashi Iwai | 56798e6 | 2017-04-11 08:10:52 +0200 | [diff] [blame] | 5381 | rename_ctl(codec, "Speaker Playback Switch", |
| 5382 | "Dock Speaker Playback Switch"); |
| 5383 | rename_ctl(codec, "Bass Speaker Playback Switch", |
| 5384 | "Speaker Playback Switch"); |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5385 | break; |
| 5386 | } |
| 5387 | } |
| 5388 | |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5389 | static void alc290_fixup_mono_speakers(struct hda_codec *codec, |
| 5390 | const struct hda_fixup *fix, int action) |
| 5391 | { |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 5392 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5393 | /* DAC node 0x03 is giving mono output. We therefore want to |
| 5394 | make sure 0x14 (front speaker) and 0x15 (headphones) use the |
| 5395 | stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ |
| 5396 | hda_nid_t conn1[2] = { 0x0c }; |
| 5397 | snd_hda_override_conn_list(codec, 0x14, 1, conn1); |
| 5398 | snd_hda_override_conn_list(codec, 0x15, 1, conn1); |
| 5399 | } |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5400 | } |
| 5401 | |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 5402 | static void alc298_fixup_speaker_volume(struct hda_codec *codec, |
| 5403 | const struct hda_fixup *fix, int action) |
| 5404 | { |
| 5405 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5406 | /* The speaker is routed to the Node 0x06 by a mistake, as a result |
| 5407 | we can't adjust the speaker's volume since this node does not has |
| 5408 | Amp-out capability. we change the speaker's route to: |
| 5409 | Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 ( |
| 5410 | Pin Complex), since Node 0x02 has Amp-out caps, we can adjust |
| 5411 | speaker's volume now. */ |
| 5412 | |
| 5413 | hda_nid_t conn1[1] = { 0x0c }; |
| 5414 | snd_hda_override_conn_list(codec, 0x17, 1, conn1); |
| 5415 | } |
| 5416 | } |
| 5417 | |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 5418 | /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */ |
| 5419 | static void alc295_fixup_disable_dac3(struct hda_codec *codec, |
| 5420 | const struct hda_fixup *fix, int action) |
| 5421 | { |
| 5422 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5423 | hda_nid_t conn[2] = { 0x02, 0x03 }; |
| 5424 | snd_hda_override_conn_list(codec, 0x17, 2, conn); |
| 5425 | } |
| 5426 | } |
| 5427 | |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5428 | /* Hook to update amp GPIO4 for automute */ |
| 5429 | static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, |
| 5430 | struct hda_jack_callback *jack) |
| 5431 | { |
| 5432 | struct alc_spec *spec = codec->spec; |
| 5433 | |
| 5434 | snd_hda_gen_hp_automute(codec, jack); |
| 5435 | /* mute_led_polarity is set to 0, so we pass inverted value here */ |
| 5436 | alc_update_gpio_led(codec, 0x10, !spec->gen.hp_jack_present); |
| 5437 | } |
| 5438 | |
| 5439 | /* Manage GPIOs for HP EliteBook Folio 9480m. |
| 5440 | * |
| 5441 | * GPIO4 is the headphone amplifier power control |
| 5442 | * GPIO3 is the audio output mute indicator LED |
| 5443 | */ |
| 5444 | |
| 5445 | static void alc280_fixup_hp_9480m(struct hda_codec *codec, |
| 5446 | const struct hda_fixup *fix, |
| 5447 | int action) |
| 5448 | { |
| 5449 | struct alc_spec *spec = codec->spec; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5450 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 5451 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5452 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 5453 | /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */ |
| 5454 | spec->gpio_mask |= 0x10; |
| 5455 | spec->gpio_dir |= 0x10; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5456 | spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5457 | } |
| 5458 | } |
| 5459 | |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 5460 | static void alc275_fixup_gpio4_off(struct hda_codec *codec, |
| 5461 | const struct hda_fixup *fix, |
| 5462 | int action) |
| 5463 | { |
| 5464 | struct alc_spec *spec = codec->spec; |
| 5465 | |
| 5466 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5467 | spec->gpio_mask |= 0x04; |
| 5468 | spec->gpio_dir |= 0x04; |
| 5469 | /* set data bit low */ |
| 5470 | } |
| 5471 | } |
| 5472 | |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 5473 | static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, |
| 5474 | const struct hda_fixup *fix, |
| 5475 | int action) |
| 5476 | { |
| 5477 | alc_fixup_dual_codecs(codec, fix, action); |
| 5478 | switch (action) { |
| 5479 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5480 | /* override card longname to provide a unique UCM profile */ |
| 5481 | strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); |
| 5482 | break; |
| 5483 | case HDA_FIXUP_ACT_BUILD: |
| 5484 | /* rename Capture controls depending on the codec */ |
| 5485 | rename_ctl(codec, "Capture Volume", |
| 5486 | codec->addr == 0 ? |
| 5487 | "Rear-Panel Capture Volume" : |
| 5488 | "Front-Panel Capture Volume"); |
| 5489 | rename_ctl(codec, "Capture Switch", |
| 5490 | codec->addr == 0 ? |
| 5491 | "Rear-Panel Capture Switch" : |
| 5492 | "Front-Panel Capture Switch"); |
| 5493 | break; |
| 5494 | } |
| 5495 | } |
| 5496 | |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 5497 | /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ |
| 5498 | static void alc274_fixup_bind_dacs(struct hda_codec *codec, |
| 5499 | const struct hda_fixup *fix, int action) |
| 5500 | { |
| 5501 | struct alc_spec *spec = codec->spec; |
| 5502 | static hda_nid_t preferred_pairs[] = { |
| 5503 | 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02, |
| 5504 | 0 |
| 5505 | }; |
| 5506 | |
| 5507 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 5508 | return; |
| 5509 | |
| 5510 | spec->gen.preferred_dacs = preferred_pairs; |
Kailang Yang | 0700d3d | 2019-04-26 16:13:54 +0800 | [diff] [blame] | 5511 | spec->gen.auto_mute_via_amp = 1; |
| 5512 | codec->power_save_node = 0; |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 5513 | } |
| 5514 | |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 5515 | /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */ |
| 5516 | static void alc285_fixup_invalidate_dacs(struct hda_codec *codec, |
| 5517 | const struct hda_fixup *fix, int action) |
| 5518 | { |
| 5519 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 5520 | return; |
| 5521 | |
| 5522 | snd_hda_override_wcaps(codec, 0x03, 0); |
| 5523 | } |
| 5524 | |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 5525 | static const struct hda_jack_keymap alc_headset_btn_keymap[] = { |
| 5526 | { SND_JACK_BTN_0, KEY_PLAYPAUSE }, |
| 5527 | { SND_JACK_BTN_1, KEY_VOICECOMMAND }, |
| 5528 | { SND_JACK_BTN_2, KEY_VOLUMEUP }, |
| 5529 | { SND_JACK_BTN_3, KEY_VOLUMEDOWN }, |
| 5530 | {} |
| 5531 | }; |
| 5532 | |
| 5533 | static void alc_headset_btn_callback(struct hda_codec *codec, |
| 5534 | struct hda_jack_callback *jack) |
| 5535 | { |
| 5536 | int report = 0; |
| 5537 | |
| 5538 | if (jack->unsol_res & (7 << 13)) |
| 5539 | report |= SND_JACK_BTN_0; |
| 5540 | |
| 5541 | if (jack->unsol_res & (1 << 16 | 3 << 8)) |
| 5542 | report |= SND_JACK_BTN_1; |
| 5543 | |
| 5544 | /* Volume up key */ |
| 5545 | if (jack->unsol_res & (7 << 23)) |
| 5546 | report |= SND_JACK_BTN_2; |
| 5547 | |
| 5548 | /* Volume down key */ |
| 5549 | if (jack->unsol_res & (7 << 10)) |
| 5550 | report |= SND_JACK_BTN_3; |
| 5551 | |
| 5552 | jack->jack->button_state = report; |
| 5553 | } |
| 5554 | |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 5555 | static void alc_fixup_headset_jack(struct hda_codec *codec, |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 5556 | const struct hda_fixup *fix, int action) |
| 5557 | { |
| 5558 | |
| 5559 | switch (action) { |
| 5560 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5561 | snd_hda_jack_detect_enable_callback(codec, 0x55, |
| 5562 | alc_headset_btn_callback); |
| 5563 | snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false, |
| 5564 | SND_JACK_HEADSET, alc_headset_btn_keymap); |
| 5565 | break; |
| 5566 | case HDA_FIXUP_ACT_INIT: |
| 5567 | switch (codec->core.vendor_id) { |
| 5568 | case 0x10ec0225: |
| 5569 | case 0x10ec0295: |
| 5570 | case 0x10ec0299: |
| 5571 | alc_write_coef_idx(codec, 0x48, 0xd011); |
| 5572 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); |
| 5573 | alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8); |
| 5574 | break; |
| 5575 | case 0x10ec0236: |
| 5576 | case 0x10ec0256: |
| 5577 | alc_write_coef_idx(codec, 0x48, 0xd011); |
| 5578 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); |
| 5579 | break; |
| 5580 | } |
| 5581 | break; |
| 5582 | } |
| 5583 | } |
| 5584 | |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 5585 | static void alc295_fixup_chromebook(struct hda_codec *codec, |
| 5586 | const struct hda_fixup *fix, int action) |
| 5587 | { |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 5588 | struct alc_spec *spec = codec->spec; |
| 5589 | |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 5590 | switch (action) { |
Kailang Yang | d3ba58b | 2019-05-06 15:09:42 +0800 | [diff] [blame] | 5591 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5592 | spec->ultra_low_power = true; |
| 5593 | break; |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 5594 | case HDA_FIXUP_ACT_INIT: |
| 5595 | switch (codec->core.vendor_id) { |
| 5596 | case 0x10ec0295: |
| 5597 | alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ |
| 5598 | alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); |
| 5599 | break; |
| 5600 | case 0x10ec0236: |
| 5601 | alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ |
| 5602 | alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); |
| 5603 | break; |
| 5604 | } |
| 5605 | break; |
| 5606 | } |
| 5607 | } |
| 5608 | |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 5609 | static void alc_fixup_disable_mic_vref(struct hda_codec *codec, |
| 5610 | const struct hda_fixup *fix, int action) |
| 5611 | { |
| 5612 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 5613 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); |
| 5614 | } |
| 5615 | |
Takashi Iwai | b317b03 | 2014-01-08 11:44:21 +0100 | [diff] [blame] | 5616 | /* for hda_fixup_thinkpad_acpi() */ |
| 5617 | #include "thinkpad_helper.c" |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 5618 | |
Takashi Iwai | d5a6cab | 2018-06-13 12:43:10 +0200 | [diff] [blame] | 5619 | static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, |
| 5620 | const struct hda_fixup *fix, int action) |
| 5621 | { |
| 5622 | alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ |
| 5623 | hda_fixup_thinkpad_acpi(codec, fix, action); |
| 5624 | } |
| 5625 | |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 5626 | /* for alc295_fixup_hp_top_speakers */ |
| 5627 | #include "hp_x360_helper.c" |
| 5628 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5629 | enum { |
| 5630 | ALC269_FIXUP_SONY_VAIO, |
| 5631 | ALC275_FIXUP_SONY_VAIO_GPIO2, |
| 5632 | ALC269_FIXUP_DELL_M101Z, |
| 5633 | ALC269_FIXUP_SKU_IGNORE, |
| 5634 | ALC269_FIXUP_ASUS_G73JW, |
| 5635 | ALC269_FIXUP_LENOVO_EAPD, |
| 5636 | ALC275_FIXUP_SONY_HWEQ, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 5637 | ALC275_FIXUP_SONY_DISABLE_AAMIX, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5638 | ALC271_FIXUP_DMIC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 5639 | ALC269_FIXUP_PCM_44K, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 5640 | ALC269_FIXUP_STEREO_DMIC, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 5641 | ALC269_FIXUP_HEADSET_MIC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 5642 | ALC269_FIXUP_QUANTA_MUTE, |
| 5643 | ALC269_FIXUP_LIFEBOOK, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 5644 | ALC269_FIXUP_LIFEBOOK_EXTMIC, |
Takashi Iwai | cc7016a | 2015-04-08 20:47:55 +0200 | [diff] [blame] | 5645 | ALC269_FIXUP_LIFEBOOK_HP_PIN, |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 5646 | ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 5647 | ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5648 | ALC269_FIXUP_AMIC, |
| 5649 | ALC269_FIXUP_DMIC, |
| 5650 | ALC269VB_FIXUP_AMIC, |
| 5651 | ALC269VB_FIXUP_DMIC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5652 | ALC269_FIXUP_HP_MUTE_LED, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 5653 | ALC269_FIXUP_HP_MUTE_LED_MIC1, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5654 | ALC269_FIXUP_HP_MUTE_LED_MIC2, |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 5655 | ALC269_FIXUP_HP_MUTE_LED_MIC3, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 5656 | ALC269_FIXUP_HP_GPIO_LED, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 5657 | ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 5658 | ALC269_FIXUP_HP_LINE1_MIC1_LED, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5659 | ALC269_FIXUP_INV_DMIC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5660 | ALC269_FIXUP_LENOVO_DOCK, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5661 | ALC269_FIXUP_NO_SHUTUP, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 5662 | ALC286_FIXUP_SONY_MIC_NO_PRESENCE, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5663 | ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5664 | ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 5665 | ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5666 | ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 5667 | ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5668 | ALC269_FIXUP_HEADSET_MODE, |
| 5669 | ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 5670 | ALC269_FIXUP_ASPIRE_HEADSET_MIC, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 5671 | ALC269_FIXUP_ASUS_X101_FUNC, |
| 5672 | ALC269_FIXUP_ASUS_X101_VERB, |
| 5673 | ALC269_FIXUP_ASUS_X101, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5674 | ALC271_FIXUP_AMIC_MIC2, |
| 5675 | ALC271_FIXUP_HP_GATE_MIC_JACK, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 5676 | ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 5677 | ALC269_FIXUP_ACER_AC700, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 5678 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 5679 | ALC269VB_FIXUP_ASUS_ZENBOOK, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 5680 | ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 5681 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 5682 | ALC269VB_FIXUP_ORDISSIMO_EVE2, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5683 | ALC283_FIXUP_CHROME_BOOK, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5684 | ALC283_FIXUP_SENSE_COMBO_JACK, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5685 | ALC282_FIXUP_ASUS_TX300, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 5686 | ALC283_FIXUP_INT_MIC, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5687 | ALC290_FIXUP_MONO_SPEAKERS, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 5688 | ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 5689 | ALC290_FIXUP_SUBWOOFER, |
| 5690 | ALC290_FIXUP_SUBWOOFER_HSJACK, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 5691 | ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 5692 | ALC269_FIXUP_DMIC_THINKPAD_ACPI, |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 5693 | ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 5694 | ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5695 | ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5696 | ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5697 | ALC255_FIXUP_HEADSET_MODE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5698 | ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5699 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 5700 | ALC292_FIXUP_TPT440_DOCK, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 5701 | ALC292_FIXUP_TPT440, |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 5702 | ALC283_FIXUP_HEADSET_MIC, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 5703 | ALC255_FIXUP_MIC_MUTE_LED, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 5704 | ALC282_FIXUP_ASPIRE_V5_PINS, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 5705 | ALC280_FIXUP_HP_GPIO4, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 5706 | ALC286_FIXUP_HP_GPIO_LED, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 5707 | ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 5708 | ALC280_FIXUP_HP_DOCK_PINS, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 5709 | ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5710 | ALC280_FIXUP_HP_9480M, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5711 | ALC288_FIXUP_DELL_HEADSET_MODE, |
| 5712 | ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 5713 | ALC288_FIXUP_DELL_XPS_13, |
| 5714 | ALC288_FIXUP_DISABLE_AAMIX, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 5715 | ALC292_FIXUP_DELL_E7X, |
| 5716 | ALC292_FIXUP_DISABLE_AAMIX, |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 5717 | ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 5718 | ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 5719 | ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 5720 | ALC275_FIXUP_DELL_XPS, |
Hui Wang | 8c69729 | 2015-11-24 11:08:18 +0800 | [diff] [blame] | 5721 | ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE, |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 5722 | ALC293_FIXUP_LENOVO_SPK_NOISE, |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 5723 | ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
Kai-Heng Feng | 3b43b71 | 2016-02-25 15:19:38 +0800 | [diff] [blame] | 5724 | ALC255_FIXUP_DELL_SPK_NOISE, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 5725 | ALC225_FIXUP_DISABLE_MIC_VREF, |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 5726 | ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 5727 | ALC295_FIXUP_DISABLE_DAC3, |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 5728 | ALC280_FIXUP_HP_HEADSET_MIC, |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 5729 | ALC221_FIXUP_HP_FRONT_MIC, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 5730 | ALC292_FIXUP_TPT460, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 5731 | ALC298_FIXUP_SPK_VOLUME, |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 5732 | ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 5733 | ALC269_FIXUP_ATIV_BOOK_8, |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 5734 | ALC221_FIXUP_HP_MIC_NO_PRESENCE, |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 5735 | ALC256_FIXUP_ASUS_HEADSET_MODE, |
| 5736 | ALC256_FIXUP_ASUS_MIC, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 5737 | ALC256_FIXUP_ASUS_AIO_GPIO2, |
Chris Chiu | 216d7ae | 2017-02-28 14:17:14 -0600 | [diff] [blame] | 5738 | ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 5739 | ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 5740 | ALC233_FIXUP_LENOVO_MULTI_CODECS, |
Jian-Hong Pan | ea5c7eb | 2019-04-01 11:25:05 +0800 | [diff] [blame] | 5741 | ALC233_FIXUP_ACER_HEADSET_MIC, |
Hui Wang | f33f79f | 2017-07-07 12:08:29 +0800 | [diff] [blame] | 5742 | ALC294_FIXUP_LENOVO_MIC_LOCATION, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 5743 | ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 5744 | ALC700_FIXUP_INTEL_REFERENCE, |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 5745 | ALC274_FIXUP_DELL_BIND_DACS, |
| 5746 | ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5747 | ALC298_FIXUP_TPT470_DOCK, |
Kailang Yang | ae104a2 | 2018-02-05 16:07:20 +0800 | [diff] [blame] | 5748 | ALC255_FIXUP_DUMMY_LINEOUT_VERB, |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 5749 | ALC255_FIXUP_DELL_HEADSET_MIC, |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 5750 | ALC256_FIXUP_HUAWEI_MBXP_PINS, |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 5751 | ALC295_FIXUP_HP_X360, |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 5752 | ALC221_FIXUP_HP_HEADSET_MIC, |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 5753 | ALC285_FIXUP_LENOVO_HEADPHONE_NOISE, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 5754 | ALC295_FIXUP_HP_AUTO_MUTE, |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 5755 | ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 5756 | ALC294_FIXUP_ASUS_MIC, |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 5757 | ALC294_FIXUP_ASUS_HEADSET_MIC, |
| 5758 | ALC294_FIXUP_ASUS_SPK, |
Jeremy Soller | 89e3a56 | 2019-01-30 16:12:31 -0700 | [diff] [blame] | 5759 | ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 5760 | ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
Jian-Hong Pan | cbc05fd | 2019-03-13 17:33:24 +0800 | [diff] [blame] | 5761 | ALC255_FIXUP_ACER_HEADSET_MIC, |
Kailang Yang | 10f5b1b | 2019-02-21 16:10:22 +0800 | [diff] [blame] | 5762 | ALC295_FIXUP_CHROME_BOOK, |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 5763 | ALC225_FIXUP_HEADSET_JACK, |
Kailang Yang | 136824e | 2019-03-14 16:22:45 +0800 | [diff] [blame] | 5764 | ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE, |
| 5765 | ALC225_FIXUP_WYSE_AUTO_MUTE, |
| 5766 | ALC225_FIXUP_WYSE_DISABLE_MIC_VREF, |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 5767 | ALC286_FIXUP_ACER_AIO_HEADSET_MIC, |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 5768 | ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 5769 | ALC299_FIXUP_PREDATOR_SPK, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5770 | }; |
| 5771 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5772 | static const struct hda_fixup alc269_fixups[] = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5773 | [ALC269_FIXUP_SONY_VAIO] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 5774 | .type = HDA_FIXUP_PINCTLS, |
| 5775 | .v.pins = (const struct hda_pintbl[]) { |
| 5776 | {0x19, PIN_VREFGRD}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5777 | {} |
| 5778 | } |
| 5779 | }, |
| 5780 | [ALC275_FIXUP_SONY_VAIO_GPIO2] = { |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 5781 | .type = HDA_FIXUP_FUNC, |
| 5782 | .v.func = alc275_fixup_gpio4_off, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5783 | .chained = true, |
| 5784 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 5785 | }, |
| 5786 | [ALC269_FIXUP_DELL_M101Z] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5787 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5788 | .v.verbs = (const struct hda_verb[]) { |
| 5789 | /* Enables internal speaker */ |
| 5790 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, |
| 5791 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, |
| 5792 | {} |
| 5793 | } |
| 5794 | }, |
| 5795 | [ALC269_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5796 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 5797 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5798 | }, |
| 5799 | [ALC269_FIXUP_ASUS_G73JW] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5800 | .type = HDA_FIXUP_PINS, |
| 5801 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5802 | { 0x17, 0x99130111 }, /* subwoofer */ |
| 5803 | { } |
| 5804 | } |
| 5805 | }, |
| 5806 | [ALC269_FIXUP_LENOVO_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5807 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5808 | .v.verbs = (const struct hda_verb[]) { |
| 5809 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 5810 | {} |
| 5811 | } |
| 5812 | }, |
| 5813 | [ALC275_FIXUP_SONY_HWEQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5814 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5815 | .v.func = alc269_fixup_hweq, |
| 5816 | .chained = true, |
| 5817 | .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 |
| 5818 | }, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 5819 | [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { |
| 5820 | .type = HDA_FIXUP_FUNC, |
| 5821 | .v.func = alc_fixup_disable_aamix, |
| 5822 | .chained = true, |
| 5823 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 5824 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5825 | [ALC271_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5826 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5827 | .v.func = alc271_fixup_dmic, |
| 5828 | }, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 5829 | [ALC269_FIXUP_PCM_44K] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5830 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 5831 | .v.func = alc269_fixup_pcm_44k, |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 5832 | .chained = true, |
| 5833 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 5834 | }, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 5835 | [ALC269_FIXUP_STEREO_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5836 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 5837 | .v.func = alc269_fixup_stereo_dmic, |
| 5838 | }, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 5839 | [ALC269_FIXUP_HEADSET_MIC] = { |
| 5840 | .type = HDA_FIXUP_FUNC, |
| 5841 | .v.func = alc269_fixup_headset_mic, |
| 5842 | }, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 5843 | [ALC269_FIXUP_QUANTA_MUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5844 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 5845 | .v.func = alc269_fixup_quanta_mute, |
| 5846 | }, |
| 5847 | [ALC269_FIXUP_LIFEBOOK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5848 | .type = HDA_FIXUP_PINS, |
| 5849 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 5850 | { 0x1a, 0x2101103f }, /* dock line-out */ |
| 5851 | { 0x1b, 0x23a11040 }, /* dock mic-in */ |
| 5852 | { } |
| 5853 | }, |
| 5854 | .chained = true, |
| 5855 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
| 5856 | }, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 5857 | [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { |
| 5858 | .type = HDA_FIXUP_PINS, |
| 5859 | .v.pins = (const struct hda_pintbl[]) { |
| 5860 | { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ |
| 5861 | { } |
| 5862 | }, |
| 5863 | }, |
Takashi Iwai | cc7016a | 2015-04-08 20:47:55 +0200 | [diff] [blame] | 5864 | [ALC269_FIXUP_LIFEBOOK_HP_PIN] = { |
| 5865 | .type = HDA_FIXUP_PINS, |
| 5866 | .v.pins = (const struct hda_pintbl[]) { |
| 5867 | { 0x21, 0x0221102f }, /* HP out */ |
| 5868 | { } |
| 5869 | }, |
| 5870 | }, |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 5871 | [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { |
| 5872 | .type = HDA_FIXUP_FUNC, |
| 5873 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
| 5874 | }, |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 5875 | [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { |
| 5876 | .type = HDA_FIXUP_FUNC, |
| 5877 | .v.func = alc269_fixup_pincfg_U7x7_headset_mic, |
| 5878 | }, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5879 | [ALC269_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5880 | .type = HDA_FIXUP_PINS, |
| 5881 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5882 | { 0x14, 0x99130110 }, /* speaker */ |
| 5883 | { 0x15, 0x0121401f }, /* HP out */ |
| 5884 | { 0x18, 0x01a19c20 }, /* mic */ |
| 5885 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 5886 | { } |
| 5887 | }, |
| 5888 | }, |
| 5889 | [ALC269_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5890 | .type = HDA_FIXUP_PINS, |
| 5891 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5892 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 5893 | { 0x14, 0x99130110 }, /* speaker */ |
| 5894 | { 0x15, 0x0121401f }, /* HP out */ |
| 5895 | { 0x18, 0x01a19c20 }, /* mic */ |
| 5896 | { } |
| 5897 | }, |
| 5898 | }, |
| 5899 | [ALC269VB_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5900 | .type = HDA_FIXUP_PINS, |
| 5901 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5902 | { 0x14, 0x99130110 }, /* speaker */ |
| 5903 | { 0x18, 0x01a19c20 }, /* mic */ |
| 5904 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 5905 | { 0x21, 0x0121401f }, /* HP out */ |
| 5906 | { } |
| 5907 | }, |
| 5908 | }, |
David Henningsson | 2267ea9 | 2012-01-03 08:45:56 +0100 | [diff] [blame] | 5909 | [ALC269VB_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5910 | .type = HDA_FIXUP_PINS, |
| 5911 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5912 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 5913 | { 0x14, 0x99130110 }, /* speaker */ |
| 5914 | { 0x18, 0x01a19c20 }, /* mic */ |
| 5915 | { 0x21, 0x0121401f }, /* HP out */ |
| 5916 | { } |
| 5917 | }, |
| 5918 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5919 | [ALC269_FIXUP_HP_MUTE_LED] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5920 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5921 | .v.func = alc269_fixup_hp_mute_led, |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 5922 | }, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 5923 | [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { |
| 5924 | .type = HDA_FIXUP_FUNC, |
| 5925 | .v.func = alc269_fixup_hp_mute_led_mic1, |
| 5926 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5927 | [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5928 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5929 | .v.func = alc269_fixup_hp_mute_led_mic2, |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 5930 | }, |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 5931 | [ALC269_FIXUP_HP_MUTE_LED_MIC3] = { |
| 5932 | .type = HDA_FIXUP_FUNC, |
| 5933 | .v.func = alc269_fixup_hp_mute_led_mic3, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 5934 | .chained = true, |
| 5935 | .chain_id = ALC295_FIXUP_HP_AUTO_MUTE |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 5936 | }, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 5937 | [ALC269_FIXUP_HP_GPIO_LED] = { |
| 5938 | .type = HDA_FIXUP_FUNC, |
| 5939 | .v.func = alc269_fixup_hp_gpio_led, |
| 5940 | }, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 5941 | [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { |
| 5942 | .type = HDA_FIXUP_FUNC, |
| 5943 | .v.func = alc269_fixup_hp_gpio_mic1_led, |
| 5944 | }, |
| 5945 | [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { |
| 5946 | .type = HDA_FIXUP_FUNC, |
| 5947 | .v.func = alc269_fixup_hp_line1_mic1_led, |
| 5948 | }, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5949 | [ALC269_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5950 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 5951 | .v.func = alc_fixup_inv_dmic, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5952 | }, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5953 | [ALC269_FIXUP_NO_SHUTUP] = { |
| 5954 | .type = HDA_FIXUP_FUNC, |
| 5955 | .v.func = alc_fixup_no_shutup, |
| 5956 | }, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5957 | [ALC269_FIXUP_LENOVO_DOCK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5958 | .type = HDA_FIXUP_PINS, |
| 5959 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5960 | { 0x19, 0x23a11040 }, /* dock mic */ |
| 5961 | { 0x1b, 0x2121103f }, /* dock headphone */ |
| 5962 | { } |
| 5963 | }, |
| 5964 | .chained = true, |
| 5965 | .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT |
| 5966 | }, |
| 5967 | [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5968 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5969 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
David Henningsson | 5212900 | 2013-11-19 10:25:53 +0100 | [diff] [blame] | 5970 | .chained = true, |
| 5971 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5972 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5973 | [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 5974 | .type = HDA_FIXUP_PINS, |
| 5975 | .v.pins = (const struct hda_pintbl[]) { |
| 5976 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 5977 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 5978 | { } |
| 5979 | }, |
| 5980 | .chained = true, |
| 5981 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 5982 | }, |
| 5983 | [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 5984 | .type = HDA_FIXUP_PINS, |
| 5985 | .v.pins = (const struct hda_pintbl[]) { |
| 5986 | { 0x16, 0x21014020 }, /* dock line out */ |
| 5987 | { 0x19, 0x21a19030 }, /* dock mic */ |
| 5988 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 5989 | { } |
| 5990 | }, |
| 5991 | .chained = true, |
| 5992 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 5993 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5994 | [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { |
| 5995 | .type = HDA_FIXUP_PINS, |
| 5996 | .v.pins = (const struct hda_pintbl[]) { |
| 5997 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 5998 | { } |
| 5999 | }, |
| 6000 | .chained = true, |
| 6001 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6002 | }, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 6003 | [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = { |
| 6004 | .type = HDA_FIXUP_PINS, |
| 6005 | .v.pins = (const struct hda_pintbl[]) { |
| 6006 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6007 | { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6008 | { } |
| 6009 | }, |
| 6010 | .chained = true, |
| 6011 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6012 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6013 | [ALC269_FIXUP_HEADSET_MODE] = { |
| 6014 | .type = HDA_FIXUP_FUNC, |
| 6015 | .v.func = alc_fixup_headset_mode, |
Hui Wang | 6676f30 | 2014-11-18 17:57:41 +0800 | [diff] [blame] | 6016 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6017 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6018 | }, |
| 6019 | [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 6020 | .type = HDA_FIXUP_FUNC, |
| 6021 | .v.func = alc_fixup_headset_mode_no_hp_mic, |
| 6022 | }, |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 6023 | [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { |
| 6024 | .type = HDA_FIXUP_PINS, |
| 6025 | .v.pins = (const struct hda_pintbl[]) { |
| 6026 | { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ |
| 6027 | { } |
| 6028 | }, |
| 6029 | .chained = true, |
| 6030 | .chain_id = ALC269_FIXUP_HEADSET_MODE, |
| 6031 | }, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 6032 | [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { |
| 6033 | .type = HDA_FIXUP_PINS, |
| 6034 | .v.pins = (const struct hda_pintbl[]) { |
| 6035 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6036 | { } |
| 6037 | }, |
David Henningsson | fbc78ad | 2013-10-11 13:46:04 +0200 | [diff] [blame] | 6038 | .chained = true, |
| 6039 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 6040 | }, |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 6041 | [ALC256_FIXUP_HUAWEI_MBXP_PINS] = { |
| 6042 | .type = HDA_FIXUP_PINS, |
| 6043 | .v.pins = (const struct hda_pintbl[]) { |
| 6044 | {0x12, 0x90a60130}, |
| 6045 | {0x13, 0x40000000}, |
| 6046 | {0x14, 0x90170110}, |
| 6047 | {0x18, 0x411111f0}, |
| 6048 | {0x19, 0x04a11040}, |
| 6049 | {0x1a, 0x411111f0}, |
| 6050 | {0x1b, 0x90170112}, |
| 6051 | {0x1d, 0x40759a05}, |
| 6052 | {0x1e, 0x411111f0}, |
| 6053 | {0x21, 0x04211020}, |
| 6054 | { } |
| 6055 | }, |
Ayman Bagabas | e2744fd | 2018-12-12 18:07:59 -0500 | [diff] [blame] | 6056 | .chained = true, |
| 6057 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 6058 | }, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 6059 | [ALC269_FIXUP_ASUS_X101_FUNC] = { |
| 6060 | .type = HDA_FIXUP_FUNC, |
| 6061 | .v.func = alc269_fixup_x101_headset_mic, |
| 6062 | }, |
| 6063 | [ALC269_FIXUP_ASUS_X101_VERB] = { |
| 6064 | .type = HDA_FIXUP_VERBS, |
| 6065 | .v.verbs = (const struct hda_verb[]) { |
| 6066 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, |
| 6067 | {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, |
| 6068 | {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, |
| 6069 | { } |
| 6070 | }, |
| 6071 | .chained = true, |
| 6072 | .chain_id = ALC269_FIXUP_ASUS_X101_FUNC |
| 6073 | }, |
| 6074 | [ALC269_FIXUP_ASUS_X101] = { |
| 6075 | .type = HDA_FIXUP_PINS, |
| 6076 | .v.pins = (const struct hda_pintbl[]) { |
| 6077 | { 0x18, 0x04a1182c }, /* Headset mic */ |
| 6078 | { } |
| 6079 | }, |
| 6080 | .chained = true, |
| 6081 | .chain_id = ALC269_FIXUP_ASUS_X101_VERB |
| 6082 | }, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6083 | [ALC271_FIXUP_AMIC_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6084 | .type = HDA_FIXUP_PINS, |
| 6085 | .v.pins = (const struct hda_pintbl[]) { |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6086 | { 0x14, 0x99130110 }, /* speaker */ |
| 6087 | { 0x19, 0x01a19c20 }, /* mic */ |
| 6088 | { 0x1b, 0x99a7012f }, /* int-mic */ |
| 6089 | { 0x21, 0x0121401f }, /* HP out */ |
| 6090 | { } |
| 6091 | }, |
| 6092 | }, |
| 6093 | [ALC271_FIXUP_HP_GATE_MIC_JACK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6094 | .type = HDA_FIXUP_FUNC, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6095 | .v.func = alc271_hp_gate_mic_jack, |
| 6096 | .chained = true, |
| 6097 | .chain_id = ALC271_FIXUP_AMIC_MIC2, |
| 6098 | }, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 6099 | [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { |
| 6100 | .type = HDA_FIXUP_FUNC, |
| 6101 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6102 | .chained = true, |
| 6103 | .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, |
| 6104 | }, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 6105 | [ALC269_FIXUP_ACER_AC700] = { |
| 6106 | .type = HDA_FIXUP_PINS, |
| 6107 | .v.pins = (const struct hda_pintbl[]) { |
| 6108 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6109 | { 0x14, 0x99130110 }, /* speaker */ |
| 6110 | { 0x18, 0x03a11c20 }, /* mic */ |
| 6111 | { 0x1e, 0x0346101e }, /* SPDIF1 */ |
| 6112 | { 0x21, 0x0321101f }, /* HP out */ |
| 6113 | { } |
| 6114 | }, |
| 6115 | .chained = true, |
| 6116 | .chain_id = ALC271_FIXUP_DMIC, |
| 6117 | }, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6118 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { |
| 6119 | .type = HDA_FIXUP_FUNC, |
| 6120 | .v.func = alc269_fixup_limit_int_mic_boost, |
David Henningsson | 2793769 | 2013-11-18 11:51:47 +0100 | [diff] [blame] | 6121 | .chained = true, |
| 6122 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6123 | }, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 6124 | [ALC269VB_FIXUP_ASUS_ZENBOOK] = { |
| 6125 | .type = HDA_FIXUP_FUNC, |
| 6126 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6127 | .chained = true, |
| 6128 | .chain_id = ALC269VB_FIXUP_DMIC, |
| 6129 | }, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 6130 | [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { |
| 6131 | .type = HDA_FIXUP_VERBS, |
| 6132 | .v.verbs = (const struct hda_verb[]) { |
| 6133 | /* class-D output amp +5dB */ |
| 6134 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, |
| 6135 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, |
| 6136 | {} |
| 6137 | }, |
| 6138 | .chained = true, |
| 6139 | .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, |
| 6140 | }, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 6141 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { |
| 6142 | .type = HDA_FIXUP_FUNC, |
| 6143 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6144 | .chained = true, |
| 6145 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, |
| 6146 | }, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 6147 | [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { |
| 6148 | .type = HDA_FIXUP_PINS, |
| 6149 | .v.pins = (const struct hda_pintbl[]) { |
| 6150 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6151 | { 0x18, 0x03a11d20 }, /* mic */ |
| 6152 | { 0x19, 0x411111f0 }, /* Unused bogus pin */ |
| 6153 | { } |
| 6154 | }, |
| 6155 | }, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 6156 | [ALC283_FIXUP_CHROME_BOOK] = { |
| 6157 | .type = HDA_FIXUP_FUNC, |
| 6158 | .v.func = alc283_fixup_chromebook, |
| 6159 | }, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 6160 | [ALC283_FIXUP_SENSE_COMBO_JACK] = { |
| 6161 | .type = HDA_FIXUP_FUNC, |
| 6162 | .v.func = alc283_fixup_sense_combo_jack, |
| 6163 | .chained = true, |
| 6164 | .chain_id = ALC283_FIXUP_CHROME_BOOK, |
| 6165 | }, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6166 | [ALC282_FIXUP_ASUS_TX300] = { |
| 6167 | .type = HDA_FIXUP_FUNC, |
| 6168 | .v.func = alc282_fixup_asus_tx300, |
| 6169 | }, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 6170 | [ALC283_FIXUP_INT_MIC] = { |
| 6171 | .type = HDA_FIXUP_VERBS, |
| 6172 | .v.verbs = (const struct hda_verb[]) { |
| 6173 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, |
| 6174 | {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, |
| 6175 | { } |
| 6176 | }, |
| 6177 | .chained = true, |
| 6178 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 6179 | }, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6180 | [ALC290_FIXUP_SUBWOOFER_HSJACK] = { |
| 6181 | .type = HDA_FIXUP_PINS, |
| 6182 | .v.pins = (const struct hda_pintbl[]) { |
| 6183 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 6184 | { } |
| 6185 | }, |
| 6186 | .chained = true, |
| 6187 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 6188 | }, |
| 6189 | [ALC290_FIXUP_SUBWOOFER] = { |
| 6190 | .type = HDA_FIXUP_PINS, |
| 6191 | .v.pins = (const struct hda_pintbl[]) { |
| 6192 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 6193 | { } |
| 6194 | }, |
| 6195 | .chained = true, |
| 6196 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS, |
| 6197 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6198 | [ALC290_FIXUP_MONO_SPEAKERS] = { |
| 6199 | .type = HDA_FIXUP_FUNC, |
| 6200 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6201 | }, |
| 6202 | [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { |
| 6203 | .type = HDA_FIXUP_FUNC, |
| 6204 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6205 | .chained = true, |
| 6206 | .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
| 6207 | }, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6208 | [ALC269_FIXUP_THINKPAD_ACPI] = { |
| 6209 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | d5a6cab | 2018-06-13 12:43:10 +0200 | [diff] [blame] | 6210 | .v.func = alc_fixup_thinkpad_acpi, |
Takashi Iwai | 09da111 | 2016-09-08 12:15:02 +0200 | [diff] [blame] | 6211 | .chained = true, |
| 6212 | .chain_id = ALC269_FIXUP_SKU_IGNORE, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6213 | }, |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 6214 | [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = { |
| 6215 | .type = HDA_FIXUP_FUNC, |
| 6216 | .v.func = alc_fixup_inv_dmic, |
| 6217 | .chained = true, |
| 6218 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
| 6219 | }, |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 6220 | [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = { |
| 6221 | .type = HDA_FIXUP_PINS, |
| 6222 | .v.pins = (const struct hda_pintbl[]) { |
| 6223 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6224 | { } |
| 6225 | }, |
| 6226 | .chained = true, |
| 6227 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 6228 | }, |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 6229 | [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 6230 | .type = HDA_FIXUP_PINS, |
| 6231 | .v.pins = (const struct hda_pintbl[]) { |
| 6232 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6233 | { } |
| 6234 | }, |
| 6235 | .chained = true, |
| 6236 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 6237 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6238 | [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6239 | .type = HDA_FIXUP_PINS, |
| 6240 | .v.pins = (const struct hda_pintbl[]) { |
| 6241 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6242 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6243 | { } |
| 6244 | }, |
| 6245 | .chained = true, |
| 6246 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 6247 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6248 | [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 6249 | .type = HDA_FIXUP_PINS, |
| 6250 | .v.pins = (const struct hda_pintbl[]) { |
| 6251 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6252 | { } |
| 6253 | }, |
| 6254 | .chained = true, |
| 6255 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6256 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6257 | [ALC255_FIXUP_HEADSET_MODE] = { |
| 6258 | .type = HDA_FIXUP_FUNC, |
| 6259 | .v.func = alc_fixup_headset_mode_alc255, |
Hui Wang | 4a83d42 | 2014-11-18 17:57:40 +0800 | [diff] [blame] | 6260 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6261 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6262 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6263 | [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 6264 | .type = HDA_FIXUP_FUNC, |
| 6265 | .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, |
| 6266 | }, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 6267 | [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6268 | .type = HDA_FIXUP_PINS, |
| 6269 | .v.pins = (const struct hda_pintbl[]) { |
| 6270 | { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6271 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6272 | { } |
| 6273 | }, |
| 6274 | .chained = true, |
| 6275 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6276 | }, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6277 | [ALC292_FIXUP_TPT440_DOCK] = { |
David Henningsson | ec56af6 | 2015-06-24 10:46:33 +0200 | [diff] [blame] | 6278 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 6279 | .v.func = alc_fixup_tpt440_dock, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6280 | .chained = true, |
| 6281 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 6282 | }, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6283 | [ALC292_FIXUP_TPT440] = { |
| 6284 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 157f0b7 | 2015-12-10 23:30:43 +0100 | [diff] [blame] | 6285 | .v.func = alc_fixup_disable_aamix, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6286 | .chained = true, |
| 6287 | .chain_id = ALC292_FIXUP_TPT440_DOCK, |
| 6288 | }, |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 6289 | [ALC283_FIXUP_HEADSET_MIC] = { |
Daniel Drake | 9dc1286 | 2014-07-22 10:58:29 +0100 | [diff] [blame] | 6290 | .type = HDA_FIXUP_PINS, |
| 6291 | .v.pins = (const struct hda_pintbl[]) { |
| 6292 | { 0x19, 0x04a110f0 }, |
| 6293 | { }, |
| 6294 | }, |
| 6295 | }, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6296 | [ALC255_FIXUP_MIC_MUTE_LED] = { |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 6297 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6298 | .v.func = snd_hda_gen_fixup_micmute_led, |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 6299 | }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 6300 | [ALC282_FIXUP_ASPIRE_V5_PINS] = { |
| 6301 | .type = HDA_FIXUP_PINS, |
| 6302 | .v.pins = (const struct hda_pintbl[]) { |
| 6303 | { 0x12, 0x90a60130 }, |
| 6304 | { 0x14, 0x90170110 }, |
| 6305 | { 0x17, 0x40000008 }, |
| 6306 | { 0x18, 0x411111f0 }, |
Mateusz Sylwestrzak | 0420694 | 2015-07-19 17:38:56 +0200 | [diff] [blame] | 6307 | { 0x19, 0x01a1913c }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 6308 | { 0x1a, 0x411111f0 }, |
| 6309 | { 0x1b, 0x411111f0 }, |
| 6310 | { 0x1d, 0x40f89b2d }, |
| 6311 | { 0x1e, 0x411111f0 }, |
| 6312 | { 0x21, 0x0321101f }, |
| 6313 | { }, |
| 6314 | }, |
| 6315 | }, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 6316 | [ALC280_FIXUP_HP_GPIO4] = { |
| 6317 | .type = HDA_FIXUP_FUNC, |
| 6318 | .v.func = alc280_fixup_hp_gpio4, |
| 6319 | }, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 6320 | [ALC286_FIXUP_HP_GPIO_LED] = { |
| 6321 | .type = HDA_FIXUP_FUNC, |
| 6322 | .v.func = alc286_fixup_hp_gpio_led, |
| 6323 | }, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 6324 | [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = { |
| 6325 | .type = HDA_FIXUP_FUNC, |
| 6326 | .v.func = alc280_fixup_hp_gpio2_mic_hotkey, |
| 6327 | }, |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 6328 | [ALC280_FIXUP_HP_DOCK_PINS] = { |
| 6329 | .type = HDA_FIXUP_PINS, |
| 6330 | .v.pins = (const struct hda_pintbl[]) { |
| 6331 | { 0x1b, 0x21011020 }, /* line-out */ |
| 6332 | { 0x1a, 0x01a1903c }, /* headset mic */ |
| 6333 | { 0x18, 0x2181103f }, /* line-in */ |
| 6334 | { }, |
| 6335 | }, |
| 6336 | .chained = true, |
| 6337 | .chain_id = ALC280_FIXUP_HP_GPIO4 |
| 6338 | }, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 6339 | [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = { |
| 6340 | .type = HDA_FIXUP_PINS, |
| 6341 | .v.pins = (const struct hda_pintbl[]) { |
| 6342 | { 0x1b, 0x21011020 }, /* line-out */ |
| 6343 | { 0x18, 0x2181103f }, /* line-in */ |
| 6344 | { }, |
| 6345 | }, |
| 6346 | .chained = true, |
| 6347 | .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED |
| 6348 | }, |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6349 | [ALC280_FIXUP_HP_9480M] = { |
| 6350 | .type = HDA_FIXUP_FUNC, |
| 6351 | .v.func = alc280_fixup_hp_9480m, |
| 6352 | }, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6353 | [ALC288_FIXUP_DELL_HEADSET_MODE] = { |
| 6354 | .type = HDA_FIXUP_FUNC, |
| 6355 | .v.func = alc_fixup_headset_mode_dell_alc288, |
| 6356 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6357 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6358 | }, |
| 6359 | [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6360 | .type = HDA_FIXUP_PINS, |
| 6361 | .v.pins = (const struct hda_pintbl[]) { |
| 6362 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6363 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6364 | { } |
| 6365 | }, |
| 6366 | .chained = true, |
| 6367 | .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE |
| 6368 | }, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6369 | [ALC288_FIXUP_DISABLE_AAMIX] = { |
| 6370 | .type = HDA_FIXUP_FUNC, |
| 6371 | .v.func = alc_fixup_disable_aamix, |
| 6372 | .chained = true, |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 6373 | .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6374 | }, |
| 6375 | [ALC288_FIXUP_DELL_XPS_13] = { |
| 6376 | .type = HDA_FIXUP_FUNC, |
| 6377 | .v.func = alc_fixup_dell_xps13, |
| 6378 | .chained = true, |
| 6379 | .chain_id = ALC288_FIXUP_DISABLE_AAMIX |
| 6380 | }, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6381 | [ALC292_FIXUP_DISABLE_AAMIX] = { |
| 6382 | .type = HDA_FIXUP_FUNC, |
| 6383 | .v.func = alc_fixup_disable_aamix, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6384 | .chained = true, |
| 6385 | .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6386 | }, |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 6387 | [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = { |
| 6388 | .type = HDA_FIXUP_FUNC, |
| 6389 | .v.func = alc_fixup_disable_aamix, |
| 6390 | .chained = true, |
| 6391 | .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6392 | }, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6393 | [ALC292_FIXUP_DELL_E7X] = { |
| 6394 | .type = HDA_FIXUP_FUNC, |
| 6395 | .v.func = alc_fixup_dell_xps13, |
| 6396 | .chained = true, |
| 6397 | .chain_id = ALC292_FIXUP_DISABLE_AAMIX |
| 6398 | }, |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 6399 | [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6400 | .type = HDA_FIXUP_PINS, |
| 6401 | .v.pins = (const struct hda_pintbl[]) { |
| 6402 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6403 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6404 | { } |
| 6405 | }, |
| 6406 | .chained = true, |
| 6407 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6408 | }, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 6409 | [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = { |
| 6410 | .type = HDA_FIXUP_PINS, |
| 6411 | .v.pins = (const struct hda_pintbl[]) { |
| 6412 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6413 | { } |
| 6414 | }, |
| 6415 | .chained = true, |
| 6416 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6417 | }, |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 6418 | [ALC275_FIXUP_DELL_XPS] = { |
| 6419 | .type = HDA_FIXUP_VERBS, |
| 6420 | .v.verbs = (const struct hda_verb[]) { |
| 6421 | /* Enables internal speaker */ |
| 6422 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1f}, |
| 6423 | {0x20, AC_VERB_SET_PROC_COEF, 0x00c0}, |
| 6424 | {0x20, AC_VERB_SET_COEF_INDEX, 0x30}, |
| 6425 | {0x20, AC_VERB_SET_PROC_COEF, 0x00b1}, |
| 6426 | {} |
| 6427 | } |
| 6428 | }, |
Hui Wang | 8c69729 | 2015-11-24 11:08:18 +0800 | [diff] [blame] | 6429 | [ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE] = { |
| 6430 | .type = HDA_FIXUP_VERBS, |
| 6431 | .v.verbs = (const struct hda_verb[]) { |
| 6432 | /* Disable pass-through path for FRONT 14h */ |
| 6433 | {0x20, AC_VERB_SET_COEF_INDEX, 0x36}, |
| 6434 | {0x20, AC_VERB_SET_PROC_COEF, 0x1737}, |
| 6435 | {} |
| 6436 | }, |
| 6437 | .chained = true, |
| 6438 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6439 | }, |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 6440 | [ALC293_FIXUP_LENOVO_SPK_NOISE] = { |
| 6441 | .type = HDA_FIXUP_FUNC, |
| 6442 | .v.func = alc_fixup_disable_aamix, |
| 6443 | .chained = true, |
| 6444 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
| 6445 | }, |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 6446 | [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = { |
| 6447 | .type = HDA_FIXUP_FUNC, |
| 6448 | .v.func = alc233_fixup_lenovo_line2_mic_hotkey, |
| 6449 | }, |
Kai-Heng Feng | 3b43b71 | 2016-02-25 15:19:38 +0800 | [diff] [blame] | 6450 | [ALC255_FIXUP_DELL_SPK_NOISE] = { |
| 6451 | .type = HDA_FIXUP_FUNC, |
| 6452 | .v.func = alc_fixup_disable_aamix, |
| 6453 | .chained = true, |
| 6454 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6455 | }, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 6456 | [ALC225_FIXUP_DISABLE_MIC_VREF] = { |
| 6457 | .type = HDA_FIXUP_FUNC, |
| 6458 | .v.func = alc_fixup_disable_mic_vref, |
| 6459 | .chained = true, |
| 6460 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6461 | }, |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 6462 | [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6463 | .type = HDA_FIXUP_VERBS, |
| 6464 | .v.verbs = (const struct hda_verb[]) { |
| 6465 | /* Disable pass-through path for FRONT 14h */ |
| 6466 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, |
| 6467 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, |
| 6468 | {} |
| 6469 | }, |
| 6470 | .chained = true, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 6471 | .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 6472 | }, |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 6473 | [ALC280_FIXUP_HP_HEADSET_MIC] = { |
| 6474 | .type = HDA_FIXUP_FUNC, |
| 6475 | .v.func = alc_fixup_disable_aamix, |
| 6476 | .chained = true, |
| 6477 | .chain_id = ALC269_FIXUP_HEADSET_MIC, |
| 6478 | }, |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 6479 | [ALC221_FIXUP_HP_FRONT_MIC] = { |
| 6480 | .type = HDA_FIXUP_PINS, |
| 6481 | .v.pins = (const struct hda_pintbl[]) { |
| 6482 | { 0x19, 0x02a19020 }, /* Front Mic */ |
| 6483 | { } |
| 6484 | }, |
| 6485 | }, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 6486 | [ALC292_FIXUP_TPT460] = { |
| 6487 | .type = HDA_FIXUP_FUNC, |
| 6488 | .v.func = alc_fixup_tpt440_dock, |
| 6489 | .chained = true, |
| 6490 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, |
| 6491 | }, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6492 | [ALC298_FIXUP_SPK_VOLUME] = { |
| 6493 | .type = HDA_FIXUP_FUNC, |
| 6494 | .v.func = alc298_fixup_speaker_volume, |
Hui Wang | 59ec4b5 | 2016-08-04 15:28:04 +0800 | [diff] [blame] | 6495 | .chained = true, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 6496 | .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6497 | }, |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 6498 | [ALC295_FIXUP_DISABLE_DAC3] = { |
| 6499 | .type = HDA_FIXUP_FUNC, |
| 6500 | .v.func = alc295_fixup_disable_dac3, |
| 6501 | }, |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 6502 | [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { |
| 6503 | .type = HDA_FIXUP_PINS, |
| 6504 | .v.pins = (const struct hda_pintbl[]) { |
| 6505 | { 0x1b, 0x90170151 }, |
| 6506 | { } |
| 6507 | }, |
| 6508 | .chained = true, |
| 6509 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6510 | }, |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 6511 | [ALC269_FIXUP_ATIV_BOOK_8] = { |
| 6512 | .type = HDA_FIXUP_FUNC, |
| 6513 | .v.func = alc_fixup_auto_mute_via_amp, |
| 6514 | .chained = true, |
| 6515 | .chain_id = ALC269_FIXUP_NO_SHUTUP |
| 6516 | }, |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 6517 | [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { |
| 6518 | .type = HDA_FIXUP_PINS, |
| 6519 | .v.pins = (const struct hda_pintbl[]) { |
| 6520 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6521 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6522 | { } |
| 6523 | }, |
| 6524 | .chained = true, |
| 6525 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6526 | }, |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6527 | [ALC256_FIXUP_ASUS_HEADSET_MODE] = { |
| 6528 | .type = HDA_FIXUP_FUNC, |
| 6529 | .v.func = alc_fixup_headset_mode, |
| 6530 | }, |
| 6531 | [ALC256_FIXUP_ASUS_MIC] = { |
| 6532 | .type = HDA_FIXUP_PINS, |
| 6533 | .v.pins = (const struct hda_pintbl[]) { |
| 6534 | { 0x13, 0x90a60160 }, /* use as internal mic */ |
| 6535 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 6536 | { } |
| 6537 | }, |
| 6538 | .chained = true, |
| 6539 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 6540 | }, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 6541 | [ALC256_FIXUP_ASUS_AIO_GPIO2] = { |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 6542 | .type = HDA_FIXUP_FUNC, |
| 6543 | /* Set up GPIO2 for the speaker amp */ |
| 6544 | .v.func = alc_fixup_gpio4, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 6545 | }, |
Chris Chiu | 216d7ae | 2017-02-28 14:17:14 -0600 | [diff] [blame] | 6546 | [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 6547 | .type = HDA_FIXUP_PINS, |
| 6548 | .v.pins = (const struct hda_pintbl[]) { |
| 6549 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6550 | { } |
| 6551 | }, |
| 6552 | .chained = true, |
| 6553 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 6554 | }, |
| 6555 | [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = { |
| 6556 | .type = HDA_FIXUP_VERBS, |
| 6557 | .v.verbs = (const struct hda_verb[]) { |
| 6558 | /* Enables internal speaker */ |
| 6559 | {0x20, AC_VERB_SET_COEF_INDEX, 0x40}, |
| 6560 | {0x20, AC_VERB_SET_PROC_COEF, 0x8800}, |
| 6561 | {} |
| 6562 | }, |
| 6563 | .chained = true, |
| 6564 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE |
| 6565 | }, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 6566 | [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { |
| 6567 | .type = HDA_FIXUP_FUNC, |
| 6568 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, |
| 6569 | }, |
Jian-Hong Pan | ea5c7eb | 2019-04-01 11:25:05 +0800 | [diff] [blame] | 6570 | [ALC233_FIXUP_ACER_HEADSET_MIC] = { |
| 6571 | .type = HDA_FIXUP_VERBS, |
| 6572 | .v.verbs = (const struct hda_verb[]) { |
| 6573 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, |
| 6574 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, |
| 6575 | { } |
| 6576 | }, |
| 6577 | .chained = true, |
| 6578 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE |
| 6579 | }, |
Hui Wang | f33f79f | 2017-07-07 12:08:29 +0800 | [diff] [blame] | 6580 | [ALC294_FIXUP_LENOVO_MIC_LOCATION] = { |
| 6581 | .type = HDA_FIXUP_PINS, |
| 6582 | .v.pins = (const struct hda_pintbl[]) { |
| 6583 | /* Change the mic location from front to right, otherwise there are |
| 6584 | two front mics with the same name, pulseaudio can't handle them. |
| 6585 | This is just a temporary workaround, after applying this fixup, |
| 6586 | there will be one "Front Mic" and one "Mic" in this machine. |
| 6587 | */ |
| 6588 | { 0x1a, 0x04a19040 }, |
| 6589 | { } |
| 6590 | }, |
| 6591 | }, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 6592 | [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = { |
| 6593 | .type = HDA_FIXUP_PINS, |
| 6594 | .v.pins = (const struct hda_pintbl[]) { |
| 6595 | { 0x16, 0x0101102f }, /* Rear Headset HP */ |
| 6596 | { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */ |
| 6597 | { 0x1a, 0x01a19030 }, /* Rear Headset MIC */ |
| 6598 | { 0x1b, 0x02011020 }, |
| 6599 | { } |
| 6600 | }, |
| 6601 | .chained = true, |
| 6602 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6603 | }, |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 6604 | [ALC700_FIXUP_INTEL_REFERENCE] = { |
| 6605 | .type = HDA_FIXUP_VERBS, |
| 6606 | .v.verbs = (const struct hda_verb[]) { |
| 6607 | /* Enables internal speaker */ |
| 6608 | {0x20, AC_VERB_SET_COEF_INDEX, 0x45}, |
| 6609 | {0x20, AC_VERB_SET_PROC_COEF, 0x5289}, |
| 6610 | {0x20, AC_VERB_SET_COEF_INDEX, 0x4A}, |
| 6611 | {0x20, AC_VERB_SET_PROC_COEF, 0x001b}, |
| 6612 | {0x58, AC_VERB_SET_COEF_INDEX, 0x00}, |
| 6613 | {0x58, AC_VERB_SET_PROC_COEF, 0x3888}, |
| 6614 | {0x20, AC_VERB_SET_COEF_INDEX, 0x6f}, |
| 6615 | {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b}, |
| 6616 | {} |
| 6617 | } |
| 6618 | }, |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 6619 | [ALC274_FIXUP_DELL_BIND_DACS] = { |
| 6620 | .type = HDA_FIXUP_FUNC, |
| 6621 | .v.func = alc274_fixup_bind_dacs, |
| 6622 | .chained = true, |
| 6623 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6624 | }, |
| 6625 | [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = { |
| 6626 | .type = HDA_FIXUP_PINS, |
| 6627 | .v.pins = (const struct hda_pintbl[]) { |
| 6628 | { 0x1b, 0x0401102f }, |
| 6629 | { } |
| 6630 | }, |
| 6631 | .chained = true, |
| 6632 | .chain_id = ALC274_FIXUP_DELL_BIND_DACS |
| 6633 | }, |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6634 | [ALC298_FIXUP_TPT470_DOCK] = { |
| 6635 | .type = HDA_FIXUP_FUNC, |
| 6636 | .v.func = alc_fixup_tpt470_dock, |
| 6637 | .chained = true, |
| 6638 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE |
| 6639 | }, |
Kailang Yang | ae104a2 | 2018-02-05 16:07:20 +0800 | [diff] [blame] | 6640 | [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = { |
| 6641 | .type = HDA_FIXUP_PINS, |
| 6642 | .v.pins = (const struct hda_pintbl[]) { |
| 6643 | { 0x14, 0x0201101f }, |
| 6644 | { } |
| 6645 | }, |
| 6646 | .chained = true, |
| 6647 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6648 | }, |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 6649 | [ALC255_FIXUP_DELL_HEADSET_MIC] = { |
| 6650 | .type = HDA_FIXUP_PINS, |
| 6651 | .v.pins = (const struct hda_pintbl[]) { |
| 6652 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6653 | { } |
| 6654 | }, |
Hui Wang | 3ce0d5a | 2018-04-19 13:29:04 +0800 | [diff] [blame] | 6655 | .chained = true, |
| 6656 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 6657 | }, |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 6658 | [ALC295_FIXUP_HP_X360] = { |
| 6659 | .type = HDA_FIXUP_FUNC, |
| 6660 | .v.func = alc295_fixup_hp_top_speakers, |
| 6661 | .chained = true, |
| 6662 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3 |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 6663 | }, |
| 6664 | [ALC221_FIXUP_HP_HEADSET_MIC] = { |
| 6665 | .type = HDA_FIXUP_PINS, |
| 6666 | .v.pins = (const struct hda_pintbl[]) { |
| 6667 | { 0x19, 0x0181313f}, |
| 6668 | { } |
| 6669 | }, |
| 6670 | .chained = true, |
| 6671 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 6672 | }, |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 6673 | [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = { |
| 6674 | .type = HDA_FIXUP_FUNC, |
| 6675 | .v.func = alc285_fixup_invalidate_dacs, |
Hui Wang | 6ba189c | 2018-12-09 09:16:43 +0800 | [diff] [blame] | 6676 | .chained = true, |
| 6677 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 6678 | }, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 6679 | [ALC295_FIXUP_HP_AUTO_MUTE] = { |
| 6680 | .type = HDA_FIXUP_FUNC, |
| 6681 | .v.func = alc_fixup_auto_mute_via_amp, |
| 6682 | }, |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 6683 | [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = { |
| 6684 | .type = HDA_FIXUP_PINS, |
| 6685 | .v.pins = (const struct hda_pintbl[]) { |
| 6686 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6687 | { } |
| 6688 | }, |
| 6689 | .chained = true, |
| 6690 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 6691 | }, |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 6692 | [ALC294_FIXUP_ASUS_MIC] = { |
| 6693 | .type = HDA_FIXUP_PINS, |
| 6694 | .v.pins = (const struct hda_pintbl[]) { |
| 6695 | { 0x13, 0x90a60160 }, /* use as internal mic */ |
| 6696 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 6697 | { } |
| 6698 | }, |
| 6699 | .chained = true, |
| 6700 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6701 | }, |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 6702 | [ALC294_FIXUP_ASUS_HEADSET_MIC] = { |
| 6703 | .type = HDA_FIXUP_PINS, |
| 6704 | .v.pins = (const struct hda_pintbl[]) { |
Jian-Hong Pan | 82b0114 | 2018-12-27 16:46:31 +0800 | [diff] [blame] | 6705 | { 0x19, 0x01a1103c }, /* use as headset mic */ |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 6706 | { } |
| 6707 | }, |
| 6708 | .chained = true, |
| 6709 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6710 | }, |
| 6711 | [ALC294_FIXUP_ASUS_SPK] = { |
| 6712 | .type = HDA_FIXUP_VERBS, |
| 6713 | .v.verbs = (const struct hda_verb[]) { |
| 6714 | /* Set EAPD high */ |
| 6715 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 }, |
| 6716 | { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 }, |
| 6717 | { } |
| 6718 | }, |
| 6719 | .chained = true, |
| 6720 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 6721 | }, |
Jaroslav Kysela | c8a9afa | 2019-03-14 09:21:08 +0100 | [diff] [blame] | 6722 | [ALC295_FIXUP_CHROME_BOOK] = { |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 6723 | .type = HDA_FIXUP_FUNC, |
Jaroslav Kysela | c8a9afa | 2019-03-14 09:21:08 +0100 | [diff] [blame] | 6724 | .v.func = alc295_fixup_chromebook, |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 6725 | .chained = true, |
| 6726 | .chain_id = ALC225_FIXUP_HEADSET_JACK |
| 6727 | }, |
| 6728 | [ALC225_FIXUP_HEADSET_JACK] = { |
| 6729 | .type = HDA_FIXUP_FUNC, |
| 6730 | .v.func = alc_fixup_headset_jack, |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 6731 | }, |
Jeremy Soller | 89e3a56 | 2019-01-30 16:12:31 -0700 | [diff] [blame] | 6732 | [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { |
| 6733 | .type = HDA_FIXUP_PINS, |
| 6734 | .v.pins = (const struct hda_pintbl[]) { |
| 6735 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6736 | { } |
| 6737 | }, |
| 6738 | .chained = true, |
| 6739 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6740 | }, |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 6741 | [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = { |
| 6742 | .type = HDA_FIXUP_VERBS, |
| 6743 | .v.verbs = (const struct hda_verb[]) { |
| 6744 | /* Disable PCBEEP-IN passthrough */ |
| 6745 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, |
| 6746 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, |
| 6747 | { } |
| 6748 | }, |
| 6749 | .chained = true, |
| 6750 | .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE |
| 6751 | }, |
Jian-Hong Pan | cbc05fd | 2019-03-13 17:33:24 +0800 | [diff] [blame] | 6752 | [ALC255_FIXUP_ACER_HEADSET_MIC] = { |
| 6753 | .type = HDA_FIXUP_PINS, |
| 6754 | .v.pins = (const struct hda_pintbl[]) { |
| 6755 | { 0x19, 0x03a11130 }, |
| 6756 | { 0x1a, 0x90a60140 }, /* use as internal mic */ |
| 6757 | { } |
| 6758 | }, |
| 6759 | .chained = true, |
| 6760 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6761 | }, |
Kailang Yang | 136824e | 2019-03-14 16:22:45 +0800 | [diff] [blame] | 6762 | [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = { |
| 6763 | .type = HDA_FIXUP_PINS, |
| 6764 | .v.pins = (const struct hda_pintbl[]) { |
| 6765 | { 0x16, 0x01011020 }, /* Rear Line out */ |
| 6766 | { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */ |
| 6767 | { } |
| 6768 | }, |
| 6769 | .chained = true, |
| 6770 | .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE |
| 6771 | }, |
| 6772 | [ALC225_FIXUP_WYSE_AUTO_MUTE] = { |
| 6773 | .type = HDA_FIXUP_FUNC, |
| 6774 | .v.func = alc_fixup_auto_mute_via_amp, |
| 6775 | .chained = true, |
| 6776 | .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF |
| 6777 | }, |
| 6778 | [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = { |
| 6779 | .type = HDA_FIXUP_FUNC, |
| 6780 | .v.func = alc_fixup_disable_mic_vref, |
| 6781 | .chained = true, |
| 6782 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6783 | }, |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 6784 | [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = { |
| 6785 | .type = HDA_FIXUP_VERBS, |
| 6786 | .v.verbs = (const struct hda_verb[]) { |
| 6787 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f }, |
| 6788 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 }, |
| 6789 | { } |
| 6790 | }, |
| 6791 | .chained = true, |
| 6792 | .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE |
| 6793 | }, |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 6794 | [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 6795 | .type = HDA_FIXUP_PINS, |
| 6796 | .v.pins = (const struct hda_pintbl[]) { |
| 6797 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 6798 | { } |
| 6799 | }, |
| 6800 | .chained = true, |
| 6801 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 6802 | }, |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 6803 | [ALC299_FIXUP_PREDATOR_SPK] = { |
| 6804 | .type = HDA_FIXUP_PINS, |
| 6805 | .v.pins = (const struct hda_pintbl[]) { |
| 6806 | { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */ |
| 6807 | { } |
| 6808 | } |
| 6809 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6810 | }; |
| 6811 | |
| 6812 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
Marius Knaust | a6b92b6 | 2014-03-03 01:48:58 +0100 | [diff] [blame] | 6813 | SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6814 | SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), |
| 6815 | SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 6816 | SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 6817 | SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
| 6818 | 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] | 6819 | SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), |
| 6820 | 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] | 6821 | 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] | 6822 | 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] | 6823 | SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), |
Chris Chiu | 705b65f | 2018-12-05 14:48:54 +0800 | [diff] [blame] | 6824 | SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), |
Takashi Iwai | b9c2fa5 | 2015-11-19 16:39:50 +0100 | [diff] [blame] | 6825 | SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), |
Chris Chiu | c7531e3 | 2019-03-21 17:17:31 +0800 | [diff] [blame] | 6826 | SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
| 6827 | SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 6828 | SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK), |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 6829 | SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
| 6830 | SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
| 6831 | SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
Jian-Hong Pan | 2733cce | 2019-03-21 16:39:04 +0800 | [diff] [blame] | 6832 | SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
Jian-Hong Pan | ea5c7eb | 2019-04-01 11:25:05 +0800 | [diff] [blame] | 6833 | SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC), |
Jian-Hong Pan | cbc05fd | 2019-03-13 17:33:24 +0800 | [diff] [blame] | 6834 | SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 6835 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 6836 | 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] | 6837 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | cf52103 | 2016-01-15 12:59:25 +0100 | [diff] [blame] | 6838 | SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6839 | SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X), |
| 6840 | SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6841 | SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6842 | SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 6843 | SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 6844 | SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6845 | SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
| 6846 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
Takashi Iwai | 9807057 | 2016-01-12 21:06:39 +0100 | [diff] [blame] | 6847 | SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | 4275554 | 2015-06-29 10:56:53 +0200 | [diff] [blame] | 6848 | SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6849 | 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] | 6850 | SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 6851 | SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6852 | 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] | 6853 | 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] | 6854 | SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), |
Kailang Yang | 8b72415 | 2014-12-17 17:08:59 +0800 | [diff] [blame] | 6855 | SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
Kailang Yang | b734304 | 2014-12-02 14:50:45 +0800 | [diff] [blame] | 6856 | SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 6857 | SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 6858 | SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 6859 | SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 6860 | SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 6861 | SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 6862 | SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
Kai-Heng Feng | 423cd78 | 2016-05-20 15:47:23 +0800 | [diff] [blame] | 6863 | 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] | 6864 | 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] | 6865 | SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE), |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 6866 | SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP), |
Kai-Heng Feng | 423cd78 | 2016-05-20 15:47:23 +0800 | [diff] [blame] | 6867 | SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), |
Kai-Heng Feng | 709ae62 | 2018-10-04 11:39:42 +0800 | [diff] [blame] | 6868 | SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME), |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6869 | SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 6870 | SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3), |
Takashi Iwai | 493de34 | 2017-02-28 17:27:57 +0100 | [diff] [blame] | 6871 | 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] | 6872 | 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] | 6873 | 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] | 6874 | SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
| 6875 | SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 6876 | SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
| 6877 | 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] | 6878 | SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), |
Kailang Yang | 136824e | 2019-03-14 16:22:45 +0800 | [diff] [blame] | 6879 | SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE), |
Kailang Yang | da484d0 | 2019-03-14 15:50:59 +0800 | [diff] [blame] | 6880 | SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE), |
Kailang Yang | c2a7c55a | 2019-01-03 15:53:39 +0800 | [diff] [blame] | 6881 | SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 6882 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 6883 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6884 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 6885 | SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 6886 | 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] | 6887 | SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6888 | /* ALC282 */ |
Hui Wang | 7976eb4 | 2015-02-13 11:14:41 +0800 | [diff] [blame] | 6889 | SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 6890 | SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 6891 | SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6892 | SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 6893 | SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 6894 | SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 6895 | SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6896 | SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6897 | SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6898 | SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6899 | SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 6900 | SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 6901 | SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED), |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 6902 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
TienFu Chen | 3271cb2 | 2015-02-10 09:09:41 +0100 | [diff] [blame] | 6903 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6904 | SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6905 | SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6906 | SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6907 | SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6908 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6909 | SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6910 | SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6911 | SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6912 | /* ALC290 */ |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6913 | SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6914 | SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6915 | SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6916 | SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6917 | SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6918 | SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6919 | SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6920 | SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6921 | SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 6922 | 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] | 6923 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6924 | SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6925 | SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6926 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6927 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6928 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6929 | SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6930 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6931 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6932 | SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6933 | SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6934 | SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6935 | SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6936 | SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6937 | SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 6938 | SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6939 | SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6940 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6941 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 6942 | SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), |
Jaroslav Kysela | 167897f | 2019-03-13 13:40:15 +0100 | [diff] [blame] | 6943 | SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
| 6944 | SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
Takashi Iwai | 563785e | 2018-11-12 09:43:12 +0100 | [diff] [blame] | 6945 | SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 6946 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 6947 | SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), |
Jaroslav Kysela | 167897f | 2019-03-13 13:40:15 +0100 | [diff] [blame] | 6948 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
| 6949 | SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
Alexandru Gagniuc | 56e40eb | 2018-08-04 11:44:44 -0500 | [diff] [blame] | 6950 | SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6951 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6952 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6953 | SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Wandrille RONCE | 9cf6533 | 2018-12-19 14:52:44 +0100 | [diff] [blame] | 6954 | SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6955 | SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 4eab0ea | 2017-06-06 12:33:17 +0200 | [diff] [blame] | 6956 | 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] | 6957 | 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] | 6958 | SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
| 6959 | SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), |
| 6960 | 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] | 6961 | SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), |
| 6962 | SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), |
| 6963 | SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 6964 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 6965 | 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] | 6966 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 6967 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
Chris Chiu | 28e8af8 | 2017-06-05 15:05:30 -0600 | [diff] [blame] | 6968 | SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6969 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 6970 | 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] | 6971 | 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] | 6972 | SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 6973 | SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 6974 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), |
| 6975 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), |
| 6976 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
| 6977 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 6978 | SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), |
Takashi Iwai | f88abaa | 2014-02-07 12:07:59 +0100 | [diff] [blame] | 6979 | 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] | 6980 | 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] | 6981 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), |
| 6982 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
| 6983 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 6984 | 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] | 6985 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 6986 | 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] | 6987 | SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
Takashi Iwai | 88776f3 | 2015-05-01 09:20:34 +0200 | [diff] [blame] | 6988 | 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] | 6989 | 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] | 6990 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 6991 | SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), |
YOKOTA Hiroshi | 0fca97a | 2018-07-01 18:30:01 +0900 | [diff] [blame] | 6992 | SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), |
David Henningsson | a33cc48 | 2014-10-07 10:18:41 +0200 | [diff] [blame] | 6993 | 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] | 6994 | 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] | 6995 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |
| 6996 | SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), |
Anisse Astier | 8cd6527 | 2018-11-23 17:59:11 +0100 | [diff] [blame] | 6997 | SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), |
Jeremy Soller | 89e3a56 | 2019-01-30 16:12:31 -0700 | [diff] [blame] | 6998 | SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Jeremy Soller | 80a5052 | 2019-05-07 17:11:08 -0400 | [diff] [blame] | 6999 | SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Jeremy Soller | 891afcf | 2019-05-10 10:15:07 -0400 | [diff] [blame] | 7000 | SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
| 7001 | SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC), |
| 7002 | SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC), |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 7003 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7004 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
| 7005 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), |
| 7006 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), |
| 7007 | SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), |
| 7008 | SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), |
Takashi Iwai | 707fba3 | 2012-08-02 09:04:39 +0200 | [diff] [blame] | 7009 | SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK), |
Felix Kaechele | c8415a4 | 2012-08-06 23:02:01 +0200 | [diff] [blame] | 7010 | SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), |
Stefán Freyr | 84f98fd | 2012-10-19 22:46:00 +0200 | [diff] [blame] | 7011 | SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), |
Philipp A. Mohrenweiser | 4407be6 | 2012-08-06 13:14:18 +0200 | [diff] [blame] | 7012 | SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 7013 | SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 7014 | SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 7015 | SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440), |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 7016 | SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | a12137e | 2014-06-27 12:14:35 +0200 | [diff] [blame] | 7017 | SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), |
Rick Sherman | 59a51a6 | 2015-08-18 21:04:30 -0500 | [diff] [blame] | 7018 | SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | 6d16941 | 2014-10-07 17:27:02 +0200 | [diff] [blame] | 7019 | SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), |
Lukas Bossard | 7c21539 | 2014-10-29 18:31:07 +0100 | [diff] [blame] | 7020 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 7021 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Takashi Iwai | b6903c0 | 2015-12-10 12:20:20 +0100 | [diff] [blame] | 7022 | 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] | 7023 | SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), |
Yves-Alexis Perez | c027866 | 2015-04-11 09:31:35 +0200 | [diff] [blame] | 7024 | SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7025 | SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7026 | SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Torsten Hilbrich | dab38e4 | 2016-06-07 13:14:21 +0200 | [diff] [blame] | 7027 | SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460), |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 7028 | SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7029 | SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK), |
| 7030 | SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7031 | SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Dennis Wassenberg | e4c07b3 | 2018-03-08 13:17:54 +0100 | [diff] [blame] | 7032 | SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7033 | SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7034 | SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7035 | SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Benjamin Berg | 85981df | 2018-02-14 13:29:39 +0100 | [diff] [blame] | 7036 | SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 7037 | 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] | 7038 | 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] | 7039 | SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | e41fc8c | 2018-06-25 14:40:56 +0800 | [diff] [blame] | 7040 | SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Kailang Yang | 6581183 | 2018-04-25 17:07:27 +0800 | [diff] [blame] | 7041 | SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | 8da5bbf | 2017-12-22 11:17:46 +0800 | [diff] [blame] | 7042 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 7043 | 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] | 7044 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
Michał Wadowski | 56df90b | 2019-05-14 16:58:00 +0200 | [diff] [blame] | 7045 | SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 7046 | SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 7047 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), |
Takashi Iwai | c497d9f | 2014-10-08 12:14:40 +0200 | [diff] [blame] | 7048 | SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 7049 | 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] | 7050 | SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), |
Sebastian Wicki | 80b311d | 2015-03-23 17:23:11 +0100 | [diff] [blame] | 7051 | SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), |
Ansgar Hegerfeld | 09ea997 | 2015-05-14 12:31:32 +0200 | [diff] [blame] | 7052 | SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), |
Conrad Kostecki | 037e119 | 2016-04-26 10:08:10 +0200 | [diff] [blame] | 7053 | SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK), |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 7054 | SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), |
Jaroslav Kysela | 0f087ee | 2016-06-24 15:13:16 +0200 | [diff] [blame] | 7055 | SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460), |
Torsten Hilbrich | 9cd2574 | 2016-07-05 10:40:22 +0200 | [diff] [blame] | 7056 | SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460), |
Jaroslav Kysela | 0f087ee | 2016-06-24 15:13:16 +0200 | [diff] [blame] | 7057 | SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7058 | SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7059 | SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7060 | SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 7061 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 7062 | SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 7063 | SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 7064 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7065 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), |
Ayman Bagabas | e2744fd | 2018-12-12 18:07:59 -0500 | [diff] [blame] | 7066 | SND_PCI_QUIRK(0x19e5, 0x3200, "Huawei MBX", ALC255_FIXUP_MIC_MUTE_LED), |
| 7067 | SND_PCI_QUIRK(0x19e5, 0x3201, "Huawei MBX", ALC255_FIXUP_MIC_MUTE_LED), |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 7068 | SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MBXP", ALC256_FIXUP_HUAWEI_MBXP_PINS), |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 7069 | 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] | 7070 | |
Takashi Iwai | a7f3eed | 2012-02-16 13:03:18 +0100 | [diff] [blame] | 7071 | #if 0 |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7072 | /* Below is a quirk table taken from the old code. |
| 7073 | * Basically the device should work as is without the fixup table. |
| 7074 | * If BIOS doesn't give a proper info, enable the corresponding |
| 7075 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 7076 | */ |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7077 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", |
| 7078 | ALC269_FIXUP_AMIC), |
| 7079 | SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7080 | SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), |
| 7081 | SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), |
| 7082 | SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), |
| 7083 | SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), |
| 7084 | SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), |
| 7085 | SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), |
| 7086 | SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), |
| 7087 | SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), |
| 7088 | SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), |
| 7089 | SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), |
| 7090 | SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), |
| 7091 | SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), |
| 7092 | SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), |
| 7093 | SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), |
| 7094 | SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), |
| 7095 | SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), |
| 7096 | SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), |
| 7097 | SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), |
| 7098 | SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), |
| 7099 | SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), |
| 7100 | SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), |
| 7101 | SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), |
| 7102 | SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), |
| 7103 | SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), |
| 7104 | SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), |
| 7105 | SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), |
| 7106 | SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), |
| 7107 | SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), |
| 7108 | SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), |
| 7109 | SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), |
| 7110 | SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), |
| 7111 | SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), |
| 7112 | SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), |
| 7113 | SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), |
| 7114 | SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), |
| 7115 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), |
| 7116 | SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), |
| 7117 | SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), |
| 7118 | #endif |
| 7119 | {} |
| 7120 | }; |
| 7121 | |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 7122 | static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = { |
| 7123 | SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), |
| 7124 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), |
| 7125 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), |
| 7126 | SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), |
| 7127 | {} |
| 7128 | }; |
| 7129 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7130 | static const struct hda_model_fixup alc269_fixup_models[] = { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7131 | {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, |
| 7132 | {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 7133 | {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, |
| 7134 | {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, |
| 7135 | {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 7136 | {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, |
Takashi Iwai | b016951 | 2015-05-19 10:20:13 +0200 | [diff] [blame] | 7137 | {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, |
| 7138 | {.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] | 7139 | {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 7140 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 7141 | {.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] | 7142 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
| 7143 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7144 | {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"}, |
| 7145 | {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"}, |
Kailang Yang | be8ef16 | 2014-04-08 15:19:49 +0800 | [diff] [blame] | 7146 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 7147 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 7148 | {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 7149 | {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 7150 | {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7151 | {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 7152 | {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
Takashi Iwai | 28d1d6d | 2017-10-18 14:01:58 +0200 | [diff] [blame] | 7153 | {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7154 | {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"}, |
| 7155 | {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"}, |
| 7156 | {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"}, |
| 7157 | {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"}, |
| 7158 | {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"}, |
| 7159 | {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"}, |
| 7160 | {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"}, |
| 7161 | {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"}, |
| 7162 | {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"}, |
| 7163 | {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"}, |
| 7164 | {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"}, |
| 7165 | {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"}, |
| 7166 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"}, |
| 7167 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"}, |
| 7168 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"}, |
| 7169 | {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"}, |
| 7170 | {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"}, |
| 7171 | {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"}, |
| 7172 | {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"}, |
| 7173 | {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"}, |
| 7174 | {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"}, |
| 7175 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"}, |
| 7176 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"}, |
| 7177 | {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"}, |
| 7178 | {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"}, |
| 7179 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"}, |
| 7180 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"}, |
| 7181 | {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"}, |
| 7182 | {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"}, |
| 7183 | {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"}, |
| 7184 | {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"}, |
| 7185 | {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"}, |
| 7186 | {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"}, |
| 7187 | {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"}, |
| 7188 | {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"}, |
| 7189 | {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"}, |
| 7190 | {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"}, |
| 7191 | {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"}, |
| 7192 | {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"}, |
| 7193 | {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"}, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 7194 | {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7195 | {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"}, |
| 7196 | {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"}, |
| 7197 | {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
| 7198 | {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"}, |
| 7199 | {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"}, |
| 7200 | {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"}, |
| 7201 | {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"}, |
| 7202 | {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"}, |
| 7203 | {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"}, |
| 7204 | {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"}, |
| 7205 | {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"}, |
| 7206 | {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"}, |
| 7207 | {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"}, |
| 7208 | {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"}, |
| 7209 | {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"}, |
| 7210 | {.id = ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE, .name = "alc256-dell-xps13"}, |
| 7211 | {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"}, |
| 7212 | {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"}, |
| 7213 | {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"}, |
Kailang Yang | 82aa0d7 | 2019-01-11 17:15:53 +0800 | [diff] [blame] | 7214 | {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7215 | {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"}, |
| 7216 | {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"}, |
| 7217 | {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"}, |
| 7218 | {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"}, |
| 7219 | {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"}, |
| 7220 | {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"}, |
| 7221 | {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"}, |
| 7222 | {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"}, |
| 7223 | {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"}, |
| 7224 | {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"}, |
| 7225 | {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"}, |
| 7226 | {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"}, |
| 7227 | {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"}, |
| 7228 | {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"}, |
| 7229 | {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"}, |
| 7230 | {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, |
| 7231 | {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, |
| 7232 | {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, |
Kailang Yang | 8983eb6 | 2019-04-03 15:31:49 +0800 | [diff] [blame] | 7233 | {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"}, |
| 7234 | {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"}, |
Bernhard Rosenkraenzer | e2a829b | 2019-03-05 00:38:19 +0100 | [diff] [blame] | 7235 | {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7236 | {} |
| 7237 | }; |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 7238 | #define ALC225_STANDARD_PINS \ |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 7239 | {0x21, 0x04211020} |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7240 | |
Hui Wang | e8191a8 | 2015-04-24 13:39:59 +0800 | [diff] [blame] | 7241 | #define ALC256_STANDARD_PINS \ |
| 7242 | {0x12, 0x90a60140}, \ |
| 7243 | {0x14, 0x90170110}, \ |
Hui Wang | e8191a8 | 2015-04-24 13:39:59 +0800 | [diff] [blame] | 7244 | {0x21, 0x02211020} |
| 7245 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 7246 | #define ALC282_STANDARD_PINS \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7247 | {0x14, 0x90170110} |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 7248 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 7249 | #define ALC290_STANDARD_PINS \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7250 | {0x12, 0x99a30130} |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 7251 | |
| 7252 | #define ALC292_STANDARD_PINS \ |
| 7253 | {0x14, 0x90170110}, \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7254 | {0x15, 0x0221401f} |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 7255 | |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 7256 | #define ALC295_STANDARD_PINS \ |
| 7257 | {0x12, 0xb7a60130}, \ |
| 7258 | {0x14, 0x90170110}, \ |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 7259 | {0x21, 0x04211020} |
| 7260 | |
Woodrow Shen | 703867e | 2015-08-05 12:34:12 +0800 | [diff] [blame] | 7261 | #define ALC298_STANDARD_PINS \ |
| 7262 | {0x12, 0x90a60130}, \ |
| 7263 | {0x21, 0x03211020} |
| 7264 | |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 7265 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 7266 | SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC, |
| 7267 | {0x14, 0x01014020}, |
| 7268 | {0x17, 0x90170110}, |
| 7269 | {0x18, 0x02a11030}, |
| 7270 | {0x19, 0x0181303F}, |
| 7271 | {0x21, 0x0221102f}), |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 7272 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
| 7273 | {0x12, 0x90a601c0}, |
| 7274 | {0x14, 0x90171120}, |
| 7275 | {0x21, 0x02211030}), |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 7276 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 7277 | {0x14, 0x90170110}, |
| 7278 | {0x1b, 0x90a70130}, |
| 7279 | {0x21, 0x03211020}), |
| 7280 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 7281 | {0x1a, 0x90a70130}, |
| 7282 | {0x1b, 0x90170110}, |
| 7283 | {0x21, 0x03211020}), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 7284 | 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] | 7285 | ALC225_STANDARD_PINS, |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 7286 | {0x12, 0xb7a60130}, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 7287 | {0x14, 0x901701a0}), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 7288 | 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] | 7289 | ALC225_STANDARD_PINS, |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 7290 | {0x12, 0xb7a60130}, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 7291 | {0x14, 0x901701b0}), |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 7292 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7293 | ALC225_STANDARD_PINS, |
| 7294 | {0x12, 0xb7a60150}, |
| 7295 | {0x14, 0x901701a0}), |
| 7296 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7297 | ALC225_STANDARD_PINS, |
| 7298 | {0x12, 0xb7a60150}, |
| 7299 | {0x14, 0x901701b0}), |
| 7300 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7301 | ALC225_STANDARD_PINS, |
| 7302 | {0x12, 0xb7a60130}, |
| 7303 | {0x1b, 0x90170110}), |
Kai-Heng Feng | 0ce48e1 | 2017-11-20 02:29:13 -0500 | [diff] [blame] | 7304 | SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7305 | {0x1b, 0x01111010}, |
| 7306 | {0x1e, 0x01451130}, |
| 7307 | {0x21, 0x02211020}), |
Hui Wang | 986376b | 2018-05-30 12:33:07 +0800 | [diff] [blame] | 7308 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
| 7309 | {0x12, 0x90a60140}, |
| 7310 | {0x14, 0x90170110}, |
| 7311 | {0x19, 0x02a11030}, |
| 7312 | {0x21, 0x02211020}), |
Hui Wang | e41fc8c | 2018-06-25 14:40:56 +0800 | [diff] [blame] | 7313 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 7314 | {0x14, 0x90170110}, |
| 7315 | {0x19, 0x02a11030}, |
| 7316 | {0x1a, 0x02a11040}, |
| 7317 | {0x1b, 0x01014020}, |
| 7318 | {0x21, 0x0221101f}), |
Hui Wang | c6b17f1 | 2018-07-06 15:14:11 +0800 | [diff] [blame] | 7319 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 7320 | {0x14, 0x90170110}, |
Hui Wang | d06fb56 | 2018-10-10 11:57:25 +0800 | [diff] [blame] | 7321 | {0x19, 0x02a11030}, |
| 7322 | {0x1a, 0x02a11040}, |
| 7323 | {0x1b, 0x01011020}, |
| 7324 | {0x21, 0x0221101f}), |
| 7325 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 7326 | {0x14, 0x90170110}, |
Hui Wang | c6b17f1 | 2018-07-06 15:14:11 +0800 | [diff] [blame] | 7327 | {0x19, 0x02a11020}, |
| 7328 | {0x1a, 0x02a11030}, |
| 7329 | {0x21, 0x0221101f}), |
Hui Wang | f265788 | 2017-10-24 16:53:34 +0800 | [diff] [blame] | 7330 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7331 | {0x12, 0x90a60140}, |
| 7332 | {0x14, 0x90170110}, |
| 7333 | {0x21, 0x02211020}), |
| 7334 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7335 | {0x12, 0x90a60140}, |
| 7336 | {0x14, 0x90170150}, |
| 7337 | {0x21, 0x02211020}), |
Hui Wang | b26e36b | 2019-04-17 16:10:32 +0800 | [diff] [blame] | 7338 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7339 | {0x21, 0x02211020}), |
Kailang Yang | 0a29c57 | 2019-04-24 16:34:25 +0800 | [diff] [blame] | 7340 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7341 | {0x12, 0x40000000}, |
| 7342 | {0x14, 0x90170110}, |
| 7343 | {0x21, 0x02211020}), |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 7344 | 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] | 7345 | {0x14, 0x90170110}, |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 7346 | {0x21, 0x02211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7347 | 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] | 7348 | {0x14, 0x90170130}, |
| 7349 | {0x21, 0x02211040}), |
| 7350 | 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] | 7351 | {0x12, 0x90a60140}, |
| 7352 | {0x14, 0x90170110}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7353 | {0x21, 0x02211020}), |
| 7354 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7355 | {0x12, 0x90a60160}, |
| 7356 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7357 | {0x21, 0x02211030}), |
| 7358 | 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] | 7359 | {0x14, 0x90170110}, |
| 7360 | {0x1b, 0x02011020}, |
| 7361 | {0x21, 0x0221101f}), |
| 7362 | 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] | 7363 | {0x14, 0x90170110}, |
| 7364 | {0x1b, 0x01011020}, |
| 7365 | {0x21, 0x0221101f}), |
| 7366 | 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] | 7367 | {0x14, 0x90170130}, |
David Henningsson | cba5997 | 2015-07-22 10:00:25 +0200 | [diff] [blame] | 7368 | {0x1b, 0x01014020}, |
David Henningsson | cba5997 | 2015-07-22 10:00:25 +0200 | [diff] [blame] | 7369 | {0x21, 0x0221103f}), |
| 7370 | 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] | 7371 | {0x14, 0x90170130}, |
Hui Wang | 6aecd87 | 2016-10-20 14:03:33 +0800 | [diff] [blame] | 7372 | {0x1b, 0x01011020}, |
| 7373 | {0x21, 0x0221103f}), |
| 7374 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7375 | {0x14, 0x90170130}, |
Hui Wang | 59ec4b5 | 2016-08-04 15:28:04 +0800 | [diff] [blame] | 7376 | {0x1b, 0x02011020}, |
| 7377 | {0x21, 0x0221103f}), |
| 7378 | 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] | 7379 | {0x14, 0x90170150}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 7380 | {0x1b, 0x02011020}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 7381 | {0x21, 0x0221105f}), |
| 7382 | 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] | 7383 | {0x14, 0x90170110}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 7384 | {0x1b, 0x01014020}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 7385 | {0x21, 0x0221101f}), |
| 7386 | 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] | 7387 | {0x12, 0x90a60160}, |
| 7388 | {0x14, 0x90170120}, |
| 7389 | {0x17, 0x90170140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7390 | {0x21, 0x0321102f}), |
| 7391 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7392 | {0x12, 0x90a60160}, |
| 7393 | {0x14, 0x90170130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7394 | {0x21, 0x02211040}), |
| 7395 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7396 | {0x12, 0x90a60160}, |
| 7397 | {0x14, 0x90170140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7398 | {0x21, 0x02211050}), |
| 7399 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7400 | {0x12, 0x90a60170}, |
| 7401 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7402 | {0x21, 0x02211030}), |
| 7403 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7404 | {0x12, 0x90a60170}, |
| 7405 | {0x14, 0x90170130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7406 | {0x21, 0x02211040}), |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 7407 | 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] | 7408 | {0x12, 0x90a60170}, |
Hui Wang | 0a1f90a | 2016-01-13 11:51:38 +0800 | [diff] [blame] | 7409 | {0x14, 0x90171130}, |
| 7410 | {0x21, 0x02211040}), |
| 7411 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7412 | {0x12, 0x90a60170}, |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 7413 | {0x14, 0x90170140}, |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 7414 | {0x21, 0x02211050}), |
David Henningsson | 9b5a4e3 | 2015-05-11 14:04:14 +0200 | [diff] [blame] | 7415 | 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] | 7416 | {0x12, 0x90a60180}, |
| 7417 | {0x14, 0x90170130}, |
David Henningsson | 9b5a4e3 | 2015-05-11 14:04:14 +0200 | [diff] [blame] | 7418 | {0x21, 0x02211040}), |
AceLan Kao | f90d83b | 2016-06-03 14:45:25 +0800 | [diff] [blame] | 7419 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7420 | {0x12, 0x90a60180}, |
| 7421 | {0x14, 0x90170120}, |
| 7422 | {0x21, 0x02211030}), |
Hui Wang | 989dbe4 | 2016-11-23 16:05:38 +0800 | [diff] [blame] | 7423 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7424 | {0x1b, 0x01011020}, |
| 7425 | {0x21, 0x02211010}), |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 7426 | 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] | 7427 | {0x12, 0x90a60130}, |
| 7428 | {0x14, 0x90170110}, |
| 7429 | {0x1b, 0x01011020}, |
| 7430 | {0x21, 0x0221101f}), |
| 7431 | 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] | 7432 | {0x12, 0x90a60160}, |
| 7433 | {0x14, 0x90170120}, |
Kailang Yang | 81a1231 | 2015-05-28 16:48:22 +0800 | [diff] [blame] | 7434 | {0x21, 0x02211030}), |
| 7435 | 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] | 7436 | {0x12, 0x90a60170}, |
| 7437 | {0x14, 0x90170120}, |
| 7438 | {0x21, 0x02211030}), |
Shrirang Bagul | 311042d | 2016-08-29 15:19:27 +0800 | [diff] [blame] | 7439 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7440 | {0x12, 0x90a60180}, |
| 7441 | {0x14, 0x90170120}, |
| 7442 | {0x21, 0x02211030}), |
Woodrow Shen | f83c329 | 2016-06-24 15:58:34 +0800 | [diff] [blame] | 7443 | 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] | 7444 | {0x12, 0xb7a60130}, |
| 7445 | {0x14, 0x90170110}, |
| 7446 | {0x21, 0x02211020}), |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 7447 | 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] | 7448 | {0x12, 0x90a60130}, |
| 7449 | {0x14, 0x90170110}, |
| 7450 | {0x14, 0x01011020}, |
| 7451 | {0x21, 0x0221101f}), |
| 7452 | 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] | 7453 | ALC256_STANDARD_PINS), |
Hui Wang | b26e36b | 2019-04-17 16:10:32 +0800 | [diff] [blame] | 7454 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7455 | {0x14, 0x90170110}, |
| 7456 | {0x1b, 0x01011020}, |
| 7457 | {0x21, 0x0221101f}), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 7458 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
| 7459 | {0x14, 0x90170110}, |
| 7460 | {0x1b, 0x90a70130}, |
| 7461 | {0x21, 0x04211020}), |
| 7462 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
| 7463 | {0x14, 0x90170110}, |
| 7464 | {0x1b, 0x90a70130}, |
| 7465 | {0x21, 0x03211020}), |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 7466 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
Chris Chiu | a806ef1 | 2019-03-22 11:37:20 +0800 | [diff] [blame] | 7467 | {0x12, 0x90a60130}, |
| 7468 | {0x14, 0x90170110}, |
| 7469 | {0x21, 0x03211020}), |
| 7470 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
Jian-Hong Pan | 6ac371a | 2019-03-22 11:37:22 +0800 | [diff] [blame] | 7471 | {0x12, 0x90a60130}, |
| 7472 | {0x14, 0x90170110}, |
| 7473 | {0x21, 0x04211020}), |
| 7474 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
Jian-Hong Pan | e103735 | 2019-03-22 11:37:18 +0800 | [diff] [blame] | 7475 | {0x1a, 0x90a70130}, |
| 7476 | {0x1b, 0x90170110}, |
| 7477 | {0x21, 0x03211020}), |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 7478 | 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] | 7479 | {0x12, 0xb7a60130}, |
| 7480 | {0x13, 0xb8a61140}, |
| 7481 | {0x16, 0x90170110}, |
| 7482 | {0x21, 0x04211020}), |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 7483 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, |
| 7484 | {0x12, 0x90a60130}, |
| 7485 | {0x14, 0x90170110}, |
| 7486 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7487 | {0x1a, 0x04a11020}), |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 7488 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 7489 | {0x12, 0x90a60140}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 7490 | {0x14, 0x90170110}, |
| 7491 | {0x15, 0x0421101f}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 7492 | {0x18, 0x02811030}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 7493 | {0x1a, 0x04a1103f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7494 | {0x1b, 0x02011020}), |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 7495 | 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] | 7496 | ALC282_STANDARD_PINS, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 7497 | {0x12, 0x99a30130}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 7498 | {0x19, 0x03a11020}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 7499 | {0x21, 0x0321101f}), |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7500 | 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] | 7501 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7502 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7503 | {0x19, 0x03a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7504 | {0x21, 0x03211040}), |
| 7505 | 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] | 7506 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7507 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7508 | {0x19, 0x03a11030}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7509 | {0x21, 0x03211020}), |
| 7510 | 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] | 7511 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7512 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7513 | {0x19, 0x04a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7514 | {0x21, 0x0421101f}), |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 7515 | 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] | 7516 | ALC282_STANDARD_PINS, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 7517 | {0x12, 0x90a60140}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 7518 | {0x19, 0x04a11030}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 7519 | {0x21, 0x04211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7520 | 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] | 7521 | ALC282_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7522 | {0x12, 0x90a60130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7523 | {0x21, 0x0321101f}), |
| 7524 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7525 | {0x12, 0x90a60160}, |
| 7526 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7527 | {0x21, 0x02211030}), |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 7528 | 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] | 7529 | ALC282_STANDARD_PINS, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 7530 | {0x12, 0x90a60130}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 7531 | {0x19, 0x03a11020}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 7532 | {0x21, 0x0321101f}), |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 7533 | SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 7534 | {0x12, 0x90a60130}, |
| 7535 | {0x14, 0x90170110}, |
| 7536 | {0x19, 0x04a11040}, |
| 7537 | {0x21, 0x04211020}), |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 7538 | SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
| 7539 | {0x12, 0x90a60130}, |
| 7540 | {0x17, 0x90170110}, |
| 7541 | {0x21, 0x02211020}), |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 7542 | SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 7543 | {0x12, 0x90a60120}, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 7544 | {0x14, 0x90170110}, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 7545 | {0x21, 0x0321101f}), |
Hui Wang | d507819 | 2018-03-02 13:05:36 +0800 | [diff] [blame] | 7546 | 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] | 7547 | {0x12, 0xb7a60130}, |
| 7548 | {0x14, 0x90170110}, |
| 7549 | {0x21, 0x04211020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7550 | 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] | 7551 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7552 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7553 | {0x18, 0x90170112}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7554 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7555 | 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] | 7556 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7557 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7558 | {0x18, 0x90170110}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7559 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7560 | 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] | 7561 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7562 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7563 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7564 | 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] | 7565 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7566 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7567 | {0x1a, 0x04a11040}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7568 | 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] | 7569 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7570 | {0x14, 0x90170110}, |
| 7571 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7572 | {0x1a, 0x04a11040}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7573 | 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] | 7574 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7575 | {0x14, 0x90170110}, |
| 7576 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7577 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7578 | 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] | 7579 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7580 | {0x14, 0x90170110}, |
| 7581 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7582 | {0x1a, 0x04a11020}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7583 | 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] | 7584 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7585 | {0x12, 0x90a60140}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7586 | {0x16, 0x01014020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7587 | {0x19, 0x01a19030}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7588 | 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] | 7589 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7590 | {0x12, 0x90a60140}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7591 | {0x16, 0x01014020}, |
| 7592 | {0x18, 0x02a19031}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7593 | {0x19, 0x01a1903e}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7594 | 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] | 7595 | ALC292_STANDARD_PINS, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7596 | {0x12, 0x90a60140}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7597 | 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] | 7598 | ALC292_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7599 | {0x13, 0x90a60140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7600 | {0x16, 0x21014020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7601 | {0x19, 0x21a19030}), |
David Henningsson | e03fdbd | 2014-06-27 08:41:59 +0200 | [diff] [blame] | 7602 | 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] | 7603 | ALC292_STANDARD_PINS, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7604 | {0x13, 0x90a60140}), |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 7605 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC, |
| 7606 | {0x14, 0x90170110}, |
| 7607 | {0x1b, 0x90a70130}, |
| 7608 | {0x21, 0x04211020}), |
Jian-Hong Pan | 0bea4cc | 2018-12-07 17:17:13 +0800 | [diff] [blame] | 7609 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 7610 | {0x12, 0x90a60130}, |
| 7611 | {0x17, 0x90170110}, |
Jian-Hong Pan | 8bb37a2 | 2019-02-21 17:00:18 +0800 | [diff] [blame] | 7612 | {0x21, 0x03211020}), |
| 7613 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 7614 | {0x12, 0x90a60130}, |
| 7615 | {0x17, 0x90170110}, |
Jian-Hong Pan | 0bea4cc | 2018-12-07 17:17:13 +0800 | [diff] [blame] | 7616 | {0x21, 0x04211020}), |
Takashi Iwai | 3887c26 | 2019-04-30 15:10:01 +0200 | [diff] [blame] | 7617 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 7618 | {0x12, 0x90a60130}, |
| 7619 | {0x17, 0x90170110}, |
| 7620 | {0x21, 0x03211020}), |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 7621 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
Kailang Yang | 0a29c57 | 2019-04-24 16:34:25 +0800 | [diff] [blame] | 7622 | {0x14, 0x90170110}, |
| 7623 | {0x21, 0x04211020}), |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 7624 | 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] | 7625 | ALC295_STANDARD_PINS, |
| 7626 | {0x17, 0x21014020}, |
| 7627 | {0x18, 0x21a19030}), |
| 7628 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7629 | ALC295_STANDARD_PINS, |
| 7630 | {0x17, 0x21014040}, |
| 7631 | {0x18, 0x21a19050}), |
Hui Wang | 3f30783 | 2017-03-23 10:00:25 +0800 | [diff] [blame] | 7632 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7633 | ALC295_STANDARD_PINS), |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 7634 | 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] | 7635 | ALC298_STANDARD_PINS, |
Takashi Iwai | 9f502ff | 2015-08-05 12:09:45 +0200 | [diff] [blame] | 7636 | {0x17, 0x90170110}), |
| 7637 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7638 | ALC298_STANDARD_PINS, |
Woodrow Shen | 703867e | 2015-08-05 12:34:12 +0800 | [diff] [blame] | 7639 | {0x17, 0x90170140}), |
| 7640 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7641 | ALC298_STANDARD_PINS, |
Takashi Iwai | 9f502ff | 2015-08-05 12:09:45 +0200 | [diff] [blame] | 7642 | {0x17, 0x90170150}), |
Kai-Heng Feng | 9f1bc2c4 | 2017-02-16 15:26:54 +0800 | [diff] [blame] | 7643 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME, |
| 7644 | {0x12, 0xb7a60140}, |
| 7645 | {0x13, 0xb7a60150}, |
| 7646 | {0x17, 0x90170110}, |
| 7647 | {0x1a, 0x03011020}, |
| 7648 | {0x21, 0x03211030}), |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 7649 | SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
| 7650 | ALC225_STANDARD_PINS, |
| 7651 | {0x12, 0xb7a60130}, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 7652 | {0x17, 0x90170110}), |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 7653 | {} |
| 7654 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7655 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 7656 | static void alc269_fill_coef(struct hda_codec *codec) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7657 | { |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 7658 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7659 | int val; |
| 7660 | |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 7661 | if (spec->codec_variant != ALC269_TYPE_ALC269VB) |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 7662 | return; |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 7663 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7664 | if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7665 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 7666 | alc_write_coef_idx(codec, 0xe, 0x8817); |
| 7667 | } |
| 7668 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7669 | if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7670 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 7671 | alc_write_coef_idx(codec, 0xe, 0x8814); |
| 7672 | } |
| 7673 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7674 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7675 | /* Power up output pin */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 7676 | alc_update_coef_idx(codec, 0x04, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7677 | } |
| 7678 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7679 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7680 | val = alc_read_coef_idx(codec, 0xd); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 7681 | if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7682 | /* Capless ramp up clock control */ |
| 7683 | alc_write_coef_idx(codec, 0xd, val | (1<<10)); |
| 7684 | } |
| 7685 | val = alc_read_coef_idx(codec, 0x17); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 7686 | if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7687 | /* Class D power on reset */ |
| 7688 | alc_write_coef_idx(codec, 0x17, val | (1<<7)); |
| 7689 | } |
| 7690 | } |
| 7691 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 7692 | /* HP */ |
| 7693 | alc_update_coef_idx(codec, 0x4, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7694 | } |
| 7695 | |
| 7696 | /* |
| 7697 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7698 | static int patch_alc269(struct hda_codec *codec) |
| 7699 | { |
| 7700 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7701 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7702 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7703 | err = alc_alloc_spec(codec, 0x0b); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7704 | if (err < 0) |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7705 | return err; |
| 7706 | |
| 7707 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 7708 | spec->gen.shared_mic_vref_pin = 0x18; |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 7709 | codec->power_save_node = 1; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7710 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 7711 | #ifdef CONFIG_PM |
| 7712 | codec->patch_ops.suspend = alc269_suspend; |
| 7713 | codec->patch_ops.resume = alc269_resume; |
| 7714 | #endif |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 7715 | spec->shutup = alc_default_shutup; |
| 7716 | spec->init_hook = alc_default_init; |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 7717 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 7718 | switch (codec->core.vendor_id) { |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 7719 | case 0x10ec0269: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7720 | spec->codec_variant = ALC269_TYPE_ALC269VA; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7721 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 7722 | case 0x0010: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 7723 | if (codec->bus->pci && |
| 7724 | codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7725 | spec->cdefine.platform_type == 1) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 7726 | err = alc_codec_rename(codec, "ALC271X"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7727 | spec->codec_variant = ALC269_TYPE_ALC269VB; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7728 | break; |
| 7729 | case 0x0020: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 7730 | if (codec->bus->pci && |
| 7731 | codec->bus->pci->subsystem_vendor == 0x17aa && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7732 | codec->bus->pci->subsystem_device == 0x21f3) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 7733 | err = alc_codec_rename(codec, "ALC3202"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7734 | spec->codec_variant = ALC269_TYPE_ALC269VC; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7735 | break; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 7736 | case 0x0030: |
| 7737 | spec->codec_variant = ALC269_TYPE_ALC269VD; |
| 7738 | break; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7739 | default: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7740 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7741 | } |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7742 | if (err < 0) |
| 7743 | goto error; |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 7744 | spec->shutup = alc269_shutup; |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 7745 | spec->init_hook = alc269_fill_coef; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7746 | alc269_fill_coef(codec); |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 7747 | break; |
| 7748 | |
| 7749 | case 0x10ec0280: |
| 7750 | case 0x10ec0290: |
| 7751 | spec->codec_variant = ALC269_TYPE_ALC280; |
| 7752 | break; |
| 7753 | case 0x10ec0282: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 7754 | spec->codec_variant = ALC269_TYPE_ALC282; |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 7755 | spec->shutup = alc282_shutup; |
| 7756 | spec->init_hook = alc282_init; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 7757 | break; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 7758 | case 0x10ec0233: |
| 7759 | case 0x10ec0283: |
| 7760 | spec->codec_variant = ALC269_TYPE_ALC283; |
| 7761 | spec->shutup = alc283_shutup; |
| 7762 | spec->init_hook = alc283_init; |
| 7763 | break; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 7764 | case 0x10ec0284: |
| 7765 | case 0x10ec0292: |
| 7766 | spec->codec_variant = ALC269_TYPE_ALC284; |
| 7767 | break; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 7768 | case 0x10ec0293: |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 7769 | spec->codec_variant = ALC269_TYPE_ALC293; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 7770 | break; |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 7771 | case 0x10ec0286: |
Kailang Yang | 7c66593 | 2014-04-14 15:09:44 +0800 | [diff] [blame] | 7772 | case 0x10ec0288: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 7773 | spec->codec_variant = ALC269_TYPE_ALC286; |
| 7774 | break; |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 7775 | case 0x10ec0298: |
| 7776 | spec->codec_variant = ALC269_TYPE_ALC298; |
| 7777 | break; |
Kailang Yang | ea04a1d | 2018-04-25 15:31:52 +0800 | [diff] [blame] | 7778 | case 0x10ec0235: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 7779 | case 0x10ec0255: |
| 7780 | spec->codec_variant = ALC269_TYPE_ALC255; |
Kailang Yang | ab3b8e5 | 2018-04-25 16:05:27 +0800 | [diff] [blame] | 7781 | spec->shutup = alc256_shutup; |
| 7782 | spec->init_hook = alc256_init; |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 7783 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 7784 | case 0x10ec0236: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 7785 | case 0x10ec0256: |
| 7786 | spec->codec_variant = ALC269_TYPE_ALC256; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 7787 | spec->shutup = alc256_shutup; |
| 7788 | spec->init_hook = alc256_init; |
David Henningsson | 7d1b6e2 | 2015-04-21 10:48:46 +0200 | [diff] [blame] | 7789 | 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] | 7790 | 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] | 7791 | break; |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 7792 | case 0x10ec0257: |
| 7793 | spec->codec_variant = ALC269_TYPE_ALC257; |
Kailang Yang | 88d42b2 | 2018-03-14 16:08:57 +0800 | [diff] [blame] | 7794 | spec->shutup = alc256_shutup; |
| 7795 | spec->init_hook = alc256_init; |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 7796 | spec->gen.mixer_nid = 0; |
| 7797 | break; |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 7798 | case 0x10ec0215: |
| 7799 | case 0x10ec0285: |
| 7800 | case 0x10ec0289: |
| 7801 | spec->codec_variant = ALC269_TYPE_ALC215; |
Kailang Yang | 1b6832be | 2018-01-17 15:32:03 +0800 | [diff] [blame] | 7802 | spec->shutup = alc225_shutup; |
| 7803 | spec->init_hook = alc225_init; |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 7804 | spec->gen.mixer_nid = 0; |
| 7805 | break; |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 7806 | case 0x10ec0225: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 7807 | case 0x10ec0295: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 7808 | case 0x10ec0299: |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 7809 | spec->codec_variant = ALC269_TYPE_ALC225; |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 7810 | spec->shutup = alc225_shutup; |
| 7811 | spec->init_hook = alc225_init; |
Takashi Iwai | c1350bf | 2017-12-27 09:03:45 +0100 | [diff] [blame] | 7812 | spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */ |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 7813 | break; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 7814 | case 0x10ec0234: |
| 7815 | case 0x10ec0274: |
| 7816 | case 0x10ec0294: |
| 7817 | spec->codec_variant = ALC269_TYPE_ALC294; |
Hui Wang | 532a778 | 2017-06-26 12:30:32 +0800 | [diff] [blame] | 7818 | 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] | 7819 | alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */ |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 7820 | spec->init_hook = alc294_init; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 7821 | break; |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 7822 | case 0x10ec0300: |
| 7823 | spec->codec_variant = ALC269_TYPE_ALC300; |
| 7824 | spec->gen.mixer_nid = 0; /* no loopback on ALC300 */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7825 | break; |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 7826 | case 0x10ec0700: |
| 7827 | case 0x10ec0701: |
| 7828 | case 0x10ec0703: |
| 7829 | spec->codec_variant = ALC269_TYPE_ALC700; |
| 7830 | 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] | 7831 | alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */ |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 7832 | spec->init_hook = alc294_init; |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 7833 | break; |
| 7834 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7835 | } |
| 7836 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 7837 | 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] | 7838 | spec->has_alc5505_dsp = 1; |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 7839 | spec->init_hook = alc5505_dsp_init; |
| 7840 | } |
| 7841 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 7842 | alc_pre_init(codec); |
| 7843 | |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 7844 | snd_hda_pick_fixup(codec, alc269_fixup_models, |
| 7845 | alc269_fixup_tbl, alc269_fixups); |
| 7846 | snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups); |
| 7847 | snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, |
| 7848 | alc269_fixups); |
| 7849 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
| 7850 | |
| 7851 | alc_auto_parse_customize_define(codec); |
| 7852 | |
| 7853 | if (has_cdefine_beep(codec)) |
| 7854 | spec->gen.beep_nid = 0x01; |
| 7855 | |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7856 | /* automatic parse from the BIOS config */ |
| 7857 | err = alc269_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7858 | if (err < 0) |
| 7859 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7860 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 7861 | if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) { |
| 7862 | err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT); |
| 7863 | if (err < 0) |
| 7864 | goto error; |
| 7865 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7866 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7867 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 7868 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7869 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7870 | |
| 7871 | error: |
| 7872 | alc_free(codec); |
| 7873 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7874 | } |
| 7875 | |
| 7876 | /* |
| 7877 | * ALC861 |
| 7878 | */ |
| 7879 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7880 | static int alc861_parse_auto_config(struct hda_codec *codec) |
| 7881 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7882 | static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 7883 | static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; |
| 7884 | return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7885 | } |
| 7886 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7887 | /* Pin config fixes */ |
| 7888 | enum { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7889 | ALC861_FIXUP_FSC_AMILO_PI1505, |
| 7890 | ALC861_FIXUP_AMP_VREF_0F, |
| 7891 | ALC861_FIXUP_NO_JACK_DETECT, |
| 7892 | ALC861_FIXUP_ASUS_A6RP, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 7893 | ALC660_FIXUP_ASUS_W7J, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7894 | }; |
| 7895 | |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7896 | /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ |
| 7897 | static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7898 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7899 | { |
| 7900 | struct alc_spec *spec = codec->spec; |
| 7901 | unsigned int val; |
| 7902 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7903 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7904 | return; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 7905 | val = snd_hda_codec_get_pin_target(codec, 0x0f); |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7906 | if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) |
| 7907 | val |= AC_PINCTL_IN_EN; |
| 7908 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 7909 | snd_hda_set_pin_ctl(codec, 0x0f, val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 7910 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7911 | } |
| 7912 | |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7913 | /* suppress the jack-detection */ |
| 7914 | static void alc_fixup_no_jack_detect(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7915 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7916 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7917 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7918 | codec->no_jack_detect = 1; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 7919 | } |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7920 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7921 | static const struct hda_fixup alc861_fixups[] = { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7922 | [ALC861_FIXUP_FSC_AMILO_PI1505] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7923 | .type = HDA_FIXUP_PINS, |
| 7924 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7925 | { 0x0b, 0x0221101f }, /* HP */ |
| 7926 | { 0x0f, 0x90170310 }, /* speaker */ |
| 7927 | { } |
| 7928 | } |
| 7929 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7930 | [ALC861_FIXUP_AMP_VREF_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7931 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7932 | .v.func = alc861_fixup_asus_amp_vref_0f, |
Takashi Iwai | 3b25eb6 | 2012-01-25 09:55:46 +0100 | [diff] [blame] | 7933 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7934 | [ALC861_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7935 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7936 | .v.func = alc_fixup_no_jack_detect, |
| 7937 | }, |
| 7938 | [ALC861_FIXUP_ASUS_A6RP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7939 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7940 | .v.func = alc861_fixup_asus_amp_vref_0f, |
| 7941 | .chained = true, |
| 7942 | .chain_id = ALC861_FIXUP_NO_JACK_DETECT, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 7943 | }, |
| 7944 | [ALC660_FIXUP_ASUS_W7J] = { |
| 7945 | .type = HDA_FIXUP_VERBS, |
| 7946 | .v.verbs = (const struct hda_verb[]) { |
| 7947 | /* ASUS W7J needs a magic pin setup on unused NID 0x10 |
| 7948 | * for enabling outputs |
| 7949 | */ |
| 7950 | {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, |
| 7951 | { } |
| 7952 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7953 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7954 | }; |
| 7955 | |
| 7956 | static const struct snd_pci_quirk alc861_fixup_tbl[] = { |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 7957 | SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e7ca237 | 2013-12-02 15:27:19 +0100 | [diff] [blame] | 7958 | SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7959 | SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), |
| 7960 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), |
| 7961 | SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), |
| 7962 | SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F), |
| 7963 | SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F), |
| 7964 | 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] | 7965 | {} |
| 7966 | }; |
| 7967 | |
| 7968 | /* |
| 7969 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7970 | static int patch_alc861(struct hda_codec *codec) |
| 7971 | { |
| 7972 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7973 | int err; |
| 7974 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7975 | err = alc_alloc_spec(codec, 0x15); |
| 7976 | if (err < 0) |
| 7977 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7978 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7979 | spec = codec->spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 7980 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7981 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 7982 | #ifdef CONFIG_PM |
| 7983 | spec->power_hook = alc_power_eapd; |
| 7984 | #endif |
| 7985 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 7986 | alc_pre_init(codec); |
| 7987 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7988 | snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); |
| 7989 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7990 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 7991 | /* automatic parse from the BIOS config */ |
| 7992 | err = alc861_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7993 | if (err < 0) |
| 7994 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7995 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 7996 | if (!spec->gen.no_analog) { |
| 7997 | err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); |
| 7998 | if (err < 0) |
| 7999 | goto error; |
| 8000 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8001 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8002 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 8003 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8004 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8005 | |
| 8006 | error: |
| 8007 | alc_free(codec); |
| 8008 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8009 | } |
| 8010 | |
| 8011 | /* |
| 8012 | * ALC861-VD support |
| 8013 | * |
| 8014 | * Based on ALC882 |
| 8015 | * |
| 8016 | * In addition, an independent DAC |
| 8017 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8018 | static int alc861vd_parse_auto_config(struct hda_codec *codec) |
| 8019 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8020 | static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8021 | static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 8022 | return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8023 | } |
| 8024 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8025 | enum { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8026 | ALC660VD_FIX_ASUS_GPIO1, |
| 8027 | ALC861VD_FIX_DALLAS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8028 | }; |
| 8029 | |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8030 | /* exclude VREF80 */ |
| 8031 | static void alc861vd_fixup_dallas(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8032 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8033 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8034 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | b78562b | 2012-12-17 20:06:49 +0100 | [diff] [blame] | 8035 | snd_hda_override_pin_caps(codec, 0x18, 0x00000734); |
| 8036 | snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8037 | } |
| 8038 | } |
| 8039 | |
Takashi Iwai | df73d83 | 2018-06-19 23:05:47 +0200 | [diff] [blame] | 8040 | /* reset GPIO1 */ |
| 8041 | static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec, |
| 8042 | const struct hda_fixup *fix, int action) |
| 8043 | { |
| 8044 | struct alc_spec *spec = codec->spec; |
| 8045 | |
| 8046 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 8047 | spec->gpio_mask |= 0x02; |
| 8048 | alc_fixup_gpio(codec, action, 0x01); |
| 8049 | } |
| 8050 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8051 | static const struct hda_fixup alc861vd_fixups[] = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8052 | [ALC660VD_FIX_ASUS_GPIO1] = { |
Takashi Iwai | df73d83 | 2018-06-19 23:05:47 +0200 | [diff] [blame] | 8053 | .type = HDA_FIXUP_FUNC, |
| 8054 | .v.func = alc660vd_fixup_asus_gpio1, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8055 | }, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8056 | [ALC861VD_FIX_DALLAS] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8057 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8058 | .v.func = alc861vd_fixup_dallas, |
| 8059 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8060 | }; |
| 8061 | |
| 8062 | static const struct snd_pci_quirk alc861vd_fixup_tbl[] = { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8063 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8064 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 8065 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8066 | {} |
| 8067 | }; |
| 8068 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8069 | /* |
| 8070 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8071 | static int patch_alc861vd(struct hda_codec *codec) |
| 8072 | { |
| 8073 | struct alc_spec *spec; |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 8074 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8075 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8076 | err = alc_alloc_spec(codec, 0x0b); |
| 8077 | if (err < 0) |
| 8078 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8079 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8080 | spec = codec->spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 8081 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8082 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 8083 | spec->shutup = alc_eapd_shutup; |
| 8084 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 8085 | alc_pre_init(codec); |
| 8086 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8087 | snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); |
| 8088 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8089 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 8090 | /* automatic parse from the BIOS config */ |
| 8091 | err = alc861vd_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8092 | if (err < 0) |
| 8093 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8094 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 8095 | if (!spec->gen.no_analog) { |
| 8096 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 8097 | if (err < 0) |
| 8098 | goto error; |
| 8099 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8100 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8101 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 8102 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8103 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8104 | |
| 8105 | error: |
| 8106 | alc_free(codec); |
| 8107 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8108 | } |
| 8109 | |
| 8110 | /* |
| 8111 | * ALC662 support |
| 8112 | * |
| 8113 | * ALC662 is almost identical with ALC880 but has cleaner and more flexible |
| 8114 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 8115 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 8116 | * 6-channel independent captures. |
| 8117 | * |
| 8118 | * In addition, an independent DAC for the multi-playback (not used in this |
| 8119 | * driver yet). |
| 8120 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8121 | |
| 8122 | /* |
| 8123 | * BIOS auto configuration |
| 8124 | */ |
| 8125 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8126 | static int alc662_parse_auto_config(struct hda_codec *codec) |
| 8127 | { |
Takashi Iwai | 4c6d72d | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 8128 | static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8129 | static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; |
| 8130 | static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 8131 | const hda_nid_t *ssids; |
Takashi Iwai | ee979a14 | 2008-09-02 15:42:20 +0200 | [diff] [blame] | 8132 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 8133 | if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || |
| 8134 | codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || |
| 8135 | codec->core.vendor_id == 0x10ec0671) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8136 | ssids = alc663_ssids; |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 8137 | else |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8138 | ssids = alc662_ssids; |
| 8139 | return alc_parse_auto_config(codec, alc662_ignore, ssids); |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8140 | } |
| 8141 | |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8142 | static void alc272_fixup_mario(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8143 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 8144 | { |
Takashi Iwai | 9bb1f06 | 2013-01-10 17:14:29 +0100 | [diff] [blame] | 8145 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 8146 | return; |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8147 | if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, |
| 8148 | (0x3b << AC_AMPCAP_OFFSET_SHIFT) | |
| 8149 | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 8150 | (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 8151 | (0 << AC_AMPCAP_MUTE_SHIFT))) |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 8152 | codec_warn(codec, "failed to override amp caps for NID 0x2\n"); |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8153 | } |
| 8154 | |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 8155 | static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { |
| 8156 | { .channels = 2, |
| 8157 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, |
| 8158 | { .channels = 4, |
| 8159 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, |
| 8160 | SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ |
| 8161 | { } |
| 8162 | }; |
| 8163 | |
| 8164 | /* override the 2.1 chmap */ |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 8165 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 8166 | const struct hda_fixup *fix, int action) |
| 8167 | { |
| 8168 | if (action == HDA_FIXUP_ACT_BUILD) { |
| 8169 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | bbbc7e8 | 2015-02-27 17:43:19 +0100 | [diff] [blame] | 8170 | 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] | 8171 | } |
| 8172 | } |
| 8173 | |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 8174 | /* avoid D3 for keeping GPIO up */ |
| 8175 | static unsigned int gpio_led_power_filter(struct hda_codec *codec, |
| 8176 | hda_nid_t nid, |
| 8177 | unsigned int power_state) |
| 8178 | { |
| 8179 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 8180 | if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data) |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 8181 | return AC_PWRST_D0; |
| 8182 | return power_state; |
| 8183 | } |
| 8184 | |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8185 | static void alc662_fixup_led_gpio1(struct hda_codec *codec, |
| 8186 | const struct hda_fixup *fix, int action) |
| 8187 | { |
| 8188 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8189 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 8190 | alc_fixup_hp_gpio_led(codec, action, 0x01, 0); |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8191 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 8192 | spec->mute_led_polarity = 1; |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 8193 | codec->power_filter = gpio_led_power_filter; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8194 | } |
| 8195 | } |
| 8196 | |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 8197 | static void alc662_usi_automute_hook(struct hda_codec *codec, |
| 8198 | struct hda_jack_callback *jack) |
| 8199 | { |
| 8200 | struct alc_spec *spec = codec->spec; |
| 8201 | int vref; |
| 8202 | msleep(200); |
| 8203 | snd_hda_gen_hp_automute(codec, jack); |
| 8204 | |
| 8205 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 8206 | msleep(100); |
| 8207 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 8208 | vref); |
| 8209 | } |
| 8210 | |
| 8211 | static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, |
| 8212 | const struct hda_fixup *fix, int action) |
| 8213 | { |
| 8214 | struct alc_spec *spec = codec->spec; |
| 8215 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 8216 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 8217 | spec->gen.hp_automute_hook = alc662_usi_automute_hook; |
| 8218 | } |
| 8219 | } |
| 8220 | |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 8221 | static struct coef_fw alc668_coefs[] = { |
| 8222 | WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), |
| 8223 | WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), |
| 8224 | WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), |
| 8225 | WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), |
| 8226 | WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), |
| 8227 | WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), |
| 8228 | WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), |
| 8229 | WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), |
| 8230 | WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), |
| 8231 | WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), |
| 8232 | WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), |
| 8233 | WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), |
| 8234 | WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), |
| 8235 | WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), |
| 8236 | WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), |
| 8237 | WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), |
| 8238 | WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), |
| 8239 | WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), |
| 8240 | WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), |
| 8241 | WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), |
| 8242 | {} |
| 8243 | }; |
| 8244 | |
| 8245 | static void alc668_restore_default_value(struct hda_codec *codec) |
| 8246 | { |
| 8247 | alc_process_coef_fw(codec, alc668_coefs); |
| 8248 | } |
| 8249 | |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8250 | enum { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 8251 | ALC662_FIXUP_ASPIRE, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8252 | ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8253 | ALC662_FIXUP_IDEAPAD, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8254 | ALC272_FIXUP_MARIO, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 8255 | ALC662_FIXUP_CZC_P10T, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 8256 | ALC662_FIXUP_SKU_IGNORE, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 8257 | ALC662_FIXUP_HP_RP5800, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8258 | ALC662_FIXUP_ASUS_MODE1, |
| 8259 | ALC662_FIXUP_ASUS_MODE2, |
| 8260 | ALC662_FIXUP_ASUS_MODE3, |
| 8261 | ALC662_FIXUP_ASUS_MODE4, |
| 8262 | ALC662_FIXUP_ASUS_MODE5, |
| 8263 | ALC662_FIXUP_ASUS_MODE6, |
| 8264 | ALC662_FIXUP_ASUS_MODE7, |
| 8265 | ALC662_FIXUP_ASUS_MODE8, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 8266 | ALC662_FIXUP_NO_JACK_DETECT, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 8267 | ALC662_FIXUP_ZOTAC_Z68, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 8268 | ALC662_FIXUP_INV_DMIC, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8269 | ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 8270 | ALC668_FIXUP_DELL_MIC_NO_PRESENCE, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8271 | ALC662_FIXUP_HEADSET_MODE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 8272 | ALC668_FIXUP_HEADSET_MODE, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8273 | ALC662_FIXUP_BASS_MODE4_CHMAP, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 8274 | ALC662_FIXUP_BASS_16, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 8275 | ALC662_FIXUP_BASS_1A, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8276 | ALC662_FIXUP_BASS_CHMAP, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 8277 | ALC668_FIXUP_AUTO_MUTE, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 8278 | ALC668_FIXUP_DELL_DISABLE_AAMIX, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 8279 | ALC668_FIXUP_DELL_XPS13, |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 8280 | ALC662_FIXUP_ASUS_Nx50, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 8281 | ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 8282 | ALC668_FIXUP_ASUS_Nx51, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 8283 | ALC668_FIXUP_MIC_COEF, |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 8284 | ALC668_FIXUP_ASUS_G751, |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 8285 | ALC891_FIXUP_HEADSET_MODE, |
| 8286 | ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 8287 | ALC662_FIXUP_ACER_VERITON, |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 8288 | ALC892_FIXUP_ASROCK_MOBO, |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 8289 | ALC662_FIXUP_USI_FUNC, |
| 8290 | ALC662_FIXUP_USI_HEADSET_MODE, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 8291 | ALC662_FIXUP_LENOVO_MULTI_CODECS, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8292 | }; |
| 8293 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8294 | static const struct hda_fixup alc662_fixups[] = { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 8295 | [ALC662_FIXUP_ASPIRE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8296 | .type = HDA_FIXUP_PINS, |
| 8297 | .v.pins = (const struct hda_pintbl[]) { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 8298 | { 0x15, 0x99130112 }, /* subwoofer */ |
| 8299 | { } |
| 8300 | } |
| 8301 | }, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8302 | [ALC662_FIXUP_LED_GPIO1] = { |
| 8303 | .type = HDA_FIXUP_FUNC, |
| 8304 | .v.func = alc662_fixup_led_gpio1, |
| 8305 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8306 | [ALC662_FIXUP_IDEAPAD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8307 | .type = HDA_FIXUP_PINS, |
| 8308 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8309 | { 0x17, 0x99130112 }, /* subwoofer */ |
| 8310 | { } |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8311 | }, |
| 8312 | .chained = true, |
| 8313 | .chain_id = ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8314 | }, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8315 | [ALC272_FIXUP_MARIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8316 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | b5bfbc6 | 2011-01-13 14:22:32 +0100 | [diff] [blame] | 8317 | .v.func = alc272_fixup_mario, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 8318 | }, |
| 8319 | [ALC662_FIXUP_CZC_P10T] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8320 | .type = HDA_FIXUP_VERBS, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 8321 | .v.verbs = (const struct hda_verb[]) { |
| 8322 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 8323 | {} |
| 8324 | } |
| 8325 | }, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 8326 | [ALC662_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8327 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 8328 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | c6b3587 | 2011-03-28 12:05:31 +0200 | [diff] [blame] | 8329 | }, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 8330 | [ALC662_FIXUP_HP_RP5800] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8331 | .type = HDA_FIXUP_PINS, |
| 8332 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 8333 | { 0x14, 0x0221201f }, /* HP out */ |
| 8334 | { } |
| 8335 | }, |
| 8336 | .chained = true, |
| 8337 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8338 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8339 | [ALC662_FIXUP_ASUS_MODE1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8340 | .type = HDA_FIXUP_PINS, |
| 8341 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8342 | { 0x14, 0x99130110 }, /* speaker */ |
| 8343 | { 0x18, 0x01a19c20 }, /* mic */ |
| 8344 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 8345 | { 0x21, 0x0121401f }, /* HP out */ |
| 8346 | { } |
| 8347 | }, |
| 8348 | .chained = true, |
| 8349 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8350 | }, |
| 8351 | [ALC662_FIXUP_ASUS_MODE2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8352 | .type = HDA_FIXUP_PINS, |
| 8353 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 8354 | { 0x14, 0x99130110 }, /* speaker */ |
| 8355 | { 0x18, 0x01a19820 }, /* mic */ |
| 8356 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 8357 | { 0x1b, 0x0121401f }, /* HP out */ |
| 8358 | { } |
| 8359 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8360 | .chained = true, |
| 8361 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8362 | }, |
| 8363 | [ALC662_FIXUP_ASUS_MODE3] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8364 | .type = HDA_FIXUP_PINS, |
| 8365 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8366 | { 0x14, 0x99130110 }, /* speaker */ |
| 8367 | { 0x15, 0x0121441f }, /* HP */ |
| 8368 | { 0x18, 0x01a19840 }, /* mic */ |
| 8369 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 8370 | { 0x21, 0x01211420 }, /* HP2 */ |
| 8371 | { } |
| 8372 | }, |
| 8373 | .chained = true, |
| 8374 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8375 | }, |
| 8376 | [ALC662_FIXUP_ASUS_MODE4] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8377 | .type = HDA_FIXUP_PINS, |
| 8378 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8379 | { 0x14, 0x99130110 }, /* speaker */ |
| 8380 | { 0x16, 0x99130111 }, /* speaker */ |
| 8381 | { 0x18, 0x01a19840 }, /* mic */ |
| 8382 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 8383 | { 0x21, 0x0121441f }, /* HP */ |
| 8384 | { } |
| 8385 | }, |
| 8386 | .chained = true, |
| 8387 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8388 | }, |
| 8389 | [ALC662_FIXUP_ASUS_MODE5] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8390 | .type = HDA_FIXUP_PINS, |
| 8391 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8392 | { 0x14, 0x99130110 }, /* speaker */ |
| 8393 | { 0x15, 0x0121441f }, /* HP */ |
| 8394 | { 0x16, 0x99130111 }, /* speaker */ |
| 8395 | { 0x18, 0x01a19840 }, /* mic */ |
| 8396 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 8397 | { } |
| 8398 | }, |
| 8399 | .chained = true, |
| 8400 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8401 | }, |
| 8402 | [ALC662_FIXUP_ASUS_MODE6] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8403 | .type = HDA_FIXUP_PINS, |
| 8404 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8405 | { 0x14, 0x99130110 }, /* speaker */ |
| 8406 | { 0x15, 0x01211420 }, /* HP2 */ |
| 8407 | { 0x18, 0x01a19840 }, /* mic */ |
| 8408 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 8409 | { 0x1b, 0x0121441f }, /* HP */ |
| 8410 | { } |
| 8411 | }, |
| 8412 | .chained = true, |
| 8413 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8414 | }, |
| 8415 | [ALC662_FIXUP_ASUS_MODE7] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8416 | .type = HDA_FIXUP_PINS, |
| 8417 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8418 | { 0x14, 0x99130110 }, /* speaker */ |
| 8419 | { 0x17, 0x99130111 }, /* speaker */ |
| 8420 | { 0x18, 0x01a19840 }, /* mic */ |
| 8421 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 8422 | { 0x1b, 0x01214020 }, /* HP */ |
| 8423 | { 0x21, 0x0121401f }, /* HP */ |
| 8424 | { } |
| 8425 | }, |
| 8426 | .chained = true, |
| 8427 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8428 | }, |
| 8429 | [ALC662_FIXUP_ASUS_MODE8] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8430 | .type = HDA_FIXUP_PINS, |
| 8431 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8432 | { 0x14, 0x99130110 }, /* speaker */ |
| 8433 | { 0x12, 0x99a30970 }, /* int-mic */ |
| 8434 | { 0x15, 0x01214020 }, /* HP */ |
| 8435 | { 0x17, 0x99130111 }, /* speaker */ |
| 8436 | { 0x18, 0x01a19840 }, /* mic */ |
| 8437 | { 0x21, 0x0121401f }, /* HP */ |
| 8438 | { } |
| 8439 | }, |
| 8440 | .chained = true, |
| 8441 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 8442 | }, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 8443 | [ALC662_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8444 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 8445 | .v.func = alc_fixup_no_jack_detect, |
| 8446 | }, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 8447 | [ALC662_FIXUP_ZOTAC_Z68] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8448 | .type = HDA_FIXUP_PINS, |
| 8449 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 8450 | { 0x1b, 0x02214020 }, /* Front HP */ |
| 8451 | { } |
| 8452 | } |
| 8453 | }, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 8454 | [ALC662_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8455 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 8456 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 8457 | }, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 8458 | [ALC668_FIXUP_DELL_XPS13] = { |
| 8459 | .type = HDA_FIXUP_FUNC, |
| 8460 | .v.func = alc_fixup_dell_xps13, |
| 8461 | .chained = true, |
| 8462 | .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX |
| 8463 | }, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 8464 | [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { |
| 8465 | .type = HDA_FIXUP_FUNC, |
| 8466 | .v.func = alc_fixup_disable_aamix, |
| 8467 | .chained = true, |
| 8468 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 8469 | }, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 8470 | [ALC668_FIXUP_AUTO_MUTE] = { |
| 8471 | .type = HDA_FIXUP_FUNC, |
| 8472 | .v.func = alc_fixup_auto_mute_via_amp, |
| 8473 | .chained = true, |
| 8474 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 8475 | }, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8476 | [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 8477 | .type = HDA_FIXUP_PINS, |
| 8478 | .v.pins = (const struct hda_pintbl[]) { |
| 8479 | { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 8480 | /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */ |
| 8481 | { } |
| 8482 | }, |
| 8483 | .chained = true, |
| 8484 | .chain_id = ALC662_FIXUP_HEADSET_MODE |
| 8485 | }, |
| 8486 | [ALC662_FIXUP_HEADSET_MODE] = { |
| 8487 | .type = HDA_FIXUP_FUNC, |
| 8488 | .v.func = alc_fixup_headset_mode_alc662, |
| 8489 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 8490 | [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 8491 | .type = HDA_FIXUP_PINS, |
| 8492 | .v.pins = (const struct hda_pintbl[]) { |
| 8493 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 8494 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 8495 | { } |
| 8496 | }, |
| 8497 | .chained = true, |
| 8498 | .chain_id = ALC668_FIXUP_HEADSET_MODE |
| 8499 | }, |
| 8500 | [ALC668_FIXUP_HEADSET_MODE] = { |
| 8501 | .type = HDA_FIXUP_FUNC, |
| 8502 | .v.func = alc_fixup_headset_mode_alc668, |
| 8503 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8504 | [ALC662_FIXUP_BASS_MODE4_CHMAP] = { |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 8505 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 8506 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 8507 | .chained = true, |
| 8508 | .chain_id = ALC662_FIXUP_ASUS_MODE4 |
| 8509 | }, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 8510 | [ALC662_FIXUP_BASS_16] = { |
| 8511 | .type = HDA_FIXUP_PINS, |
| 8512 | .v.pins = (const struct hda_pintbl[]) { |
| 8513 | {0x16, 0x80106111}, /* bass speaker */ |
| 8514 | {} |
| 8515 | }, |
| 8516 | .chained = true, |
| 8517 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
| 8518 | }, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 8519 | [ALC662_FIXUP_BASS_1A] = { |
| 8520 | .type = HDA_FIXUP_PINS, |
| 8521 | .v.pins = (const struct hda_pintbl[]) { |
| 8522 | {0x1a, 0x80106111}, /* bass speaker */ |
| 8523 | {} |
| 8524 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8525 | .chained = true, |
| 8526 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 8527 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8528 | [ALC662_FIXUP_BASS_CHMAP] = { |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 8529 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 8530 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 8531 | }, |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 8532 | [ALC662_FIXUP_ASUS_Nx50] = { |
| 8533 | .type = HDA_FIXUP_FUNC, |
| 8534 | .v.func = alc_fixup_auto_mute_via_amp, |
| 8535 | .chained = true, |
| 8536 | .chain_id = ALC662_FIXUP_BASS_1A |
| 8537 | }, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 8538 | [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = { |
| 8539 | .type = HDA_FIXUP_FUNC, |
| 8540 | .v.func = alc_fixup_headset_mode_alc668, |
| 8541 | .chain_id = ALC662_FIXUP_BASS_CHMAP |
| 8542 | }, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 8543 | [ALC668_FIXUP_ASUS_Nx51] = { |
| 8544 | .type = HDA_FIXUP_PINS, |
| 8545 | .v.pins = (const struct hda_pintbl[]) { |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 8546 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 8547 | { 0x1a, 0x90170151 }, /* bass speaker */ |
| 8548 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 8549 | {} |
| 8550 | }, |
| 8551 | .chained = true, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 8552 | .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 8553 | }, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 8554 | [ALC668_FIXUP_MIC_COEF] = { |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 8555 | .type = HDA_FIXUP_VERBS, |
| 8556 | .v.verbs = (const struct hda_verb[]) { |
| 8557 | { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 }, |
| 8558 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 }, |
| 8559 | {} |
| 8560 | }, |
| 8561 | }, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 8562 | [ALC668_FIXUP_ASUS_G751] = { |
| 8563 | .type = HDA_FIXUP_PINS, |
| 8564 | .v.pins = (const struct hda_pintbl[]) { |
| 8565 | { 0x16, 0x0421101f }, /* HP */ |
| 8566 | {} |
| 8567 | }, |
| 8568 | .chained = true, |
| 8569 | .chain_id = ALC668_FIXUP_MIC_COEF |
| 8570 | }, |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 8571 | [ALC891_FIXUP_HEADSET_MODE] = { |
| 8572 | .type = HDA_FIXUP_FUNC, |
| 8573 | .v.func = alc_fixup_headset_mode, |
| 8574 | }, |
| 8575 | [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 8576 | .type = HDA_FIXUP_PINS, |
| 8577 | .v.pins = (const struct hda_pintbl[]) { |
| 8578 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 8579 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 8580 | { } |
| 8581 | }, |
| 8582 | .chained = true, |
| 8583 | .chain_id = ALC891_FIXUP_HEADSET_MODE |
| 8584 | }, |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 8585 | [ALC662_FIXUP_ACER_VERITON] = { |
| 8586 | .type = HDA_FIXUP_PINS, |
| 8587 | .v.pins = (const struct hda_pintbl[]) { |
| 8588 | { 0x15, 0x50170120 }, /* no internal speaker */ |
| 8589 | { } |
| 8590 | } |
| 8591 | }, |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 8592 | [ALC892_FIXUP_ASROCK_MOBO] = { |
| 8593 | .type = HDA_FIXUP_PINS, |
| 8594 | .v.pins = (const struct hda_pintbl[]) { |
| 8595 | { 0x15, 0x40f000f0 }, /* disabled */ |
| 8596 | { 0x16, 0x40f000f0 }, /* disabled */ |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 8597 | { } |
| 8598 | } |
| 8599 | }, |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 8600 | [ALC662_FIXUP_USI_FUNC] = { |
| 8601 | .type = HDA_FIXUP_FUNC, |
| 8602 | .v.func = alc662_fixup_usi_headset_mic, |
| 8603 | }, |
| 8604 | [ALC662_FIXUP_USI_HEADSET_MODE] = { |
| 8605 | .type = HDA_FIXUP_PINS, |
| 8606 | .v.pins = (const struct hda_pintbl[]) { |
| 8607 | { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */ |
| 8608 | { 0x18, 0x01a1903d }, |
| 8609 | { } |
| 8610 | }, |
| 8611 | .chained = true, |
| 8612 | .chain_id = ALC662_FIXUP_USI_FUNC |
| 8613 | }, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 8614 | [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { |
| 8615 | .type = HDA_FIXUP_FUNC, |
| 8616 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, |
| 8617 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8618 | }; |
| 8619 | |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 8620 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8621 | SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), |
Takashi Iwai | d3d3835 | 2013-08-19 20:05:50 +0200 | [diff] [blame] | 8622 | SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), |
David Henningsson | 02f6ff9 | 2015-12-07 11:29:31 +0100 | [diff] [blame] | 8623 | SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), |
David Henningsson | a6c47a8 | 2011-02-10 15:39:19 +0100 | [diff] [blame] | 8624 | SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 8625 | SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 8626 | SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), |
Takashi Iwai | 1801928 | 2013-08-16 08:17:05 +0200 | [diff] [blame] | 8627 | SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 8628 | SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 8629 | SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 8630 | SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | c5d019c | 2014-07-22 17:33:32 +0200 | [diff] [blame] | 8631 | SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 8632 | SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), |
Niranjan Sivakumar | 467e143 | 2015-09-05 18:20:35 +0200 | [diff] [blame] | 8633 | SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13), |
David Henningsson | 09d2014 | 2013-11-20 11:43:30 +0100 | [diff] [blame] | 8634 | SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
David Henningsson | ad8ff99 | 2013-11-07 09:28:59 +0100 | [diff] [blame] | 8635 | SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 8dc9abb | 2014-04-16 15:53:12 +0800 | [diff] [blame] | 8636 | SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 8637 | SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 6a98e34 | 2014-10-27 16:20:30 +0800 | [diff] [blame] | 8638 | SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 8639 | SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), |
Kaho Ng | 2da2dc9 | 2016-05-09 00:27:49 +0800 | [diff] [blame] | 8640 | SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), |
Bobi Mihalca | 83a9efb | 2016-03-23 13:32:33 +0200 | [diff] [blame] | 8641 | SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), |
Takashi Iwai | db8948e | 2016-01-18 09:17:30 +0100 | [diff] [blame] | 8642 | SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 8643 | SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 8644 | SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8645 | SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 8646 | SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 8647 | SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51), |
| 8648 | SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51), |
Takashi Iwai | c7efff9 | 2017-01-04 21:38:16 +0100 | [diff] [blame] | 8649 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 8650 | SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8651 | SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 8652 | SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8653 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), |
Daniel T Chen | a0e90ac | 2010-11-20 10:20:35 -0500 | [diff] [blame] | 8654 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 8655 | SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 8656 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), |
Valentine Sinitsyn | d411858 | 2010-10-01 22:24:08 +0600 | [diff] [blame] | 8657 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8658 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 8659 | SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 8660 | SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 8661 | SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 8662 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8663 | |
| 8664 | #if 0 |
| 8665 | /* Below is a quirk table taken from the old code. |
| 8666 | * Basically the device should work as is without the fixup table. |
| 8667 | * If BIOS doesn't give a proper info, enable the corresponding |
| 8668 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 8669 | */ |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8670 | SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), |
| 8671 | SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), |
| 8672 | SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), |
| 8673 | SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), |
| 8674 | SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 8675 | SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8676 | SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 8677 | SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), |
| 8678 | SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), |
| 8679 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8680 | SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), |
| 8681 | SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), |
| 8682 | SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), |
| 8683 | SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), |
| 8684 | SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), |
| 8685 | SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8686 | SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), |
| 8687 | SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), |
| 8688 | SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8689 | SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 8690 | SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 8691 | SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8692 | SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), |
| 8693 | SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), |
| 8694 | SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), |
| 8695 | SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8696 | SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), |
| 8697 | SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 8698 | SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8699 | SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), |
| 8700 | SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8701 | SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8702 | SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), |
| 8703 | SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), |
| 8704 | SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), |
| 8705 | SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), |
| 8706 | SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), |
| 8707 | SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), |
| 8708 | SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), |
| 8709 | SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8710 | SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), |
| 8711 | SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), |
| 8712 | SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 8713 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), |
| 8714 | SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), |
| 8715 | SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), |
| 8716 | SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), |
| 8717 | SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), |
| 8718 | SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 8719 | SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), |
| 8720 | #endif |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8721 | {} |
| 8722 | }; |
| 8723 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8724 | static const struct hda_model_fixup alc662_fixup_models[] = { |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 8725 | {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"}, |
| 8726 | {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"}, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8727 | {.id = ALC272_FIXUP_MARIO, .name = "mario"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 8728 | {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"}, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8729 | {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, |
| 8730 | {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, |
| 8731 | {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, |
| 8732 | {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, |
| 8733 | {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, |
| 8734 | {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, |
| 8735 | {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, |
| 8736 | {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 8737 | {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 8738 | {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 8739 | {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"}, |
David Henningsson | e32aa85 | 2013-06-17 11:04:02 +0200 | [diff] [blame] | 8740 | {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 8741 | {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"}, |
| 8742 | {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"}, |
| 8743 | {.id = ALC662_FIXUP_BASS_16, .name = "bass16"}, |
| 8744 | {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"}, |
| 8745 | {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"}, |
| 8746 | {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"}, |
| 8747 | {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"}, |
| 8748 | {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"}, |
Takashi Iwai | 40c5167 | 2018-10-07 09:47:39 +0200 | [diff] [blame] | 8749 | {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 8750 | {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"}, |
| 8751 | {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"}, |
| 8752 | {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"}, |
| 8753 | {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"}, |
| 8754 | {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 8755 | {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8756 | {} |
| 8757 | }; |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8758 | |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 8759 | static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 8760 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
| 8761 | {0x17, 0x02211010}, |
| 8762 | {0x18, 0x01a19030}, |
| 8763 | {0x1a, 0x01813040}, |
| 8764 | {0x21, 0x01014020}), |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8765 | 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] | 8766 | {0x14, 0x01014010}, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8767 | {0x18, 0x01a19020}, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8768 | {0x1a, 0x0181302f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8769 | {0x1b, 0x0221401f}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8770 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 8771 | {0x12, 0x99a30130}, |
| 8772 | {0x14, 0x90170110}, |
| 8773 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8774 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8775 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 8776 | {0x12, 0x99a30140}, |
| 8777 | {0x14, 0x90170110}, |
| 8778 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8779 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8780 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 8781 | {0x12, 0x99a30150}, |
| 8782 | {0x14, 0x90170110}, |
| 8783 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8784 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8785 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8786 | {0x14, 0x90170110}, |
| 8787 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8788 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8789 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, |
| 8790 | {0x12, 0x90a60130}, |
| 8791 | {0x14, 0x90170110}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8792 | {0x15, 0x0321101f}), |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 8793 | {} |
| 8794 | }; |
| 8795 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8796 | /* |
| 8797 | */ |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8798 | static int patch_alc662(struct hda_codec *codec) |
| 8799 | { |
| 8800 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8801 | int err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8802 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8803 | err = alc_alloc_spec(codec, 0x0b); |
| 8804 | if (err < 0) |
| 8805 | return err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8806 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8807 | spec = codec->spec; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 8808 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 8809 | spec->shutup = alc_eapd_shutup; |
| 8810 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8811 | /* handle multiple HPs as is */ |
| 8812 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 8813 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 8814 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
| 8815 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 8816 | switch (codec->core.vendor_id) { |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 8817 | case 0x10ec0668: |
| 8818 | spec->init_hook = alc668_restore_default_value; |
| 8819 | break; |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 8820 | } |
Kailang Yang | 8663ff7 | 2012-06-29 09:35:52 +0200 | [diff] [blame] | 8821 | |
Takashi Iwai | c9af753 | 2019-05-10 11:01:43 +0200 | [diff] [blame] | 8822 | alc_pre_init(codec); |
| 8823 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8824 | snd_hda_pick_fixup(codec, alc662_fixup_models, |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 8825 | alc662_fixup_tbl, alc662_fixups); |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 8826 | snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8827 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 8828 | |
| 8829 | alc_auto_parse_customize_define(codec); |
| 8830 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 8831 | if (has_cdefine_beep(codec)) |
| 8832 | spec->gen.beep_nid = 0x01; |
| 8833 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8834 | if ((alc_get_coef0(codec) & (1 << 14)) && |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 8835 | codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8836 | spec->cdefine.platform_type == 1) { |
Wei Yongjun | 6134b1a | 2013-04-18 11:12:59 +0800 | [diff] [blame] | 8837 | err = alc_codec_rename(codec, "ALC272X"); |
| 8838 | if (err < 0) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8839 | goto error; |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 8840 | } |
Kailang Yang | 274693f | 2009-12-03 10:07:50 +0100 | [diff] [blame] | 8841 | |
Takashi Iwai | b9c5106 | 2011-08-24 18:08:07 +0200 | [diff] [blame] | 8842 | /* automatic parse from the BIOS config */ |
| 8843 | err = alc662_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8844 | if (err < 0) |
| 8845 | goto error; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8846 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 8847 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 8848 | switch (codec->core.vendor_id) { |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 8849 | case 0x10ec0662: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 8850 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 8851 | break; |
| 8852 | case 0x10ec0272: |
| 8853 | case 0x10ec0663: |
| 8854 | case 0x10ec0665: |
Kailang Yang | 9ad5454 | 2013-11-26 15:41:40 +0800 | [diff] [blame] | 8855 | case 0x10ec0668: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 8856 | err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 8857 | break; |
| 8858 | case 0x10ec0273: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 8859 | err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 8860 | break; |
| 8861 | } |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 8862 | if (err < 0) |
| 8863 | goto error; |
Kailang Yang | cec27c8 | 2010-02-04 14:18:18 +0100 | [diff] [blame] | 8864 | } |
Takashi Iwai | 2134ea4 | 2008-01-10 16:53:55 +0100 | [diff] [blame] | 8865 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8866 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 8867 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8868 | return 0; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8869 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8870 | error: |
| 8871 | alc_free(codec); |
| 8872 | return err; |
Kailang Yang | b478b99 | 2011-05-18 11:51:15 +0200 | [diff] [blame] | 8873 | } |
| 8874 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8875 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8876 | * ALC680 support |
| 8877 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8878 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8879 | static int alc680_parse_auto_config(struct hda_codec *codec) |
| 8880 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8881 | return alc_parse_auto_config(codec, NULL, NULL); |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8882 | } |
| 8883 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8884 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8885 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8886 | static int patch_alc680(struct hda_codec *codec) |
| 8887 | { |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8888 | int err; |
| 8889 | |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 8890 | /* ALC680 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8891 | err = alc_alloc_spec(codec, 0); |
| 8892 | if (err < 0) |
| 8893 | return err; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 8894 | |
Takashi Iwai | 1ebec5f | 2011-08-15 13:21:48 +0200 | [diff] [blame] | 8895 | /* automatic parse from the BIOS config */ |
| 8896 | err = alc680_parse_auto_config(codec); |
| 8897 | if (err < 0) { |
| 8898 | alc_free(codec); |
| 8899 | return err; |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8900 | } |
| 8901 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8902 | return 0; |
| 8903 | } |
| 8904 | |
| 8905 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8906 | * patch entries |
| 8907 | */ |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8908 | static const struct hda_device_id snd_hda_id_realtek[] = { |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 8909 | HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8910 | HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269), |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 8911 | HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8912 | HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269), |
| 8913 | HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 8914 | HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8915 | HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269), |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 8916 | HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8917 | HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269), |
| 8918 | HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269), |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 8919 | HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8920 | HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260), |
| 8921 | HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262), |
| 8922 | HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268), |
| 8923 | HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268), |
| 8924 | HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269), |
| 8925 | HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269), |
| 8926 | HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 8927 | HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8928 | HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269), |
| 8929 | HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269), |
| 8930 | HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269), |
| 8931 | HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269), |
| 8932 | HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269), |
| 8933 | HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269), |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 8934 | HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8935 | HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269), |
| 8936 | HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269), |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 8937 | HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8938 | HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269), |
| 8939 | HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269), |
| 8940 | HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 8941 | HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 8942 | HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8943 | HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 8944 | HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 8945 | HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8946 | HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), |
| 8947 | HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), |
| 8948 | HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), |
| 8949 | HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd), |
| 8950 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882), |
| 8951 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662), |
| 8952 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662), |
| 8953 | HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662), |
| 8954 | HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662), |
| 8955 | HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662), |
| 8956 | HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662), |
| 8957 | HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662), |
| 8958 | HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662), |
| 8959 | HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680), |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 8960 | HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269), |
| 8961 | HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269), |
| 8962 | HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269), |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 8963 | HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8964 | HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880), |
| 8965 | HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882), |
| 8966 | HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882), |
| 8967 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882), |
| 8968 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882), |
| 8969 | HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882), |
| 8970 | HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882), |
| 8971 | HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882), |
| 8972 | HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882), |
| 8973 | HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882), |
| 8974 | HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662), |
| 8975 | HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882), |
| 8976 | HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882), |
Kailang Yang | 65553b1 | 2017-07-11 15:15:47 +0800 | [diff] [blame] | 8977 | HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 8978 | HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8979 | {} /* terminator */ |
| 8980 | }; |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8981 | MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 8982 | |
| 8983 | MODULE_LICENSE("GPL"); |
| 8984 | MODULE_DESCRIPTION("Realtek HD-audio codec"); |
| 8985 | |
Takashi Iwai | d8a766a | 2015-02-17 15:25:37 +0100 | [diff] [blame] | 8986 | static struct hda_codec_driver realtek_driver = { |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8987 | .id = snd_hda_id_realtek, |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 8988 | }; |
| 8989 | |
Takashi Iwai | d8a766a | 2015-02-17 15:25:37 +0100 | [diff] [blame] | 8990 | module_hda_codec_driver(realtek_driver); |