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; |
Takashi Iwai | e64f14f | 2009-01-20 18:32:55 +0100 | [diff] [blame] | 122 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 123 | /* for PLL fix */ |
| 124 | hda_nid_t pll_nid; |
| 125 | unsigned int pll_coef_idx, pll_coef_bit; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 126 | unsigned int coef0; |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 127 | struct input_dev *kb_dev; |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 128 | u8 alc_mute_keycode_map[1]; |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 129 | }; |
| 130 | |
Takashi Iwai | 23f0c04 | 2009-02-26 13:03:58 +0100 | [diff] [blame] | 131 | /* |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 132 | * COEF access helper functions |
| 133 | */ |
| 134 | |
| 135 | static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 136 | unsigned int coef_idx) |
| 137 | { |
| 138 | unsigned int val; |
| 139 | |
| 140 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 141 | val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); |
| 142 | return val; |
| 143 | } |
| 144 | |
| 145 | #define alc_read_coef_idx(codec, coef_idx) \ |
| 146 | alc_read_coefex_idx(codec, 0x20, coef_idx) |
| 147 | |
| 148 | static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 149 | unsigned int coef_idx, unsigned int coef_val) |
| 150 | { |
| 151 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); |
| 152 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); |
| 153 | } |
| 154 | |
| 155 | #define alc_write_coef_idx(codec, coef_idx, coef_val) \ |
| 156 | alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) |
| 157 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 158 | static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
| 159 | unsigned int coef_idx, unsigned int mask, |
| 160 | unsigned int bits_set) |
| 161 | { |
| 162 | unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx); |
| 163 | |
| 164 | if (val != -1) |
| 165 | alc_write_coefex_idx(codec, nid, coef_idx, |
| 166 | (val & ~mask) | bits_set); |
| 167 | } |
| 168 | |
| 169 | #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ |
| 170 | alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) |
| 171 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 172 | /* a special bypass for COEF 0; read the cached value at the second time */ |
| 173 | static unsigned int alc_get_coef0(struct hda_codec *codec) |
| 174 | { |
| 175 | struct alc_spec *spec = codec->spec; |
| 176 | |
| 177 | if (!spec->coef0) |
| 178 | spec->coef0 = alc_read_coef_idx(codec, 0); |
| 179 | return spec->coef0; |
| 180 | } |
| 181 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 182 | /* coef writes/updates batch */ |
| 183 | struct coef_fw { |
| 184 | unsigned char nid; |
| 185 | unsigned char idx; |
| 186 | unsigned short mask; |
| 187 | unsigned short val; |
| 188 | }; |
| 189 | |
| 190 | #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ |
| 191 | { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } |
| 192 | #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) |
| 193 | #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) |
| 194 | #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) |
| 195 | |
| 196 | static void alc_process_coef_fw(struct hda_codec *codec, |
| 197 | const struct coef_fw *fw) |
| 198 | { |
| 199 | for (; fw->nid; fw++) { |
| 200 | if (fw->mask == (unsigned short)-1) |
| 201 | alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); |
| 202 | else |
| 203 | alc_update_coefex_idx(codec, fw->nid, fw->idx, |
| 204 | fw->mask, fw->val); |
| 205 | } |
| 206 | } |
| 207 | |
Takashi Iwai | f2a227c | 2014-08-18 13:35:22 +0200 | [diff] [blame] | 208 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 209 | * GPIO setup tables, used in initialization |
Kailang Yang | df694da | 2005-12-05 19:42:22 +0100 | [diff] [blame] | 210 | */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 211 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 212 | /* Enable GPIO mask and set output */ |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 213 | static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask) |
| 214 | { |
| 215 | struct alc_spec *spec = codec->spec; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 216 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 217 | spec->gpio_mask |= mask; |
| 218 | spec->gpio_dir |= mask; |
| 219 | spec->gpio_data |= mask; |
| 220 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 221 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 222 | static void alc_write_gpio_data(struct hda_codec *codec) |
| 223 | { |
| 224 | struct alc_spec *spec = codec->spec; |
| 225 | |
| 226 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
| 227 | spec->gpio_data); |
| 228 | } |
| 229 | |
Takashi Iwai | aaf312d | 2018-06-19 22:28:22 +0200 | [diff] [blame] | 230 | static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask, |
| 231 | bool on) |
| 232 | { |
| 233 | struct alc_spec *spec = codec->spec; |
| 234 | unsigned int oldval = spec->gpio_data; |
| 235 | |
| 236 | if (on) |
| 237 | spec->gpio_data |= mask; |
| 238 | else |
| 239 | spec->gpio_data &= ~mask; |
| 240 | if (oldval != spec->gpio_data) |
| 241 | alc_write_gpio_data(codec); |
| 242 | } |
| 243 | |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 244 | static void alc_write_gpio(struct hda_codec *codec) |
| 245 | { |
| 246 | struct alc_spec *spec = codec->spec; |
| 247 | |
| 248 | if (!spec->gpio_mask) |
| 249 | return; |
| 250 | |
| 251 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 252 | AC_VERB_SET_GPIO_MASK, spec->gpio_mask); |
| 253 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 254 | AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir); |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 255 | if (spec->gpio_write_delay) |
| 256 | msleep(1); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 257 | alc_write_gpio_data(codec); |
| 258 | } |
| 259 | |
| 260 | static void alc_fixup_gpio(struct hda_codec *codec, int action, |
| 261 | unsigned int mask) |
| 262 | { |
| 263 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 264 | alc_setup_gpio(codec, mask); |
| 265 | } |
| 266 | |
| 267 | static void alc_fixup_gpio1(struct hda_codec *codec, |
| 268 | const struct hda_fixup *fix, int action) |
| 269 | { |
| 270 | alc_fixup_gpio(codec, action, 0x01); |
| 271 | } |
| 272 | |
| 273 | static void alc_fixup_gpio2(struct hda_codec *codec, |
| 274 | const struct hda_fixup *fix, int action) |
| 275 | { |
| 276 | alc_fixup_gpio(codec, action, 0x02); |
| 277 | } |
| 278 | |
| 279 | static void alc_fixup_gpio3(struct hda_codec *codec, |
| 280 | const struct hda_fixup *fix, int action) |
| 281 | { |
| 282 | alc_fixup_gpio(codec, action, 0x03); |
| 283 | } |
Kailang Yang | bdd148a | 2007-05-08 15:19:08 +0200 | [diff] [blame] | 284 | |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 285 | static void alc_fixup_gpio4(struct hda_codec *codec, |
| 286 | const struct hda_fixup *fix, int action) |
| 287 | { |
| 288 | alc_fixup_gpio(codec, action, 0x04); |
| 289 | } |
| 290 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 291 | /* |
| 292 | * Fix hardware PLL issue |
| 293 | * On some codecs, the analog PLL gating control must be off while |
| 294 | * the default value is 1. |
| 295 | */ |
| 296 | static void alc_fix_pll(struct hda_codec *codec) |
| 297 | { |
| 298 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 299 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 300 | if (spec->pll_nid) |
| 301 | alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, |
| 302 | 1 << spec->pll_coef_bit, 0); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 303 | } |
| 304 | |
| 305 | static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, |
| 306 | unsigned int coef_idx, unsigned int coef_bit) |
| 307 | { |
| 308 | struct alc_spec *spec = codec->spec; |
| 309 | spec->pll_nid = nid; |
| 310 | spec->pll_coef_idx = coef_idx; |
| 311 | spec->pll_coef_bit = coef_bit; |
| 312 | alc_fix_pll(codec); |
| 313 | } |
| 314 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 315 | /* update the master volume per volume-knob's unsol event */ |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 316 | static void alc_update_knob_master(struct hda_codec *codec, |
| 317 | struct hda_jack_callback *jack) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 318 | { |
| 319 | unsigned int val; |
| 320 | struct snd_kcontrol *kctl; |
| 321 | struct snd_ctl_elem_value *uctl; |
| 322 | |
| 323 | kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); |
| 324 | if (!kctl) |
| 325 | return; |
| 326 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); |
| 327 | if (!uctl) |
| 328 | return; |
Takashi Iwai | 2ebab40 | 2016-02-09 10:23:52 +0100 | [diff] [blame] | 329 | val = snd_hda_codec_read(codec, jack->nid, 0, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 330 | AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); |
| 331 | val &= HDA_AMP_VOLMASK; |
| 332 | uctl->value.integer.value[0] = val; |
| 333 | uctl->value.integer.value[1] = val; |
| 334 | kctl->put(kctl, uctl); |
| 335 | kfree(uctl); |
| 336 | } |
| 337 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 338 | static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 339 | { |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 340 | /* For some reason, the res given from ALC880 is broken. |
| 341 | Here we adjust it properly. */ |
| 342 | snd_hda_jack_unsol_event(codec, res >> 2); |
Takashi Iwai | f21d78e | 2012-01-19 12:10:29 +0100 | [diff] [blame] | 343 | } |
| 344 | |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 345 | /* Change EAPD to verb control */ |
| 346 | static void alc_fill_eapd_coef(struct hda_codec *codec) |
| 347 | { |
| 348 | int coef; |
| 349 | |
| 350 | coef = alc_get_coef0(codec); |
| 351 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 352 | switch (codec->core.vendor_id) { |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 353 | case 0x10ec0262: |
| 354 | alc_update_coef_idx(codec, 0x7, 0, 1<<5); |
| 355 | break; |
| 356 | case 0x10ec0267: |
| 357 | case 0x10ec0268: |
| 358 | alc_update_coef_idx(codec, 0x7, 0, 1<<13); |
| 359 | break; |
| 360 | case 0x10ec0269: |
| 361 | if ((coef & 0x00f0) == 0x0010) |
| 362 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); |
| 363 | if ((coef & 0x00f0) == 0x0020) |
| 364 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 365 | if ((coef & 0x00f0) == 0x0030) |
| 366 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 367 | break; |
| 368 | case 0x10ec0280: |
| 369 | case 0x10ec0284: |
| 370 | case 0x10ec0290: |
| 371 | case 0x10ec0292: |
| 372 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); |
| 373 | break; |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 374 | case 0x10ec0225: |
Takashi Iwai | 44be77c | 2017-12-27 08:53:59 +0100 | [diff] [blame] | 375 | case 0x10ec0295: |
| 376 | case 0x10ec0299: |
| 377 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); |
| 378 | /* fallthrough */ |
| 379 | case 0x10ec0215: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 380 | case 0x10ec0233: |
Kailang Yang | ea04a1d | 2018-04-25 15:31:52 +0800 | [diff] [blame] | 381 | case 0x10ec0235: |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 382 | case 0x10ec0236: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 383 | case 0x10ec0255: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 384 | case 0x10ec0256: |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 385 | case 0x10ec0257: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 386 | case 0x10ec0282: |
| 387 | case 0x10ec0283: |
| 388 | case 0x10ec0286: |
| 389 | case 0x10ec0288: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 390 | case 0x10ec0285: |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 391 | case 0x10ec0298: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 392 | case 0x10ec0289: |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 393 | case 0x10ec0300: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 394 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
| 395 | break; |
Kailang Yang | 3aabf94 | 2017-11-08 15:28:33 +0800 | [diff] [blame] | 396 | case 0x10ec0275: |
| 397 | alc_update_coef_idx(codec, 0xe, 0, 1<<0); |
| 398 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 399 | case 0x10ec0293: |
| 400 | alc_update_coef_idx(codec, 0xa, 1<<13, 0); |
| 401 | break; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 402 | case 0x10ec0234: |
| 403 | case 0x10ec0274: |
| 404 | case 0x10ec0294: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 405 | case 0x10ec0700: |
| 406 | case 0x10ec0701: |
| 407 | case 0x10ec0703: |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 408 | alc_update_coef_idx(codec, 0x10, 1<<15, 0); |
| 409 | break; |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 410 | case 0x10ec0662: |
| 411 | if ((coef & 0x00f0) == 0x0030) |
| 412 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ |
| 413 | break; |
| 414 | case 0x10ec0272: |
| 415 | case 0x10ec0273: |
| 416 | case 0x10ec0663: |
| 417 | case 0x10ec0665: |
| 418 | case 0x10ec0670: |
| 419 | case 0x10ec0671: |
| 420 | case 0x10ec0672: |
| 421 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ |
| 422 | break; |
| 423 | case 0x10ec0668: |
| 424 | alc_update_coef_idx(codec, 0x7, 3<<13, 0); |
| 425 | break; |
| 426 | case 0x10ec0867: |
| 427 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); |
| 428 | break; |
| 429 | case 0x10ec0888: |
| 430 | if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030) |
| 431 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 432 | break; |
| 433 | case 0x10ec0892: |
| 434 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
| 435 | break; |
| 436 | case 0x10ec0899: |
| 437 | case 0x10ec0900: |
Kailang Yang | 65553b1 | 2017-07-11 15:15:47 +0800 | [diff] [blame] | 438 | case 0x10ec1168: |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 439 | case 0x10ec1220: |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 440 | alc_update_coef_idx(codec, 0x7, 1<<1, 0); |
| 441 | break; |
| 442 | } |
| 443 | } |
| 444 | |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 445 | /* additional initialization for ALC888 variants */ |
| 446 | static void alc888_coef_init(struct hda_codec *codec) |
| 447 | { |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 448 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 449 | /* alc888-VA */ |
| 450 | case 0x00: |
| 451 | /* alc888-VB */ |
| 452 | case 0x10: |
| 453 | alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ |
| 454 | break; |
| 455 | } |
Jaroslav Kysela | 87a8c37 | 2009-07-23 10:58:29 +0200 | [diff] [blame] | 456 | } |
| 457 | |
Takashi Iwai | 3fb4a50 | 2010-01-19 15:46:37 +0100 | [diff] [blame] | 458 | /* turn on/off EAPD control (only if available) */ |
| 459 | static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) |
| 460 | { |
| 461 | if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) |
| 462 | return; |
| 463 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) |
| 464 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, |
| 465 | on ? 2 : 0); |
| 466 | } |
| 467 | |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 468 | /* turn on/off EAPD controls of the codec */ |
| 469 | static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) |
| 470 | { |
| 471 | /* We currently only handle front, HP */ |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 472 | static hda_nid_t pins[] = { |
Hui Wang | af95b41 | 2015-03-26 17:14:55 +0800 | [diff] [blame] | 473 | 0x0f, 0x10, 0x14, 0x15, 0x17, 0 |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 474 | }; |
| 475 | hda_nid_t *p; |
| 476 | for (p = pins; *p; p++) |
| 477 | set_eapd(codec, *p, on); |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 478 | } |
| 479 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 480 | static void alc_shutup_pins(struct hda_codec *codec) |
| 481 | { |
| 482 | struct alc_spec *spec = codec->spec; |
| 483 | |
| 484 | if (!spec->no_shutup_pins) |
| 485 | snd_hda_shutup_pins(codec); |
| 486 | } |
| 487 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 488 | /* generic shutup callback; |
Lars-Peter Clausen | 4ce8e6a | 2016-11-08 15:48:06 +0100 | [diff] [blame] | 489 | * just turning off EAPD and a little pause for avoiding pop-noise |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 490 | */ |
| 491 | static void alc_eapd_shutup(struct hda_codec *codec) |
| 492 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 493 | struct alc_spec *spec = codec->spec; |
| 494 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 495 | alc_auto_setup_eapd(codec, false); |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 496 | if (!spec->no_depop_delay) |
| 497 | msleep(200); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 498 | alc_shutup_pins(codec); |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 499 | } |
| 500 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 501 | /* generic EAPD initialization */ |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 502 | static void alc_auto_init_amp(struct hda_codec *codec, int type) |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 503 | { |
Kailang Yang | 394c97f | 2014-11-12 17:38:08 +0800 | [diff] [blame] | 504 | alc_fill_eapd_coef(codec); |
Takashi Iwai | 39fa84e | 2011-06-27 15:28:57 +0200 | [diff] [blame] | 505 | alc_auto_setup_eapd(codec, true); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 506 | alc_write_gpio(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 507 | switch (type) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 508 | case ALC_INIT_DEFAULT: |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 509 | switch (codec->core.vendor_id) { |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 510 | case 0x10ec0260: |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 511 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 512 | break; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 513 | case 0x10ec0880: |
| 514 | case 0x10ec0882: |
| 515 | case 0x10ec0883: |
| 516 | case 0x10ec0885: |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 517 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 518 | break; |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 519 | case 0x10ec0888: |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 520 | alc888_coef_init(codec); |
Kailang Yang | f9423e7 | 2008-05-27 12:32:25 +0200 | [diff] [blame] | 521 | break; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 522 | } |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 523 | break; |
| 524 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 525 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 526 | |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 527 | /* get a primary headphone pin if available */ |
| 528 | static hda_nid_t alc_get_hp_pin(struct alc_spec *spec) |
| 529 | { |
| 530 | if (spec->gen.autocfg.hp_pins[0]) |
| 531 | return spec->gen.autocfg.hp_pins[0]; |
| 532 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) |
| 533 | return spec->gen.autocfg.line_out_pins[0]; |
| 534 | return 0; |
| 535 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 536 | |
| 537 | /* |
| 538 | * Realtek SSID verification |
| 539 | */ |
| 540 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 541 | /* Could be any non-zero and even value. When used as fixup, tells |
| 542 | * the driver to ignore any present sku defines. |
| 543 | */ |
| 544 | #define ALC_FIXUP_SKU_IGNORE (2) |
| 545 | |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 546 | static void alc_fixup_sku_ignore(struct hda_codec *codec, |
| 547 | const struct hda_fixup *fix, int action) |
| 548 | { |
| 549 | struct alc_spec *spec = codec->spec; |
| 550 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 551 | spec->cdefine.fixup = 1; |
| 552 | spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; |
| 553 | } |
| 554 | } |
| 555 | |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 556 | static void alc_fixup_no_depop_delay(struct hda_codec *codec, |
| 557 | const struct hda_fixup *fix, int action) |
| 558 | { |
| 559 | struct alc_spec *spec = codec->spec; |
| 560 | |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 561 | if (action == HDA_FIXUP_ACT_PROBE) { |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 562 | spec->no_depop_delay = 1; |
Mengdong Lin | 84d2dc3 | 2013-12-02 22:26:03 -0500 | [diff] [blame] | 563 | codec->depop_delay = 0; |
| 564 | } |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 565 | } |
| 566 | |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 567 | static int alc_auto_parse_customize_define(struct hda_codec *codec) |
| 568 | { |
| 569 | unsigned int ass, tmp, i; |
Takashi Iwai | 7fb5622 | 2010-03-22 17:09:47 +0100 | [diff] [blame] | 570 | unsigned nid = 0; |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 571 | struct alc_spec *spec = codec->spec; |
| 572 | |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 573 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ |
| 574 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 575 | if (spec->cdefine.fixup) { |
| 576 | ass = spec->cdefine.sku_cfg; |
| 577 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 578 | return -1; |
| 579 | goto do_sku; |
| 580 | } |
| 581 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 582 | if (!codec->bus->pci) |
| 583 | return -1; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 584 | ass = codec->core.subsystem_id & 0xffff; |
Takashi Iwai | b6cbe51 | 2010-07-28 17:43:36 +0200 | [diff] [blame] | 585 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 586 | goto do_sku; |
| 587 | |
| 588 | nid = 0x1d; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 589 | if (codec->core.vendor_id == 0x10ec0260) |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 590 | nid = 0x17; |
| 591 | ass = snd_hda_codec_get_pincfg(codec, nid); |
| 592 | |
| 593 | if (!(ass & 1)) { |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 594 | codec_info(codec, "%s: SKU not ready 0x%08x\n", |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 595 | codec->core.chip_name, ass); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 596 | return -1; |
| 597 | } |
| 598 | |
| 599 | /* check sum */ |
| 600 | tmp = 0; |
| 601 | for (i = 1; i < 16; i++) { |
| 602 | if ((ass >> i) & 1) |
| 603 | tmp++; |
| 604 | } |
| 605 | if (((ass >> 16) & 0xf) != tmp) |
| 606 | return -1; |
| 607 | |
| 608 | spec->cdefine.port_connectivity = ass >> 30; |
| 609 | spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; |
| 610 | spec->cdefine.check_sum = (ass >> 16) & 0xf; |
| 611 | spec->cdefine.customization = ass >> 8; |
| 612 | do_sku: |
| 613 | spec->cdefine.sku_cfg = ass; |
| 614 | spec->cdefine.external_amp = (ass & 0x38) >> 3; |
| 615 | spec->cdefine.platform_type = (ass & 0x4) >> 2; |
| 616 | spec->cdefine.swap = (ass & 0x2) >> 1; |
| 617 | spec->cdefine.override = ass & 0x1; |
| 618 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 619 | codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 620 | nid, spec->cdefine.sku_cfg); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 621 | codec_dbg(codec, "SKU: port_connectivity=0x%x\n", |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 622 | spec->cdefine.port_connectivity); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 623 | codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); |
| 624 | codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); |
| 625 | codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); |
| 626 | codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); |
| 627 | codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); |
| 628 | codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); |
| 629 | codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 630 | |
| 631 | return 0; |
| 632 | } |
| 633 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 634 | /* return the position of NID in the list, or -1 if not found */ |
| 635 | static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 636 | { |
| 637 | int i; |
| 638 | for (i = 0; i < nums; i++) |
| 639 | if (list[i] == nid) |
| 640 | return i; |
| 641 | return -1; |
| 642 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 643 | /* return true if the given NID is found in the list */ |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 644 | static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
| 645 | { |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 646 | return find_idx_in_nid_list(nid, list, nums) >= 0; |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 647 | } |
| 648 | |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 649 | /* check subsystem ID and set up device-specific initialization; |
| 650 | * return 1 if initialized, 0 if invalid SSID |
| 651 | */ |
| 652 | /* 32-bit subsystem ID for BIOS loading in HD Audio codec. |
| 653 | * 31 ~ 16 : Manufacture ID |
| 654 | * 15 ~ 8 : SKU ID |
| 655 | * 7 ~ 0 : Assembly ID |
| 656 | * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 |
| 657 | */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 658 | 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] | 659 | { |
| 660 | unsigned int ass, tmp, i; |
| 661 | unsigned nid; |
| 662 | struct alc_spec *spec = codec->spec; |
| 663 | |
David Henningsson | 9062291 | 2010-10-14 14:50:18 +0200 | [diff] [blame] | 664 | if (spec->cdefine.fixup) { |
| 665 | ass = spec->cdefine.sku_cfg; |
| 666 | if (ass == ALC_FIXUP_SKU_IGNORE) |
| 667 | return 0; |
| 668 | goto do_sku; |
| 669 | } |
| 670 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 671 | ass = codec->core.subsystem_id & 0xffff; |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 672 | if (codec->bus->pci && |
| 673 | ass != codec->bus->pci->subsystem_device && (ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 674 | goto do_sku; |
| 675 | |
| 676 | /* invalid SSID, check the special NID pin defcfg instead */ |
| 677 | /* |
Sasha Alexandr | def319f | 2009-06-16 16:00:15 -0400 | [diff] [blame] | 678 | * 31~30 : port connectivity |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 679 | * 29~21 : reserve |
| 680 | * 20 : PCBEEP input |
| 681 | * 19~16 : Check sum (15:1) |
| 682 | * 15~1 : Custom |
| 683 | * 0 : override |
| 684 | */ |
| 685 | nid = 0x1d; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 686 | if (codec->core.vendor_id == 0x10ec0260) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 687 | nid = 0x17; |
| 688 | ass = snd_hda_codec_get_pincfg(codec, nid); |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 689 | codec_dbg(codec, |
| 690 | "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] | 691 | ass, nid); |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 692 | if (!(ass & 1)) |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 693 | return 0; |
| 694 | if ((ass >> 30) != 1) /* no physical connection */ |
| 695 | return 0; |
| 696 | |
| 697 | /* check sum */ |
| 698 | tmp = 0; |
| 699 | for (i = 1; i < 16; i++) { |
| 700 | if ((ass >> i) & 1) |
| 701 | tmp++; |
| 702 | } |
| 703 | if (((ass >> 16) & 0xf) != tmp) |
| 704 | return 0; |
| 705 | do_sku: |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 706 | 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] | 707 | ass & 0xffff, codec->core.vendor_id); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 708 | /* |
| 709 | * 0 : override |
| 710 | * 1 : Swap Jack |
| 711 | * 2 : 0 --> Desktop, 1 --> Laptop |
| 712 | * 3~5 : External Amplifier control |
| 713 | * 7~6 : Reserved |
| 714 | */ |
| 715 | tmp = (ass & 0x38) >> 3; /* external Amp control */ |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 716 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
| 717 | switch (tmp) { |
| 718 | case 1: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 719 | alc_setup_gpio(codec, 0x01); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 720 | break; |
| 721 | case 3: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 722 | alc_setup_gpio(codec, 0x02); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 723 | break; |
| 724 | case 7: |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 725 | alc_setup_gpio(codec, 0x03); |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 726 | break; |
| 727 | case 5: |
| 728 | default: |
| 729 | spec->init_amp = ALC_INIT_DEFAULT; |
| 730 | break; |
| 731 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 732 | } |
| 733 | |
| 734 | /* is laptop or Desktop and enable the function "Mute internal speaker |
| 735 | * when the external headphone out jack is plugged" |
| 736 | */ |
| 737 | if (!(ass & 0x8000)) |
| 738 | return 1; |
| 739 | /* |
| 740 | * 10~8 : Jack location |
| 741 | * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered |
| 742 | * 14~13: Resvered |
| 743 | * 15 : 1 --> enable the function "Mute internal speaker |
| 744 | * when the external headphone out jack is plugged" |
| 745 | */ |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 746 | if (!alc_get_hp_pin(spec)) { |
Takashi Iwai | 01d4825 | 2009-10-06 13:21:54 +0200 | [diff] [blame] | 747 | hda_nid_t nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 748 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 749 | nid = ports[tmp]; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 750 | if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, |
| 751 | spec->gen.autocfg.line_outs)) |
Takashi Iwai | 3af9ee6 | 2011-06-27 12:34:01 +0200 | [diff] [blame] | 752 | return 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 753 | spec->gen.autocfg.hp_pins[0] = nid; |
Kailang Yang | c9b5800 | 2007-10-16 14:30:01 +0200 | [diff] [blame] | 754 | } |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 755 | return 1; |
| 756 | } |
Kailang Yang | ea1fb29 | 2008-08-26 12:58:38 +0200 | [diff] [blame] | 757 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 758 | /* Check the validity of ALC subsystem-id |
| 759 | * ports contains an array of 4 pin NIDs for port-A, E, D and I */ |
| 760 | 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] | 761 | { |
Takashi Iwai | 58c57cf | 2014-01-07 18:22:49 +0100 | [diff] [blame] | 762 | if (!alc_subsystem_id(codec, ports)) { |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 763 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 764 | codec_dbg(codec, |
| 765 | "realtek: Enable default setup for auto mode as fallback\n"); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 766 | spec->init_amp = ALC_INIT_DEFAULT; |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 767 | } |
Takashi Iwai | 2126896 | 2011-07-07 15:01:13 +0200 | [diff] [blame] | 768 | } |
Takashi Iwai | 1a1455d | 2011-04-28 17:36:18 +0200 | [diff] [blame] | 769 | |
Takashi Iwai | 41e41f1 | 2005-06-08 14:48:49 +0200 | [diff] [blame] | 770 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 771 | */ |
| 772 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 773 | static void alc_fixup_inv_dmic(struct hda_codec *codec, |
| 774 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 775 | { |
| 776 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 668d1e9 | 2012-11-29 14:10:17 +0100 | [diff] [blame] | 777 | |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 778 | spec->gen.inv_dmic_split = 1; |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 779 | } |
| 780 | |
Takashi Iwai | 603c401 | 2008-07-30 15:01:44 +0200 | [diff] [blame] | 781 | |
Takashi Iwai | 2eab694 | 2012-12-18 15:30:41 +0100 | [diff] [blame] | 782 | static int alc_build_controls(struct hda_codec *codec) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 783 | { |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 784 | int err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 785 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 786 | err = snd_hda_gen_build_controls(codec); |
| 787 | if (err < 0) |
| 788 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 789 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 790 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 791 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 792 | } |
| 793 | |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 794 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 795 | /* |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 796 | * Common callbacks |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 797 | */ |
Takashi Iwai | 16ded52 | 2005-06-10 19:58:24 +0200 | [diff] [blame] | 798 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 799 | static int alc_init(struct hda_codec *codec) |
| 800 | { |
| 801 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | e9edcee | 2005-06-13 14:16:38 +0200 | [diff] [blame] | 802 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 803 | if (spec->init_hook) |
| 804 | spec->init_hook(codec); |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 805 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 806 | alc_fix_pll(codec); |
Takashi Iwai | 4a79ba3 | 2009-04-22 16:31:35 +0200 | [diff] [blame] | 807 | alc_auto_init_amp(codec, spec->init_amp); |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 808 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 809 | snd_hda_gen_init(codec); |
Takashi Iwai | ae6b813 | 2006-03-03 16:47:17 +0100 | [diff] [blame] | 810 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 811 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); |
Takashi Iwai | e08a007 | 2006-09-07 17:52:14 +0200 | [diff] [blame] | 812 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 813 | return 0; |
| 814 | } |
| 815 | |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 816 | static inline void alc_shutup(struct hda_codec *codec) |
| 817 | { |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 818 | struct alc_spec *spec = codec->spec; |
| 819 | |
Takashi Iwai | c7273bd | 2018-06-12 16:09:57 +0200 | [diff] [blame] | 820 | if (!snd_hda_get_bool_hint(codec, "shutup")) |
| 821 | return; /* disabled explicitly by hints */ |
| 822 | |
Takashi Iwai | 1c716153 | 2011-04-07 10:37:16 +0200 | [diff] [blame] | 823 | if (spec && spec->shutup) |
| 824 | spec->shutup(codec); |
Takashi Iwai | 9bfb284 | 2013-07-24 14:31:50 +0200 | [diff] [blame] | 825 | else |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 826 | alc_shutup_pins(codec); |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 827 | } |
| 828 | |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 829 | static void alc_reboot_notify(struct hda_codec *codec) |
| 830 | { |
| 831 | struct alc_spec *spec = codec->spec; |
| 832 | |
| 833 | if (spec && spec->reboot_notify) |
| 834 | spec->reboot_notify(codec); |
| 835 | else |
| 836 | alc_shutup(codec); |
| 837 | } |
| 838 | |
| 839 | /* power down codec to D3 at reboot/shutdown; set as reboot_notify ops */ |
| 840 | static void alc_d3_at_reboot(struct hda_codec *codec) |
| 841 | { |
| 842 | snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3); |
| 843 | snd_hda_codec_write(codec, codec->core.afg, 0, |
| 844 | AC_VERB_SET_POWER_STATE, AC_PWRST_D3); |
| 845 | msleep(10); |
| 846 | } |
| 847 | |
Takashi Iwai | 8a02c0c | 2014-02-10 18:09:45 +0100 | [diff] [blame] | 848 | #define alc_free snd_hda_gen_free |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 849 | |
Takashi Iwai | 83012a7 | 2012-08-24 18:38:08 +0200 | [diff] [blame] | 850 | #ifdef CONFIG_PM |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 851 | static void alc_power_eapd(struct hda_codec *codec) |
| 852 | { |
Takashi Iwai | 691f1fc | 2011-04-07 10:31:43 +0200 | [diff] [blame] | 853 | alc_auto_setup_eapd(codec, false); |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 854 | } |
| 855 | |
Takashi Iwai | 68cb2b5 | 2012-07-02 15:20:37 +0200 | [diff] [blame] | 856 | static int alc_suspend(struct hda_codec *codec) |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 857 | { |
| 858 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | a4e09aa | 2009-12-27 11:22:24 +0100 | [diff] [blame] | 859 | alc_shutup(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 860 | if (spec && spec->power_hook) |
Daniel T Chen | c97259d | 2009-12-27 18:52:08 -0500 | [diff] [blame] | 861 | spec->power_hook(codec); |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 862 | return 0; |
| 863 | } |
| 864 | #endif |
| 865 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 866 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 867 | static int alc_resume(struct hda_codec *codec) |
| 868 | { |
Kailang Yang | 97a2657 | 2013-11-29 00:35:26 -0500 | [diff] [blame] | 869 | struct alc_spec *spec = codec->spec; |
| 870 | |
| 871 | if (!spec->no_depop_delay) |
| 872 | msleep(150); /* to avoid pop noise */ |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 873 | codec->patch_ops.init(codec); |
Takashi Iwai | eeecd9d | 2015-02-25 15:18:50 +0100 | [diff] [blame] | 874 | regcache_sync(codec->core.regmap); |
Takashi Iwai | 9e5341b | 2010-09-21 09:57:06 +0200 | [diff] [blame] | 875 | hda_call_check_power_status(codec, 0x01); |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 876 | return 0; |
| 877 | } |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 878 | #endif |
| 879 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 880 | /* |
| 881 | */ |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 882 | static const struct hda_codec_ops alc_patch_ops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 883 | .build_controls = alc_build_controls, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 884 | .build_pcms = snd_hda_gen_build_pcms, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 885 | .init = alc_init, |
| 886 | .free = alc_free, |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 887 | .unsol_event = snd_hda_jack_unsol_event, |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 888 | #ifdef CONFIG_PM |
Takashi Iwai | e044c39 | 2008-10-27 16:56:24 +0100 | [diff] [blame] | 889 | .resume = alc_resume, |
Hector Martin | f5de24b | 2009-12-20 22:51:31 +0100 | [diff] [blame] | 890 | .suspend = alc_suspend, |
Takashi Iwai | fce52a3 | 2013-01-07 12:42:48 +0100 | [diff] [blame] | 891 | .check_power_status = snd_hda_gen_check_power_status, |
Takashi Iwai | cb53c62 | 2007-08-10 17:21:45 +0200 | [diff] [blame] | 892 | #endif |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 893 | .reboot_notify = alc_reboot_notify, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 894 | }; |
| 895 | |
David Henningsson | 29adc4b | 2012-09-25 11:31:00 +0200 | [diff] [blame] | 896 | |
Takashi Iwai | ded255b | 2015-10-01 17:59:43 +0200 | [diff] [blame] | 897 | #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] | 898 | |
Takashi Iwai | 2fa522b | 2005-05-12 14:51:12 +0200 | [diff] [blame] | 899 | /* |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 900 | * Rename codecs appropriately from COEF value or subvendor id |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 901 | */ |
| 902 | struct alc_codec_rename_table { |
| 903 | unsigned int vendor_id; |
| 904 | unsigned short coef_mask; |
| 905 | unsigned short coef_bits; |
| 906 | const char *name; |
| 907 | }; |
| 908 | |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 909 | struct alc_codec_rename_pci_table { |
| 910 | unsigned int codec_vendor_id; |
| 911 | unsigned short pci_subvendor; |
| 912 | unsigned short pci_subdevice; |
| 913 | const char *name; |
| 914 | }; |
| 915 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 916 | static struct alc_codec_rename_table rename_tbl[] = { |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 917 | { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 918 | { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, |
| 919 | { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, |
| 920 | { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, |
| 921 | { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, |
| 922 | { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, |
| 923 | { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, |
| 924 | { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 925 | { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 926 | { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 927 | { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, |
| 928 | { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, |
| 929 | { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, |
| 930 | { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, |
| 931 | { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, |
| 932 | { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, |
| 933 | { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, |
| 934 | { } /* terminator */ |
| 935 | }; |
| 936 | |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 937 | static struct alc_codec_rename_pci_table rename_pci_tbl[] = { |
| 938 | { 0x10ec0280, 0x1028, 0, "ALC3220" }, |
| 939 | { 0x10ec0282, 0x1028, 0, "ALC3221" }, |
| 940 | { 0x10ec0283, 0x1028, 0, "ALC3223" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 941 | { 0x10ec0288, 0x1028, 0, "ALC3263" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 942 | { 0x10ec0292, 0x1028, 0, "ALC3226" }, |
Kailang Yang | 193177d | 2014-04-23 16:06:13 +0800 | [diff] [blame] | 943 | { 0x10ec0293, 0x1028, 0, "ALC3235" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 944 | { 0x10ec0255, 0x1028, 0, "ALC3234" }, |
| 945 | { 0x10ec0668, 0x1028, 0, "ALC3661" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 946 | { 0x10ec0275, 0x1028, 0, "ALC3260" }, |
| 947 | { 0x10ec0899, 0x1028, 0, "ALC3861" }, |
Kailang Yang | 2c674fa | 2015-05-05 15:02:42 +0800 | [diff] [blame] | 948 | { 0x10ec0298, 0x1028, 0, "ALC3266" }, |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 949 | { 0x10ec0236, 0x1028, 0, "ALC3204" }, |
Kailang Yang | 8232450 | 2015-05-25 17:16:49 +0800 | [diff] [blame] | 950 | { 0x10ec0256, 0x1028, 0, "ALC3246" }, |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 951 | { 0x10ec0225, 0x1028, 0, "ALC3253" }, |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 952 | { 0x10ec0295, 0x1028, 0, "ALC3254" }, |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 953 | { 0x10ec0299, 0x1028, 0, "ALC3271" }, |
Kailang Yang | e6e5f7a | 2014-06-06 16:46:43 +0800 | [diff] [blame] | 954 | { 0x10ec0670, 0x1025, 0, "ALC669X" }, |
| 955 | { 0x10ec0676, 0x1025, 0, "ALC679X" }, |
| 956 | { 0x10ec0282, 0x1043, 0, "ALC3229" }, |
| 957 | { 0x10ec0233, 0x1043, 0, "ALC3236" }, |
| 958 | { 0x10ec0280, 0x103c, 0, "ALC3228" }, |
| 959 | { 0x10ec0282, 0x103c, 0, "ALC3227" }, |
| 960 | { 0x10ec0286, 0x103c, 0, "ALC3242" }, |
| 961 | { 0x10ec0290, 0x103c, 0, "ALC3241" }, |
| 962 | { 0x10ec0668, 0x103c, 0, "ALC3662" }, |
| 963 | { 0x10ec0283, 0x17aa, 0, "ALC3239" }, |
| 964 | { 0x10ec0292, 0x17aa, 0, "ALC3232" }, |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 965 | { } /* terminator */ |
| 966 | }; |
| 967 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 968 | static int alc_codec_rename_from_preset(struct hda_codec *codec) |
| 969 | { |
| 970 | const struct alc_codec_rename_table *p; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 971 | const struct alc_codec_rename_pci_table *q; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 972 | |
| 973 | for (p = rename_tbl; p->vendor_id; p++) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 974 | if (p->vendor_id != codec->core.vendor_id) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 975 | continue; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 976 | if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 977 | return alc_codec_rename(codec, p->name); |
| 978 | } |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 979 | |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 980 | if (!codec->bus->pci) |
| 981 | return 0; |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 982 | for (q = rename_pci_tbl; q->codec_vendor_id; q++) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 983 | if (q->codec_vendor_id != codec->core.vendor_id) |
Kailang Yang | 4b01693 | 2013-11-28 11:55:09 +0100 | [diff] [blame] | 984 | continue; |
| 985 | if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) |
| 986 | continue; |
| 987 | if (!q->pci_subdevice || |
| 988 | q->pci_subdevice == codec->bus->pci->subsystem_device) |
| 989 | return alc_codec_rename(codec, q->name); |
| 990 | } |
| 991 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 992 | return 0; |
| 993 | } |
| 994 | |
Takashi Iwai | e477062 | 2011-07-08 11:11:35 +0200 | [diff] [blame] | 995 | |
| 996 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 997 | * Digital-beep handlers |
| 998 | */ |
| 999 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1000 | |
| 1001 | /* additional beep mixers; private_value will be overwritten */ |
| 1002 | static const struct snd_kcontrol_new alc_beep_mixer[] = { |
| 1003 | HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), |
| 1004 | HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), |
| 1005 | }; |
| 1006 | |
| 1007 | /* set up and create beep controls */ |
| 1008 | static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid, |
| 1009 | int idx, int dir) |
| 1010 | { |
| 1011 | struct snd_kcontrol_new *knew; |
| 1012 | unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir); |
| 1013 | int i; |
| 1014 | |
| 1015 | for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) { |
| 1016 | knew = snd_hda_gen_add_kctl(&spec->gen, NULL, |
| 1017 | &alc_beep_mixer[i]); |
| 1018 | if (!knew) |
| 1019 | return -ENOMEM; |
| 1020 | knew->private_value = beep_amp; |
| 1021 | } |
| 1022 | return 0; |
| 1023 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1024 | |
| 1025 | static const struct snd_pci_quirk beep_white_list[] = { |
Duncan Roe | 7110005 | 2012-10-10 14:19:50 +0200 | [diff] [blame] | 1026 | SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), |
W. Trevor King | a4b7f21d | 2014-03-29 17:47:24 -0700 | [diff] [blame] | 1027 | SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1028 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), |
Takashi Iwai | 8554ee4 | 2013-02-25 09:54:43 +0100 | [diff] [blame] | 1029 | SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1030 | SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), |
| 1031 | SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), |
| 1032 | SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), |
Takashi Iwai | 78f8baf | 2012-03-06 14:02:32 +0100 | [diff] [blame] | 1033 | SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1034 | SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), |
| 1035 | {} |
| 1036 | }; |
| 1037 | |
| 1038 | static inline int has_cdefine_beep(struct hda_codec *codec) |
| 1039 | { |
| 1040 | struct alc_spec *spec = codec->spec; |
| 1041 | const struct snd_pci_quirk *q; |
| 1042 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list); |
| 1043 | if (q) |
| 1044 | return q->value; |
| 1045 | return spec->cdefine.enable_pcbeep; |
| 1046 | } |
| 1047 | #else |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1048 | #define set_beep_amp(spec, nid, idx, dir) 0 |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1049 | #define has_cdefine_beep(codec) 0 |
| 1050 | #endif |
| 1051 | |
| 1052 | /* parse the BIOS configuration and set up the alc_spec */ |
| 1053 | /* return 1 if successful, 0 if the proper config is not found, |
| 1054 | * or a negative error code |
| 1055 | */ |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1056 | static int alc_parse_auto_config(struct hda_codec *codec, |
| 1057 | const hda_nid_t *ignore_nids, |
| 1058 | const hda_nid_t *ssid_nids) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1059 | { |
| 1060 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1061 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1062 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1063 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 1064 | err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, |
| 1065 | spec->parse_flags); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1066 | if (err < 0) |
| 1067 | return err; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1068 | |
| 1069 | if (ssid_nids) |
| 1070 | alc_ssid_check(codec, ssid_nids); |
| 1071 | |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1072 | err = snd_hda_gen_parse_auto_config(codec, cfg); |
| 1073 | if (err < 0) |
| 1074 | return err; |
Takashi Iwai | 070cff4 | 2012-02-21 12:54:17 +0100 | [diff] [blame] | 1075 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1076 | return 1; |
| 1077 | } |
| 1078 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1079 | /* common preparation job for alc_spec */ |
| 1080 | static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) |
| 1081 | { |
| 1082 | struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
| 1083 | int err; |
| 1084 | |
| 1085 | if (!spec) |
| 1086 | return -ENOMEM; |
| 1087 | codec->spec = spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1088 | snd_hda_gen_spec_init(&spec->gen); |
| 1089 | spec->gen.mixer_nid = mixer_nid; |
| 1090 | spec->gen.own_eapd_ctl = 1; |
Takashi Iwai | 1098b7c | 2012-12-17 20:03:15 +0100 | [diff] [blame] | 1091 | codec->single_adc_amp = 1; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1092 | /* FIXME: do we need this for all Realtek codec models? */ |
| 1093 | codec->spdif_status_reset = 1; |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1094 | codec->patch_ops = alc_patch_ops; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1095 | |
| 1096 | err = alc_codec_rename_from_preset(codec); |
| 1097 | if (err < 0) { |
| 1098 | kfree(spec); |
| 1099 | return err; |
| 1100 | } |
| 1101 | return 0; |
| 1102 | } |
| 1103 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1104 | static int alc880_parse_auto_config(struct hda_codec *codec) |
| 1105 | { |
| 1106 | static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 1107 | static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1108 | return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); |
| 1109 | } |
| 1110 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1111 | /* |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1112 | * ALC880 fix-ups |
| 1113 | */ |
| 1114 | enum { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1115 | ALC880_FIXUP_GPIO1, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1116 | ALC880_FIXUP_GPIO2, |
| 1117 | ALC880_FIXUP_MEDION_RIM, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1118 | ALC880_FIXUP_LG, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1119 | ALC880_FIXUP_LG_LW25, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1120 | ALC880_FIXUP_W810, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1121 | ALC880_FIXUP_EAPD_COEF, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1122 | ALC880_FIXUP_TCL_S700, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1123 | ALC880_FIXUP_VOL_KNOB, |
| 1124 | ALC880_FIXUP_FUJITSU, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1125 | ALC880_FIXUP_F1734, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1126 | ALC880_FIXUP_UNIWILL, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1127 | ALC880_FIXUP_UNIWILL_DIG, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1128 | ALC880_FIXUP_Z71V, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1129 | ALC880_FIXUP_ASUS_W5A, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1130 | ALC880_FIXUP_3ST_BASE, |
| 1131 | ALC880_FIXUP_3ST, |
| 1132 | ALC880_FIXUP_3ST_DIG, |
| 1133 | ALC880_FIXUP_5ST_BASE, |
| 1134 | ALC880_FIXUP_5ST, |
| 1135 | ALC880_FIXUP_5ST_DIG, |
| 1136 | ALC880_FIXUP_6ST_BASE, |
| 1137 | ALC880_FIXUP_6ST, |
| 1138 | ALC880_FIXUP_6ST_DIG, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1139 | ALC880_FIXUP_6ST_AUTOMUTE, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1140 | }; |
| 1141 | |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1142 | /* enable the volume-knob widget support on NID 0x21 */ |
| 1143 | static void alc880_fixup_vol_knob(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1144 | const struct hda_fixup *fix, int action) |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1145 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1146 | if (action == HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1147 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
| 1148 | alc_update_knob_master); |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1149 | } |
| 1150 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1151 | static const struct hda_fixup alc880_fixups[] = { |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1152 | [ALC880_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1153 | .type = HDA_FIXUP_FUNC, |
| 1154 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 411225a | 2012-02-20 17:48:19 +0100 | [diff] [blame] | 1155 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1156 | [ALC880_FIXUP_GPIO2] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1157 | .type = HDA_FIXUP_FUNC, |
| 1158 | .v.func = alc_fixup_gpio2, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1159 | }, |
| 1160 | [ALC880_FIXUP_MEDION_RIM] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1161 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1162 | .v.verbs = (const struct hda_verb[]) { |
| 1163 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1164 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1165 | { } |
| 1166 | }, |
| 1167 | .chained = true, |
| 1168 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1169 | }, |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1170 | [ALC880_FIXUP_LG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1171 | .type = HDA_FIXUP_PINS, |
| 1172 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1173 | /* disable bogus unused pins */ |
| 1174 | { 0x16, 0x411111f0 }, |
| 1175 | { 0x18, 0x411111f0 }, |
| 1176 | { 0x1a, 0x411111f0 }, |
| 1177 | { } |
| 1178 | } |
| 1179 | }, |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1180 | [ALC880_FIXUP_LG_LW25] = { |
| 1181 | .type = HDA_FIXUP_PINS, |
| 1182 | .v.pins = (const struct hda_pintbl[]) { |
| 1183 | { 0x1a, 0x0181344f }, /* line-in */ |
| 1184 | { 0x1b, 0x0321403f }, /* headphone */ |
| 1185 | { } |
| 1186 | } |
| 1187 | }, |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1188 | [ALC880_FIXUP_W810] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1189 | .type = HDA_FIXUP_PINS, |
| 1190 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1191 | /* disable bogus unused pins */ |
| 1192 | { 0x17, 0x411111f0 }, |
| 1193 | { } |
| 1194 | }, |
| 1195 | .chained = true, |
| 1196 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1197 | }, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1198 | [ALC880_FIXUP_EAPD_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1199 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1200 | .v.verbs = (const struct hda_verb[]) { |
| 1201 | /* change to EAPD mode */ |
| 1202 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1203 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 1204 | {} |
| 1205 | }, |
| 1206 | }, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1207 | [ALC880_FIXUP_TCL_S700] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1208 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1209 | .v.verbs = (const struct hda_verb[]) { |
| 1210 | /* change to EAPD mode */ |
| 1211 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1212 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 1213 | {} |
| 1214 | }, |
| 1215 | .chained = true, |
| 1216 | .chain_id = ALC880_FIXUP_GPIO2, |
| 1217 | }, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1218 | [ALC880_FIXUP_VOL_KNOB] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1219 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1220 | .v.func = alc880_fixup_vol_knob, |
| 1221 | }, |
| 1222 | [ALC880_FIXUP_FUJITSU] = { |
| 1223 | /* override all pins as BIOS on old Amilo is broken */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1224 | .type = HDA_FIXUP_PINS, |
| 1225 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | bb148bd | 2015-08-13 18:02:39 +0200 | [diff] [blame] | 1226 | { 0x14, 0x0121401f }, /* HP */ |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1227 | { 0x15, 0x99030120 }, /* speaker */ |
| 1228 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1229 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1230 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1231 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1232 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1233 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1234 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1235 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1236 | { 0x1e, 0x01454140 }, /* SPDIF out */ |
| 1237 | { } |
| 1238 | }, |
| 1239 | .chained = true, |
| 1240 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1241 | }, |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1242 | [ALC880_FIXUP_F1734] = { |
| 1243 | /* almost compatible with FUJITSU, but no bass and SPDIF */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1244 | .type = HDA_FIXUP_PINS, |
| 1245 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | bb148bd | 2015-08-13 18:02:39 +0200 | [diff] [blame] | 1246 | { 0x14, 0x0121401f }, /* HP */ |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1247 | { 0x15, 0x99030120 }, /* speaker */ |
| 1248 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1249 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1250 | { 0x18, 0x411111f0 }, /* N/A */ |
| 1251 | { 0x19, 0x01a19950 }, /* mic-in */ |
| 1252 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1253 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1254 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1255 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1256 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1257 | { } |
| 1258 | }, |
| 1259 | .chained = true, |
| 1260 | .chain_id = ALC880_FIXUP_VOL_KNOB, |
| 1261 | }, |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1262 | [ALC880_FIXUP_UNIWILL] = { |
| 1263 | /* need to fix HP and speaker pins to be parsed correctly */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1264 | .type = HDA_FIXUP_PINS, |
| 1265 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1266 | { 0x14, 0x0121411f }, /* HP */ |
| 1267 | { 0x15, 0x99030120 }, /* speaker */ |
| 1268 | { 0x16, 0x99030130 }, /* bass speaker */ |
| 1269 | { } |
| 1270 | }, |
| 1271 | }, |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1272 | [ALC880_FIXUP_UNIWILL_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1273 | .type = HDA_FIXUP_PINS, |
| 1274 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1275 | /* disable bogus unused pins */ |
| 1276 | { 0x17, 0x411111f0 }, |
| 1277 | { 0x19, 0x411111f0 }, |
| 1278 | { 0x1b, 0x411111f0 }, |
| 1279 | { 0x1f, 0x411111f0 }, |
| 1280 | { } |
| 1281 | } |
| 1282 | }, |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1283 | [ALC880_FIXUP_Z71V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1284 | .type = HDA_FIXUP_PINS, |
| 1285 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1286 | /* set up the whole pins as BIOS is utterly broken */ |
| 1287 | { 0x14, 0x99030120 }, /* speaker */ |
| 1288 | { 0x15, 0x0121411f }, /* HP */ |
| 1289 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1290 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1291 | { 0x18, 0x01a19950 }, /* mic-in */ |
| 1292 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1293 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1294 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1295 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1296 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1297 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1298 | { } |
| 1299 | } |
| 1300 | }, |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1301 | [ALC880_FIXUP_ASUS_W5A] = { |
| 1302 | .type = HDA_FIXUP_PINS, |
| 1303 | .v.pins = (const struct hda_pintbl[]) { |
| 1304 | /* set up the whole pins as BIOS is utterly broken */ |
| 1305 | { 0x14, 0x0121411f }, /* HP */ |
| 1306 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1307 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1308 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1309 | { 0x18, 0x90a60160 }, /* mic */ |
| 1310 | { 0x19, 0x411111f0 }, /* N/A */ |
| 1311 | { 0x1a, 0x411111f0 }, /* N/A */ |
| 1312 | { 0x1b, 0x411111f0 }, /* N/A */ |
| 1313 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1314 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1315 | { 0x1e, 0xb743111e }, /* SPDIF out */ |
| 1316 | { } |
| 1317 | }, |
| 1318 | .chained = true, |
| 1319 | .chain_id = ALC880_FIXUP_GPIO1, |
| 1320 | }, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1321 | [ALC880_FIXUP_3ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1322 | .type = HDA_FIXUP_PINS, |
| 1323 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1324 | { 0x14, 0x01014010 }, /* line-out */ |
| 1325 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1326 | { 0x16, 0x411111f0 }, /* N/A */ |
| 1327 | { 0x17, 0x411111f0 }, /* N/A */ |
| 1328 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1329 | { 0x19, 0x0121411f }, /* HP */ |
| 1330 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1331 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1332 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1333 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1334 | /* 0x1e is filled in below */ |
| 1335 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1336 | { } |
| 1337 | } |
| 1338 | }, |
| 1339 | [ALC880_FIXUP_3ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1340 | .type = HDA_FIXUP_PINS, |
| 1341 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1342 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1343 | { } |
| 1344 | }, |
| 1345 | .chained = true, |
| 1346 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1347 | }, |
| 1348 | [ALC880_FIXUP_3ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1349 | .type = HDA_FIXUP_PINS, |
| 1350 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1351 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1352 | { } |
| 1353 | }, |
| 1354 | .chained = true, |
| 1355 | .chain_id = ALC880_FIXUP_3ST_BASE, |
| 1356 | }, |
| 1357 | [ALC880_FIXUP_5ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1358 | .type = HDA_FIXUP_PINS, |
| 1359 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1360 | { 0x14, 0x01014010 }, /* front */ |
| 1361 | { 0x15, 0x411111f0 }, /* N/A */ |
| 1362 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1363 | { 0x17, 0x01016412 }, /* surr */ |
| 1364 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1365 | { 0x19, 0x0121411f }, /* HP */ |
| 1366 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1367 | { 0x1b, 0x02a19c40 }, /* front-mic */ |
| 1368 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1369 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1370 | /* 0x1e is filled in below */ |
| 1371 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1372 | { } |
| 1373 | } |
| 1374 | }, |
| 1375 | [ALC880_FIXUP_5ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1376 | .type = HDA_FIXUP_PINS, |
| 1377 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1378 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1379 | { } |
| 1380 | }, |
| 1381 | .chained = true, |
| 1382 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1383 | }, |
| 1384 | [ALC880_FIXUP_5ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1385 | .type = HDA_FIXUP_PINS, |
| 1386 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1387 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1388 | { } |
| 1389 | }, |
| 1390 | .chained = true, |
| 1391 | .chain_id = ALC880_FIXUP_5ST_BASE, |
| 1392 | }, |
| 1393 | [ALC880_FIXUP_6ST_BASE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1394 | .type = HDA_FIXUP_PINS, |
| 1395 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1396 | { 0x14, 0x01014010 }, /* front */ |
| 1397 | { 0x15, 0x01016412 }, /* surr */ |
| 1398 | { 0x16, 0x01011411 }, /* CLFE */ |
| 1399 | { 0x17, 0x01012414 }, /* side */ |
| 1400 | { 0x18, 0x01a19c30 }, /* mic-in */ |
| 1401 | { 0x19, 0x02a19c40 }, /* front-mic */ |
| 1402 | { 0x1a, 0x01813031 }, /* line-in */ |
| 1403 | { 0x1b, 0x0121411f }, /* HP */ |
| 1404 | { 0x1c, 0x411111f0 }, /* N/A */ |
| 1405 | { 0x1d, 0x411111f0 }, /* N/A */ |
| 1406 | /* 0x1e is filled in below */ |
| 1407 | { 0x1f, 0x411111f0 }, /* N/A */ |
| 1408 | { } |
| 1409 | } |
| 1410 | }, |
| 1411 | [ALC880_FIXUP_6ST] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1412 | .type = HDA_FIXUP_PINS, |
| 1413 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1414 | { 0x1e, 0x411111f0 }, /* N/A */ |
| 1415 | { } |
| 1416 | }, |
| 1417 | .chained = true, |
| 1418 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1419 | }, |
| 1420 | [ALC880_FIXUP_6ST_DIG] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1421 | .type = HDA_FIXUP_PINS, |
| 1422 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1423 | { 0x1e, 0x0144111e }, /* SPDIF */ |
| 1424 | { } |
| 1425 | }, |
| 1426 | .chained = true, |
| 1427 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1428 | }, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1429 | [ALC880_FIXUP_6ST_AUTOMUTE] = { |
| 1430 | .type = HDA_FIXUP_PINS, |
| 1431 | .v.pins = (const struct hda_pintbl[]) { |
| 1432 | { 0x1b, 0x0121401f }, /* HP with jack detect */ |
| 1433 | { } |
| 1434 | }, |
| 1435 | .chained_before = true, |
| 1436 | .chain_id = ALC880_FIXUP_6ST_BASE, |
| 1437 | }, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1438 | }; |
| 1439 | |
| 1440 | static const struct snd_pci_quirk alc880_fixup_tbl[] = { |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1441 | SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), |
Takashi Iwai | 487a588 | 2013-11-07 07:29:30 +0100 | [diff] [blame] | 1442 | SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), |
Takashi Iwai | 96e225f | 2012-02-20 17:41:51 +0100 | [diff] [blame] | 1443 | SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1444 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), |
David Henningsson | 6538de0 | 2014-06-10 10:52:50 +0200 | [diff] [blame] | 1445 | SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | 29e3fdc | 2012-02-20 17:56:57 +0100 | [diff] [blame] | 1446 | SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), |
Takashi Iwai | 27e917f | 2012-02-17 17:49:54 +0100 | [diff] [blame] | 1447 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), |
Takashi Iwai | 967b88c | 2012-02-20 17:31:02 +0100 | [diff] [blame] | 1448 | SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1449 | SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), |
Takashi Iwai | 817de92 | 2012-02-20 17:20:48 +0100 | [diff] [blame] | 1450 | SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), |
Takashi Iwai | 7833c7e | 2012-02-20 17:11:38 +0100 | [diff] [blame] | 1451 | SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), |
Takashi Iwai | f02aab5 | 2012-02-17 16:33:56 +0100 | [diff] [blame] | 1452 | SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1453 | SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1454 | SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), |
Takashi Iwai | a161574 | 2015-08-13 18:05:06 +0200 | [diff] [blame] | 1455 | SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1456 | SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | ba53381 | 2012-02-20 16:36:52 +0100 | [diff] [blame] | 1457 | SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), |
Takashi Iwai | cf5a227 | 2012-02-20 16:31:07 +0100 | [diff] [blame] | 1458 | SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), |
Takashi Iwai | dc6af52 | 2012-02-17 16:18:59 +0100 | [diff] [blame] | 1459 | SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), |
| 1460 | SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), |
| 1461 | SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), |
Takashi Iwai | db8a38e | 2013-08-09 12:34:42 +0200 | [diff] [blame] | 1462 | SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), |
Takashi Iwai | b9368f5 | 2012-02-17 17:54:44 +0100 | [diff] [blame] | 1463 | SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1464 | |
| 1465 | /* Below is the copied entries from alc880_quirks.c. |
| 1466 | * It's not quite sure whether BIOS sets the correct pin-config table |
| 1467 | * on these machines, thus they are kept to be compatible with |
| 1468 | * the old static quirks. Once when it's confirmed to work without |
| 1469 | * these overrides, it'd be better to remove. |
| 1470 | */ |
| 1471 | SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), |
| 1472 | SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), |
| 1473 | SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1474 | SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1475 | SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1476 | SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), |
| 1477 | SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), |
| 1478 | SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), |
| 1479 | SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), |
| 1480 | SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), |
| 1481 | SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), |
| 1482 | SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), |
| 1483 | SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), |
| 1484 | SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), |
| 1485 | SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), |
| 1486 | SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), |
| 1487 | SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), |
| 1488 | SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), |
| 1489 | SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), |
| 1490 | SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), |
| 1491 | SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), |
| 1492 | SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ |
| 1493 | SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), |
| 1494 | SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1495 | SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1496 | SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1497 | SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1498 | SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1499 | SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1500 | SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), |
| 1501 | SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1502 | SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1503 | SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), |
| 1504 | /* default Intel */ |
| 1505 | SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), |
| 1506 | SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), |
| 1507 | SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), |
| 1508 | {} |
| 1509 | }; |
| 1510 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1511 | static const struct hda_model_fixup alc880_fixup_models[] = { |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1512 | {.id = ALC880_FIXUP_3ST, .name = "3stack"}, |
| 1513 | {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, |
| 1514 | {.id = ALC880_FIXUP_5ST, .name = "5stack"}, |
| 1515 | {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, |
| 1516 | {.id = ALC880_FIXUP_6ST, .name = "6stack"}, |
| 1517 | {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, |
Takashi Iwai | 5397145 | 2013-01-23 18:21:37 +0100 | [diff] [blame] | 1518 | {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, |
Takashi Iwai | ee3b296 | 2011-11-15 14:26:54 +0100 | [diff] [blame] | 1519 | {} |
| 1520 | }; |
| 1521 | |
| 1522 | |
| 1523 | /* |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1524 | * OK, here we have finally the patch for ALC880 |
| 1525 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1526 | static int patch_alc880(struct hda_codec *codec) |
| 1527 | { |
| 1528 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1529 | int err; |
| 1530 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1531 | err = alc_alloc_spec(codec, 0x0b); |
| 1532 | if (err < 0) |
| 1533 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1534 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1535 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1536 | spec->gen.need_dac_fix = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1537 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1538 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1539 | codec->patch_ops.unsol_event = alc880_unsol_event; |
| 1540 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1541 | snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1542 | alc880_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1543 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1544 | |
Takashi Iwai | 67b6ec3 | 2012-02-20 18:20:42 +0100 | [diff] [blame] | 1545 | /* automatic parse from the BIOS config */ |
| 1546 | err = alc880_parse_auto_config(codec); |
| 1547 | if (err < 0) |
| 1548 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1549 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1550 | if (!spec->gen.no_analog) { |
| 1551 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 1552 | if (err < 0) |
| 1553 | goto error; |
| 1554 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1555 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1556 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1557 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1558 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1559 | |
| 1560 | error: |
| 1561 | alc_free(codec); |
| 1562 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1563 | } |
| 1564 | |
| 1565 | |
| 1566 | /* |
| 1567 | * ALC260 support |
| 1568 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1569 | static int alc260_parse_auto_config(struct hda_codec *codec) |
| 1570 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1571 | static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 1572 | static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; |
| 1573 | return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1574 | } |
| 1575 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1576 | /* |
| 1577 | * Pin config fixes |
| 1578 | */ |
| 1579 | enum { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1580 | ALC260_FIXUP_HP_DC5750, |
| 1581 | ALC260_FIXUP_HP_PIN_0F, |
| 1582 | ALC260_FIXUP_COEF, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1583 | ALC260_FIXUP_GPIO1, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1584 | ALC260_FIXUP_GPIO1_TOGGLE, |
| 1585 | ALC260_FIXUP_REPLACER, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1586 | ALC260_FIXUP_HP_B1900, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1587 | ALC260_FIXUP_KN1, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1588 | ALC260_FIXUP_FSC_S7020, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1589 | ALC260_FIXUP_FSC_S7020_JWSE, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1590 | ALC260_FIXUP_VAIO_PINS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1591 | }; |
| 1592 | |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1593 | static void alc260_gpio1_automute(struct hda_codec *codec) |
| 1594 | { |
| 1595 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | aaf312d | 2018-06-19 22:28:22 +0200 | [diff] [blame] | 1596 | |
| 1597 | alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1598 | } |
| 1599 | |
| 1600 | static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1601 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1602 | { |
| 1603 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1604 | if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1605 | /* although the machine has only one output pin, we need to |
| 1606 | * toggle GPIO1 according to the jack state |
| 1607 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1608 | spec->gen.automute_hook = alc260_gpio1_automute; |
| 1609 | spec->gen.detect_hp = 1; |
| 1610 | spec->gen.automute_speaker = 1; |
| 1611 | spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ |
Takashi Iwai | 62f949b | 2014-09-11 14:06:53 +0200 | [diff] [blame] | 1612 | snd_hda_jack_detect_enable_callback(codec, 0x0f, |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1613 | snd_hda_gen_hp_automute); |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1614 | alc_setup_gpio(codec, 0x01); |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1615 | } |
| 1616 | } |
| 1617 | |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1618 | static void alc260_fixup_kn1(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1619 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1620 | { |
| 1621 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1622 | static const struct hda_pintbl pincfgs[] = { |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1623 | { 0x0f, 0x02214000 }, /* HP/speaker */ |
| 1624 | { 0x12, 0x90a60160 }, /* int mic */ |
| 1625 | { 0x13, 0x02a19000 }, /* ext mic */ |
| 1626 | { 0x18, 0x01446000 }, /* SPDIF out */ |
| 1627 | /* disable bogus I/O pins */ |
| 1628 | { 0x10, 0x411111f0 }, |
| 1629 | { 0x11, 0x411111f0 }, |
| 1630 | { 0x14, 0x411111f0 }, |
| 1631 | { 0x15, 0x411111f0 }, |
| 1632 | { 0x16, 0x411111f0 }, |
| 1633 | { 0x17, 0x411111f0 }, |
| 1634 | { 0x19, 0x411111f0 }, |
| 1635 | { } |
| 1636 | }; |
| 1637 | |
| 1638 | switch (action) { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1639 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 1640 | snd_hda_apply_pincfgs(codec, pincfgs); |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1641 | spec->init_amp = ALC_INIT_NONE; |
| 1642 | break; |
| 1643 | } |
| 1644 | } |
| 1645 | |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1646 | static void alc260_fixup_fsc_s7020(struct hda_codec *codec, |
| 1647 | const struct hda_fixup *fix, int action) |
| 1648 | { |
| 1649 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 1650 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1651 | spec->init_amp = ALC_INIT_NONE; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1652 | } |
| 1653 | |
| 1654 | static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, |
| 1655 | const struct hda_fixup *fix, int action) |
| 1656 | { |
| 1657 | struct alc_spec *spec = codec->spec; |
| 1658 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | f811c3c | 2013-03-07 18:32:59 +0100 | [diff] [blame] | 1659 | spec->gen.add_jack_modes = 1; |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1660 | spec->gen.hp_mic = 1; |
Takashi Iwai | e6e0ee5 | 2013-02-18 17:04:20 +0100 | [diff] [blame] | 1661 | } |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1662 | } |
| 1663 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1664 | static const struct hda_fixup alc260_fixups[] = { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1665 | [ALC260_FIXUP_HP_DC5750] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1666 | .type = HDA_FIXUP_PINS, |
| 1667 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1668 | { 0x11, 0x90130110 }, /* speaker */ |
| 1669 | { } |
| 1670 | } |
| 1671 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1672 | [ALC260_FIXUP_HP_PIN_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1673 | .type = HDA_FIXUP_PINS, |
| 1674 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1675 | { 0x0f, 0x01214000 }, /* HP */ |
| 1676 | { } |
| 1677 | } |
| 1678 | }, |
| 1679 | [ALC260_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1680 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1681 | .v.verbs = (const struct hda_verb[]) { |
Ronan Marquet | e30cf2d | 2014-06-01 18:38:53 +0200 | [diff] [blame] | 1682 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1683 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1684 | { } |
| 1685 | }, |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1686 | }, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1687 | [ALC260_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 1688 | .type = HDA_FIXUP_FUNC, |
| 1689 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1690 | }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1691 | [ALC260_FIXUP_GPIO1_TOGGLE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1692 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1693 | .v.func = alc260_fixup_gpio1_toggle, |
| 1694 | .chained = true, |
| 1695 | .chain_id = ALC260_FIXUP_HP_PIN_0F, |
| 1696 | }, |
| 1697 | [ALC260_FIXUP_REPLACER] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1698 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1699 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | 192a98e | 2014-06-02 15:16:07 +0200 | [diff] [blame] | 1700 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 1701 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1702 | { } |
| 1703 | }, |
| 1704 | .chained = true, |
| 1705 | .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, |
| 1706 | }, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1707 | [ALC260_FIXUP_HP_B1900] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1708 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1709 | .v.func = alc260_fixup_gpio1_toggle, |
| 1710 | .chained = true, |
| 1711 | .chain_id = ALC260_FIXUP_COEF, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1712 | }, |
| 1713 | [ALC260_FIXUP_KN1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1714 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1715 | .v.func = alc260_fixup_kn1, |
| 1716 | }, |
Takashi Iwai | 39aedee | 2013-01-10 17:10:40 +0100 | [diff] [blame] | 1717 | [ALC260_FIXUP_FSC_S7020] = { |
| 1718 | .type = HDA_FIXUP_FUNC, |
| 1719 | .v.func = alc260_fixup_fsc_s7020, |
| 1720 | }, |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1721 | [ALC260_FIXUP_FSC_S7020_JWSE] = { |
| 1722 | .type = HDA_FIXUP_FUNC, |
| 1723 | .v.func = alc260_fixup_fsc_s7020_jwse, |
| 1724 | .chained = true, |
| 1725 | .chain_id = ALC260_FIXUP_FSC_S7020, |
| 1726 | }, |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1727 | [ALC260_FIXUP_VAIO_PINS] = { |
| 1728 | .type = HDA_FIXUP_PINS, |
| 1729 | .v.pins = (const struct hda_pintbl[]) { |
| 1730 | /* Pin configs are missing completely on some VAIOs */ |
| 1731 | { 0x0f, 0x01211020 }, |
| 1732 | { 0x10, 0x0001003f }, |
| 1733 | { 0x11, 0x411111f0 }, |
| 1734 | { 0x12, 0x01a15930 }, |
| 1735 | { 0x13, 0x411111f0 }, |
| 1736 | { 0x14, 0x411111f0 }, |
| 1737 | { 0x15, 0x411111f0 }, |
| 1738 | { 0x16, 0x411111f0 }, |
| 1739 | { 0x17, 0x411111f0 }, |
| 1740 | { 0x18, 0x411111f0 }, |
| 1741 | { 0x19, 0x411111f0 }, |
| 1742 | { } |
| 1743 | } |
| 1744 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1745 | }; |
| 1746 | |
| 1747 | static const struct snd_pci_quirk alc260_fixup_tbl[] = { |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1748 | SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1749 | SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), |
Takashi Iwai | 15317ab | 2012-02-16 12:02:53 +0100 | [diff] [blame] | 1750 | SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1751 | SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), |
Takashi Iwai | 0a1c4fa | 2012-02-16 12:42:30 +0100 | [diff] [blame] | 1752 | SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), |
Takashi Iwai | d08c5ef | 2013-11-22 08:06:36 +0100 | [diff] [blame] | 1753 | SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), |
Takashi Iwai | 0f5a5b8 | 2013-11-21 09:12:52 +0100 | [diff] [blame] | 1754 | 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] | 1755 | SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), |
Takashi Iwai | b1f5808 | 2012-02-16 12:45:03 +0100 | [diff] [blame] | 1756 | SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), |
Takashi Iwai | 118cb4a | 2012-04-19 07:33:27 +0200 | [diff] [blame] | 1757 | SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), |
Takashi Iwai | 20f7d92 | 2012-02-16 12:35:16 +0100 | [diff] [blame] | 1758 | SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), |
Takashi Iwai | ca8f042 | 2012-02-16 11:51:19 +0100 | [diff] [blame] | 1759 | SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1760 | {} |
| 1761 | }; |
| 1762 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1763 | static const struct hda_model_fixup alc260_fixup_models[] = { |
| 1764 | {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, |
| 1765 | {.id = ALC260_FIXUP_COEF, .name = "coef"}, |
| 1766 | {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, |
| 1767 | {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, |
| 1768 | {} |
| 1769 | }; |
| 1770 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1771 | /* |
| 1772 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1773 | static int patch_alc260(struct hda_codec *codec) |
| 1774 | { |
| 1775 | struct alc_spec *spec; |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1776 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1777 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1778 | err = alc_alloc_spec(codec, 0x07); |
| 1779 | if (err < 0) |
| 1780 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1781 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 1782 | spec = codec->spec; |
Takashi Iwai | ea46c3c | 2013-01-15 18:45:53 +0100 | [diff] [blame] | 1783 | /* as quite a few machines require HP amp for speaker outputs, |
| 1784 | * it's easier to enable it unconditionally; even if it's unneeded, |
| 1785 | * it's almost harmless. |
| 1786 | */ |
| 1787 | spec->gen.prefer_hp_amp = 1; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 1788 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1789 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 1790 | spec->shutup = alc_eapd_shutup; |
| 1791 | |
Takashi Iwai | 5ebd3bb | 2013-02-19 18:23:31 +0100 | [diff] [blame] | 1792 | snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, |
| 1793 | alc260_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1794 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1795 | |
Takashi Iwai | c3c2c9e | 2012-02-16 12:59:55 +0100 | [diff] [blame] | 1796 | /* automatic parse from the BIOS config */ |
| 1797 | err = alc260_parse_auto_config(codec); |
| 1798 | if (err < 0) |
| 1799 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1800 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 1801 | if (!spec->gen.no_analog) { |
| 1802 | err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); |
| 1803 | if (err < 0) |
| 1804 | goto error; |
| 1805 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1806 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1807 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 1808 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1809 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 1810 | |
| 1811 | error: |
| 1812 | alc_free(codec); |
| 1813 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1814 | } |
| 1815 | |
| 1816 | |
| 1817 | /* |
| 1818 | * ALC882/883/885/888/889 support |
| 1819 | * |
| 1820 | * ALC882 is almost identical with ALC880 but has cleaner and more flexible |
| 1821 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 1822 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 1823 | * 6-channel independent captures. |
| 1824 | * |
| 1825 | * In addition, an independent DAC for the multi-playback (not used in this |
| 1826 | * driver yet). |
| 1827 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1828 | |
| 1829 | /* |
| 1830 | * Pin config fixes |
| 1831 | */ |
| 1832 | enum { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1833 | ALC882_FIXUP_ABIT_AW9D_MAX, |
| 1834 | ALC882_FIXUP_LENOVO_Y530, |
| 1835 | ALC882_FIXUP_PB_M5210, |
| 1836 | ALC882_FIXUP_ACER_ASPIRE_7736, |
| 1837 | ALC882_FIXUP_ASUS_W90V, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 1838 | ALC889_FIXUP_CD, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 1839 | ALC889_FIXUP_FRONT_HP_NO_PRESENCE, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 1840 | ALC889_FIXUP_VAIO_TT, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 1841 | ALC888_FIXUP_EEE1601, |
Takashi Iwai | 177943a | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 1842 | ALC882_FIXUP_EAPD, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 1843 | ALC883_FIXUP_EAPD, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 1844 | ALC883_FIXUP_ACER_EAPD, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1845 | ALC882_FIXUP_GPIO1, |
| 1846 | ALC882_FIXUP_GPIO2, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 1847 | ALC882_FIXUP_GPIO3, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1848 | ALC889_FIXUP_COEF, |
| 1849 | ALC882_FIXUP_ASUS_W2JC, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 1850 | ALC882_FIXUP_ACER_ASPIRE_4930G, |
| 1851 | ALC882_FIXUP_ACER_ASPIRE_8930G, |
| 1852 | ALC882_FIXUP_ASPIRE_8930G_VERBS, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1853 | ALC885_FIXUP_MACPRO_GPIO, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1854 | ALC889_FIXUP_DAC_ROUTE, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1855 | ALC889_FIXUP_MBP_VREF, |
| 1856 | ALC889_FIXUP_IMAC91_VREF, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 1857 | ALC889_FIXUP_MBA11_VREF, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1858 | ALC889_FIXUP_MBA21_VREF, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 1859 | ALC889_FIXUP_MP11_VREF, |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 1860 | ALC889_FIXUP_MP41_VREF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 1861 | ALC882_FIXUP_INV_DMIC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1862 | ALC882_FIXUP_NO_PRIMARY_HP, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 1863 | ALC887_FIXUP_ASUS_BASS, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 1864 | ALC887_FIXUP_BASS_CHMAP, |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 1865 | ALC1220_FIXUP_GB_DUAL_CODECS, |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 1866 | ALC1220_FIXUP_CLEVO_P950, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 1867 | ALC1220_FIXUP_SYSTEM76_ORYP5, |
| 1868 | ALC1220_FIXUP_SYSTEM76_ORYP5_PINS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 1869 | }; |
| 1870 | |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1871 | static void alc889_fixup_coef(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1872 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1873 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1874 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1875 | return; |
Kailang Yang | 1df8874 | 2014-10-29 16:10:13 +0800 | [diff] [blame] | 1876 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 1877 | } |
| 1878 | |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1879 | /* set up GPIO at initialization */ |
| 1880 | static void alc885_fixup_macpro_gpio(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1881 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1882 | { |
Takashi Iwai | 215c850 | 2018-06-19 22:34:26 +0200 | [diff] [blame] | 1883 | struct alc_spec *spec = codec->spec; |
| 1884 | |
| 1885 | spec->gpio_write_delay = true; |
| 1886 | alc_fixup_gpio3(codec, fix, action); |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 1887 | } |
| 1888 | |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1889 | /* Fix the connection of some pins for ALC889: |
| 1890 | * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't |
| 1891 | * work correctly (bko#42740) |
| 1892 | */ |
| 1893 | static void alc889_fixup_dac_route(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1894 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1895 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1896 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1897 | /* fake the connections during parsing the tree */ |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1898 | hda_nid_t conn1[2] = { 0x0c, 0x0d }; |
| 1899 | hda_nid_t conn2[2] = { 0x0e, 0x0f }; |
| 1900 | snd_hda_override_conn_list(codec, 0x14, 2, conn1); |
| 1901 | snd_hda_override_conn_list(codec, 0x15, 2, conn1); |
| 1902 | snd_hda_override_conn_list(codec, 0x18, 2, conn2); |
| 1903 | snd_hda_override_conn_list(codec, 0x1a, 2, conn2); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1904 | } else if (action == HDA_FIXUP_ACT_PROBE) { |
Takashi Iwai | ef8d60f | 2012-02-17 10:12:38 +0100 | [diff] [blame] | 1905 | /* restore the connections */ |
| 1906 | hda_nid_t conn[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; |
| 1907 | snd_hda_override_conn_list(codec, 0x14, 5, conn); |
| 1908 | snd_hda_override_conn_list(codec, 0x15, 5, conn); |
| 1909 | snd_hda_override_conn_list(codec, 0x18, 5, conn); |
| 1910 | snd_hda_override_conn_list(codec, 0x1a, 5, conn); |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 1911 | } |
| 1912 | } |
| 1913 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1914 | /* Set VREF on HP pin */ |
| 1915 | static void alc889_fixup_mbp_vref(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1916 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1917 | { |
| 1918 | struct alc_spec *spec = codec->spec; |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 1919 | static hda_nid_t nids[3] = { 0x14, 0x15, 0x19 }; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1920 | int i; |
| 1921 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1922 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1923 | return; |
| 1924 | for (i = 0; i < ARRAY_SIZE(nids); i++) { |
| 1925 | unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); |
| 1926 | if (get_defcfg_device(val) != AC_JACK_HP_OUT) |
| 1927 | continue; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 1928 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1929 | val |= AC_PINCTL_VREF_80; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 1930 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1931 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1932 | break; |
| 1933 | } |
| 1934 | } |
| 1935 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1936 | static void alc889_fixup_mac_pins(struct hda_codec *codec, |
| 1937 | const hda_nid_t *nids, int num_nids) |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1938 | { |
| 1939 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1940 | int i; |
| 1941 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1942 | for (i = 0; i < num_nids; i++) { |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1943 | unsigned int val; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 1944 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1945 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 1946 | snd_hda_set_pin_ctl(codec, nids[i], val); |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1947 | } |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1948 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 1949 | } |
| 1950 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1951 | /* Set VREF on speaker pins on imac91 */ |
| 1952 | static void alc889_fixup_imac91_vref(struct hda_codec *codec, |
| 1953 | const struct hda_fixup *fix, int action) |
| 1954 | { |
| 1955 | static hda_nid_t nids[2] = { 0x18, 0x1a }; |
| 1956 | |
| 1957 | if (action == HDA_FIXUP_ACT_INIT) |
| 1958 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 1959 | } |
| 1960 | |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 1961 | /* Set VREF on speaker pins on mba11 */ |
| 1962 | static void alc889_fixup_mba11_vref(struct hda_codec *codec, |
| 1963 | const struct hda_fixup *fix, int action) |
| 1964 | { |
| 1965 | static hda_nid_t nids[1] = { 0x18 }; |
| 1966 | |
| 1967 | if (action == HDA_FIXUP_ACT_INIT) |
| 1968 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 1969 | } |
| 1970 | |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 1971 | /* Set VREF on speaker pins on mba21 */ |
| 1972 | static void alc889_fixup_mba21_vref(struct hda_codec *codec, |
| 1973 | const struct hda_fixup *fix, int action) |
| 1974 | { |
| 1975 | static hda_nid_t nids[2] = { 0x18, 0x19 }; |
| 1976 | |
| 1977 | if (action == HDA_FIXUP_ACT_INIT) |
| 1978 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); |
| 1979 | } |
| 1980 | |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1981 | /* Don't take HP output as primary |
Fernando Luis Vázquez Cao | d911149 | 2013-02-12 16:49:46 +0900 | [diff] [blame] | 1982 | * Strangely, the speaker output doesn't work on Vaio Z and some Vaio |
| 1983 | * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1984 | */ |
| 1985 | static void alc882_fixup_no_primary_hp(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 1986 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1987 | { |
| 1988 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 1989 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 1990 | spec->gen.no_primary_hp = 1; |
Takashi Iwai | da96fb5 | 2013-07-29 16:54:36 +0200 | [diff] [blame] | 1991 | spec->gen.no_multi_io = 1; |
| 1992 | } |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 1993 | } |
| 1994 | |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 1995 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
| 1996 | const struct hda_fixup *fix, int action); |
| 1997 | |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 1998 | /* For dual-codec configuration, we need to disable some features to avoid |
| 1999 | * conflicts of kctls and PCM streams |
| 2000 | */ |
| 2001 | static void alc_fixup_dual_codecs(struct hda_codec *codec, |
| 2002 | const struct hda_fixup *fix, int action) |
| 2003 | { |
| 2004 | struct alc_spec *spec = codec->spec; |
| 2005 | |
| 2006 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2007 | return; |
| 2008 | /* disable vmaster */ |
| 2009 | spec->gen.suppress_vmaster = 1; |
| 2010 | /* auto-mute and auto-mic switch don't work with multiple codecs */ |
| 2011 | spec->gen.suppress_auto_mute = 1; |
| 2012 | spec->gen.suppress_auto_mic = 1; |
| 2013 | /* disable aamix as well */ |
| 2014 | spec->gen.mixer_nid = 0; |
| 2015 | /* add location prefix to avoid conflicts */ |
| 2016 | codec->force_pin_prefix = 1; |
| 2017 | } |
| 2018 | |
| 2019 | static void rename_ctl(struct hda_codec *codec, const char *oldname, |
| 2020 | const char *newname) |
| 2021 | { |
| 2022 | struct snd_kcontrol *kctl; |
| 2023 | |
| 2024 | kctl = snd_hda_find_mixer_ctl(codec, oldname); |
| 2025 | if (kctl) |
| 2026 | strcpy(kctl->id.name, newname); |
| 2027 | } |
| 2028 | |
| 2029 | static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, |
| 2030 | const struct hda_fixup *fix, |
| 2031 | int action) |
| 2032 | { |
| 2033 | alc_fixup_dual_codecs(codec, fix, action); |
| 2034 | switch (action) { |
| 2035 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 2036 | /* override card longname to provide a unique UCM profile */ |
| 2037 | strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); |
| 2038 | break; |
| 2039 | case HDA_FIXUP_ACT_BUILD: |
| 2040 | /* rename Capture controls depending on the codec */ |
| 2041 | rename_ctl(codec, "Capture Volume", |
| 2042 | codec->addr == 0 ? |
| 2043 | "Rear-Panel Capture Volume" : |
| 2044 | "Front-Panel Capture Volume"); |
| 2045 | rename_ctl(codec, "Capture Switch", |
| 2046 | codec->addr == 0 ? |
| 2047 | "Rear-Panel Capture Switch" : |
| 2048 | "Front-Panel Capture Switch"); |
| 2049 | break; |
| 2050 | } |
| 2051 | } |
| 2052 | |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2053 | static void alc1220_fixup_clevo_p950(struct hda_codec *codec, |
| 2054 | const struct hda_fixup *fix, |
| 2055 | int action) |
| 2056 | { |
| 2057 | hda_nid_t conn1[1] = { 0x0c }; |
| 2058 | |
| 2059 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 2060 | return; |
| 2061 | |
| 2062 | alc_update_coef_idx(codec, 0x7, 0, 0x3c3); |
| 2063 | /* We therefore want to make sure 0x14 (front headphone) and |
| 2064 | * 0x1b (speakers) use the stereo DAC 0x02 |
| 2065 | */ |
| 2066 | snd_hda_override_conn_list(codec, 0x14, 1, conn1); |
| 2067 | snd_hda_override_conn_list(codec, 0x1b, 1, conn1); |
| 2068 | } |
| 2069 | |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2070 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
| 2071 | const struct hda_fixup *fix, int action); |
| 2072 | |
| 2073 | static void alc1220_fixup_system76_oryp5(struct hda_codec *codec, |
| 2074 | const struct hda_fixup *fix, |
| 2075 | int action) |
| 2076 | { |
| 2077 | alc1220_fixup_clevo_p950(codec, fix, action); |
| 2078 | alc_fixup_headset_mode_no_hp_mic(codec, fix, action); |
| 2079 | } |
| 2080 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2081 | static const struct hda_fixup alc882_fixups[] = { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2082 | [ALC882_FIXUP_ABIT_AW9D_MAX] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2083 | .type = HDA_FIXUP_PINS, |
| 2084 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2085 | { 0x15, 0x01080104 }, /* side */ |
| 2086 | { 0x16, 0x01011012 }, /* rear */ |
| 2087 | { 0x17, 0x01016011 }, /* clfe */ |
| 2088 | { } |
| 2089 | } |
| 2090 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2091 | [ALC882_FIXUP_LENOVO_Y530] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2092 | .type = HDA_FIXUP_PINS, |
| 2093 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2094 | { 0x15, 0x99130112 }, /* rear int speakers */ |
| 2095 | { 0x16, 0x99130111 }, /* subwoofer */ |
| 2096 | { } |
| 2097 | } |
| 2098 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2099 | [ALC882_FIXUP_PB_M5210] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2100 | .type = HDA_FIXUP_PINCTLS, |
| 2101 | .v.pins = (const struct hda_pintbl[]) { |
| 2102 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2103 | {} |
| 2104 | } |
| 2105 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2106 | [ALC882_FIXUP_ACER_ASPIRE_7736] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2107 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 2108 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2109 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2110 | [ALC882_FIXUP_ASUS_W90V] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2111 | .type = HDA_FIXUP_PINS, |
| 2112 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5cdf745 | 2011-10-26 23:04:08 +0200 | [diff] [blame] | 2113 | { 0x16, 0x99130110 }, /* fix sequence for CLFE */ |
| 2114 | { } |
| 2115 | } |
| 2116 | }, |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2117 | [ALC889_FIXUP_CD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2118 | .type = HDA_FIXUP_PINS, |
| 2119 | .v.pins = (const struct hda_pintbl[]) { |
Marton Balint | 8f23921 | 2012-03-05 21:33:23 +0100 | [diff] [blame] | 2120 | { 0x1c, 0x993301f0 }, /* CD */ |
| 2121 | { } |
| 2122 | } |
| 2123 | }, |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2124 | [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { |
| 2125 | .type = HDA_FIXUP_PINS, |
| 2126 | .v.pins = (const struct hda_pintbl[]) { |
| 2127 | { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ |
| 2128 | { } |
| 2129 | }, |
| 2130 | .chained = true, |
| 2131 | .chain_id = ALC889_FIXUP_CD, |
| 2132 | }, |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2133 | [ALC889_FIXUP_VAIO_TT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2134 | .type = HDA_FIXUP_PINS, |
| 2135 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2136 | { 0x17, 0x90170111 }, /* hidden surround speaker */ |
| 2137 | { } |
| 2138 | } |
| 2139 | }, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2140 | [ALC888_FIXUP_EEE1601] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2141 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2142 | .v.verbs = (const struct hda_verb[]) { |
| 2143 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2144 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, |
| 2145 | { } |
| 2146 | } |
Takashi Iwai | 177943a | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2147 | }, |
| 2148 | [ALC882_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2149 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 177943a | 2011-11-09 12:55:18 +0100 | [diff] [blame] | 2150 | .v.verbs = (const struct hda_verb[]) { |
| 2151 | /* change to EAPD mode */ |
| 2152 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2153 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, |
| 2154 | { } |
| 2155 | } |
| 2156 | }, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2157 | [ALC883_FIXUP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2158 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2159 | .v.verbs = (const struct hda_verb[]) { |
| 2160 | /* change to EAPD mode */ |
| 2161 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2162 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2163 | { } |
| 2164 | } |
| 2165 | }, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2166 | [ALC883_FIXUP_ACER_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2167 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2168 | .v.verbs = (const struct hda_verb[]) { |
| 2169 | /* eanable EAPD on Acer laptops */ |
| 2170 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2171 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2172 | { } |
| 2173 | } |
| 2174 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2175 | [ALC882_FIXUP_GPIO1] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2176 | .type = HDA_FIXUP_FUNC, |
| 2177 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2178 | }, |
| 2179 | [ALC882_FIXUP_GPIO2] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2180 | .type = HDA_FIXUP_FUNC, |
| 2181 | .v.func = alc_fixup_gpio2, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2182 | }, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2183 | [ALC882_FIXUP_GPIO3] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2184 | .type = HDA_FIXUP_FUNC, |
| 2185 | .v.func = alc_fixup_gpio3, |
Takashi Iwai | eb844d5 | 2011-11-09 18:03:07 +0100 | [diff] [blame] | 2186 | }, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2187 | [ALC882_FIXUP_ASUS_W2JC] = { |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 2188 | .type = HDA_FIXUP_FUNC, |
| 2189 | .v.func = alc_fixup_gpio1, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2190 | .chained = true, |
| 2191 | .chain_id = ALC882_FIXUP_EAPD, |
| 2192 | }, |
| 2193 | [ALC889_FIXUP_COEF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2194 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2195 | .v.func = alc889_fixup_coef, |
| 2196 | }, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2197 | [ALC882_FIXUP_ACER_ASPIRE_4930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2198 | .type = HDA_FIXUP_PINS, |
| 2199 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2200 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2201 | { 0x17, 0x99130112 }, /* surround speaker */ |
| 2202 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2203 | }, |
| 2204 | .chained = true, |
| 2205 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2206 | }, |
| 2207 | [ALC882_FIXUP_ACER_ASPIRE_8930G] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2208 | .type = HDA_FIXUP_PINS, |
| 2209 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2210 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
| 2211 | { 0x1b, 0x99130112 }, /* surround speaker */ |
| 2212 | { } |
| 2213 | }, |
| 2214 | .chained = true, |
| 2215 | .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, |
| 2216 | }, |
| 2217 | [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { |
| 2218 | /* additional init verbs for Acer Aspire 8930G */ |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2219 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2220 | .v.verbs = (const struct hda_verb[]) { |
| 2221 | /* Enable all DACs */ |
| 2222 | /* DAC DISABLE/MUTE 1? */ |
| 2223 | /* setting bits 1-5 disables DAC nids 0x02-0x06 |
| 2224 | * apparently. Init=0x38 */ |
| 2225 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, |
| 2226 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2227 | /* DAC DISABLE/MUTE 2? */ |
| 2228 | /* some bit here disables the other DACs. |
| 2229 | * Init=0x4900 */ |
| 2230 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, |
| 2231 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, |
| 2232 | /* DMIC fix |
| 2233 | * This laptop has a stereo digital microphone. |
| 2234 | * The mics are only 1cm apart which makes the stereo |
| 2235 | * useless. However, either the mic or the ALC889 |
| 2236 | * makes the signal become a difference/sum signal |
| 2237 | * instead of standard stereo, which is annoying. |
| 2238 | * So instead we flip this bit which makes the |
| 2239 | * codec replicate the sum signal to both channels, |
| 2240 | * turning it into a normal mono mic. |
| 2241 | */ |
| 2242 | /* DMIC_CONTROL? Init value = 0x0001 */ |
| 2243 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, |
| 2244 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, |
| 2245 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2246 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2247 | { } |
Takashi Iwai | 038d4fe | 2012-04-11 17:18:12 +0200 | [diff] [blame] | 2248 | }, |
| 2249 | .chained = true, |
| 2250 | .chain_id = ALC882_FIXUP_GPIO1, |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2251 | }, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2252 | [ALC885_FIXUP_MACPRO_GPIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2253 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2254 | .v.func = alc885_fixup_macpro_gpio, |
| 2255 | }, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2256 | [ALC889_FIXUP_DAC_ROUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2257 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2258 | .v.func = alc889_fixup_dac_route, |
| 2259 | }, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2260 | [ALC889_FIXUP_MBP_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2261 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2262 | .v.func = alc889_fixup_mbp_vref, |
| 2263 | .chained = true, |
| 2264 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2265 | }, |
| 2266 | [ALC889_FIXUP_IMAC91_VREF] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2267 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2268 | .v.func = alc889_fixup_imac91_vref, |
| 2269 | .chained = true, |
| 2270 | .chain_id = ALC882_FIXUP_GPIO1, |
| 2271 | }, |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2272 | [ALC889_FIXUP_MBA11_VREF] = { |
| 2273 | .type = HDA_FIXUP_FUNC, |
| 2274 | .v.func = alc889_fixup_mba11_vref, |
| 2275 | .chained = true, |
| 2276 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2277 | }, |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2278 | [ALC889_FIXUP_MBA21_VREF] = { |
| 2279 | .type = HDA_FIXUP_FUNC, |
| 2280 | .v.func = alc889_fixup_mba21_vref, |
| 2281 | .chained = true, |
| 2282 | .chain_id = ALC889_FIXUP_MBP_VREF, |
| 2283 | }, |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2284 | [ALC889_FIXUP_MP11_VREF] = { |
| 2285 | .type = HDA_FIXUP_FUNC, |
| 2286 | .v.func = alc889_fixup_mba11_vref, |
| 2287 | .chained = true, |
| 2288 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2289 | }, |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 2290 | [ALC889_FIXUP_MP41_VREF] = { |
| 2291 | .type = HDA_FIXUP_FUNC, |
| 2292 | .v.func = alc889_fixup_mbp_vref, |
| 2293 | .chained = true, |
| 2294 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, |
| 2295 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2296 | [ALC882_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2297 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2298 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2299 | }, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2300 | [ALC882_FIXUP_NO_PRIMARY_HP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2301 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2302 | .v.func = alc882_fixup_no_primary_hp, |
| 2303 | }, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2304 | [ALC887_FIXUP_ASUS_BASS] = { |
| 2305 | .type = HDA_FIXUP_PINS, |
| 2306 | .v.pins = (const struct hda_pintbl[]) { |
| 2307 | {0x16, 0x99130130}, /* bass speaker */ |
| 2308 | {} |
| 2309 | }, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 2310 | .chained = true, |
| 2311 | .chain_id = ALC887_FIXUP_BASS_CHMAP, |
| 2312 | }, |
| 2313 | [ALC887_FIXUP_BASS_CHMAP] = { |
| 2314 | .type = HDA_FIXUP_FUNC, |
| 2315 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2316 | }, |
Takashi Iwai | 7beb3a6 | 2017-04-10 18:05:52 +0200 | [diff] [blame] | 2317 | [ALC1220_FIXUP_GB_DUAL_CODECS] = { |
| 2318 | .type = HDA_FIXUP_FUNC, |
| 2319 | .v.func = alc1220_fixup_gb_dual_codecs, |
| 2320 | }, |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2321 | [ALC1220_FIXUP_CLEVO_P950] = { |
| 2322 | .type = HDA_FIXUP_FUNC, |
| 2323 | .v.func = alc1220_fixup_clevo_p950, |
| 2324 | }, |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2325 | [ALC1220_FIXUP_SYSTEM76_ORYP5] = { |
| 2326 | .type = HDA_FIXUP_FUNC, |
| 2327 | .v.func = alc1220_fixup_system76_oryp5, |
| 2328 | }, |
| 2329 | [ALC1220_FIXUP_SYSTEM76_ORYP5_PINS] = { |
| 2330 | .type = HDA_FIXUP_PINS, |
| 2331 | .v.pins = (const struct hda_pintbl[]) { |
| 2332 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 2333 | {} |
| 2334 | }, |
| 2335 | .chained = true, |
| 2336 | .chain_id = ALC1220_FIXUP_SYSTEM76_ORYP5, |
| 2337 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2338 | }; |
| 2339 | |
| 2340 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2341 | SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), |
| 2342 | SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | b5d724b | 2015-06-02 19:57:08 +0200 | [diff] [blame] | 2343 | SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | 8812c4f | 2011-11-09 17:39:15 +0100 | [diff] [blame] | 2344 | SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), |
| 2345 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
| 2346 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), |
| 2347 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), |
Takashi Iwai | c3e837b | 2011-11-10 16:01:47 +0100 | [diff] [blame] | 2348 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", |
| 2349 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2350 | SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", |
| 2351 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2352 | SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", |
| 2353 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2354 | SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", |
| 2355 | ALC882_FIXUP_ACER_ASPIRE_8930G), |
| 2356 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", |
| 2357 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2358 | SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", |
| 2359 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
| 2360 | SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", |
| 2361 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2362 | SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), |
Takashi Iwai | f5c53d8 | 2012-05-07 10:07:33 +0200 | [diff] [blame] | 2363 | SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", |
| 2364 | ALC882_FIXUP_ACER_ASPIRE_4930G), |
Takashi Iwai | 02a237b | 2012-02-13 15:25:07 +0100 | [diff] [blame] | 2365 | SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), |
Takashi Iwai | fe97da1 | 2012-04-12 08:00:19 +0200 | [diff] [blame] | 2366 | 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] | 2367 | 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] | 2368 | SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2369 | SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2370 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), |
Takashi Iwai | 0e7cc2e | 2011-11-09 12:42:48 +0100 | [diff] [blame] | 2371 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), |
Takashi Iwai | 1f0bbf0 | 2013-11-28 15:21:21 +0100 | [diff] [blame] | 2372 | SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), |
Takashi Iwai | 85bcf96 | 2016-12-06 16:20:36 +0100 | [diff] [blame] | 2373 | SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2374 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2375 | 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] | 2376 | 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] | 2377 | 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] | 2378 | 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] | 2379 | |
| 2380 | /* All Apple entries are in codec SSIDs */ |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2381 | SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), |
| 2382 | SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), |
| 2383 | SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | c20f31e | 2014-02-03 11:02:10 +0100 | [diff] [blame] | 2384 | SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2385 | SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), |
| 2386 | SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2387 | SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), |
| 2388 | SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2389 | SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), |
Adrien Vergé | e7729a4 | 2014-01-24 14:56:14 -0500 | [diff] [blame] | 2390 | SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 0756f09 | 2013-12-04 13:59:45 +0100 | [diff] [blame] | 2391 | SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2392 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), |
| 2393 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2394 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2395 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2396 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), |
| 2397 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), |
Mario Kleiner | 9f660a1 | 2015-12-22 00:45:43 +0100 | [diff] [blame] | 2398 | 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] | 2399 | SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2400 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), |
| 2401 | 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] | 2402 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), |
Takashi Iwai | 5671087 | 2011-11-14 17:42:11 +0100 | [diff] [blame] | 2403 | |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2404 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), |
David Henningsson | b2c53e2 | 2014-01-01 14:01:34 +0100 | [diff] [blame] | 2405 | 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] | 2406 | 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] | 2407 | SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), |
Takashi Iwai | 6369158 | 2017-05-22 16:32:46 +0200 | [diff] [blame] | 2408 | 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] | 2409 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
Takashi Iwai | 5c0ebfb | 2011-11-07 17:59:13 +0100 | [diff] [blame] | 2410 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
Peisen | 0202f5c | 2017-10-26 10:35:36 +0800 | [diff] [blame] | 2411 | SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), |
Takashi Iwai | f3d737b | 2018-07-17 17:08:32 +0200 | [diff] [blame] | 2412 | SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), |
Jeremy Soller | 2f0d520 | 2018-05-07 09:28:45 -0600 | [diff] [blame] | 2413 | SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), |
Jeremy Soller | 7f665b1 | 2019-02-13 10:56:19 -0700 | [diff] [blame] | 2414 | SND_PCI_QUIRK(0x1558, 0x96e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS), |
| 2415 | SND_PCI_QUIRK(0x1558, 0x97e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS), |
Takashi Iwai | 7a6069b | 2011-11-09 15:22:01 +0100 | [diff] [blame] | 2416 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), |
| 2417 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), |
Takashi Iwai | ac9b1cd | 2011-11-09 17:45:55 +0100 | [diff] [blame] | 2418 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), |
Takashi Iwai | 68ef056 | 2011-11-09 18:24:44 +0100 | [diff] [blame] | 2419 | SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2420 | {} |
| 2421 | }; |
| 2422 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2423 | static const struct hda_model_fixup alc882_fixup_models[] = { |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2424 | {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"}, |
| 2425 | {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"}, |
| 2426 | {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"}, |
| 2427 | {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"}, |
| 2428 | {.id = ALC889_FIXUP_CD, .name = "cd"}, |
| 2429 | {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"}, |
| 2430 | {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"}, |
| 2431 | {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"}, |
| 2432 | {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"}, |
| 2433 | {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"}, |
| 2434 | {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"}, |
| 2435 | {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"}, |
| 2436 | {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"}, |
| 2437 | {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"}, |
| 2438 | {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"}, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2439 | {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, |
| 2440 | {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, |
| 2441 | {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2442 | {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"}, |
| 2443 | {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"}, |
| 2444 | {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"}, |
| 2445 | {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"}, |
| 2446 | {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"}, |
| 2447 | {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"}, |
| 2448 | {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"}, |
| 2449 | {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2450 | {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | e427c23 | 2012-07-29 10:04:08 +0200 | [diff] [blame] | 2451 | {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2452 | {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 2453 | {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, |
Takashi Iwai | 772c291 | 2018-06-26 17:17:53 +0200 | [diff] [blame] | 2454 | {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"}, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2455 | {} |
| 2456 | }; |
| 2457 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2458 | /* |
| 2459 | * BIOS auto configuration |
| 2460 | */ |
| 2461 | /* almost identical with ALC880 parser... */ |
| 2462 | static int alc882_parse_auto_config(struct hda_codec *codec) |
| 2463 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2464 | static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2465 | static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2466 | return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2467 | } |
| 2468 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2469 | /* |
| 2470 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2471 | static int patch_alc882(struct hda_codec *codec) |
| 2472 | { |
| 2473 | struct alc_spec *spec; |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2474 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2475 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2476 | err = alc_alloc_spec(codec, 0x0b); |
| 2477 | if (err < 0) |
| 2478 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2479 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2480 | spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2481 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 2482 | switch (codec->core.vendor_id) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2483 | case 0x10ec0882: |
| 2484 | case 0x10ec0885: |
Takashi Iwai | acf0808 | 2014-09-02 07:21:56 +0200 | [diff] [blame] | 2485 | case 0x10ec0900: |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 2486 | case 0x10ec1220: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2487 | break; |
| 2488 | default: |
| 2489 | /* ALC883 and variants */ |
| 2490 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2491 | break; |
| 2492 | } |
| 2493 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2494 | snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, |
Takashi Iwai | 912093b | 2012-04-11 14:03:41 +0200 | [diff] [blame] | 2495 | alc882_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2496 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2497 | |
| 2498 | alc_auto_parse_customize_define(codec); |
| 2499 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2500 | if (has_cdefine_beep(codec)) |
| 2501 | spec->gen.beep_nid = 0x01; |
| 2502 | |
Takashi Iwai | 1a97b7f | 2012-02-21 11:11:48 +0100 | [diff] [blame] | 2503 | /* automatic parse from the BIOS config */ |
| 2504 | err = alc882_parse_auto_config(codec); |
| 2505 | if (err < 0) |
| 2506 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2507 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 2508 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
| 2509 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2510 | if (err < 0) |
| 2511 | goto error; |
| 2512 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2513 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2514 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2515 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2516 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2517 | |
| 2518 | error: |
| 2519 | alc_free(codec); |
| 2520 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2521 | } |
| 2522 | |
| 2523 | |
| 2524 | /* |
| 2525 | * ALC262 support |
| 2526 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2527 | static int alc262_parse_auto_config(struct hda_codec *codec) |
| 2528 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2529 | static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2530 | static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2531 | return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2532 | } |
| 2533 | |
| 2534 | /* |
| 2535 | * Pin config fixes |
| 2536 | */ |
| 2537 | enum { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2538 | ALC262_FIXUP_FSC_H270, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2539 | ALC262_FIXUP_FSC_S7110, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2540 | ALC262_FIXUP_HP_Z200, |
| 2541 | ALC262_FIXUP_TYAN, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2542 | ALC262_FIXUP_LENOVO_3000, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2543 | ALC262_FIXUP_BENQ, |
| 2544 | ALC262_FIXUP_BENQ_T31, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2545 | ALC262_FIXUP_INV_DMIC, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2546 | ALC262_FIXUP_INTEL_BAYLEYBAY, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2547 | }; |
| 2548 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2549 | static const struct hda_fixup alc262_fixups[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2550 | [ALC262_FIXUP_FSC_H270] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2551 | .type = HDA_FIXUP_PINS, |
| 2552 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2553 | { 0x14, 0x99130110 }, /* speaker */ |
| 2554 | { 0x15, 0x0221142f }, /* front HP */ |
| 2555 | { 0x1b, 0x0121141f }, /* rear HP */ |
| 2556 | { } |
| 2557 | } |
| 2558 | }, |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2559 | [ALC262_FIXUP_FSC_S7110] = { |
| 2560 | .type = HDA_FIXUP_PINS, |
| 2561 | .v.pins = (const struct hda_pintbl[]) { |
| 2562 | { 0x15, 0x90170110 }, /* speaker */ |
| 2563 | { } |
| 2564 | }, |
| 2565 | .chained = true, |
| 2566 | .chain_id = ALC262_FIXUP_BENQ, |
| 2567 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2568 | [ALC262_FIXUP_HP_Z200] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2569 | .type = HDA_FIXUP_PINS, |
| 2570 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2571 | { 0x16, 0x99130120 }, /* internal speaker */ |
| 2572 | { } |
| 2573 | } |
| 2574 | }, |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2575 | [ALC262_FIXUP_TYAN] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2576 | .type = HDA_FIXUP_PINS, |
| 2577 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2578 | { 0x14, 0x1993e1f0 }, /* int AUX */ |
| 2579 | { } |
| 2580 | } |
| 2581 | }, |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2582 | [ALC262_FIXUP_LENOVO_3000] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 2583 | .type = HDA_FIXUP_PINCTLS, |
| 2584 | .v.pins = (const struct hda_pintbl[]) { |
| 2585 | { 0x19, PIN_VREF50 }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2586 | {} |
| 2587 | }, |
| 2588 | .chained = true, |
| 2589 | .chain_id = ALC262_FIXUP_BENQ, |
| 2590 | }, |
| 2591 | [ALC262_FIXUP_BENQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2592 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2593 | .v.verbs = (const struct hda_verb[]) { |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2594 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2595 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, |
| 2596 | {} |
| 2597 | } |
| 2598 | }, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2599 | [ALC262_FIXUP_BENQ_T31] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2600 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2601 | .v.verbs = (const struct hda_verb[]) { |
| 2602 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
| 2603 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, |
| 2604 | {} |
| 2605 | } |
| 2606 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2607 | [ALC262_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2608 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2609 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2610 | }, |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2611 | [ALC262_FIXUP_INTEL_BAYLEYBAY] = { |
| 2612 | .type = HDA_FIXUP_FUNC, |
| 2613 | .v.func = alc_fixup_no_depop_delay, |
| 2614 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2615 | }; |
| 2616 | |
| 2617 | static const struct snd_pci_quirk alc262_fixup_tbl[] = { |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2618 | SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), |
Takashi Iwai | 7513e6d | 2013-01-18 15:41:34 +0100 | [diff] [blame] | 2619 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), |
Takashi Iwai | 3dcd3be | 2011-11-07 14:59:40 +0100 | [diff] [blame] | 2620 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2621 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), |
Takashi Iwai | 275ec0c | 2018-06-22 12:17:45 +0200 | [diff] [blame] | 2622 | SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270), |
Takashi Iwai | ea4e7af | 2011-11-07 12:23:55 +0100 | [diff] [blame] | 2623 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), |
Takashi Iwai | c470150 | 2011-11-07 14:20:07 +0100 | [diff] [blame] | 2624 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), |
Takashi Iwai | b42590b | 2011-11-07 14:41:01 +0100 | [diff] [blame] | 2625 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), |
| 2626 | SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), |
Mengdong Lin | b5c6611 | 2013-11-29 00:35:35 -0500 | [diff] [blame] | 2627 | SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2628 | {} |
| 2629 | }; |
| 2630 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2631 | static const struct hda_model_fixup alc262_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2632 | {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | e43c44d | 2018-06-26 17:02:08 +0200 | [diff] [blame] | 2633 | {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"}, |
| 2634 | {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"}, |
| 2635 | {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"}, |
| 2636 | {.id = ALC262_FIXUP_TYAN, .name = "tyan"}, |
| 2637 | {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"}, |
| 2638 | {.id = ALC262_FIXUP_BENQ, .name = "benq"}, |
| 2639 | {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"}, |
| 2640 | {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2641 | {} |
| 2642 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2643 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2644 | /* |
| 2645 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2646 | static int patch_alc262(struct hda_codec *codec) |
| 2647 | { |
| 2648 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2649 | int err; |
| 2650 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2651 | err = alc_alloc_spec(codec, 0x0b); |
| 2652 | if (err < 0) |
| 2653 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2654 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2655 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2656 | spec->gen.shared_mic_vref_pin = 0x18; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2657 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 2658 | spec->shutup = alc_eapd_shutup; |
| 2659 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2660 | #if 0 |
| 2661 | /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is |
| 2662 | * under-run |
| 2663 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2664 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2665 | #endif |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2666 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
| 2667 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2668 | snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2669 | alc262_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2670 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2671 | |
Takashi Iwai | af741c1 | 2012-05-07 18:09:48 +0200 | [diff] [blame] | 2672 | alc_auto_parse_customize_define(codec); |
| 2673 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2674 | if (has_cdefine_beep(codec)) |
| 2675 | spec->gen.beep_nid = 0x01; |
| 2676 | |
Takashi Iwai | 42399f7 | 2011-11-07 17:18:44 +0100 | [diff] [blame] | 2677 | /* automatic parse from the BIOS config */ |
| 2678 | err = alc262_parse_auto_config(codec); |
| 2679 | if (err < 0) |
| 2680 | goto error; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2681 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 2682 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
| 2683 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 2684 | if (err < 0) |
| 2685 | goto error; |
| 2686 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2687 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2688 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 2689 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2690 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2691 | |
| 2692 | error: |
| 2693 | alc_free(codec); |
| 2694 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2695 | } |
| 2696 | |
| 2697 | /* |
| 2698 | * ALC268 |
| 2699 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2700 | /* bind Beep switches of both NID 0x0f and 0x10 */ |
Takashi Iwai | a717777 | 2017-05-10 12:04:08 +0200 | [diff] [blame] | 2701 | static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol, |
| 2702 | struct snd_ctl_elem_value *ucontrol) |
| 2703 | { |
| 2704 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
| 2705 | unsigned long pval; |
| 2706 | int err; |
| 2707 | |
| 2708 | mutex_lock(&codec->control_mutex); |
| 2709 | pval = kcontrol->private_value; |
| 2710 | kcontrol->private_value = (pval & ~0xff) | 0x0f; |
| 2711 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); |
| 2712 | if (err >= 0) { |
| 2713 | kcontrol->private_value = (pval & ~0xff) | 0x10; |
| 2714 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); |
| 2715 | } |
| 2716 | kcontrol->private_value = pval; |
| 2717 | mutex_unlock(&codec->control_mutex); |
| 2718 | return err; |
| 2719 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2720 | |
| 2721 | static const struct snd_kcontrol_new alc268_beep_mixer[] = { |
| 2722 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), |
Takashi Iwai | a717777 | 2017-05-10 12:04:08 +0200 | [diff] [blame] | 2723 | { |
| 2724 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
| 2725 | .name = "Beep Playback Switch", |
| 2726 | .subdevice = HDA_SUBDEV_AMP_FLAG, |
| 2727 | .info = snd_hda_mixer_amp_switch_info, |
| 2728 | .get = snd_hda_mixer_amp_switch_get, |
| 2729 | .put = alc268_beep_switch_put, |
| 2730 | .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT) |
| 2731 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2732 | }; |
| 2733 | |
| 2734 | /* set PCBEEP vol = 0, mute connections */ |
| 2735 | static const struct hda_verb alc268_beep_init_verbs[] = { |
| 2736 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
| 2737 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2738 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
| 2739 | { } |
| 2740 | }; |
| 2741 | |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2742 | enum { |
| 2743 | ALC268_FIXUP_INV_DMIC, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2744 | ALC268_FIXUP_HP_EAPD, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2745 | ALC268_FIXUP_SPDIF, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2746 | }; |
| 2747 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2748 | static const struct hda_fixup alc268_fixups[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2749 | [ALC268_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2750 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 2751 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2752 | }, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2753 | [ALC268_FIXUP_HP_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2754 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2755 | .v.verbs = (const struct hda_verb[]) { |
| 2756 | {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 2757 | {} |
| 2758 | } |
| 2759 | }, |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2760 | [ALC268_FIXUP_SPDIF] = { |
| 2761 | .type = HDA_FIXUP_PINS, |
| 2762 | .v.pins = (const struct hda_pintbl[]) { |
| 2763 | { 0x1e, 0x014b1180 }, /* enable SPDIF out */ |
| 2764 | {} |
| 2765 | } |
| 2766 | }, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2767 | }; |
| 2768 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2769 | static const struct hda_model_fixup alc268_fixup_models[] = { |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2770 | {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2771 | {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, |
Takashi Iwai | 03bf11c | 2018-06-26 16:56:41 +0200 | [diff] [blame] | 2772 | {.id = ALC268_FIXUP_SPDIF, .name = "spdif"}, |
Takashi Iwai | cb76640 | 2012-10-20 10:55:21 +0200 | [diff] [blame] | 2773 | {} |
| 2774 | }; |
| 2775 | |
| 2776 | static const struct snd_pci_quirk alc268_fixup_tbl[] = { |
Takashi Iwai | 24eff32 | 2013-11-04 18:21:08 +0100 | [diff] [blame] | 2777 | SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), |
David Henningsson | fcd8f3b | 2013-01-28 05:45:47 +0100 | [diff] [blame] | 2778 | 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] | 2779 | /* below is codec SSID since multiple Toshiba laptops have the |
| 2780 | * same PCI SSID 1179:ff00 |
| 2781 | */ |
| 2782 | SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2783 | {} |
| 2784 | }; |
| 2785 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2786 | /* |
| 2787 | * BIOS auto configuration |
| 2788 | */ |
| 2789 | static int alc268_parse_auto_config(struct hda_codec *codec) |
| 2790 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2791 | static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2792 | return alc_parse_auto_config(codec, NULL, alc268_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2793 | } |
| 2794 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2795 | /* |
| 2796 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2797 | static int patch_alc268(struct hda_codec *codec) |
| 2798 | { |
| 2799 | struct alc_spec *spec; |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 2800 | int i, err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2801 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2802 | /* ALC268 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 2803 | err = alc_alloc_spec(codec, 0); |
| 2804 | if (err < 0) |
| 2805 | return err; |
| 2806 | |
| 2807 | spec = codec->spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2808 | spec->gen.beep_nid = 0x01; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2809 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 2810 | spec->shutup = alc_eapd_shutup; |
| 2811 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2812 | snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); |
| 2813 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2814 | |
Takashi Iwai | 6ebb805 | 2011-08-16 15:15:40 +0200 | [diff] [blame] | 2815 | /* automatic parse from the BIOS config */ |
| 2816 | err = alc268_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2817 | if (err < 0) |
| 2818 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2819 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2820 | if (err > 0 && !spec->gen.no_analog && |
| 2821 | spec->gen.autocfg.speaker_pins[0] != 0x1d) { |
Takashi Iwai | a5cb463 | 2018-06-20 12:50:11 +0200 | [diff] [blame] | 2822 | for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) { |
| 2823 | if (!snd_hda_gen_add_kctl(&spec->gen, NULL, |
| 2824 | &alc268_beep_mixer[i])) { |
| 2825 | err = -ENOMEM; |
| 2826 | goto error; |
| 2827 | } |
| 2828 | } |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 2829 | snd_hda_add_verbs(codec, alc268_beep_init_verbs); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2830 | if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) |
| 2831 | /* override the amp caps for beep generator */ |
| 2832 | snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, |
| 2833 | (0x0c << AC_AMPCAP_OFFSET_SHIFT) | |
| 2834 | (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 2835 | (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 2836 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 2837 | } |
| 2838 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 2839 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 2840 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2841 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 2842 | |
| 2843 | error: |
| 2844 | alc_free(codec); |
| 2845 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2846 | } |
| 2847 | |
| 2848 | /* |
| 2849 | * ALC269 |
| 2850 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 2851 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2852 | static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2853 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2854 | }; |
| 2855 | |
| 2856 | static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2857 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2858 | }; |
| 2859 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2860 | /* different alc269-variants */ |
| 2861 | enum { |
| 2862 | ALC269_TYPE_ALC269VA, |
| 2863 | ALC269_TYPE_ALC269VB, |
| 2864 | ALC269_TYPE_ALC269VC, |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2865 | ALC269_TYPE_ALC269VD, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2866 | ALC269_TYPE_ALC280, |
| 2867 | ALC269_TYPE_ALC282, |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2868 | ALC269_TYPE_ALC283, |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2869 | ALC269_TYPE_ALC284, |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 2870 | ALC269_TYPE_ALC293, |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 2871 | ALC269_TYPE_ALC286, |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 2872 | ALC269_TYPE_ALC298, |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 2873 | ALC269_TYPE_ALC255, |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 2874 | ALC269_TYPE_ALC256, |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 2875 | ALC269_TYPE_ALC257, |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 2876 | ALC269_TYPE_ALC215, |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 2877 | ALC269_TYPE_ALC225, |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 2878 | ALC269_TYPE_ALC294, |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 2879 | ALC269_TYPE_ALC300, |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 2880 | ALC269_TYPE_ALC700, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2881 | }; |
| 2882 | |
| 2883 | /* |
| 2884 | * BIOS auto configuration |
| 2885 | */ |
| 2886 | static int alc269_parse_auto_config(struct hda_codec *codec) |
| 2887 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2888 | static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2889 | static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; |
| 2890 | static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 2891 | struct alc_spec *spec = codec->spec; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2892 | const hda_nid_t *ssids; |
| 2893 | |
| 2894 | switch (spec->codec_variant) { |
| 2895 | case ALC269_TYPE_ALC269VA: |
| 2896 | case ALC269_TYPE_ALC269VC: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2897 | case ALC269_TYPE_ALC280: |
| 2898 | case ALC269_TYPE_ALC284: |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 2899 | case ALC269_TYPE_ALC293: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2900 | ssids = alc269va_ssids; |
| 2901 | break; |
| 2902 | case ALC269_TYPE_ALC269VB: |
| 2903 | case ALC269_TYPE_ALC269VD: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 2904 | case ALC269_TYPE_ALC282: |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 2905 | case ALC269_TYPE_ALC283: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 2906 | case ALC269_TYPE_ALC286: |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 2907 | case ALC269_TYPE_ALC298: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 2908 | case ALC269_TYPE_ALC255: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 2909 | case ALC269_TYPE_ALC256: |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 2910 | case ALC269_TYPE_ALC257: |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 2911 | case ALC269_TYPE_ALC215: |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 2912 | case ALC269_TYPE_ALC225: |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 2913 | case ALC269_TYPE_ALC294: |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 2914 | case ALC269_TYPE_ALC300: |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 2915 | case ALC269_TYPE_ALC700: |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2916 | ssids = alc269_ssids; |
| 2917 | break; |
| 2918 | default: |
| 2919 | ssids = alc269_ssids; |
| 2920 | break; |
| 2921 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2922 | |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 2923 | return alc_parse_auto_config(codec, alc269_ignore, ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2924 | } |
| 2925 | |
Kailang Yang | f7ae9ba | 2014-06-30 16:10:37 +0800 | [diff] [blame] | 2926 | static int find_ext_mic_pin(struct hda_codec *codec); |
| 2927 | |
| 2928 | static void alc286_shutup(struct hda_codec *codec) |
| 2929 | { |
Takashi Iwai | a9c2dfc | 2018-04-23 17:24:56 +0200 | [diff] [blame] | 2930 | const struct hda_pincfg *pin; |
Kailang Yang | f7ae9ba | 2014-06-30 16:10:37 +0800 | [diff] [blame] | 2931 | int i; |
| 2932 | int mic_pin = find_ext_mic_pin(codec); |
| 2933 | /* don't shut up pins when unloading the driver; otherwise it breaks |
| 2934 | * the default pin setup at the next load of the driver |
| 2935 | */ |
| 2936 | if (codec->bus->shutdown) |
| 2937 | return; |
Takashi Iwai | a9c2dfc | 2018-04-23 17:24:56 +0200 | [diff] [blame] | 2938 | snd_array_for_each(&codec->init_pins, i, pin) { |
Kailang Yang | f7ae9ba | 2014-06-30 16:10:37 +0800 | [diff] [blame] | 2939 | /* use read here for syncing after issuing each verb */ |
| 2940 | if (pin->nid != mic_pin) |
| 2941 | snd_hda_codec_read(codec, pin->nid, 0, |
| 2942 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); |
| 2943 | } |
| 2944 | codec->pins_shutup = 1; |
| 2945 | } |
| 2946 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 2947 | 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] | 2948 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 2949 | 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] | 2950 | } |
| 2951 | |
| 2952 | static void alc269_shutup(struct hda_codec *codec) |
| 2953 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 2954 | struct alc_spec *spec = codec->spec; |
| 2955 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 2956 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 2957 | alc269vb_toggle_power_output(codec, 0); |
| 2958 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
| 2959 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2960 | msleep(150); |
| 2961 | } |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 2962 | alc_shutup_pins(codec); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 2963 | } |
| 2964 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2965 | static struct coef_fw alc282_coefs[] = { |
| 2966 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 32fa7e4 | 2014-10-24 16:26:01 +0800 | [diff] [blame] | 2967 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 2968 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 2969 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 2970 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 2971 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 2972 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 2973 | WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ |
| 2974 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 2975 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 2976 | WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ |
| 2977 | UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ |
| 2978 | WRITE_COEF(0x34, 0xa0c0), /* ANC */ |
| 2979 | UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ |
| 2980 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 2981 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 2982 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 2983 | WRITE_COEF(0x63, 0x2902), /* PLL */ |
| 2984 | WRITE_COEF(0x68, 0xa080), /* capless control 2 */ |
| 2985 | WRITE_COEF(0x69, 0x3400), /* capless control 3 */ |
| 2986 | WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ |
| 2987 | WRITE_COEF(0x6b, 0x0), /* capless control 5 */ |
| 2988 | UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ |
| 2989 | WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ |
| 2990 | UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ |
| 2991 | WRITE_COEF(0x71, 0x0014), /* class D test 6 */ |
| 2992 | WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ |
| 2993 | UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ |
| 2994 | WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ |
| 2995 | {} |
| 2996 | }; |
| 2997 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 2998 | static void alc282_restore_default_value(struct hda_codec *codec) |
| 2999 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3000 | alc_process_coef_fw(codec, alc282_coefs); |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3001 | } |
| 3002 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3003 | static void alc282_init(struct hda_codec *codec) |
| 3004 | { |
| 3005 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3006 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3007 | bool hp_pin_sense; |
| 3008 | int coef78; |
| 3009 | |
Kailang Yang | cb149cb | 2014-03-18 16:45:32 +0800 | [diff] [blame] | 3010 | alc282_restore_default_value(codec); |
| 3011 | |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3012 | if (!hp_pin) |
| 3013 | return; |
| 3014 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3015 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 3016 | |
| 3017 | /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ |
| 3018 | /* Headphone capless set to high power mode */ |
| 3019 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 3020 | |
| 3021 | if (hp_pin_sense) |
| 3022 | msleep(2); |
| 3023 | |
| 3024 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3025 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3026 | |
| 3027 | if (hp_pin_sense) |
| 3028 | msleep(85); |
| 3029 | |
| 3030 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3031 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3032 | |
| 3033 | if (hp_pin_sense) |
| 3034 | msleep(100); |
| 3035 | |
| 3036 | /* Headphone capless set to normal mode */ |
| 3037 | alc_write_coef_idx(codec, 0x78, coef78); |
| 3038 | } |
| 3039 | |
| 3040 | static void alc282_shutup(struct hda_codec *codec) |
| 3041 | { |
| 3042 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3043 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3044 | bool hp_pin_sense; |
| 3045 | int coef78; |
| 3046 | |
| 3047 | if (!hp_pin) { |
| 3048 | alc269_shutup(codec); |
| 3049 | return; |
| 3050 | } |
| 3051 | |
| 3052 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3053 | coef78 = alc_read_coef_idx(codec, 0x78); |
| 3054 | alc_write_coef_idx(codec, 0x78, 0x9004); |
| 3055 | |
| 3056 | if (hp_pin_sense) |
| 3057 | msleep(2); |
| 3058 | |
| 3059 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3060 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3061 | |
| 3062 | if (hp_pin_sense) |
| 3063 | msleep(85); |
| 3064 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3065 | if (!spec->no_shutup_pins) |
| 3066 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3067 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3068 | |
| 3069 | if (hp_pin_sense) |
| 3070 | msleep(100); |
| 3071 | |
| 3072 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3073 | alc_shutup_pins(codec); |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 3074 | alc_write_coef_idx(codec, 0x78, coef78); |
| 3075 | } |
| 3076 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3077 | static struct coef_fw alc283_coefs[] = { |
| 3078 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 3079 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3080 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
| 3081 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ |
| 3082 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ |
| 3083 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ |
| 3084 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ |
| 3085 | WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ |
| 3086 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ |
| 3087 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ |
| 3088 | WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ |
| 3089 | UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ |
| 3090 | WRITE_COEF(0x22, 0xa0c0), /* ANC */ |
| 3091 | UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ |
| 3092 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ |
| 3093 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ |
| 3094 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ |
| 3095 | WRITE_COEF(0x2e, 0x2902), /* PLL */ |
| 3096 | WRITE_COEF(0x33, 0xa080), /* capless control 2 */ |
| 3097 | WRITE_COEF(0x34, 0x3400), /* capless control 3 */ |
| 3098 | WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ |
| 3099 | WRITE_COEF(0x36, 0x0), /* capless control 5 */ |
| 3100 | UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ |
| 3101 | WRITE_COEF(0x39, 0x110a), /* class D test 3 */ |
| 3102 | UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ |
| 3103 | WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ |
| 3104 | WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ |
| 3105 | UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ |
| 3106 | WRITE_COEF(0x49, 0x0), /* test mode */ |
| 3107 | UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ |
| 3108 | UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ |
| 3109 | WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ |
Kailang Yang | 5677986 | 2014-10-24 16:17:51 +0800 | [diff] [blame] | 3110 | UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */ |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3111 | {} |
| 3112 | }; |
| 3113 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3114 | static void alc283_restore_default_value(struct hda_codec *codec) |
| 3115 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 3116 | alc_process_coef_fw(codec, alc283_coefs); |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3117 | } |
| 3118 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3119 | static void alc283_init(struct hda_codec *codec) |
| 3120 | { |
| 3121 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3122 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3123 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3124 | |
Kailang Yang | 6bd55b0 | 2014-03-17 13:51:27 +0800 | [diff] [blame] | 3125 | alc283_restore_default_value(codec); |
| 3126 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3127 | if (!hp_pin) |
| 3128 | return; |
Kailang Yang | a59d719 | 2015-04-08 16:34:00 +0800 | [diff] [blame] | 3129 | |
| 3130 | msleep(30); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3131 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3132 | |
| 3133 | /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ |
| 3134 | /* Headphone capless set to high power mode */ |
| 3135 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 3136 | |
| 3137 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3138 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3139 | |
| 3140 | if (hp_pin_sense) |
| 3141 | msleep(85); |
| 3142 | |
| 3143 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3144 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3145 | |
| 3146 | if (hp_pin_sense) |
| 3147 | msleep(85); |
| 3148 | /* Index 0x46 Combo jack auto switch control 2 */ |
| 3149 | /* 3k pull low control for Headset jack. */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3150 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3151 | /* Headphone capless set to normal mode */ |
| 3152 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3153 | } |
| 3154 | |
| 3155 | static void alc283_shutup(struct hda_codec *codec) |
| 3156 | { |
| 3157 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3158 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3159 | bool hp_pin_sense; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3160 | |
| 3161 | if (!hp_pin) { |
| 3162 | alc269_shutup(codec); |
| 3163 | return; |
| 3164 | } |
| 3165 | |
| 3166 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3167 | |
| 3168 | alc_write_coef_idx(codec, 0x43, 0x9004); |
| 3169 | |
Harsha Priya | b450b17 | 2014-10-09 11:04:56 +0000 | [diff] [blame] | 3170 | /*depop hp during suspend*/ |
| 3171 | alc_write_coef_idx(codec, 0x06, 0x2100); |
| 3172 | |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3173 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3174 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3175 | |
| 3176 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3177 | msleep(100); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3178 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3179 | if (!spec->no_shutup_pins) |
| 3180 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3181 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3182 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3183 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3184 | |
| 3185 | if (hp_pin_sense) |
Kailang Yang | 88011c09 | 2013-10-24 15:45:24 +0200 | [diff] [blame] | 3186 | msleep(100); |
Kailang Yang | 0435b3f | 2014-04-08 17:14:14 +0800 | [diff] [blame] | 3187 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3188 | alc_shutup_pins(codec); |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 3189 | alc_write_coef_idx(codec, 0x43, 0x9614); |
| 3190 | } |
| 3191 | |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3192 | static void alc256_init(struct hda_codec *codec) |
| 3193 | { |
| 3194 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3195 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3196 | bool hp_pin_sense; |
| 3197 | |
| 3198 | if (!hp_pin) |
| 3199 | return; |
| 3200 | |
| 3201 | msleep(30); |
| 3202 | |
| 3203 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3204 | |
| 3205 | if (hp_pin_sense) |
| 3206 | msleep(2); |
| 3207 | |
| 3208 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ |
| 3209 | |
| 3210 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3211 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3212 | |
| 3213 | if (hp_pin_sense) |
| 3214 | msleep(85); |
| 3215 | |
| 3216 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3217 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3218 | |
| 3219 | if (hp_pin_sense) |
| 3220 | msleep(100); |
| 3221 | |
| 3222 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
| 3223 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ |
Kailang Yang | 88d42b2 | 2018-03-14 16:08:57 +0800 | [diff] [blame] | 3224 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ |
| 3225 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3226 | } |
| 3227 | |
| 3228 | static void alc256_shutup(struct hda_codec *codec) |
| 3229 | { |
| 3230 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3231 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3232 | bool hp_pin_sense; |
| 3233 | |
| 3234 | if (!hp_pin) { |
| 3235 | alc269_shutup(codec); |
| 3236 | return; |
| 3237 | } |
| 3238 | |
| 3239 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3240 | |
| 3241 | if (hp_pin_sense) |
| 3242 | msleep(2); |
| 3243 | |
| 3244 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3245 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3246 | |
| 3247 | if (hp_pin_sense) |
| 3248 | msleep(85); |
| 3249 | |
Takashi Iwai | 1c9609e | 2018-01-19 14:18:34 +0100 | [diff] [blame] | 3250 | /* 3k pull low control for Headset jack. */ |
| 3251 | /* NOTE: call this before clearing the pin, otherwise codec stalls */ |
| 3252 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
| 3253 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3254 | if (!spec->no_shutup_pins) |
| 3255 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3256 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3257 | |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3258 | if (hp_pin_sense) |
| 3259 | msleep(100); |
| 3260 | |
| 3261 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3262 | alc_shutup_pins(codec); |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 3263 | } |
| 3264 | |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3265 | static void alc225_init(struct hda_codec *codec) |
| 3266 | { |
| 3267 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3268 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3269 | bool hp1_pin_sense, hp2_pin_sense; |
| 3270 | |
| 3271 | if (!hp_pin) |
| 3272 | return; |
| 3273 | |
| 3274 | msleep(30); |
| 3275 | |
| 3276 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3277 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); |
| 3278 | |
| 3279 | if (hp1_pin_sense || hp2_pin_sense) |
| 3280 | msleep(2); |
| 3281 | |
| 3282 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ |
| 3283 | |
| 3284 | if (hp1_pin_sense) |
| 3285 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3286 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3287 | if (hp2_pin_sense) |
| 3288 | snd_hda_codec_write(codec, 0x16, 0, |
| 3289 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3290 | |
| 3291 | if (hp1_pin_sense || hp2_pin_sense) |
| 3292 | msleep(85); |
| 3293 | |
| 3294 | if (hp1_pin_sense) |
| 3295 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3296 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3297 | if (hp2_pin_sense) |
| 3298 | snd_hda_codec_write(codec, 0x16, 0, |
| 3299 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3300 | |
| 3301 | if (hp1_pin_sense || hp2_pin_sense) |
| 3302 | msleep(100); |
| 3303 | |
| 3304 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); |
| 3305 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ |
| 3306 | } |
| 3307 | |
| 3308 | static void alc225_shutup(struct hda_codec *codec) |
| 3309 | { |
| 3310 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3311 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3312 | bool hp1_pin_sense, hp2_pin_sense; |
| 3313 | |
| 3314 | if (!hp_pin) { |
| 3315 | alc269_shutup(codec); |
| 3316 | return; |
| 3317 | } |
| 3318 | |
| 3319 | /* 3k pull low control for Headset jack. */ |
| 3320 | alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); |
| 3321 | |
| 3322 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3323 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); |
| 3324 | |
| 3325 | if (hp1_pin_sense || hp2_pin_sense) |
| 3326 | msleep(2); |
| 3327 | |
| 3328 | if (hp1_pin_sense) |
| 3329 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3330 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3331 | if (hp2_pin_sense) |
| 3332 | snd_hda_codec_write(codec, 0x16, 0, |
| 3333 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3334 | |
| 3335 | if (hp1_pin_sense || hp2_pin_sense) |
| 3336 | msleep(85); |
| 3337 | |
| 3338 | if (hp1_pin_sense) |
| 3339 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3340 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3341 | if (hp2_pin_sense) |
| 3342 | snd_hda_codec_write(codec, 0x16, 0, |
| 3343 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 3344 | |
| 3345 | if (hp1_pin_sense || hp2_pin_sense) |
| 3346 | msleep(100); |
| 3347 | |
| 3348 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3349 | alc_shutup_pins(codec); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 3350 | } |
| 3351 | |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3352 | static void alc_default_init(struct hda_codec *codec) |
| 3353 | { |
| 3354 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3355 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3356 | bool hp_pin_sense; |
| 3357 | |
| 3358 | if (!hp_pin) |
| 3359 | return; |
| 3360 | |
| 3361 | msleep(30); |
| 3362 | |
| 3363 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3364 | |
| 3365 | if (hp_pin_sense) |
| 3366 | msleep(2); |
| 3367 | |
| 3368 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3369 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3370 | |
| 3371 | if (hp_pin_sense) |
| 3372 | msleep(85); |
| 3373 | |
| 3374 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3375 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 3376 | |
| 3377 | if (hp_pin_sense) |
| 3378 | msleep(100); |
| 3379 | } |
| 3380 | |
| 3381 | static void alc_default_shutup(struct hda_codec *codec) |
| 3382 | { |
| 3383 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3384 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3385 | bool hp_pin_sense; |
| 3386 | |
| 3387 | if (!hp_pin) { |
| 3388 | alc269_shutup(codec); |
| 3389 | return; |
| 3390 | } |
| 3391 | |
| 3392 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
| 3393 | |
| 3394 | if (hp_pin_sense) |
| 3395 | msleep(2); |
| 3396 | |
| 3397 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3398 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3399 | |
| 3400 | if (hp_pin_sense) |
| 3401 | msleep(85); |
| 3402 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3403 | if (!spec->no_shutup_pins) |
| 3404 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3405 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3406 | |
| 3407 | if (hp_pin_sense) |
| 3408 | msleep(100); |
| 3409 | |
| 3410 | alc_auto_setup_eapd(codec, false); |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3411 | alc_shutup_pins(codec); |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 3412 | } |
| 3413 | |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3414 | static void alc294_hp_init(struct hda_codec *codec) |
| 3415 | { |
| 3416 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 3417 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3418 | int i, val; |
| 3419 | |
| 3420 | if (!hp_pin) |
| 3421 | return; |
| 3422 | |
| 3423 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3424 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 3425 | |
| 3426 | msleep(100); |
| 3427 | |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 3428 | if (!spec->no_shutup_pins) |
| 3429 | snd_hda_codec_write(codec, hp_pin, 0, |
| 3430 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3431 | |
| 3432 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ |
| 3433 | alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ |
| 3434 | |
| 3435 | /* Wait for depop procedure finish */ |
| 3436 | val = alc_read_coefex_idx(codec, 0x58, 0x01); |
| 3437 | for (i = 0; i < 20 && val & 0x0080; i++) { |
| 3438 | msleep(50); |
| 3439 | val = alc_read_coefex_idx(codec, 0x58, 0x01); |
| 3440 | } |
| 3441 | /* Set HP depop to auto mode */ |
| 3442 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b); |
| 3443 | msleep(50); |
| 3444 | } |
| 3445 | |
| 3446 | static void alc294_init(struct hda_codec *codec) |
| 3447 | { |
| 3448 | struct alc_spec *spec = codec->spec; |
| 3449 | |
Takashi Iwai | f6ef4e0 | 2019-01-29 14:14:51 +0100 | [diff] [blame] | 3450 | /* required only at boot or S4 resume time */ |
| 3451 | if (!spec->done_hp_init || |
| 3452 | codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) { |
Kailang Yang | 693abe1 | 2019-01-29 15:38:21 +0800 | [diff] [blame] | 3453 | alc294_hp_init(codec); |
| 3454 | spec->done_hp_init = true; |
| 3455 | } |
| 3456 | alc_default_init(codec); |
| 3457 | } |
| 3458 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3459 | static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, |
| 3460 | unsigned int val) |
| 3461 | { |
| 3462 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3463 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ |
| 3464 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ |
| 3465 | } |
| 3466 | |
| 3467 | static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) |
| 3468 | { |
| 3469 | unsigned int val; |
| 3470 | |
| 3471 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); |
| 3472 | val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3473 | & 0xffff; |
| 3474 | val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) |
| 3475 | << 16; |
| 3476 | return val; |
| 3477 | } |
| 3478 | |
| 3479 | static void alc5505_dsp_halt(struct hda_codec *codec) |
| 3480 | { |
| 3481 | unsigned int val; |
| 3482 | |
| 3483 | alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ |
| 3484 | alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ |
| 3485 | alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ |
| 3486 | alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ |
| 3487 | alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ |
| 3488 | alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ |
| 3489 | alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ |
| 3490 | val = alc5505_coef_get(codec, 0x6220); |
| 3491 | alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ |
| 3492 | } |
| 3493 | |
| 3494 | static void alc5505_dsp_back_from_halt(struct hda_codec *codec) |
| 3495 | { |
| 3496 | alc5505_coef_set(codec, 0x61b8, 0x04133302); |
| 3497 | alc5505_coef_set(codec, 0x61b0, 0x00005b16); |
| 3498 | alc5505_coef_set(codec, 0x61b4, 0x040a2b02); |
| 3499 | alc5505_coef_set(codec, 0x6230, 0xf80d4011); |
| 3500 | alc5505_coef_set(codec, 0x6220, 0x2002010f); |
| 3501 | alc5505_coef_set(codec, 0x880c, 0x00000004); |
| 3502 | } |
| 3503 | |
| 3504 | static void alc5505_dsp_init(struct hda_codec *codec) |
| 3505 | { |
| 3506 | unsigned int val; |
| 3507 | |
| 3508 | alc5505_dsp_halt(codec); |
| 3509 | alc5505_dsp_back_from_halt(codec); |
| 3510 | alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ |
| 3511 | alc5505_coef_set(codec, 0x61b0, 0x5b16); |
| 3512 | alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ |
| 3513 | alc5505_coef_set(codec, 0x61b4, 0x04132b02); |
| 3514 | alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ |
| 3515 | alc5505_coef_set(codec, 0x61b8, 0x041f3302); |
| 3516 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ |
| 3517 | alc5505_coef_set(codec, 0x61b8, 0x041b3302); |
| 3518 | alc5505_coef_set(codec, 0x61b8, 0x04173302); |
| 3519 | alc5505_coef_set(codec, 0x61b8, 0x04163302); |
| 3520 | alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ |
| 3521 | alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ |
| 3522 | alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ |
| 3523 | |
| 3524 | val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ |
| 3525 | if (val <= 3) |
| 3526 | alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ |
| 3527 | else |
| 3528 | alc5505_coef_set(codec, 0x6220, 0x6002018f); |
| 3529 | |
| 3530 | alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ |
| 3531 | alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ |
| 3532 | alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ |
| 3533 | alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ |
| 3534 | alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ |
| 3535 | alc5505_coef_set(codec, 0x880c, 0x00000003); |
| 3536 | alc5505_coef_set(codec, 0x880c, 0x00000010); |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3537 | |
| 3538 | #ifdef HALT_REALTEK_ALC5505 |
| 3539 | alc5505_dsp_halt(codec); |
| 3540 | #endif |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3541 | } |
| 3542 | |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3543 | #ifdef HALT_REALTEK_ALC5505 |
| 3544 | #define alc5505_dsp_suspend(codec) /* NOP */ |
| 3545 | #define alc5505_dsp_resume(codec) /* NOP */ |
| 3546 | #else |
| 3547 | #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) |
| 3548 | #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) |
| 3549 | #endif |
| 3550 | |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3551 | #ifdef CONFIG_PM |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3552 | static int alc269_suspend(struct hda_codec *codec) |
| 3553 | { |
| 3554 | struct alc_spec *spec = codec->spec; |
| 3555 | |
| 3556 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3557 | alc5505_dsp_suspend(codec); |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3558 | return alc_suspend(codec); |
| 3559 | } |
| 3560 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3561 | static int alc269_resume(struct hda_codec *codec) |
| 3562 | { |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3563 | struct alc_spec *spec = codec->spec; |
| 3564 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3565 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3566 | alc269vb_toggle_power_output(codec, 0); |
| 3567 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3568 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3569 | msleep(150); |
| 3570 | } |
| 3571 | |
| 3572 | codec->patch_ops.init(codec); |
| 3573 | |
Kailang Yang | 1387e2d | 2012-11-08 10:23:18 +0100 | [diff] [blame] | 3574 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
| 3575 | alc269vb_toggle_power_output(codec, 1); |
| 3576 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 3577 | (alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3578 | msleep(200); |
| 3579 | } |
| 3580 | |
Takashi Iwai | eeecd9d | 2015-02-25 15:18:50 +0100 | [diff] [blame] | 3581 | regcache_sync(codec->core.regmap); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3582 | hda_call_check_power_status(codec, 0x01); |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 3583 | |
| 3584 | /* on some machine, the BIOS will clear the codec gpio data when enter |
| 3585 | * suspend, and won't restore the data after resume, so we restore it |
| 3586 | * in the driver. |
| 3587 | */ |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 3588 | if (spec->gpio_data) |
| 3589 | alc_write_gpio_data(codec); |
Hui Wang | f475371 | 2014-08-19 12:07:03 +0800 | [diff] [blame] | 3590 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 3591 | if (spec->has_alc5505_dsp) |
Takashi Iwai | cd63a5f | 2013-07-05 12:13:59 +0200 | [diff] [blame] | 3592 | alc5505_dsp_resume(codec); |
Kailang Yang | c5177c8 | 2013-07-24 14:39:49 +0200 | [diff] [blame] | 3593 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3594 | return 0; |
| 3595 | } |
Takashi Iwai | 2a43952 | 2011-07-26 09:52:50 +0200 | [diff] [blame] | 3596 | #endif /* CONFIG_PM */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3597 | |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3598 | 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] | 3599 | const struct hda_fixup *fix, int action) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3600 | { |
| 3601 | struct alc_spec *spec = codec->spec; |
| 3602 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3603 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 3604 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 3605 | } |
| 3606 | |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 3607 | static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, |
| 3608 | const struct hda_fixup *fix, |
| 3609 | int action) |
| 3610 | { |
| 3611 | unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); |
| 3612 | unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); |
| 3613 | |
| 3614 | if (cfg_headphone && cfg_headset_mic == 0x411111f0) |
| 3615 | snd_hda_codec_set_pincfg(codec, 0x19, |
| 3616 | (cfg_headphone & ~AC_DEFCFG_DEVICE) | |
| 3617 | (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT)); |
| 3618 | } |
| 3619 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3620 | static void alc269_fixup_hweq(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3621 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3622 | { |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3623 | if (action == HDA_FIXUP_ACT_INIT) |
| 3624 | alc_update_coef_idx(codec, 0x1e, 0, 0x80); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3625 | } |
| 3626 | |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 3627 | static void alc269_fixup_headset_mic(struct hda_codec *codec, |
| 3628 | const struct hda_fixup *fix, int action) |
| 3629 | { |
| 3630 | struct alc_spec *spec = codec->spec; |
| 3631 | |
| 3632 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 3633 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3634 | } |
| 3635 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3636 | static void alc271_fixup_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3637 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3638 | { |
| 3639 | static const struct hda_verb verbs[] = { |
| 3640 | {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, |
| 3641 | {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, |
| 3642 | {} |
| 3643 | }; |
| 3644 | unsigned int cfg; |
| 3645 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 3646 | if (strcmp(codec->core.chip_name, "ALC271X") && |
| 3647 | strcmp(codec->core.chip_name, "ALC269VB")) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3648 | return; |
| 3649 | cfg = snd_hda_codec_get_pincfg(codec, 0x12); |
| 3650 | if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) |
| 3651 | snd_hda_sequence_write(codec, verbs); |
| 3652 | } |
| 3653 | |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3654 | static void alc269_fixup_pcm_44k(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3655 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3656 | { |
| 3657 | struct alc_spec *spec = codec->spec; |
| 3658 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3659 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3660 | return; |
| 3661 | |
| 3662 | /* Due to a hardware problem on Lenovo Ideadpad, we need to |
| 3663 | * fix the sample rate of analog I/O to 44.1kHz |
| 3664 | */ |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3665 | spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; |
| 3666 | spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 3667 | } |
| 3668 | |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3669 | static void alc269_fixup_stereo_dmic(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3670 | const struct hda_fixup *fix, int action) |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3671 | { |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3672 | /* The digital-mic unit sends PDM (differential signal) instead of |
| 3673 | * the standard PCM, thus you can't record a valid mono stream as is. |
| 3674 | * Below is a workaround specific to ALC269 to control the dmic |
| 3675 | * signal source as mono. |
| 3676 | */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 3677 | if (action == HDA_FIXUP_ACT_INIT) |
| 3678 | alc_update_coef_idx(codec, 0x07, 0, 0x80); |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 3679 | } |
| 3680 | |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3681 | static void alc269_quanta_automute(struct hda_codec *codec) |
| 3682 | { |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3683 | snd_hda_gen_update_outputs(codec); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3684 | |
Takashi Iwai | 1687ccc | 2014-08-18 13:49:35 +0200 | [diff] [blame] | 3685 | alc_write_coef_idx(codec, 0x0c, 0x680); |
| 3686 | alc_write_coef_idx(codec, 0x0c, 0x480); |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3687 | } |
| 3688 | |
| 3689 | static void alc269_fixup_quanta_mute(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3690 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3691 | { |
| 3692 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 3693 | if (action != HDA_FIXUP_ACT_PROBE) |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3694 | return; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 3695 | spec->gen.automute_hook = alc269_quanta_automute; |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 3696 | } |
| 3697 | |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3698 | static void alc269_x101_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 3699 | struct hda_jack_callback *jack) |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 3700 | { |
| 3701 | struct alc_spec *spec = codec->spec; |
| 3702 | int vref; |
| 3703 | msleep(200); |
| 3704 | snd_hda_gen_hp_automute(codec, jack); |
| 3705 | |
| 3706 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 3707 | msleep(100); |
| 3708 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 3709 | vref); |
| 3710 | msleep(500); |
| 3711 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 3712 | vref); |
| 3713 | } |
| 3714 | |
| 3715 | static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, |
| 3716 | const struct hda_fixup *fix, int action) |
| 3717 | { |
| 3718 | struct alc_spec *spec = codec->spec; |
| 3719 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3720 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 3721 | spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; |
| 3722 | } |
| 3723 | } |
| 3724 | |
| 3725 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3726 | /* update mute-LED according to the speaker mute state via mic VREF pin */ |
| 3727 | static void alc269_fixup_mic_mute_hook(void *private_data, int enabled) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3728 | { |
| 3729 | struct hda_codec *codec = private_data; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3730 | struct alc_spec *spec = codec->spec; |
| 3731 | unsigned int pinval; |
| 3732 | |
| 3733 | if (spec->mute_led_polarity) |
| 3734 | enabled = !enabled; |
Takashi Iwai | 415d555 | 2014-04-03 11:51:21 +0200 | [diff] [blame] | 3735 | pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid); |
| 3736 | pinval &= ~AC_PINCTL_VREFEN; |
| 3737 | pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80; |
Takashi Iwai | e40bdb0 | 2018-03-17 22:40:18 +0100 | [diff] [blame] | 3738 | if (spec->mute_led_nid) { |
| 3739 | /* temporarily power up/down for setting VREF */ |
| 3740 | snd_hda_power_up_pm(codec); |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3741 | snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval); |
Takashi Iwai | e40bdb0 | 2018-03-17 22:40:18 +0100 | [diff] [blame] | 3742 | snd_hda_power_down_pm(codec); |
| 3743 | } |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3744 | } |
| 3745 | |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3746 | /* Make sure the led works even in runtime suspend */ |
| 3747 | static unsigned int led_power_filter(struct hda_codec *codec, |
| 3748 | hda_nid_t nid, |
| 3749 | unsigned int power_state) |
| 3750 | { |
| 3751 | struct alc_spec *spec = codec->spec; |
| 3752 | |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 3753 | if (power_state != AC_PWRST_D3 || nid == 0 || |
| 3754 | (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3755 | return power_state; |
| 3756 | |
| 3757 | /* Set pin ctl again, it might have just been set to 0 */ |
| 3758 | snd_hda_set_pin_ctl(codec, nid, |
| 3759 | snd_hda_codec_get_pin_target(codec, nid)); |
| 3760 | |
Takashi Iwai | cffd396 | 2015-04-09 10:30:25 +0200 | [diff] [blame] | 3761 | return snd_hda_gen_path_power_filter(codec, nid, power_state); |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3762 | } |
| 3763 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3764 | static void alc269_fixup_hp_mute_led(struct hda_codec *codec, |
| 3765 | const struct hda_fixup *fix, int action) |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3766 | { |
| 3767 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3768 | const struct dmi_device *dev = NULL; |
| 3769 | |
| 3770 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 3771 | return; |
| 3772 | |
| 3773 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { |
| 3774 | int pol, pin; |
| 3775 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) |
| 3776 | continue; |
| 3777 | if (pin < 0x0a || pin >= 0x10) |
| 3778 | break; |
| 3779 | spec->mute_led_polarity = pol; |
| 3780 | spec->mute_led_nid = pin - 0x0a + 0x18; |
| 3781 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
Takashi Iwai | fd25a97 | 2012-12-20 14:57:18 +0100 | [diff] [blame] | 3782 | spec->gen.vmaster_mute_enum = 1; |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3783 | codec->power_filter = led_power_filter; |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 3784 | codec_dbg(codec, |
| 3785 | "Detected mute LED for %x:%d\n", spec->mute_led_nid, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3786 | spec->mute_led_polarity); |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 3787 | break; |
| 3788 | } |
| 3789 | } |
| 3790 | |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3791 | static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, |
| 3792 | const struct hda_fixup *fix, |
| 3793 | int action, hda_nid_t pin) |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3794 | { |
| 3795 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3796 | |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3797 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 3798 | spec->mute_led_polarity = 0; |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3799 | spec->mute_led_nid = pin; |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3800 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
| 3801 | spec->gen.vmaster_mute_enum = 1; |
David Henningsson | d5b6b65 | 2013-11-06 10:50:44 +0100 | [diff] [blame] | 3802 | codec->power_filter = led_power_filter; |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 3803 | } |
| 3804 | } |
| 3805 | |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3806 | static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, |
| 3807 | const struct hda_fixup *fix, int action) |
| 3808 | { |
| 3809 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); |
| 3810 | } |
| 3811 | |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 3812 | static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, |
| 3813 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 3814 | { |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3815 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 3816 | } |
| 3817 | |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 3818 | static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, |
| 3819 | const struct hda_fixup *fix, int action) |
| 3820 | { |
Takashi Iwai | 85c467d | 2018-05-29 11:38:38 +0200 | [diff] [blame] | 3821 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 3822 | } |
| 3823 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3824 | /* update LED status via GPIO */ |
| 3825 | static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask, |
| 3826 | bool enabled) |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3827 | { |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3828 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3829 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3830 | if (spec->mute_led_polarity) |
| 3831 | enabled = !enabled; |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 3832 | alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */ |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3833 | } |
| 3834 | |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 3835 | /* turn on/off mute LED via GPIO per vmaster hook */ |
| 3836 | static void alc_fixup_gpio_mute_hook(void *private_data, int enabled) |
| 3837 | { |
| 3838 | struct hda_codec *codec = private_data; |
| 3839 | struct alc_spec *spec = codec->spec; |
| 3840 | |
| 3841 | alc_update_gpio_led(codec, spec->gpio_mute_led_mask, enabled); |
| 3842 | } |
| 3843 | |
| 3844 | /* turn on/off mic-mute LED via GPIO per capture hook */ |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3845 | static void alc_gpio_micmute_update(struct hda_codec *codec) |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3846 | { |
| 3847 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3848 | |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3849 | alc_update_gpio_led(codec, spec->gpio_mic_led_mask, |
| 3850 | spec->gen.micmute_led.led_value); |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3851 | } |
| 3852 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 3853 | /* setup mute and mic-mute GPIO bits, add hooks appropriately */ |
| 3854 | static void alc_fixup_hp_gpio_led(struct hda_codec *codec, |
| 3855 | int action, |
| 3856 | unsigned int mute_mask, |
| 3857 | unsigned int micmute_mask) |
| 3858 | { |
| 3859 | struct alc_spec *spec = codec->spec; |
| 3860 | |
| 3861 | alc_fixup_gpio(codec, action, mute_mask | micmute_mask); |
| 3862 | |
| 3863 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 3864 | return; |
| 3865 | if (mute_mask) { |
| 3866 | spec->gpio_mute_led_mask = mute_mask; |
| 3867 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
| 3868 | } |
| 3869 | if (micmute_mask) { |
| 3870 | spec->gpio_mic_led_mask = micmute_mask; |
| 3871 | snd_hda_gen_add_micmute_led(codec, alc_gpio_micmute_update); |
| 3872 | } |
| 3873 | } |
| 3874 | |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3875 | static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, |
| 3876 | const struct hda_fixup *fix, int action) |
| 3877 | { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 3878 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 3879 | } |
| 3880 | |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 3881 | static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, |
| 3882 | const struct hda_fixup *fix, int action) |
| 3883 | { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 3884 | alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 3885 | } |
| 3886 | |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3887 | /* turn on/off mic-mute LED per capture hook */ |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3888 | static void alc_cap_micmute_update(struct hda_codec *codec) |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3889 | { |
| 3890 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3891 | unsigned int pinval; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3892 | |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3893 | if (!spec->cap_mute_led_nid) |
| 3894 | return; |
Hui Wang | fc1fad9 | 2014-07-08 17:56:14 +0800 | [diff] [blame] | 3895 | 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] | 3896 | pinval &= ~AC_PINCTL_VREFEN; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3897 | if (spec->gen.micmute_led.led_value) |
| 3898 | pinval |= AC_PINCTL_VREF_80; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3899 | else |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3900 | pinval |= AC_PINCTL_VREF_HIZ; |
| 3901 | 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] | 3902 | } |
| 3903 | |
| 3904 | static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, |
| 3905 | const struct hda_fixup *fix, int action) |
| 3906 | { |
| 3907 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3908 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 3909 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3910 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 3911 | /* Like hp_gpio_mic1_led, but also needs GPIO4 low to |
| 3912 | * enable headphone amp |
| 3913 | */ |
| 3914 | spec->gpio_mask |= 0x10; |
| 3915 | spec->gpio_dir |= 0x10; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3916 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3917 | snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update); |
Hui Wang | 50dd905 | 2014-07-08 17:56:15 +0800 | [diff] [blame] | 3918 | codec->power_filter = led_power_filter; |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 3919 | } |
| 3920 | } |
| 3921 | |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3922 | static void alc280_fixup_hp_gpio4(struct hda_codec *codec, |
| 3923 | const struct hda_fixup *fix, int action) |
| 3924 | { |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3925 | struct alc_spec *spec = codec->spec; |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3926 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 3927 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3928 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3929 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 3930 | snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update); |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 3931 | codec->power_filter = led_power_filter; |
| 3932 | } |
| 3933 | } |
| 3934 | |
Takashi Iwai | 6a30aba | 2018-04-27 17:17:35 +0200 | [diff] [blame] | 3935 | #if IS_REACHABLE(CONFIG_INPUT) |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3936 | static void gpio2_mic_hotkey_event(struct hda_codec *codec, |
| 3937 | struct hda_jack_callback *event) |
| 3938 | { |
| 3939 | struct alc_spec *spec = codec->spec; |
| 3940 | |
| 3941 | /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore |
| 3942 | send both key on and key off event for every interrupt. */ |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 3943 | 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] | 3944 | input_sync(spec->kb_dev); |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 3945 | 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] | 3946 | input_sync(spec->kb_dev); |
| 3947 | } |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3948 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3949 | static int alc_register_micmute_input_device(struct hda_codec *codec) |
| 3950 | { |
| 3951 | struct alc_spec *spec = codec->spec; |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 3952 | int i; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3953 | |
| 3954 | spec->kb_dev = input_allocate_device(); |
| 3955 | if (!spec->kb_dev) { |
| 3956 | codec_err(codec, "Out of memory (input_allocate_device)\n"); |
| 3957 | return -ENOMEM; |
| 3958 | } |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 3959 | |
| 3960 | spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE; |
| 3961 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3962 | spec->kb_dev->name = "Microphone Mute Button"; |
| 3963 | spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); |
Hui Wang | c7b60a8 | 2015-12-28 11:35:25 +0800 | [diff] [blame] | 3964 | spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]); |
| 3965 | spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map); |
| 3966 | spec->kb_dev->keycode = spec->alc_mute_keycode_map; |
| 3967 | for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++) |
| 3968 | set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3969 | |
| 3970 | if (input_register_device(spec->kb_dev)) { |
| 3971 | codec_err(codec, "input_register_device failed\n"); |
| 3972 | input_free_device(spec->kb_dev); |
| 3973 | spec->kb_dev = NULL; |
| 3974 | return -ENOMEM; |
| 3975 | } |
| 3976 | |
| 3977 | return 0; |
| 3978 | } |
| 3979 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 3980 | /* GPIO1 = set according to SKU external amp |
| 3981 | * GPIO2 = mic mute hotkey |
| 3982 | * GPIO3 = mute LED |
| 3983 | * GPIO4 = mic mute LED |
| 3984 | */ |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3985 | static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, |
| 3986 | const struct hda_fixup *fix, int action) |
| 3987 | { |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3988 | struct alc_spec *spec = codec->spec; |
| 3989 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 3990 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3991 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 3992 | spec->init_amp = ALC_INIT_DEFAULT; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 3993 | if (alc_register_micmute_input_device(codec) != 0) |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3994 | return; |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 3995 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 3996 | spec->gpio_mask |= 0x06; |
| 3997 | spec->gpio_dir |= 0x02; |
| 3998 | spec->gpio_data |= 0x02; |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 3999 | snd_hda_codec_write_cache(codec, codec->core.afg, 0, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4000 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4001 | snd_hda_jack_detect_enable_callback(codec, codec->core.afg, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4002 | gpio2_mic_hotkey_event); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4003 | return; |
| 4004 | } |
| 4005 | |
| 4006 | if (!spec->kb_dev) |
| 4007 | return; |
| 4008 | |
| 4009 | switch (action) { |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4010 | case HDA_FIXUP_ACT_FREE: |
| 4011 | input_unregister_device(spec->kb_dev); |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4012 | spec->kb_dev = NULL; |
| 4013 | } |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 4014 | } |
| 4015 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4016 | /* Line2 = mic mute hotkey |
| 4017 | * GPIO2 = mic mute LED |
| 4018 | */ |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4019 | static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, |
| 4020 | const struct hda_fixup *fix, int action) |
| 4021 | { |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4022 | struct alc_spec *spec = codec->spec; |
| 4023 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 4024 | alc_fixup_hp_gpio_led(codec, action, 0, 0x04); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4025 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 4026 | spec->init_amp = ALC_INIT_DEFAULT; |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4027 | if (alc_register_micmute_input_device(codec) != 0) |
| 4028 | return; |
| 4029 | |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4030 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
| 4031 | gpio2_mic_hotkey_event); |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4032 | return; |
| 4033 | } |
| 4034 | |
| 4035 | if (!spec->kb_dev) |
| 4036 | return; |
| 4037 | |
| 4038 | switch (action) { |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4039 | case HDA_FIXUP_ACT_FREE: |
| 4040 | input_unregister_device(spec->kb_dev); |
| 4041 | spec->kb_dev = NULL; |
| 4042 | } |
| 4043 | } |
Takashi Iwai | c469652 | 2018-01-15 10:44:35 +0100 | [diff] [blame] | 4044 | #else /* INPUT */ |
| 4045 | #define alc280_fixup_hp_gpio2_mic_hotkey NULL |
| 4046 | #define alc233_fixup_lenovo_line2_mic_hotkey NULL |
| 4047 | #endif /* INPUT */ |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 4048 | |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4049 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, |
| 4050 | const struct hda_fixup *fix, int action) |
| 4051 | { |
| 4052 | struct alc_spec *spec = codec->spec; |
| 4053 | |
Takashi Iwai | 1bce62a | 2018-06-19 23:15:59 +0200 | [diff] [blame] | 4054 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4055 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4056 | spec->cap_mute_led_nid = 0x18; |
Takashi Iwai | d03abec | 2018-06-19 12:29:13 +0200 | [diff] [blame] | 4057 | snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update); |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 4058 | } |
| 4059 | } |
| 4060 | |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4061 | static struct coef_fw alc225_pre_hsmode[] = { |
| 4062 | UPDATE_COEF(0x4a, 1<<8, 0), |
| 4063 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), |
| 4064 | UPDATE_COEF(0x63, 3<<14, 3<<14), |
| 4065 | UPDATE_COEF(0x4a, 3<<4, 2<<4), |
| 4066 | UPDATE_COEF(0x4a, 3<<10, 3<<10), |
| 4067 | UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), |
| 4068 | UPDATE_COEF(0x4a, 3<<10, 0), |
| 4069 | {} |
| 4070 | }; |
| 4071 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4072 | static void alc_headset_mode_unplugged(struct hda_codec *codec) |
| 4073 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4074 | static struct coef_fw coef0255[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4075 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
| 4076 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ |
| 4077 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ |
| 4078 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ |
| 4079 | {} |
| 4080 | }; |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4081 | static struct coef_fw coef0255_1[] = { |
| 4082 | WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ |
| 4083 | {} |
| 4084 | }; |
| 4085 | static struct coef_fw coef0256[] = { |
| 4086 | WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */ |
| 4087 | {} |
| 4088 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4089 | static struct coef_fw coef0233[] = { |
| 4090 | WRITE_COEF(0x1b, 0x0c0b), |
| 4091 | WRITE_COEF(0x45, 0xc429), |
| 4092 | UPDATE_COEF(0x35, 0x4000, 0), |
| 4093 | WRITE_COEF(0x06, 0x2104), |
| 4094 | WRITE_COEF(0x1a, 0x0001), |
| 4095 | WRITE_COEF(0x26, 0x0004), |
| 4096 | WRITE_COEF(0x32, 0x42a3), |
| 4097 | {} |
| 4098 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4099 | static struct coef_fw coef0288[] = { |
| 4100 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
| 4101 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4102 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4103 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4104 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4105 | {} |
| 4106 | }; |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4107 | static struct coef_fw coef0298[] = { |
| 4108 | UPDATE_COEF(0x19, 0x1300, 0x0300), |
| 4109 | {} |
| 4110 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4111 | static struct coef_fw coef0292[] = { |
| 4112 | WRITE_COEF(0x76, 0x000e), |
| 4113 | WRITE_COEF(0x6c, 0x2400), |
| 4114 | WRITE_COEF(0x18, 0x7308), |
| 4115 | WRITE_COEF(0x6b, 0xc429), |
| 4116 | {} |
| 4117 | }; |
| 4118 | static struct coef_fw coef0293[] = { |
| 4119 | UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ |
| 4120 | UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ |
| 4121 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ |
| 4122 | UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ |
| 4123 | WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ |
| 4124 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 4125 | {} |
| 4126 | }; |
| 4127 | static struct coef_fw coef0668[] = { |
| 4128 | WRITE_COEF(0x15, 0x0d40), |
| 4129 | WRITE_COEF(0xb7, 0x802b), |
| 4130 | {} |
| 4131 | }; |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4132 | static struct coef_fw coef0225[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4133 | UPDATE_COEF(0x63, 3<<14, 0), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4134 | {} |
| 4135 | }; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4136 | static struct coef_fw coef0274[] = { |
| 4137 | UPDATE_COEF(0x4a, 0x0100, 0), |
| 4138 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0), |
| 4139 | UPDATE_COEF(0x6b, 0xf000, 0x5000), |
| 4140 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4141 | UPDATE_COEF(0x4a, 0x0c00, 0x0c00), |
| 4142 | WRITE_COEF(0x45, 0x5289), |
| 4143 | UPDATE_COEF(0x4a, 0x0c00, 0), |
| 4144 | {} |
| 4145 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4146 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4147 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4148 | case 0x10ec0255: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4149 | alc_process_coef_fw(codec, coef0255_1); |
| 4150 | alc_process_coef_fw(codec, coef0255); |
| 4151 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4152 | case 0x10ec0236: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4153 | case 0x10ec0256: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4154 | alc_process_coef_fw(codec, coef0256); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4155 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4156 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4157 | case 0x10ec0234: |
| 4158 | case 0x10ec0274: |
| 4159 | case 0x10ec0294: |
| 4160 | alc_process_coef_fw(codec, coef0274); |
| 4161 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4162 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4163 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4164 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4165 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4166 | case 0x10ec0286: |
| 4167 | case 0x10ec0288: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4168 | alc_process_coef_fw(codec, coef0288); |
| 4169 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4170 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4171 | alc_process_coef_fw(codec, coef0298); |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4172 | alc_process_coef_fw(codec, coef0288); |
| 4173 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4174 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4175 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4176 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4177 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4178 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4179 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4180 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4181 | alc_process_coef_fw(codec, coef0668); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4182 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4183 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4184 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4185 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4186 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4187 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4188 | case 0x10ec0299: |
Kailang Yang | 4d4b0c5 | 2019-01-09 16:23:37 +0800 | [diff] [blame] | 4189 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4190 | alc_process_coef_fw(codec, coef0225); |
| 4191 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4192 | case 0x10ec0867: |
| 4193 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4194 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4195 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4196 | codec_dbg(codec, "Headset jack set to unplugged mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4197 | } |
| 4198 | |
| 4199 | |
| 4200 | static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, |
| 4201 | hda_nid_t mic_pin) |
| 4202 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4203 | static struct coef_fw coef0255[] = { |
| 4204 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), |
| 4205 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ |
| 4206 | {} |
| 4207 | }; |
| 4208 | static struct coef_fw coef0233[] = { |
| 4209 | UPDATE_COEF(0x35, 0, 1<<14), |
| 4210 | WRITE_COEF(0x06, 0x2100), |
| 4211 | WRITE_COEF(0x1a, 0x0021), |
| 4212 | WRITE_COEF(0x26, 0x008c), |
| 4213 | {} |
| 4214 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4215 | static struct coef_fw coef0288[] = { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4216 | UPDATE_COEF(0x4f, 0x00c0, 0), |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4217 | UPDATE_COEF(0x50, 0x2000, 0), |
| 4218 | UPDATE_COEF(0x56, 0x0006, 0), |
| 4219 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
| 4220 | UPDATE_COEF(0x66, 0x0008, 0x0008), |
| 4221 | UPDATE_COEF(0x67, 0x2000, 0x2000), |
| 4222 | {} |
| 4223 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4224 | static struct coef_fw coef0292[] = { |
| 4225 | WRITE_COEF(0x19, 0xa208), |
| 4226 | WRITE_COEF(0x2e, 0xacf0), |
| 4227 | {} |
| 4228 | }; |
| 4229 | static struct coef_fw coef0293[] = { |
| 4230 | UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ |
| 4231 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ |
| 4232 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 4233 | {} |
| 4234 | }; |
| 4235 | static struct coef_fw coef0688[] = { |
| 4236 | WRITE_COEF(0xb7, 0x802b), |
| 4237 | WRITE_COEF(0xb5, 0x1040), |
| 4238 | UPDATE_COEF(0xc3, 0, 1<<12), |
| 4239 | {} |
| 4240 | }; |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4241 | static struct coef_fw coef0225[] = { |
| 4242 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), |
| 4243 | UPDATE_COEF(0x4a, 3<<4, 2<<4), |
| 4244 | UPDATE_COEF(0x63, 3<<14, 0), |
| 4245 | {} |
| 4246 | }; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4247 | static struct coef_fw coef0274[] = { |
| 4248 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000), |
| 4249 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4250 | UPDATE_COEF(0x6b, 0xf000, 0), |
| 4251 | {} |
| 4252 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4253 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4254 | switch (codec->core.vendor_id) { |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4255 | case 0x10ec0236: |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4256 | case 0x10ec0255: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4257 | case 0x10ec0256: |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4258 | alc_write_coef_idx(codec, 0x45, 0xc489); |
| 4259 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4260 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4261 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4262 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4263 | case 0x10ec0234: |
| 4264 | case 0x10ec0274: |
| 4265 | case 0x10ec0294: |
| 4266 | alc_write_coef_idx(codec, 0x45, 0x4689); |
| 4267 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4268 | alc_process_coef_fw(codec, coef0274); |
| 4269 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4270 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4271 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4272 | case 0x10ec0283: |
| 4273 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 4274 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4275 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4276 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4277 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4278 | case 0x10ec0286: |
| 4279 | case 0x10ec0288: |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4280 | case 0x10ec0298: |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4281 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4282 | alc_process_coef_fw(codec, coef0288); |
| 4283 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4284 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4285 | case 0x10ec0292: |
| 4286 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4287 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4288 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4289 | case 0x10ec0293: |
| 4290 | /* Set to TRS mode */ |
| 4291 | alc_write_coef_idx(codec, 0x45, 0xc429); |
| 4292 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4293 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4294 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4295 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4296 | case 0x10ec0867: |
| 4297 | alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); |
| 4298 | /* fallthru */ |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 4299 | case 0x10ec0221: |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 4300 | case 0x10ec0662: |
| 4301 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4302 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4303 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4304 | case 0x10ec0668: |
| 4305 | alc_write_coef_idx(codec, 0x11, 0x0001); |
| 4306 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4307 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4308 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4309 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4310 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4311 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4312 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4313 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4314 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4315 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4316 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4317 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); |
| 4318 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
| 4319 | alc_process_coef_fw(codec, coef0225); |
| 4320 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
| 4321 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4322 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4323 | codec_dbg(codec, "Headset jack set to mic-in mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4324 | } |
| 4325 | |
| 4326 | static void alc_headset_mode_default(struct hda_codec *codec) |
| 4327 | { |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4328 | static struct coef_fw coef0225[] = { |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4329 | UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10), |
| 4330 | UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10), |
| 4331 | UPDATE_COEF(0x49, 3<<8, 0<<8), |
| 4332 | UPDATE_COEF(0x4a, 3<<4, 3<<4), |
| 4333 | UPDATE_COEF(0x63, 3<<14, 0), |
| 4334 | UPDATE_COEF(0x67, 0xf000, 0x3000), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4335 | {} |
| 4336 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4337 | static struct coef_fw coef0255[] = { |
| 4338 | WRITE_COEF(0x45, 0xc089), |
| 4339 | WRITE_COEF(0x45, 0xc489), |
| 4340 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4341 | WRITE_COEF(0x49, 0x0049), |
| 4342 | {} |
| 4343 | }; |
| 4344 | static struct coef_fw coef0233[] = { |
| 4345 | WRITE_COEF(0x06, 0x2100), |
| 4346 | WRITE_COEF(0x32, 0x4ea3), |
| 4347 | {} |
| 4348 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4349 | static struct coef_fw coef0288[] = { |
| 4350 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ |
| 4351 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4352 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4353 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4354 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4355 | {} |
| 4356 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4357 | static struct coef_fw coef0292[] = { |
| 4358 | WRITE_COEF(0x76, 0x000e), |
| 4359 | WRITE_COEF(0x6c, 0x2400), |
| 4360 | WRITE_COEF(0x6b, 0xc429), |
| 4361 | WRITE_COEF(0x18, 0x7308), |
| 4362 | {} |
| 4363 | }; |
| 4364 | static struct coef_fw coef0293[] = { |
| 4365 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
| 4366 | WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ |
| 4367 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ |
| 4368 | {} |
| 4369 | }; |
| 4370 | static struct coef_fw coef0688[] = { |
| 4371 | WRITE_COEF(0x11, 0x0041), |
| 4372 | WRITE_COEF(0x15, 0x0d40), |
| 4373 | WRITE_COEF(0xb7, 0x802b), |
| 4374 | {} |
| 4375 | }; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4376 | static struct coef_fw coef0274[] = { |
| 4377 | WRITE_COEF(0x45, 0x4289), |
| 4378 | UPDATE_COEF(0x4a, 0x0010, 0x0010), |
| 4379 | UPDATE_COEF(0x6b, 0x0f00, 0), |
| 4380 | UPDATE_COEF(0x49, 0x0300, 0x0300), |
| 4381 | {} |
| 4382 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4383 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4384 | switch (codec->core.vendor_id) { |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4385 | case 0x10ec0215: |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4386 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4387 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4388 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4389 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4390 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4391 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 4392 | alc_process_coef_fw(codec, coef0225); |
| 4393 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4394 | case 0x10ec0236: |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4395 | case 0x10ec0255: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4396 | case 0x10ec0256: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4397 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4398 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4399 | case 0x10ec0234: |
| 4400 | case 0x10ec0274: |
| 4401 | case 0x10ec0294: |
| 4402 | alc_process_coef_fw(codec, coef0274); |
| 4403 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4404 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4405 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4406 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4407 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4408 | case 0x10ec0286: |
| 4409 | case 0x10ec0288: |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4410 | case 0x10ec0298: |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4411 | alc_process_coef_fw(codec, coef0288); |
| 4412 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4413 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4414 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4415 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4416 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4417 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4418 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4419 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4420 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4421 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4422 | case 0x10ec0867: |
| 4423 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4424 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4425 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4426 | codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4427 | } |
| 4428 | |
| 4429 | /* Iphone type */ |
| 4430 | static void alc_headset_mode_ctia(struct hda_codec *codec) |
| 4431 | { |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4432 | int val; |
| 4433 | |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4434 | static struct coef_fw coef0255[] = { |
| 4435 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
| 4436 | WRITE_COEF(0x1b, 0x0c2b), |
| 4437 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4438 | {} |
| 4439 | }; |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4440 | static struct coef_fw coef0256[] = { |
| 4441 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
| 4442 | WRITE_COEF(0x1b, 0x0c6b), |
| 4443 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4444 | {} |
| 4445 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4446 | static struct coef_fw coef0233[] = { |
| 4447 | WRITE_COEF(0x45, 0xd429), |
| 4448 | WRITE_COEF(0x1b, 0x0c2b), |
| 4449 | WRITE_COEF(0x32, 0x4ea3), |
| 4450 | {} |
| 4451 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4452 | static struct coef_fw coef0288[] = { |
| 4453 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4454 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4455 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4456 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4457 | {} |
| 4458 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4459 | static struct coef_fw coef0292[] = { |
| 4460 | WRITE_COEF(0x6b, 0xd429), |
| 4461 | WRITE_COEF(0x76, 0x0008), |
| 4462 | WRITE_COEF(0x18, 0x7388), |
| 4463 | {} |
| 4464 | }; |
| 4465 | static struct coef_fw coef0293[] = { |
| 4466 | WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ |
| 4467 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 4468 | {} |
| 4469 | }; |
| 4470 | static struct coef_fw coef0688[] = { |
| 4471 | WRITE_COEF(0x11, 0x0001), |
| 4472 | WRITE_COEF(0x15, 0x0d60), |
| 4473 | WRITE_COEF(0xc3, 0x0000), |
| 4474 | {} |
| 4475 | }; |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4476 | static struct coef_fw coef0225_1[] = { |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4477 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4478 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
| 4479 | {} |
| 4480 | }; |
| 4481 | static struct coef_fw coef0225_2[] = { |
| 4482 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
| 4483 | UPDATE_COEF(0x63, 3<<14, 1<<14), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4484 | {} |
| 4485 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4486 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4487 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4488 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4489 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4490 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4491 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4492 | case 0x10ec0256: |
| 4493 | alc_process_coef_fw(codec, coef0256); |
| 4494 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4495 | case 0x10ec0234: |
| 4496 | case 0x10ec0274: |
| 4497 | case 0x10ec0294: |
| 4498 | alc_write_coef_idx(codec, 0x45, 0xd689); |
| 4499 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4500 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4501 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4502 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4503 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4504 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4505 | val = alc_read_coef_idx(codec, 0x50); |
| 4506 | if (val & (1 << 12)) { |
| 4507 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); |
| 4508 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 4509 | msleep(300); |
| 4510 | } else { |
| 4511 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); |
| 4512 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 4513 | msleep(300); |
| 4514 | } |
| 4515 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4516 | case 0x10ec0286: |
| 4517 | case 0x10ec0288: |
| 4518 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
| 4519 | msleep(300); |
| 4520 | alc_process_coef_fw(codec, coef0288); |
| 4521 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4522 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4523 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4524 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4525 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4526 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4527 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4528 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4529 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4530 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4531 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4532 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4533 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4534 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4535 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4536 | case 0x10ec0299: |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4537 | val = alc_read_coef_idx(codec, 0x45); |
| 4538 | if (val & (1 << 9)) |
| 4539 | alc_process_coef_fw(codec, coef0225_2); |
| 4540 | else |
| 4541 | alc_process_coef_fw(codec, coef0225_1); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4542 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4543 | case 0x10ec0867: |
| 4544 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
| 4545 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4546 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4547 | codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4548 | } |
| 4549 | |
| 4550 | /* Nokia type */ |
| 4551 | static void alc_headset_mode_omtp(struct hda_codec *codec) |
| 4552 | { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4553 | static struct coef_fw coef0255[] = { |
| 4554 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
| 4555 | WRITE_COEF(0x1b, 0x0c2b), |
| 4556 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4557 | {} |
| 4558 | }; |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4559 | static struct coef_fw coef0256[] = { |
| 4560 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
| 4561 | WRITE_COEF(0x1b, 0x0c6b), |
| 4562 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), |
| 4563 | {} |
| 4564 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4565 | static struct coef_fw coef0233[] = { |
| 4566 | WRITE_COEF(0x45, 0xe429), |
| 4567 | WRITE_COEF(0x1b, 0x0c2b), |
| 4568 | WRITE_COEF(0x32, 0x4ea3), |
| 4569 | {} |
| 4570 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4571 | static struct coef_fw coef0288[] = { |
| 4572 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4573 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4574 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4575 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4576 | {} |
| 4577 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4578 | static struct coef_fw coef0292[] = { |
| 4579 | WRITE_COEF(0x6b, 0xe429), |
| 4580 | WRITE_COEF(0x76, 0x0008), |
| 4581 | WRITE_COEF(0x18, 0x7388), |
| 4582 | {} |
| 4583 | }; |
| 4584 | static struct coef_fw coef0293[] = { |
| 4585 | WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ |
| 4586 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ |
| 4587 | {} |
| 4588 | }; |
| 4589 | static struct coef_fw coef0688[] = { |
| 4590 | WRITE_COEF(0x11, 0x0001), |
| 4591 | WRITE_COEF(0x15, 0x0d50), |
| 4592 | WRITE_COEF(0xc3, 0x0000), |
| 4593 | {} |
| 4594 | }; |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4595 | static struct coef_fw coef0225[] = { |
| 4596 | UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4597 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4598 | {} |
| 4599 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4600 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4601 | switch (codec->core.vendor_id) { |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4602 | case 0x10ec0255: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4603 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4604 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4605 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4606 | case 0x10ec0256: |
| 4607 | alc_process_coef_fw(codec, coef0256); |
| 4608 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4609 | case 0x10ec0234: |
| 4610 | case 0x10ec0274: |
| 4611 | case 0x10ec0294: |
| 4612 | alc_write_coef_idx(codec, 0x45, 0xe689); |
| 4613 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4614 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4615 | case 0x10ec0283: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4616 | alc_process_coef_fw(codec, coef0233); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4617 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4618 | case 0x10ec0298: |
| 4619 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4620 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
| 4621 | msleep(300); |
| 4622 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4623 | case 0x10ec0286: |
| 4624 | case 0x10ec0288: |
| 4625 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
| 4626 | msleep(300); |
| 4627 | alc_process_coef_fw(codec, coef0288); |
| 4628 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4629 | case 0x10ec0292: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4630 | alc_process_coef_fw(codec, coef0292); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4631 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4632 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4633 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4634 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4635 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4636 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4637 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4638 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4639 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4640 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4641 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4642 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4643 | case 0x10ec0299: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4644 | alc_process_coef_fw(codec, coef0225); |
| 4645 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4646 | } |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4647 | codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4648 | } |
| 4649 | |
| 4650 | static void alc_determine_headset_type(struct hda_codec *codec) |
| 4651 | { |
| 4652 | int val; |
| 4653 | bool is_ctia = false; |
| 4654 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4655 | static struct coef_fw coef0255[] = { |
| 4656 | WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ |
| 4657 | WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref |
| 4658 | conteol) */ |
| 4659 | {} |
| 4660 | }; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4661 | static struct coef_fw coef0288[] = { |
| 4662 | UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ |
| 4663 | {} |
| 4664 | }; |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4665 | static struct coef_fw coef0298[] = { |
| 4666 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
| 4667 | UPDATE_COEF(0x56, 0x0006, 0x0006), |
| 4668 | UPDATE_COEF(0x66, 0x0008, 0), |
| 4669 | UPDATE_COEF(0x67, 0x2000, 0), |
| 4670 | UPDATE_COEF(0x19, 0x1300, 0x1300), |
| 4671 | {} |
| 4672 | }; |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4673 | static struct coef_fw coef0293[] = { |
| 4674 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ |
| 4675 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ |
| 4676 | {} |
| 4677 | }; |
| 4678 | static struct coef_fw coef0688[] = { |
| 4679 | WRITE_COEF(0x11, 0x0001), |
| 4680 | WRITE_COEF(0xb7, 0x802b), |
| 4681 | WRITE_COEF(0x15, 0x0d60), |
| 4682 | WRITE_COEF(0xc3, 0x0c00), |
| 4683 | {} |
| 4684 | }; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4685 | static struct coef_fw coef0274[] = { |
| 4686 | UPDATE_COEF(0x4a, 0x0010, 0), |
| 4687 | UPDATE_COEF(0x4a, 0x8000, 0), |
| 4688 | WRITE_COEF(0x45, 0xd289), |
| 4689 | UPDATE_COEF(0x49, 0x0300, 0x0300), |
| 4690 | {} |
| 4691 | }; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4692 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 4693 | switch (codec->core.vendor_id) { |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4694 | case 0x10ec0236: |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4695 | case 0x10ec0255: |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 4696 | case 0x10ec0256: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4697 | alc_process_coef_fw(codec, coef0255); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4698 | msleep(300); |
| 4699 | val = alc_read_coef_idx(codec, 0x46); |
| 4700 | is_ctia = (val & 0x0070) == 0x0070; |
| 4701 | break; |
Kailang Yang | 71683c3 | 2017-06-20 16:33:50 +0800 | [diff] [blame] | 4702 | case 0x10ec0234: |
| 4703 | case 0x10ec0274: |
| 4704 | case 0x10ec0294: |
| 4705 | alc_process_coef_fw(codec, coef0274); |
| 4706 | msleep(80); |
| 4707 | val = alc_read_coef_idx(codec, 0x46); |
| 4708 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 4709 | break; |
Kailang Yang | 13fd08a | 2014-05-21 16:49:48 +0800 | [diff] [blame] | 4710 | case 0x10ec0233: |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4711 | case 0x10ec0283: |
| 4712 | alc_write_coef_idx(codec, 0x45, 0xd029); |
| 4713 | msleep(300); |
| 4714 | val = alc_read_coef_idx(codec, 0x46); |
| 4715 | is_ctia = (val & 0x0070) == 0x0070; |
| 4716 | break; |
Kailang Yang | 1a5bc8d | 2015-05-12 17:11:10 +0800 | [diff] [blame] | 4717 | case 0x10ec0298: |
Kailang Yang | 8954293 | 2017-07-17 15:03:43 +0800 | [diff] [blame] | 4718 | snd_hda_codec_write(codec, 0x21, 0, |
| 4719 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 4720 | msleep(100); |
| 4721 | snd_hda_codec_write(codec, 0x21, 0, |
| 4722 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 4723 | msleep(200); |
| 4724 | |
| 4725 | val = alc_read_coef_idx(codec, 0x50); |
| 4726 | if (val & (1 << 12)) { |
| 4727 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); |
| 4728 | alc_process_coef_fw(codec, coef0288); |
| 4729 | msleep(350); |
| 4730 | val = alc_read_coef_idx(codec, 0x50); |
| 4731 | is_ctia = (val & 0x0070) == 0x0070; |
| 4732 | } else { |
| 4733 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); |
| 4734 | alc_process_coef_fw(codec, coef0288); |
| 4735 | msleep(350); |
| 4736 | val = alc_read_coef_idx(codec, 0x50); |
| 4737 | is_ctia = (val & 0x0070) == 0x0070; |
| 4738 | } |
| 4739 | alc_process_coef_fw(codec, coef0298); |
| 4740 | snd_hda_codec_write(codec, 0x21, 0, |
| 4741 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); |
| 4742 | msleep(75); |
| 4743 | snd_hda_codec_write(codec, 0x21, 0, |
| 4744 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
| 4745 | break; |
Kailang Yang | f3b7033 | 2015-04-08 15:01:17 +0800 | [diff] [blame] | 4746 | case 0x10ec0286: |
| 4747 | case 0x10ec0288: |
| 4748 | alc_process_coef_fw(codec, coef0288); |
| 4749 | msleep(350); |
| 4750 | val = alc_read_coef_idx(codec, 0x50); |
| 4751 | is_ctia = (val & 0x0070) == 0x0070; |
| 4752 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4753 | case 0x10ec0292: |
| 4754 | alc_write_coef_idx(codec, 0x6b, 0xd429); |
| 4755 | msleep(300); |
| 4756 | val = alc_read_coef_idx(codec, 0x6c); |
| 4757 | is_ctia = (val & 0x001c) == 0x001c; |
| 4758 | break; |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4759 | case 0x10ec0293: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4760 | alc_process_coef_fw(codec, coef0293); |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 4761 | msleep(300); |
| 4762 | val = alc_read_coef_idx(codec, 0x46); |
| 4763 | is_ctia = (val & 0x0070) == 0x0070; |
| 4764 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4765 | case 0x10ec0668: |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4766 | alc_process_coef_fw(codec, coef0688); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4767 | msleep(300); |
| 4768 | val = alc_read_coef_idx(codec, 0xbe); |
| 4769 | is_ctia = (val & 0x1c02) == 0x1c02; |
| 4770 | break; |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4771 | case 0x10ec0215: |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4772 | case 0x10ec0225: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4773 | case 0x10ec0285: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 4774 | case 0x10ec0295: |
Kailang Yang | c2b691e | 2018-01-17 15:22:55 +0800 | [diff] [blame] | 4775 | case 0x10ec0289: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 4776 | case 0x10ec0299: |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 4777 | snd_hda_codec_write(codec, 0x21, 0, |
| 4778 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 4779 | msleep(80); |
| 4780 | snd_hda_codec_write(codec, 0x21, 0, |
| 4781 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); |
| 4782 | |
Kailang Yang | 5a36767 | 2017-07-21 15:23:53 +0800 | [diff] [blame] | 4783 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
| 4784 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); |
| 4785 | val = alc_read_coef_idx(codec, 0x45); |
| 4786 | if (val & (1 << 9)) { |
| 4787 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); |
| 4788 | alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); |
| 4789 | msleep(800); |
| 4790 | val = alc_read_coef_idx(codec, 0x46); |
| 4791 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 4792 | } else { |
| 4793 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); |
| 4794 | alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); |
| 4795 | msleep(800); |
| 4796 | val = alc_read_coef_idx(codec, 0x46); |
| 4797 | is_ctia = (val & 0x00f0) == 0x00f0; |
| 4798 | } |
| 4799 | alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); |
| 4800 | alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); |
| 4801 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 4802 | |
| 4803 | snd_hda_codec_write(codec, 0x21, 0, |
| 4804 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); |
| 4805 | msleep(80); |
| 4806 | snd_hda_codec_write(codec, 0x21, 0, |
| 4807 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); |
Kailang Yang | 4cc9b9d | 2016-02-03 15:09:35 +0800 | [diff] [blame] | 4808 | break; |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 4809 | case 0x10ec0867: |
| 4810 | is_ctia = true; |
| 4811 | break; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4812 | } |
| 4813 | |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 4814 | codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4815 | is_ctia ? "yes" : "no"); |
| 4816 | spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; |
| 4817 | } |
| 4818 | |
| 4819 | static void alc_update_headset_mode(struct hda_codec *codec) |
| 4820 | { |
| 4821 | struct alc_spec *spec = codec->spec; |
| 4822 | |
| 4823 | 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] | 4824 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4825 | |
| 4826 | int new_headset_mode; |
| 4827 | |
| 4828 | if (!snd_hda_jack_detect(codec, hp_pin)) |
| 4829 | new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; |
| 4830 | else if (mux_pin == spec->headset_mic_pin) |
| 4831 | new_headset_mode = ALC_HEADSET_MODE_HEADSET; |
| 4832 | else if (mux_pin == spec->headphone_mic_pin) |
| 4833 | new_headset_mode = ALC_HEADSET_MODE_MIC; |
| 4834 | else |
| 4835 | new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; |
| 4836 | |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 4837 | if (new_headset_mode == spec->current_headset_mode) { |
| 4838 | snd_hda_gen_update_outputs(codec); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4839 | return; |
David Henningsson | 5959a6b | 2013-11-12 11:10:57 +0100 | [diff] [blame] | 4840 | } |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4841 | |
| 4842 | switch (new_headset_mode) { |
| 4843 | case ALC_HEADSET_MODE_UNPLUGGED: |
| 4844 | alc_headset_mode_unplugged(codec); |
| 4845 | spec->gen.hp_jack_present = false; |
| 4846 | break; |
| 4847 | case ALC_HEADSET_MODE_HEADSET: |
| 4848 | if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) |
| 4849 | alc_determine_headset_type(codec); |
| 4850 | if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) |
| 4851 | alc_headset_mode_ctia(codec); |
| 4852 | else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) |
| 4853 | alc_headset_mode_omtp(codec); |
| 4854 | spec->gen.hp_jack_present = true; |
| 4855 | break; |
| 4856 | case ALC_HEADSET_MODE_MIC: |
| 4857 | alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); |
| 4858 | spec->gen.hp_jack_present = false; |
| 4859 | break; |
| 4860 | case ALC_HEADSET_MODE_HEADPHONE: |
| 4861 | alc_headset_mode_default(codec); |
| 4862 | spec->gen.hp_jack_present = true; |
| 4863 | break; |
| 4864 | } |
| 4865 | if (new_headset_mode != ALC_HEADSET_MODE_MIC) { |
| 4866 | snd_hda_set_pin_ctl_cache(codec, hp_pin, |
| 4867 | AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 4868 | if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4869 | snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, |
| 4870 | PIN_VREFHIZ); |
| 4871 | } |
| 4872 | spec->current_headset_mode = new_headset_mode; |
| 4873 | |
| 4874 | snd_hda_gen_update_outputs(codec); |
| 4875 | } |
| 4876 | |
| 4877 | static void alc_update_headset_mode_hook(struct hda_codec *codec, |
Takashi Iwai | 7fe3071 | 2014-01-30 17:59:02 +0100 | [diff] [blame] | 4878 | struct snd_kcontrol *kcontrol, |
| 4879 | struct snd_ctl_elem_value *ucontrol) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4880 | { |
| 4881 | alc_update_headset_mode(codec); |
| 4882 | } |
| 4883 | |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 4884 | static void alc_update_headset_jack_cb(struct hda_codec *codec, |
| 4885 | struct hda_jack_callback *jack) |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4886 | { |
| 4887 | struct alc_spec *spec = codec->spec; |
David Henningsson | 5db4d34 | 2013-11-22 12:17:06 +0100 | [diff] [blame] | 4888 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4889 | snd_hda_gen_hp_automute(codec, jack); |
| 4890 | } |
| 4891 | |
| 4892 | static void alc_probe_headset_mode(struct hda_codec *codec) |
| 4893 | { |
| 4894 | int i; |
| 4895 | struct alc_spec *spec = codec->spec; |
| 4896 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 4897 | |
| 4898 | /* Find mic pins */ |
| 4899 | for (i = 0; i < cfg->num_inputs; i++) { |
| 4900 | if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) |
| 4901 | spec->headset_mic_pin = cfg->inputs[i].pin; |
| 4902 | if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) |
| 4903 | spec->headphone_mic_pin = cfg->inputs[i].pin; |
| 4904 | } |
| 4905 | |
Takashi Iwai | 0bed2aa | 2018-06-19 12:45:53 +0200 | [diff] [blame] | 4906 | WARN_ON(spec->gen.cap_sync_hook); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 4907 | spec->gen.cap_sync_hook = alc_update_headset_mode_hook; |
| 4908 | spec->gen.automute_hook = alc_update_headset_mode; |
| 4909 | spec->gen.hp_automute_hook = alc_update_headset_jack_cb; |
| 4910 | } |
| 4911 | |
| 4912 | static void alc_fixup_headset_mode(struct hda_codec *codec, |
| 4913 | const struct hda_fixup *fix, int action) |
| 4914 | { |
| 4915 | struct alc_spec *spec = codec->spec; |
| 4916 | |
| 4917 | switch (action) { |
| 4918 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 4919 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; |
| 4920 | break; |
| 4921 | case HDA_FIXUP_ACT_PROBE: |
| 4922 | alc_probe_headset_mode(codec); |
| 4923 | break; |
| 4924 | case HDA_FIXUP_ACT_INIT: |
| 4925 | spec->current_headset_mode = 0; |
| 4926 | alc_update_headset_mode(codec); |
| 4927 | break; |
| 4928 | } |
| 4929 | } |
| 4930 | |
| 4931 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
| 4932 | const struct hda_fixup *fix, int action) |
| 4933 | { |
| 4934 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4935 | struct alc_spec *spec = codec->spec; |
| 4936 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 4937 | } |
| 4938 | else |
| 4939 | alc_fixup_headset_mode(codec, fix, action); |
| 4940 | } |
| 4941 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4942 | static void alc255_set_default_jack_type(struct hda_codec *codec) |
| 4943 | { |
| 4944 | /* Set to iphone type */ |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4945 | static struct coef_fw alc255fw[] = { |
Takashi Iwai | 54db6c3 | 2014-08-18 15:11:19 +0200 | [diff] [blame] | 4946 | WRITE_COEF(0x1b, 0x880b), |
| 4947 | WRITE_COEF(0x45, 0xd089), |
| 4948 | WRITE_COEF(0x1b, 0x080b), |
| 4949 | WRITE_COEF(0x46, 0x0004), |
| 4950 | WRITE_COEF(0x1b, 0x0c0b), |
| 4951 | {} |
| 4952 | }; |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4953 | static struct coef_fw alc256fw[] = { |
| 4954 | WRITE_COEF(0x1b, 0x884b), |
| 4955 | WRITE_COEF(0x45, 0xd089), |
| 4956 | WRITE_COEF(0x1b, 0x084b), |
| 4957 | WRITE_COEF(0x46, 0x0004), |
| 4958 | WRITE_COEF(0x1b, 0x0c4b), |
| 4959 | {} |
| 4960 | }; |
| 4961 | switch (codec->core.vendor_id) { |
| 4962 | case 0x10ec0255: |
| 4963 | alc_process_coef_fw(codec, alc255fw); |
| 4964 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 4965 | case 0x10ec0236: |
Kailang Yang | e69e7e0 | 2016-05-30 15:58:28 +0800 | [diff] [blame] | 4966 | case 0x10ec0256: |
| 4967 | alc_process_coef_fw(codec, alc256fw); |
| 4968 | break; |
| 4969 | } |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4970 | msleep(30); |
| 4971 | } |
| 4972 | |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4973 | static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, |
| 4974 | const struct hda_fixup *fix, int action) |
| 4975 | { |
| 4976 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4977 | alc255_set_default_jack_type(codec); |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 4978 | } |
| 4979 | alc_fixup_headset_mode(codec, fix, action); |
| 4980 | } |
| 4981 | |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 4982 | static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, |
| 4983 | const struct hda_fixup *fix, int action) |
| 4984 | { |
| 4985 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4986 | struct alc_spec *spec = codec->spec; |
| 4987 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 4988 | alc255_set_default_jack_type(codec); |
| 4989 | } |
| 4990 | else |
| 4991 | alc_fixup_headset_mode(codec, fix, action); |
| 4992 | } |
| 4993 | |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 4994 | static void alc288_update_headset_jack_cb(struct hda_codec *codec, |
| 4995 | struct hda_jack_callback *jack) |
| 4996 | { |
| 4997 | struct alc_spec *spec = codec->spec; |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 4998 | |
| 4999 | alc_update_headset_jack_cb(codec, jack); |
| 5000 | /* Headset Mic enable or disable, only for Dell Dino */ |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 5001 | alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present); |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5002 | } |
| 5003 | |
| 5004 | static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, |
| 5005 | const struct hda_fixup *fix, int action) |
| 5006 | { |
| 5007 | alc_fixup_headset_mode(codec, fix, action); |
| 5008 | if (action == HDA_FIXUP_ACT_PROBE) { |
| 5009 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 5010 | /* toggled via hp_automute_hook */ |
| 5011 | spec->gpio_mask |= 0x40; |
| 5012 | spec->gpio_dir |= 0x40; |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5013 | spec->gen.hp_automute_hook = alc288_update_headset_jack_cb; |
| 5014 | } |
| 5015 | } |
| 5016 | |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 5017 | static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, |
| 5018 | const struct hda_fixup *fix, int action) |
| 5019 | { |
| 5020 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5021 | struct alc_spec *spec = codec->spec; |
| 5022 | spec->gen.auto_mute_via_amp = 1; |
| 5023 | } |
| 5024 | } |
| 5025 | |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5026 | static void alc_fixup_no_shutup(struct hda_codec *codec, |
| 5027 | const struct hda_fixup *fix, int action) |
| 5028 | { |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 5029 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5030 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | c0ca5ec | 2019-02-20 16:15:45 +0100 | [diff] [blame] | 5031 | spec->no_shutup_pins = 1; |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5032 | } |
| 5033 | } |
| 5034 | |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 5035 | static void alc_fixup_disable_aamix(struct hda_codec *codec, |
| 5036 | const struct hda_fixup *fix, int action) |
| 5037 | { |
| 5038 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5039 | struct alc_spec *spec = codec->spec; |
| 5040 | /* Disable AA-loopback as it causes white noise */ |
| 5041 | spec->gen.mixer_nid = 0; |
| 5042 | } |
| 5043 | } |
| 5044 | |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 5045 | /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */ |
| 5046 | static void alc_fixup_tpt440_dock(struct hda_codec *codec, |
| 5047 | const struct hda_fixup *fix, int action) |
| 5048 | { |
| 5049 | static const struct hda_pintbl pincfgs[] = { |
| 5050 | { 0x16, 0x21211010 }, /* dock headphone */ |
| 5051 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 5052 | { } |
| 5053 | }; |
| 5054 | struct alc_spec *spec = codec->spec; |
| 5055 | |
| 5056 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 70a0976 | 2015-12-15 14:59:58 +0100 | [diff] [blame] | 5057 | spec->reboot_notify = alc_d3_at_reboot; /* reduce noise */ |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 5058 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 5059 | codec->power_save_node = 0; /* avoid click noises */ |
| 5060 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 5061 | } |
| 5062 | } |
| 5063 | |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5064 | static void alc_fixup_tpt470_dock(struct hda_codec *codec, |
| 5065 | const struct hda_fixup *fix, int action) |
| 5066 | { |
| 5067 | static const struct hda_pintbl pincfgs[] = { |
| 5068 | { 0x17, 0x21211010 }, /* dock headphone */ |
| 5069 | { 0x19, 0x21a11010 }, /* dock mic */ |
| 5070 | { } |
| 5071 | }; |
Takashi Iwai | 54947cd | 2018-12-03 10:44:15 +0100 | [diff] [blame] | 5072 | /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise |
| 5073 | * the speaker output becomes too low by some reason on Thinkpads with |
| 5074 | * ALC298 codec |
| 5075 | */ |
| 5076 | static hda_nid_t preferred_pairs[] = { |
| 5077 | 0x14, 0x03, 0x17, 0x02, 0x21, 0x02, |
| 5078 | 0 |
| 5079 | }; |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5080 | struct alc_spec *spec = codec->spec; |
| 5081 | |
| 5082 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 54947cd | 2018-12-03 10:44:15 +0100 | [diff] [blame] | 5083 | spec->gen.preferred_dacs = preferred_pairs; |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5084 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
Takashi Iwai | 71db96d | 2018-02-26 15:36:38 +0100 | [diff] [blame] | 5085 | snd_hda_apply_pincfgs(codec, pincfgs); |
| 5086 | } else if (action == HDA_FIXUP_ACT_INIT) { |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5087 | /* Enable DOCK device */ |
| 5088 | snd_hda_codec_write(codec, 0x17, 0, |
| 5089 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); |
| 5090 | /* Enable DOCK device */ |
| 5091 | snd_hda_codec_write(codec, 0x19, 0, |
| 5092 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5093 | } |
| 5094 | } |
| 5095 | |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5096 | static void alc_shutup_dell_xps13(struct hda_codec *codec) |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5097 | { |
| 5098 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 5099 | int hp_pin = alc_get_hp_pin(spec); |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5100 | |
Gabriele Mazzotta | 9476d369 | 2015-04-19 19:00:40 +0200 | [diff] [blame] | 5101 | /* Prevent pop noises when headphones are plugged in */ |
| 5102 | snd_hda_codec_write(codec, hp_pin, 0, |
| 5103 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
| 5104 | msleep(20); |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5105 | } |
| 5106 | |
| 5107 | static void alc_fixup_dell_xps13(struct hda_codec *codec, |
| 5108 | const struct hda_fixup *fix, int action) |
| 5109 | { |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5110 | struct alc_spec *spec = codec->spec; |
| 5111 | struct hda_input_mux *imux = &spec->gen.input_mux; |
| 5112 | int i; |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 5113 | |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5114 | switch (action) { |
| 5115 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5116 | /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise |
| 5117 | * it causes a click noise at start up |
| 5118 | */ |
| 5119 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 5120 | spec->shutup = alc_shutup_dell_xps13; |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5121 | break; |
| 5122 | case HDA_FIXUP_ACT_PROBE: |
Gabriele Mazzotta | f38663a | 2014-08-08 19:34:40 +0200 | [diff] [blame] | 5123 | /* Make the internal mic the default input source. */ |
| 5124 | for (i = 0; i < imux->num_items; i++) { |
| 5125 | if (spec->gen.imux_pins[i] == 0x12) { |
| 5126 | spec->gen.cur_mux[0] = i; |
| 5127 | break; |
| 5128 | } |
| 5129 | } |
Takashi Iwai | 3e1b0c4 | 2015-04-27 10:43:22 +0200 | [diff] [blame] | 5130 | break; |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 5131 | } |
| 5132 | } |
| 5133 | |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 5134 | static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, |
| 5135 | const struct hda_fixup *fix, int action) |
| 5136 | { |
| 5137 | struct alc_spec *spec = codec->spec; |
| 5138 | |
| 5139 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5140 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 5141 | spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */ |
David Henningsson | b40eda6 | 2015-05-28 09:40:23 +0200 | [diff] [blame] | 5142 | |
| 5143 | /* Disable boost for mic-in permanently. (This code is only called |
| 5144 | from quirks that guarantee that the headphone is at NID 0x1b.) */ |
| 5145 | snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); |
| 5146 | 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] | 5147 | } else |
| 5148 | alc_fixup_headset_mode(codec, fix, action); |
| 5149 | } |
| 5150 | |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5151 | static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, |
| 5152 | const struct hda_fixup *fix, int action) |
| 5153 | { |
| 5154 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5155 | alc_write_coef_idx(codec, 0xc4, 0x8000); |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5156 | alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5157 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
| 5158 | } |
| 5159 | alc_fixup_headset_mode(codec, fix, action); |
| 5160 | } |
| 5161 | |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5162 | /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ |
| 5163 | static int find_ext_mic_pin(struct hda_codec *codec) |
| 5164 | { |
| 5165 | struct alc_spec *spec = codec->spec; |
| 5166 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5167 | hda_nid_t nid; |
| 5168 | unsigned int defcfg; |
| 5169 | int i; |
| 5170 | |
| 5171 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5172 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 5173 | continue; |
| 5174 | nid = cfg->inputs[i].pin; |
| 5175 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 5176 | if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) |
| 5177 | continue; |
| 5178 | return nid; |
| 5179 | } |
| 5180 | |
| 5181 | return 0; |
| 5182 | } |
| 5183 | |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5184 | static void alc271_hp_gate_mic_jack(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5185 | const struct hda_fixup *fix, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5186 | int action) |
| 5187 | { |
| 5188 | struct alc_spec *spec = codec->spec; |
| 5189 | |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5190 | if (action == HDA_FIXUP_ACT_PROBE) { |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5191 | int mic_pin = find_ext_mic_pin(codec); |
Takashi Iwai | 35a39f9 | 2019-02-01 11:19:50 +0100 | [diff] [blame] | 5192 | int hp_pin = alc_get_hp_pin(spec); |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5193 | |
| 5194 | if (snd_BUG_ON(!mic_pin || !hp_pin)) |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5195 | return; |
Chih-Chung Chang | bde7bc6 | 2013-08-05 16:38:42 +0800 | [diff] [blame] | 5196 | snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); |
Takashi Iwai | 0db7579 | 2013-01-23 13:57:20 +0100 | [diff] [blame] | 5197 | } |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5198 | } |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5199 | |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 5200 | static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, |
| 5201 | const struct hda_fixup *fix, |
| 5202 | int action) |
| 5203 | { |
| 5204 | struct alc_spec *spec = codec->spec; |
| 5205 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
| 5206 | int i; |
| 5207 | |
| 5208 | /* The mic boosts on level 2 and 3 are too noisy |
| 5209 | on the internal mic input. |
| 5210 | Therefore limit the boost to 0 or 1. */ |
| 5211 | |
| 5212 | if (action != HDA_FIXUP_ACT_PROBE) |
| 5213 | return; |
| 5214 | |
| 5215 | for (i = 0; i < cfg->num_inputs; i++) { |
| 5216 | hda_nid_t nid = cfg->inputs[i].pin; |
| 5217 | unsigned int defcfg; |
| 5218 | if (cfg->inputs[i].type != AUTO_PIN_MIC) |
| 5219 | continue; |
| 5220 | defcfg = snd_hda_codec_get_pincfg(codec, nid); |
| 5221 | if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) |
| 5222 | continue; |
| 5223 | |
| 5224 | snd_hda_override_amp_caps(codec, nid, HDA_INPUT, |
| 5225 | (0x00 << AC_AMPCAP_OFFSET_SHIFT) | |
| 5226 | (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 5227 | (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 5228 | (0 << AC_AMPCAP_MUTE_SHIFT)); |
| 5229 | } |
| 5230 | } |
| 5231 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5232 | static void alc283_hp_automute_hook(struct hda_codec *codec, |
Takashi Iwai | 1a4f69d | 2014-09-11 15:22:46 +0200 | [diff] [blame] | 5233 | struct hda_jack_callback *jack) |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5234 | { |
| 5235 | struct alc_spec *spec = codec->spec; |
| 5236 | int vref; |
| 5237 | |
| 5238 | msleep(200); |
| 5239 | snd_hda_gen_hp_automute(codec, jack); |
| 5240 | |
| 5241 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 5242 | |
| 5243 | msleep(600); |
| 5244 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 5245 | vref); |
| 5246 | } |
| 5247 | |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5248 | static void alc283_fixup_chromebook(struct hda_codec *codec, |
| 5249 | const struct hda_fixup *fix, int action) |
| 5250 | { |
| 5251 | struct alc_spec *spec = codec->spec; |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5252 | |
| 5253 | switch (action) { |
| 5254 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5255 | snd_hda_override_wcaps(codec, 0x03, 0); |
Takashi Iwai | d2e9270 | 2013-10-30 07:50:53 +0100 | [diff] [blame] | 5256 | /* Disable AA-loopback as it causes white noise */ |
| 5257 | spec->gen.mixer_nid = 0; |
Kailang Yang | 3807021 | 2013-11-01 15:57:35 +0800 | [diff] [blame] | 5258 | break; |
| 5259 | case HDA_FIXUP_ACT_INIT: |
Kailang Yang | de9481c | 2014-04-07 16:41:52 +0800 | [diff] [blame] | 5260 | /* MIC2-VREF control */ |
| 5261 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5262 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5263 | /* Enable Line1 input control by verb */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5264 | alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5265 | break; |
| 5266 | } |
| 5267 | } |
| 5268 | |
| 5269 | static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, |
| 5270 | const struct hda_fixup *fix, int action) |
| 5271 | { |
| 5272 | struct alc_spec *spec = codec->spec; |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5273 | |
| 5274 | switch (action) { |
| 5275 | case HDA_FIXUP_ACT_PRE_PROBE: |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5276 | spec->gen.hp_automute_hook = alc283_hp_automute_hook; |
| 5277 | break; |
| 5278 | case HDA_FIXUP_ACT_INIT: |
| 5279 | /* MIC2-VREF control */ |
| 5280 | /* Set to manual mode */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 5281 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5282 | break; |
| 5283 | } |
| 5284 | } |
| 5285 | |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5286 | /* mute tablet speaker pin (0x14) via dock plugging in addition */ |
| 5287 | static void asus_tx300_automute(struct hda_codec *codec) |
| 5288 | { |
| 5289 | struct alc_spec *spec = codec->spec; |
| 5290 | snd_hda_gen_update_outputs(codec); |
| 5291 | if (snd_hda_jack_detect(codec, 0x1b)) |
| 5292 | spec->gen.mute_bits |= (1ULL << 0x14); |
| 5293 | } |
| 5294 | |
| 5295 | static void alc282_fixup_asus_tx300(struct hda_codec *codec, |
| 5296 | const struct hda_fixup *fix, int action) |
| 5297 | { |
| 5298 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5299 | static const struct hda_pintbl dock_pins[] = { |
| 5300 | { 0x1b, 0x21114000 }, /* dock speaker pin */ |
| 5301 | {} |
| 5302 | }; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5303 | |
| 5304 | switch (action) { |
| 5305 | case HDA_FIXUP_ACT_PRE_PROBE: |
Takashi Iwai | 1c76aa5 | 2018-06-21 16:37:54 +0200 | [diff] [blame] | 5306 | spec->init_amp = ALC_INIT_DEFAULT; |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 5307 | /* TX300 needs to set up GPIO2 for the speaker amp */ |
| 5308 | alc_setup_gpio(codec, 0x04); |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5309 | snd_hda_apply_pincfgs(codec, dock_pins); |
| 5310 | spec->gen.auto_mute_via_amp = 1; |
| 5311 | spec->gen.automute_hook = asus_tx300_automute; |
| 5312 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5313 | snd_hda_gen_hp_automute); |
| 5314 | break; |
Takashi Iwai | 5579cd6 | 2018-06-19 22:22:41 +0200 | [diff] [blame] | 5315 | case HDA_FIXUP_ACT_PROBE: |
| 5316 | spec->init_amp = ALC_INIT_DEFAULT; |
| 5317 | break; |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5318 | case HDA_FIXUP_ACT_BUILD: |
| 5319 | /* this is a bit tricky; give more sane names for the main |
| 5320 | * (tablet) speaker and the dock speaker, respectively |
| 5321 | */ |
Takashi Iwai | 56798e6 | 2017-04-11 08:10:52 +0200 | [diff] [blame] | 5322 | rename_ctl(codec, "Speaker Playback Switch", |
| 5323 | "Dock Speaker Playback Switch"); |
| 5324 | rename_ctl(codec, "Bass Speaker Playback Switch", |
| 5325 | "Speaker Playback Switch"); |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5326 | break; |
| 5327 | } |
| 5328 | } |
| 5329 | |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5330 | static void alc290_fixup_mono_speakers(struct hda_codec *codec, |
| 5331 | const struct hda_fixup *fix, int action) |
| 5332 | { |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 5333 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5334 | /* DAC node 0x03 is giving mono output. We therefore want to |
| 5335 | make sure 0x14 (front speaker) and 0x15 (headphones) use the |
| 5336 | stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ |
| 5337 | hda_nid_t conn1[2] = { 0x0c }; |
| 5338 | snd_hda_override_conn_list(codec, 0x14, 1, conn1); |
| 5339 | snd_hda_override_conn_list(codec, 0x15, 1, conn1); |
| 5340 | } |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5341 | } |
| 5342 | |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 5343 | static void alc298_fixup_speaker_volume(struct hda_codec *codec, |
| 5344 | const struct hda_fixup *fix, int action) |
| 5345 | { |
| 5346 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5347 | /* The speaker is routed to the Node 0x06 by a mistake, as a result |
| 5348 | we can't adjust the speaker's volume since this node does not has |
| 5349 | Amp-out capability. we change the speaker's route to: |
| 5350 | Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 ( |
| 5351 | Pin Complex), since Node 0x02 has Amp-out caps, we can adjust |
| 5352 | speaker's volume now. */ |
| 5353 | |
| 5354 | hda_nid_t conn1[1] = { 0x0c }; |
| 5355 | snd_hda_override_conn_list(codec, 0x17, 1, conn1); |
| 5356 | } |
| 5357 | } |
| 5358 | |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 5359 | /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */ |
| 5360 | static void alc295_fixup_disable_dac3(struct hda_codec *codec, |
| 5361 | const struct hda_fixup *fix, int action) |
| 5362 | { |
| 5363 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5364 | hda_nid_t conn[2] = { 0x02, 0x03 }; |
| 5365 | snd_hda_override_conn_list(codec, 0x17, 2, conn); |
| 5366 | } |
| 5367 | } |
| 5368 | |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5369 | /* Hook to update amp GPIO4 for automute */ |
| 5370 | static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, |
| 5371 | struct hda_jack_callback *jack) |
| 5372 | { |
| 5373 | struct alc_spec *spec = codec->spec; |
| 5374 | |
| 5375 | snd_hda_gen_hp_automute(codec, jack); |
| 5376 | /* mute_led_polarity is set to 0, so we pass inverted value here */ |
| 5377 | alc_update_gpio_led(codec, 0x10, !spec->gen.hp_jack_present); |
| 5378 | } |
| 5379 | |
| 5380 | /* Manage GPIOs for HP EliteBook Folio 9480m. |
| 5381 | * |
| 5382 | * GPIO4 is the headphone amplifier power control |
| 5383 | * GPIO3 is the audio output mute indicator LED |
| 5384 | */ |
| 5385 | |
| 5386 | static void alc280_fixup_hp_9480m(struct hda_codec *codec, |
| 5387 | const struct hda_fixup *fix, |
| 5388 | int action) |
| 5389 | { |
| 5390 | struct alc_spec *spec = codec->spec; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5391 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 5392 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5393 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 5394 | /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */ |
| 5395 | spec->gpio_mask |= 0x10; |
| 5396 | spec->gpio_dir |= 0x10; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5397 | spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook; |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5398 | } |
| 5399 | } |
| 5400 | |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 5401 | static void alc275_fixup_gpio4_off(struct hda_codec *codec, |
| 5402 | const struct hda_fixup *fix, |
| 5403 | int action) |
| 5404 | { |
| 5405 | struct alc_spec *spec = codec->spec; |
| 5406 | |
| 5407 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 5408 | spec->gpio_mask |= 0x04; |
| 5409 | spec->gpio_dir |= 0x04; |
| 5410 | /* set data bit low */ |
| 5411 | } |
| 5412 | } |
| 5413 | |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 5414 | static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, |
| 5415 | const struct hda_fixup *fix, |
| 5416 | int action) |
| 5417 | { |
| 5418 | alc_fixup_dual_codecs(codec, fix, action); |
| 5419 | switch (action) { |
| 5420 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5421 | /* override card longname to provide a unique UCM profile */ |
| 5422 | strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); |
| 5423 | break; |
| 5424 | case HDA_FIXUP_ACT_BUILD: |
| 5425 | /* rename Capture controls depending on the codec */ |
| 5426 | rename_ctl(codec, "Capture Volume", |
| 5427 | codec->addr == 0 ? |
| 5428 | "Rear-Panel Capture Volume" : |
| 5429 | "Front-Panel Capture Volume"); |
| 5430 | rename_ctl(codec, "Capture Switch", |
| 5431 | codec->addr == 0 ? |
| 5432 | "Rear-Panel Capture Switch" : |
| 5433 | "Front-Panel Capture Switch"); |
| 5434 | break; |
| 5435 | } |
| 5436 | } |
| 5437 | |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 5438 | /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ |
| 5439 | static void alc274_fixup_bind_dacs(struct hda_codec *codec, |
| 5440 | const struct hda_fixup *fix, int action) |
| 5441 | { |
| 5442 | struct alc_spec *spec = codec->spec; |
| 5443 | static hda_nid_t preferred_pairs[] = { |
| 5444 | 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02, |
| 5445 | 0 |
| 5446 | }; |
| 5447 | |
| 5448 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 5449 | return; |
| 5450 | |
| 5451 | spec->gen.preferred_dacs = preferred_pairs; |
| 5452 | } |
| 5453 | |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 5454 | /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */ |
| 5455 | static void alc285_fixup_invalidate_dacs(struct hda_codec *codec, |
| 5456 | const struct hda_fixup *fix, int action) |
| 5457 | { |
| 5458 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
| 5459 | return; |
| 5460 | |
| 5461 | snd_hda_override_wcaps(codec, 0x03, 0); |
| 5462 | } |
| 5463 | |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 5464 | static const struct hda_jack_keymap alc_headset_btn_keymap[] = { |
| 5465 | { SND_JACK_BTN_0, KEY_PLAYPAUSE }, |
| 5466 | { SND_JACK_BTN_1, KEY_VOICECOMMAND }, |
| 5467 | { SND_JACK_BTN_2, KEY_VOLUMEUP }, |
| 5468 | { SND_JACK_BTN_3, KEY_VOLUMEDOWN }, |
| 5469 | {} |
| 5470 | }; |
| 5471 | |
| 5472 | static void alc_headset_btn_callback(struct hda_codec *codec, |
| 5473 | struct hda_jack_callback *jack) |
| 5474 | { |
| 5475 | int report = 0; |
| 5476 | |
| 5477 | if (jack->unsol_res & (7 << 13)) |
| 5478 | report |= SND_JACK_BTN_0; |
| 5479 | |
| 5480 | if (jack->unsol_res & (1 << 16 | 3 << 8)) |
| 5481 | report |= SND_JACK_BTN_1; |
| 5482 | |
| 5483 | /* Volume up key */ |
| 5484 | if (jack->unsol_res & (7 << 23)) |
| 5485 | report |= SND_JACK_BTN_2; |
| 5486 | |
| 5487 | /* Volume down key */ |
| 5488 | if (jack->unsol_res & (7 << 10)) |
| 5489 | report |= SND_JACK_BTN_3; |
| 5490 | |
| 5491 | jack->jack->button_state = report; |
| 5492 | } |
| 5493 | |
Jaroslav Kysela | c8a9afa | 2019-03-14 09:21:08 +0100 | [diff] [blame] | 5494 | static void alc295_fixup_chromebook(struct hda_codec *codec, |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 5495 | const struct hda_fixup *fix, int action) |
| 5496 | { |
| 5497 | |
| 5498 | switch (action) { |
| 5499 | case HDA_FIXUP_ACT_PRE_PROBE: |
| 5500 | snd_hda_jack_detect_enable_callback(codec, 0x55, |
| 5501 | alc_headset_btn_callback); |
| 5502 | snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false, |
| 5503 | SND_JACK_HEADSET, alc_headset_btn_keymap); |
Jaroslav Kysela | c8a9afa | 2019-03-14 09:21:08 +0100 | [diff] [blame] | 5504 | switch (codec->core.vendor_id) { |
| 5505 | case 0x10ec0295: |
| 5506 | alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ |
| 5507 | alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); |
| 5508 | break; |
| 5509 | case 0x10ec0236: |
| 5510 | alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ |
| 5511 | alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); |
| 5512 | break; |
| 5513 | } |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 5514 | break; |
| 5515 | case HDA_FIXUP_ACT_INIT: |
| 5516 | switch (codec->core.vendor_id) { |
| 5517 | case 0x10ec0225: |
| 5518 | case 0x10ec0295: |
| 5519 | case 0x10ec0299: |
| 5520 | alc_write_coef_idx(codec, 0x48, 0xd011); |
| 5521 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); |
| 5522 | alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8); |
| 5523 | break; |
| 5524 | case 0x10ec0236: |
| 5525 | case 0x10ec0256: |
| 5526 | alc_write_coef_idx(codec, 0x48, 0xd011); |
| 5527 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); |
| 5528 | break; |
| 5529 | } |
| 5530 | break; |
| 5531 | } |
| 5532 | } |
| 5533 | |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 5534 | static void alc_fixup_disable_mic_vref(struct hda_codec *codec, |
| 5535 | const struct hda_fixup *fix, int action) |
| 5536 | { |
| 5537 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 5538 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); |
| 5539 | } |
| 5540 | |
Takashi Iwai | b317b03 | 2014-01-08 11:44:21 +0100 | [diff] [blame] | 5541 | /* for hda_fixup_thinkpad_acpi() */ |
| 5542 | #include "thinkpad_helper.c" |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 5543 | |
Takashi Iwai | d5a6cab | 2018-06-13 12:43:10 +0200 | [diff] [blame] | 5544 | static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, |
| 5545 | const struct hda_fixup *fix, int action) |
| 5546 | { |
| 5547 | alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ |
| 5548 | hda_fixup_thinkpad_acpi(codec, fix, action); |
| 5549 | } |
| 5550 | |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 5551 | /* for alc295_fixup_hp_top_speakers */ |
| 5552 | #include "hp_x360_helper.c" |
| 5553 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5554 | enum { |
| 5555 | ALC269_FIXUP_SONY_VAIO, |
| 5556 | ALC275_FIXUP_SONY_VAIO_GPIO2, |
| 5557 | ALC269_FIXUP_DELL_M101Z, |
| 5558 | ALC269_FIXUP_SKU_IGNORE, |
| 5559 | ALC269_FIXUP_ASUS_G73JW, |
| 5560 | ALC269_FIXUP_LENOVO_EAPD, |
| 5561 | ALC275_FIXUP_SONY_HWEQ, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 5562 | ALC275_FIXUP_SONY_DISABLE_AAMIX, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5563 | ALC271_FIXUP_DMIC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 5564 | ALC269_FIXUP_PCM_44K, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 5565 | ALC269_FIXUP_STEREO_DMIC, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 5566 | ALC269_FIXUP_HEADSET_MIC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 5567 | ALC269_FIXUP_QUANTA_MUTE, |
| 5568 | ALC269_FIXUP_LIFEBOOK, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 5569 | ALC269_FIXUP_LIFEBOOK_EXTMIC, |
Takashi Iwai | cc7016a | 2015-04-08 20:47:55 +0200 | [diff] [blame] | 5570 | ALC269_FIXUP_LIFEBOOK_HP_PIN, |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 5571 | ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 5572 | ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5573 | ALC269_FIXUP_AMIC, |
| 5574 | ALC269_FIXUP_DMIC, |
| 5575 | ALC269VB_FIXUP_AMIC, |
| 5576 | ALC269VB_FIXUP_DMIC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5577 | ALC269_FIXUP_HP_MUTE_LED, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 5578 | ALC269_FIXUP_HP_MUTE_LED_MIC1, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5579 | ALC269_FIXUP_HP_MUTE_LED_MIC2, |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 5580 | ALC269_FIXUP_HP_MUTE_LED_MIC3, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 5581 | ALC269_FIXUP_HP_GPIO_LED, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 5582 | ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 5583 | ALC269_FIXUP_HP_LINE1_MIC1_LED, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5584 | ALC269_FIXUP_INV_DMIC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5585 | ALC269_FIXUP_LENOVO_DOCK, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5586 | ALC269_FIXUP_NO_SHUTUP, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 5587 | ALC286_FIXUP_SONY_MIC_NO_PRESENCE, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5588 | ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5589 | ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 5590 | ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5591 | ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 5592 | ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5593 | ALC269_FIXUP_HEADSET_MODE, |
| 5594 | ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 5595 | ALC269_FIXUP_ASPIRE_HEADSET_MIC, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 5596 | ALC269_FIXUP_ASUS_X101_FUNC, |
| 5597 | ALC269_FIXUP_ASUS_X101_VERB, |
| 5598 | ALC269_FIXUP_ASUS_X101, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 5599 | ALC271_FIXUP_AMIC_MIC2, |
| 5600 | ALC271_FIXUP_HP_GATE_MIC_JACK, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 5601 | ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 5602 | ALC269_FIXUP_ACER_AC700, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 5603 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 5604 | ALC269VB_FIXUP_ASUS_ZENBOOK, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 5605 | ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 5606 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 5607 | ALC269VB_FIXUP_ORDISSIMO_EVE2, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 5608 | ALC283_FIXUP_CHROME_BOOK, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 5609 | ALC283_FIXUP_SENSE_COMBO_JACK, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 5610 | ALC282_FIXUP_ASUS_TX300, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 5611 | ALC283_FIXUP_INT_MIC, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5612 | ALC290_FIXUP_MONO_SPEAKERS, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 5613 | ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 5614 | ALC290_FIXUP_SUBWOOFER, |
| 5615 | ALC290_FIXUP_SUBWOOFER_HSJACK, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 5616 | ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 5617 | ALC269_FIXUP_DMIC_THINKPAD_ACPI, |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 5618 | ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 5619 | ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5620 | ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5621 | ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 5622 | ALC255_FIXUP_HEADSET_MODE, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 5623 | ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 5624 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 5625 | ALC292_FIXUP_TPT440_DOCK, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 5626 | ALC292_FIXUP_TPT440, |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 5627 | ALC283_FIXUP_HEADSET_MIC, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 5628 | ALC255_FIXUP_MIC_MUTE_LED, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 5629 | ALC282_FIXUP_ASPIRE_V5_PINS, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 5630 | ALC280_FIXUP_HP_GPIO4, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 5631 | ALC286_FIXUP_HP_GPIO_LED, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 5632 | ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 5633 | ALC280_FIXUP_HP_DOCK_PINS, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 5634 | ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 5635 | ALC280_FIXUP_HP_9480M, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 5636 | ALC288_FIXUP_DELL_HEADSET_MODE, |
| 5637 | ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 5638 | ALC288_FIXUP_DELL_XPS_13, |
| 5639 | ALC288_FIXUP_DISABLE_AAMIX, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 5640 | ALC292_FIXUP_DELL_E7X, |
| 5641 | ALC292_FIXUP_DISABLE_AAMIX, |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 5642 | ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 5643 | ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 5644 | ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 5645 | ALC275_FIXUP_DELL_XPS, |
Hui Wang | 8c69729 | 2015-11-24 11:08:18 +0800 | [diff] [blame] | 5646 | ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE, |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 5647 | ALC293_FIXUP_LENOVO_SPK_NOISE, |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 5648 | ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
Kai-Heng Feng | 3b43b71 | 2016-02-25 15:19:38 +0800 | [diff] [blame] | 5649 | ALC255_FIXUP_DELL_SPK_NOISE, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 5650 | ALC225_FIXUP_DISABLE_MIC_VREF, |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 5651 | ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 5652 | ALC295_FIXUP_DISABLE_DAC3, |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 5653 | ALC280_FIXUP_HP_HEADSET_MIC, |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 5654 | ALC221_FIXUP_HP_FRONT_MIC, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 5655 | ALC292_FIXUP_TPT460, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 5656 | ALC298_FIXUP_SPK_VOLUME, |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 5657 | ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 5658 | ALC269_FIXUP_ATIV_BOOK_8, |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 5659 | ALC221_FIXUP_HP_MIC_NO_PRESENCE, |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 5660 | ALC256_FIXUP_ASUS_HEADSET_MODE, |
| 5661 | ALC256_FIXUP_ASUS_MIC, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 5662 | ALC256_FIXUP_ASUS_AIO_GPIO2, |
Chris Chiu | 216d7ae | 2017-02-28 14:17:14 -0600 | [diff] [blame] | 5663 | ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 5664 | ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 5665 | ALC233_FIXUP_LENOVO_MULTI_CODECS, |
Hui Wang | f33f79f | 2017-07-07 12:08:29 +0800 | [diff] [blame] | 5666 | ALC294_FIXUP_LENOVO_MIC_LOCATION, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 5667 | ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 5668 | ALC700_FIXUP_INTEL_REFERENCE, |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 5669 | ALC274_FIXUP_DELL_BIND_DACS, |
| 5670 | ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 5671 | ALC298_FIXUP_TPT470_DOCK, |
Kailang Yang | ae104a2 | 2018-02-05 16:07:20 +0800 | [diff] [blame] | 5672 | ALC255_FIXUP_DUMMY_LINEOUT_VERB, |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 5673 | ALC255_FIXUP_DELL_HEADSET_MIC, |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 5674 | ALC256_FIXUP_HUAWEI_MBXP_PINS, |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 5675 | ALC295_FIXUP_HP_X360, |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 5676 | ALC221_FIXUP_HP_HEADSET_MIC, |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 5677 | ALC285_FIXUP_LENOVO_HEADPHONE_NOISE, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 5678 | ALC295_FIXUP_HP_AUTO_MUTE, |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 5679 | ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 5680 | ALC294_FIXUP_ASUS_MIC, |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 5681 | ALC294_FIXUP_ASUS_HEADSET_MIC, |
| 5682 | ALC294_FIXUP_ASUS_SPK, |
Jeremy Soller | 89e3a56 | 2019-01-30 16:12:31 -0700 | [diff] [blame] | 5683 | ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 5684 | ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
Jian-Hong Pan | cbc05fd | 2019-03-13 17:33:24 +0800 | [diff] [blame] | 5685 | ALC255_FIXUP_ACER_HEADSET_MIC, |
Kailang Yang | 10f5b1b | 2019-02-21 16:10:22 +0800 | [diff] [blame] | 5686 | ALC295_FIXUP_CHROME_BOOK, |
Kailang Yang | 136824e | 2019-03-14 16:22:45 +0800 | [diff] [blame] | 5687 | ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE, |
| 5688 | ALC225_FIXUP_WYSE_AUTO_MUTE, |
| 5689 | ALC225_FIXUP_WYSE_DISABLE_MIC_VREF, |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 5690 | ALC286_FIXUP_ACER_AIO_HEADSET_MIC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5691 | }; |
| 5692 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5693 | static const struct hda_fixup alc269_fixups[] = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5694 | [ALC269_FIXUP_SONY_VAIO] = { |
Takashi Iwai | fd10821 | 2013-01-10 10:18:14 +0100 | [diff] [blame] | 5695 | .type = HDA_FIXUP_PINCTLS, |
| 5696 | .v.pins = (const struct hda_pintbl[]) { |
| 5697 | {0x19, PIN_VREFGRD}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5698 | {} |
| 5699 | } |
| 5700 | }, |
| 5701 | [ALC275_FIXUP_SONY_VAIO_GPIO2] = { |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 5702 | .type = HDA_FIXUP_FUNC, |
| 5703 | .v.func = alc275_fixup_gpio4_off, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5704 | .chained = true, |
| 5705 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 5706 | }, |
| 5707 | [ALC269_FIXUP_DELL_M101Z] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5708 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5709 | .v.verbs = (const struct hda_verb[]) { |
| 5710 | /* Enables internal speaker */ |
| 5711 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, |
| 5712 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, |
| 5713 | {} |
| 5714 | } |
| 5715 | }, |
| 5716 | [ALC269_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5717 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 5718 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5719 | }, |
| 5720 | [ALC269_FIXUP_ASUS_G73JW] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5721 | .type = HDA_FIXUP_PINS, |
| 5722 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5723 | { 0x17, 0x99130111 }, /* subwoofer */ |
| 5724 | { } |
| 5725 | } |
| 5726 | }, |
| 5727 | [ALC269_FIXUP_LENOVO_EAPD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5728 | .type = HDA_FIXUP_VERBS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5729 | .v.verbs = (const struct hda_verb[]) { |
| 5730 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 5731 | {} |
| 5732 | } |
| 5733 | }, |
| 5734 | [ALC275_FIXUP_SONY_HWEQ] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5735 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5736 | .v.func = alc269_fixup_hweq, |
| 5737 | .chained = true, |
| 5738 | .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 |
| 5739 | }, |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 5740 | [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { |
| 5741 | .type = HDA_FIXUP_FUNC, |
| 5742 | .v.func = alc_fixup_disable_aamix, |
| 5743 | .chained = true, |
| 5744 | .chain_id = ALC269_FIXUP_SONY_VAIO |
| 5745 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5746 | [ALC271_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5747 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 5748 | .v.func = alc271_fixup_dmic, |
| 5749 | }, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 5750 | [ALC269_FIXUP_PCM_44K] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5751 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 5752 | .v.func = alc269_fixup_pcm_44k, |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 5753 | .chained = true, |
| 5754 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 5755 | }, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 5756 | [ALC269_FIXUP_STEREO_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5757 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 5758 | .v.func = alc269_fixup_stereo_dmic, |
| 5759 | }, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 5760 | [ALC269_FIXUP_HEADSET_MIC] = { |
| 5761 | .type = HDA_FIXUP_FUNC, |
| 5762 | .v.func = alc269_fixup_headset_mic, |
| 5763 | }, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 5764 | [ALC269_FIXUP_QUANTA_MUTE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5765 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 5766 | .v.func = alc269_fixup_quanta_mute, |
| 5767 | }, |
| 5768 | [ALC269_FIXUP_LIFEBOOK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5769 | .type = HDA_FIXUP_PINS, |
| 5770 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2451991 | 2011-08-16 15:08:49 +0200 | [diff] [blame] | 5771 | { 0x1a, 0x2101103f }, /* dock line-out */ |
| 5772 | { 0x1b, 0x23a11040 }, /* dock mic-in */ |
| 5773 | { } |
| 5774 | }, |
| 5775 | .chained = true, |
| 5776 | .chain_id = ALC269_FIXUP_QUANTA_MUTE |
| 5777 | }, |
David Henningsson | 2041d56 | 2014-06-13 11:15:44 +0200 | [diff] [blame] | 5778 | [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { |
| 5779 | .type = HDA_FIXUP_PINS, |
| 5780 | .v.pins = (const struct hda_pintbl[]) { |
| 5781 | { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ |
| 5782 | { } |
| 5783 | }, |
| 5784 | }, |
Takashi Iwai | cc7016a | 2015-04-08 20:47:55 +0200 | [diff] [blame] | 5785 | [ALC269_FIXUP_LIFEBOOK_HP_PIN] = { |
| 5786 | .type = HDA_FIXUP_PINS, |
| 5787 | .v.pins = (const struct hda_pintbl[]) { |
| 5788 | { 0x21, 0x0221102f }, /* HP out */ |
| 5789 | { } |
| 5790 | }, |
| 5791 | }, |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 5792 | [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { |
| 5793 | .type = HDA_FIXUP_FUNC, |
| 5794 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
| 5795 | }, |
Jan-Marek Glogowski | fdcc968 | 2018-02-14 11:29:15 +0100 | [diff] [blame] | 5796 | [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { |
| 5797 | .type = HDA_FIXUP_FUNC, |
| 5798 | .v.func = alc269_fixup_pincfg_U7x7_headset_mic, |
| 5799 | }, |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5800 | [ALC269_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5801 | .type = HDA_FIXUP_PINS, |
| 5802 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5803 | { 0x14, 0x99130110 }, /* speaker */ |
| 5804 | { 0x15, 0x0121401f }, /* HP out */ |
| 5805 | { 0x18, 0x01a19c20 }, /* mic */ |
| 5806 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 5807 | { } |
| 5808 | }, |
| 5809 | }, |
| 5810 | [ALC269_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5811 | .type = HDA_FIXUP_PINS, |
| 5812 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5813 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 5814 | { 0x14, 0x99130110 }, /* speaker */ |
| 5815 | { 0x15, 0x0121401f }, /* HP out */ |
| 5816 | { 0x18, 0x01a19c20 }, /* mic */ |
| 5817 | { } |
| 5818 | }, |
| 5819 | }, |
| 5820 | [ALC269VB_FIXUP_AMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5821 | .type = HDA_FIXUP_PINS, |
| 5822 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5823 | { 0x14, 0x99130110 }, /* speaker */ |
| 5824 | { 0x18, 0x01a19c20 }, /* mic */ |
| 5825 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 5826 | { 0x21, 0x0121401f }, /* HP out */ |
| 5827 | { } |
| 5828 | }, |
| 5829 | }, |
David Henningsson | 2267ea9 | 2012-01-03 08:45:56 +0100 | [diff] [blame] | 5830 | [ALC269VB_FIXUP_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5831 | .type = HDA_FIXUP_PINS, |
| 5832 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 5833 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 5834 | { 0x14, 0x99130110 }, /* speaker */ |
| 5835 | { 0x18, 0x01a19c20 }, /* mic */ |
| 5836 | { 0x21, 0x0121401f }, /* HP out */ |
| 5837 | { } |
| 5838 | }, |
| 5839 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5840 | [ALC269_FIXUP_HP_MUTE_LED] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5841 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5842 | .v.func = alc269_fixup_hp_mute_led, |
David Henningsson | 6d3cd5d | 2013-01-07 12:03:47 +0100 | [diff] [blame] | 5843 | }, |
David Henningsson | d06ac14 | 2013-02-18 11:41:55 +0100 | [diff] [blame] | 5844 | [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { |
| 5845 | .type = HDA_FIXUP_FUNC, |
| 5846 | .v.func = alc269_fixup_hp_mute_led_mic1, |
| 5847 | }, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5848 | [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5849 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 5850 | .v.func = alc269_fixup_hp_mute_led_mic2, |
Takashi Iwai | 420b0fe | 2012-03-12 12:35:27 +0100 | [diff] [blame] | 5851 | }, |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 5852 | [ALC269_FIXUP_HP_MUTE_LED_MIC3] = { |
| 5853 | .type = HDA_FIXUP_FUNC, |
| 5854 | .v.func = alc269_fixup_hp_mute_led_mic3, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 5855 | .chained = true, |
| 5856 | .chain_id = ALC295_FIXUP_HP_AUTO_MUTE |
Tom Briden | 7f783bd | 2017-03-25 10:12:01 +0000 | [diff] [blame] | 5857 | }, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 5858 | [ALC269_FIXUP_HP_GPIO_LED] = { |
| 5859 | .type = HDA_FIXUP_FUNC, |
| 5860 | .v.func = alc269_fixup_hp_gpio_led, |
| 5861 | }, |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 5862 | [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { |
| 5863 | .type = HDA_FIXUP_FUNC, |
| 5864 | .v.func = alc269_fixup_hp_gpio_mic1_led, |
| 5865 | }, |
| 5866 | [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { |
| 5867 | .type = HDA_FIXUP_FUNC, |
| 5868 | .v.func = alc269_fixup_hp_line1_mic1_led, |
| 5869 | }, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5870 | [ALC269_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5871 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 5872 | .v.func = alc_fixup_inv_dmic, |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 5873 | }, |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 5874 | [ALC269_FIXUP_NO_SHUTUP] = { |
| 5875 | .type = HDA_FIXUP_FUNC, |
| 5876 | .v.func = alc_fixup_no_shutup, |
| 5877 | }, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5878 | [ALC269_FIXUP_LENOVO_DOCK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5879 | .type = HDA_FIXUP_PINS, |
| 5880 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5881 | { 0x19, 0x23a11040 }, /* dock mic */ |
| 5882 | { 0x1b, 0x2121103f }, /* dock headphone */ |
| 5883 | { } |
| 5884 | }, |
| 5885 | .chained = true, |
| 5886 | .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT |
| 5887 | }, |
| 5888 | [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 5889 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5890 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
David Henningsson | 5212900 | 2013-11-19 10:25:53 +0100 | [diff] [blame] | 5891 | .chained = true, |
| 5892 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 5893 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5894 | [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 5895 | .type = HDA_FIXUP_PINS, |
| 5896 | .v.pins = (const struct hda_pintbl[]) { |
| 5897 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 5898 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 5899 | { } |
| 5900 | }, |
| 5901 | .chained = true, |
| 5902 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 5903 | }, |
| 5904 | [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 5905 | .type = HDA_FIXUP_PINS, |
| 5906 | .v.pins = (const struct hda_pintbl[]) { |
| 5907 | { 0x16, 0x21014020 }, /* dock line out */ |
| 5908 | { 0x19, 0x21a19030 }, /* dock mic */ |
| 5909 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 5910 | { } |
| 5911 | }, |
| 5912 | .chained = true, |
| 5913 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 5914 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 5915 | [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { |
| 5916 | .type = HDA_FIXUP_PINS, |
| 5917 | .v.pins = (const struct hda_pintbl[]) { |
| 5918 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 5919 | { } |
| 5920 | }, |
| 5921 | .chained = true, |
| 5922 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 5923 | }, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 5924 | [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = { |
| 5925 | .type = HDA_FIXUP_PINS, |
| 5926 | .v.pins = (const struct hda_pintbl[]) { |
| 5927 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 5928 | { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 5929 | { } |
| 5930 | }, |
| 5931 | .chained = true, |
| 5932 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 5933 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5934 | [ALC269_FIXUP_HEADSET_MODE] = { |
| 5935 | .type = HDA_FIXUP_FUNC, |
| 5936 | .v.func = alc_fixup_headset_mode, |
Hui Wang | 6676f30 | 2014-11-18 17:57:41 +0800 | [diff] [blame] | 5937 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 5938 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 5939 | }, |
| 5940 | [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 5941 | .type = HDA_FIXUP_FUNC, |
| 5942 | .v.func = alc_fixup_headset_mode_no_hp_mic, |
| 5943 | }, |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 5944 | [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { |
| 5945 | .type = HDA_FIXUP_PINS, |
| 5946 | .v.pins = (const struct hda_pintbl[]) { |
| 5947 | { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ |
| 5948 | { } |
| 5949 | }, |
| 5950 | .chained = true, |
| 5951 | .chain_id = ALC269_FIXUP_HEADSET_MODE, |
| 5952 | }, |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 5953 | [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { |
| 5954 | .type = HDA_FIXUP_PINS, |
| 5955 | .v.pins = (const struct hda_pintbl[]) { |
| 5956 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 5957 | { } |
| 5958 | }, |
David Henningsson | fbc78ad | 2013-10-11 13:46:04 +0200 | [diff] [blame] | 5959 | .chained = true, |
| 5960 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
David Henningsson | 88cfcf8 | 2013-10-11 10:18:45 +0200 | [diff] [blame] | 5961 | }, |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 5962 | [ALC256_FIXUP_HUAWEI_MBXP_PINS] = { |
| 5963 | .type = HDA_FIXUP_PINS, |
| 5964 | .v.pins = (const struct hda_pintbl[]) { |
| 5965 | {0x12, 0x90a60130}, |
| 5966 | {0x13, 0x40000000}, |
| 5967 | {0x14, 0x90170110}, |
| 5968 | {0x18, 0x411111f0}, |
| 5969 | {0x19, 0x04a11040}, |
| 5970 | {0x1a, 0x411111f0}, |
| 5971 | {0x1b, 0x90170112}, |
| 5972 | {0x1d, 0x40759a05}, |
| 5973 | {0x1e, 0x411111f0}, |
| 5974 | {0x21, 0x04211020}, |
| 5975 | { } |
| 5976 | }, |
Ayman Bagabas | e2744fd | 2018-12-12 18:07:59 -0500 | [diff] [blame] | 5977 | .chained = true, |
| 5978 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 5979 | }, |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 5980 | [ALC269_FIXUP_ASUS_X101_FUNC] = { |
| 5981 | .type = HDA_FIXUP_FUNC, |
| 5982 | .v.func = alc269_fixup_x101_headset_mic, |
| 5983 | }, |
| 5984 | [ALC269_FIXUP_ASUS_X101_VERB] = { |
| 5985 | .type = HDA_FIXUP_VERBS, |
| 5986 | .v.verbs = (const struct hda_verb[]) { |
| 5987 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, |
| 5988 | {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, |
| 5989 | {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, |
| 5990 | { } |
| 5991 | }, |
| 5992 | .chained = true, |
| 5993 | .chain_id = ALC269_FIXUP_ASUS_X101_FUNC |
| 5994 | }, |
| 5995 | [ALC269_FIXUP_ASUS_X101] = { |
| 5996 | .type = HDA_FIXUP_PINS, |
| 5997 | .v.pins = (const struct hda_pintbl[]) { |
| 5998 | { 0x18, 0x04a1182c }, /* Headset mic */ |
| 5999 | { } |
| 6000 | }, |
| 6001 | .chained = true, |
| 6002 | .chain_id = ALC269_FIXUP_ASUS_X101_VERB |
| 6003 | }, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6004 | [ALC271_FIXUP_AMIC_MIC2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6005 | .type = HDA_FIXUP_PINS, |
| 6006 | .v.pins = (const struct hda_pintbl[]) { |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6007 | { 0x14, 0x99130110 }, /* speaker */ |
| 6008 | { 0x19, 0x01a19c20 }, /* mic */ |
| 6009 | { 0x1b, 0x99a7012f }, /* int-mic */ |
| 6010 | { 0x21, 0x0121401f }, /* HP out */ |
| 6011 | { } |
| 6012 | }, |
| 6013 | }, |
| 6014 | [ALC271_FIXUP_HP_GATE_MIC_JACK] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 6015 | .type = HDA_FIXUP_FUNC, |
Dylan Reid | 08a978d | 2012-11-18 22:56:40 -0800 | [diff] [blame] | 6016 | .v.func = alc271_hp_gate_mic_jack, |
| 6017 | .chained = true, |
| 6018 | .chain_id = ALC271_FIXUP_AMIC_MIC2, |
| 6019 | }, |
Oleksij Rempel | b1e8972 | 2013-12-04 20:50:53 +0100 | [diff] [blame] | 6020 | [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { |
| 6021 | .type = HDA_FIXUP_FUNC, |
| 6022 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6023 | .chained = true, |
| 6024 | .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, |
| 6025 | }, |
Dylan Reid | 4239700 | 2013-04-05 14:58:22 -0700 | [diff] [blame] | 6026 | [ALC269_FIXUP_ACER_AC700] = { |
| 6027 | .type = HDA_FIXUP_PINS, |
| 6028 | .v.pins = (const struct hda_pintbl[]) { |
| 6029 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6030 | { 0x14, 0x99130110 }, /* speaker */ |
| 6031 | { 0x18, 0x03a11c20 }, /* mic */ |
| 6032 | { 0x1e, 0x0346101e }, /* SPDIF1 */ |
| 6033 | { 0x21, 0x0321101f }, /* HP out */ |
| 6034 | { } |
| 6035 | }, |
| 6036 | .chained = true, |
| 6037 | .chain_id = ALC271_FIXUP_DMIC, |
| 6038 | }, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6039 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { |
| 6040 | .type = HDA_FIXUP_FUNC, |
| 6041 | .v.func = alc269_fixup_limit_int_mic_boost, |
David Henningsson | 2793769 | 2013-11-18 11:51:47 +0100 | [diff] [blame] | 6042 | .chained = true, |
| 6043 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6044 | }, |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 6045 | [ALC269VB_FIXUP_ASUS_ZENBOOK] = { |
| 6046 | .type = HDA_FIXUP_FUNC, |
| 6047 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6048 | .chained = true, |
| 6049 | .chain_id = ALC269VB_FIXUP_DMIC, |
| 6050 | }, |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 6051 | [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { |
| 6052 | .type = HDA_FIXUP_VERBS, |
| 6053 | .v.verbs = (const struct hda_verb[]) { |
| 6054 | /* class-D output amp +5dB */ |
| 6055 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, |
| 6056 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, |
| 6057 | {} |
| 6058 | }, |
| 6059 | .chained = true, |
| 6060 | .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, |
| 6061 | }, |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 6062 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { |
| 6063 | .type = HDA_FIXUP_FUNC, |
| 6064 | .v.func = alc269_fixup_limit_int_mic_boost, |
| 6065 | .chained = true, |
| 6066 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, |
| 6067 | }, |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 6068 | [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { |
| 6069 | .type = HDA_FIXUP_PINS, |
| 6070 | .v.pins = (const struct hda_pintbl[]) { |
| 6071 | { 0x12, 0x99a3092f }, /* int-mic */ |
| 6072 | { 0x18, 0x03a11d20 }, /* mic */ |
| 6073 | { 0x19, 0x411111f0 }, /* Unused bogus pin */ |
| 6074 | { } |
| 6075 | }, |
| 6076 | }, |
Kailang Yang | cd217a6 | 2013-08-22 10:15:24 +0200 | [diff] [blame] | 6077 | [ALC283_FIXUP_CHROME_BOOK] = { |
| 6078 | .type = HDA_FIXUP_FUNC, |
| 6079 | .v.func = alc283_fixup_chromebook, |
| 6080 | }, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 6081 | [ALC283_FIXUP_SENSE_COMBO_JACK] = { |
| 6082 | .type = HDA_FIXUP_FUNC, |
| 6083 | .v.func = alc283_fixup_sense_combo_jack, |
| 6084 | .chained = true, |
| 6085 | .chain_id = ALC283_FIXUP_CHROME_BOOK, |
| 6086 | }, |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6087 | [ALC282_FIXUP_ASUS_TX300] = { |
| 6088 | .type = HDA_FIXUP_FUNC, |
| 6089 | .v.func = alc282_fixup_asus_tx300, |
| 6090 | }, |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 6091 | [ALC283_FIXUP_INT_MIC] = { |
| 6092 | .type = HDA_FIXUP_VERBS, |
| 6093 | .v.verbs = (const struct hda_verb[]) { |
| 6094 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, |
| 6095 | {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, |
| 6096 | { } |
| 6097 | }, |
| 6098 | .chained = true, |
| 6099 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 6100 | }, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6101 | [ALC290_FIXUP_SUBWOOFER_HSJACK] = { |
| 6102 | .type = HDA_FIXUP_PINS, |
| 6103 | .v.pins = (const struct hda_pintbl[]) { |
| 6104 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 6105 | { } |
| 6106 | }, |
| 6107 | .chained = true, |
| 6108 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
| 6109 | }, |
| 6110 | [ALC290_FIXUP_SUBWOOFER] = { |
| 6111 | .type = HDA_FIXUP_PINS, |
| 6112 | .v.pins = (const struct hda_pintbl[]) { |
| 6113 | { 0x17, 0x90170112 }, /* subwoofer */ |
| 6114 | { } |
| 6115 | }, |
| 6116 | .chained = true, |
| 6117 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS, |
| 6118 | }, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6119 | [ALC290_FIXUP_MONO_SPEAKERS] = { |
| 6120 | .type = HDA_FIXUP_FUNC, |
| 6121 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6122 | }, |
| 6123 | [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { |
| 6124 | .type = HDA_FIXUP_FUNC, |
| 6125 | .v.func = alc290_fixup_mono_speakers, |
David Henningsson | 338cae5 | 2013-10-07 10:39:59 +0200 | [diff] [blame] | 6126 | .chained = true, |
| 6127 | .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
| 6128 | }, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6129 | [ALC269_FIXUP_THINKPAD_ACPI] = { |
| 6130 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | d5a6cab | 2018-06-13 12:43:10 +0200 | [diff] [blame] | 6131 | .v.func = alc_fixup_thinkpad_acpi, |
Takashi Iwai | 09da111 | 2016-09-08 12:15:02 +0200 | [diff] [blame] | 6132 | .chained = true, |
| 6133 | .chain_id = ALC269_FIXUP_SKU_IGNORE, |
David Henningsson | b67ae3f | 2013-11-05 13:11:37 +0100 | [diff] [blame] | 6134 | }, |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 6135 | [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = { |
| 6136 | .type = HDA_FIXUP_FUNC, |
| 6137 | .v.func = alc_fixup_inv_dmic, |
| 6138 | .chained = true, |
| 6139 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, |
| 6140 | }, |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 6141 | [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = { |
| 6142 | .type = HDA_FIXUP_PINS, |
| 6143 | .v.pins = (const struct hda_pintbl[]) { |
| 6144 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6145 | { } |
| 6146 | }, |
| 6147 | .chained = true, |
| 6148 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 6149 | }, |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 6150 | [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 6151 | .type = HDA_FIXUP_PINS, |
| 6152 | .v.pins = (const struct hda_pintbl[]) { |
| 6153 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6154 | { } |
| 6155 | }, |
| 6156 | .chained = true, |
| 6157 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 6158 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6159 | [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6160 | .type = HDA_FIXUP_PINS, |
| 6161 | .v.pins = (const struct hda_pintbl[]) { |
| 6162 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6163 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6164 | { } |
| 6165 | }, |
| 6166 | .chained = true, |
| 6167 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
| 6168 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6169 | [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
| 6170 | .type = HDA_FIXUP_PINS, |
| 6171 | .v.pins = (const struct hda_pintbl[]) { |
| 6172 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6173 | { } |
| 6174 | }, |
| 6175 | .chained = true, |
| 6176 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6177 | }, |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6178 | [ALC255_FIXUP_HEADSET_MODE] = { |
| 6179 | .type = HDA_FIXUP_FUNC, |
| 6180 | .v.func = alc_fixup_headset_mode_alc255, |
Hui Wang | 4a83d42 | 2014-11-18 17:57:40 +0800 | [diff] [blame] | 6181 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6182 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Kailang Yang | 9a22a8f5 | 2013-11-08 15:54:49 +0800 | [diff] [blame] | 6183 | }, |
Kailang Yang | 3127899 | 2014-03-03 15:27:22 +0800 | [diff] [blame] | 6184 | [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
| 6185 | .type = HDA_FIXUP_FUNC, |
| 6186 | .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, |
| 6187 | }, |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 6188 | [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6189 | .type = HDA_FIXUP_PINS, |
| 6190 | .v.pins = (const struct hda_pintbl[]) { |
| 6191 | { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6192 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6193 | { } |
| 6194 | }, |
| 6195 | .chained = true, |
| 6196 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6197 | }, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6198 | [ALC292_FIXUP_TPT440_DOCK] = { |
David Henningsson | ec56af6 | 2015-06-24 10:46:33 +0200 | [diff] [blame] | 6199 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 7f57d80 | 2015-09-24 17:36:51 +0200 | [diff] [blame] | 6200 | .v.func = alc_fixup_tpt440_dock, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6201 | .chained = true, |
| 6202 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 6203 | }, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6204 | [ALC292_FIXUP_TPT440] = { |
| 6205 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 157f0b7 | 2015-12-10 23:30:43 +0100 | [diff] [blame] | 6206 | .v.func = alc_fixup_disable_aamix, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6207 | .chained = true, |
| 6208 | .chain_id = ALC292_FIXUP_TPT440_DOCK, |
| 6209 | }, |
Anisse Astier | abaa2274 | 2016-08-24 09:14:13 +0200 | [diff] [blame] | 6210 | [ALC283_FIXUP_HEADSET_MIC] = { |
Daniel Drake | 9dc1286 | 2014-07-22 10:58:29 +0100 | [diff] [blame] | 6211 | .type = HDA_FIXUP_PINS, |
| 6212 | .v.pins = (const struct hda_pintbl[]) { |
| 6213 | { 0x19, 0x04a110f0 }, |
| 6214 | { }, |
| 6215 | }, |
| 6216 | }, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6217 | [ALC255_FIXUP_MIC_MUTE_LED] = { |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 6218 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6219 | .v.func = snd_hda_gen_fixup_micmute_led, |
Hui Wang | 00ef994 | 2014-07-31 11:52:38 +0800 | [diff] [blame] | 6220 | }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 6221 | [ALC282_FIXUP_ASPIRE_V5_PINS] = { |
| 6222 | .type = HDA_FIXUP_PINS, |
| 6223 | .v.pins = (const struct hda_pintbl[]) { |
| 6224 | { 0x12, 0x90a60130 }, |
| 6225 | { 0x14, 0x90170110 }, |
| 6226 | { 0x17, 0x40000008 }, |
| 6227 | { 0x18, 0x411111f0 }, |
Mateusz Sylwestrzak | 0420694 | 2015-07-19 17:38:56 +0200 | [diff] [blame] | 6228 | { 0x19, 0x01a1913c }, |
Takashi Iwai | 1a22e77 | 2014-08-27 08:19:05 +0200 | [diff] [blame] | 6229 | { 0x1a, 0x411111f0 }, |
| 6230 | { 0x1b, 0x411111f0 }, |
| 6231 | { 0x1d, 0x40f89b2d }, |
| 6232 | { 0x1e, 0x411111f0 }, |
| 6233 | { 0x21, 0x0321101f }, |
| 6234 | { }, |
| 6235 | }, |
| 6236 | }, |
David Henningsson | 7a5255f | 2014-10-30 08:26:01 +0100 | [diff] [blame] | 6237 | [ALC280_FIXUP_HP_GPIO4] = { |
| 6238 | .type = HDA_FIXUP_FUNC, |
| 6239 | .v.func = alc280_fixup_hp_gpio4, |
| 6240 | }, |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 6241 | [ALC286_FIXUP_HP_GPIO_LED] = { |
| 6242 | .type = HDA_FIXUP_FUNC, |
| 6243 | .v.func = alc286_fixup_hp_gpio_led, |
| 6244 | }, |
David Henningsson | 33f4acd | 2015-01-07 15:50:13 +0100 | [diff] [blame] | 6245 | [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = { |
| 6246 | .type = HDA_FIXUP_FUNC, |
| 6247 | .v.func = alc280_fixup_hp_gpio2_mic_hotkey, |
| 6248 | }, |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 6249 | [ALC280_FIXUP_HP_DOCK_PINS] = { |
| 6250 | .type = HDA_FIXUP_PINS, |
| 6251 | .v.pins = (const struct hda_pintbl[]) { |
| 6252 | { 0x1b, 0x21011020 }, /* line-out */ |
| 6253 | { 0x1a, 0x01a1903c }, /* headset mic */ |
| 6254 | { 0x18, 0x2181103f }, /* line-in */ |
| 6255 | { }, |
| 6256 | }, |
| 6257 | .chained = true, |
| 6258 | .chain_id = ALC280_FIXUP_HP_GPIO4 |
| 6259 | }, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 6260 | [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = { |
| 6261 | .type = HDA_FIXUP_PINS, |
| 6262 | .v.pins = (const struct hda_pintbl[]) { |
| 6263 | { 0x1b, 0x21011020 }, /* line-out */ |
| 6264 | { 0x18, 0x2181103f }, /* line-in */ |
| 6265 | { }, |
| 6266 | }, |
| 6267 | .chained = true, |
| 6268 | .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED |
| 6269 | }, |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6270 | [ALC280_FIXUP_HP_9480M] = { |
| 6271 | .type = HDA_FIXUP_FUNC, |
| 6272 | .v.func = alc280_fixup_hp_9480m, |
| 6273 | }, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6274 | [ALC288_FIXUP_DELL_HEADSET_MODE] = { |
| 6275 | .type = HDA_FIXUP_FUNC, |
| 6276 | .v.func = alc_fixup_headset_mode_dell_alc288, |
| 6277 | .chained = true, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 6278 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 6279 | }, |
| 6280 | [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6281 | .type = HDA_FIXUP_PINS, |
| 6282 | .v.pins = (const struct hda_pintbl[]) { |
| 6283 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6284 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6285 | { } |
| 6286 | }, |
| 6287 | .chained = true, |
| 6288 | .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE |
| 6289 | }, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6290 | [ALC288_FIXUP_DISABLE_AAMIX] = { |
| 6291 | .type = HDA_FIXUP_FUNC, |
| 6292 | .v.func = alc_fixup_disable_aamix, |
| 6293 | .chained = true, |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 6294 | .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6295 | }, |
| 6296 | [ALC288_FIXUP_DELL_XPS_13] = { |
| 6297 | .type = HDA_FIXUP_FUNC, |
| 6298 | .v.func = alc_fixup_dell_xps13, |
| 6299 | .chained = true, |
| 6300 | .chain_id = ALC288_FIXUP_DISABLE_AAMIX |
| 6301 | }, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6302 | [ALC292_FIXUP_DISABLE_AAMIX] = { |
| 6303 | .type = HDA_FIXUP_FUNC, |
| 6304 | .v.func = alc_fixup_disable_aamix, |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6305 | .chained = true, |
| 6306 | .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6307 | }, |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 6308 | [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = { |
| 6309 | .type = HDA_FIXUP_FUNC, |
| 6310 | .v.func = alc_fixup_disable_aamix, |
| 6311 | .chained = true, |
| 6312 | .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6313 | }, |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6314 | [ALC292_FIXUP_DELL_E7X] = { |
| 6315 | .type = HDA_FIXUP_FUNC, |
| 6316 | .v.func = alc_fixup_dell_xps13, |
| 6317 | .chained = true, |
| 6318 | .chain_id = ALC292_FIXUP_DISABLE_AAMIX |
| 6319 | }, |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 6320 | [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6321 | .type = HDA_FIXUP_PINS, |
| 6322 | .v.pins = (const struct hda_pintbl[]) { |
| 6323 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6324 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6325 | { } |
| 6326 | }, |
| 6327 | .chained = true, |
| 6328 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6329 | }, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 6330 | [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = { |
| 6331 | .type = HDA_FIXUP_PINS, |
| 6332 | .v.pins = (const struct hda_pintbl[]) { |
| 6333 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6334 | { } |
| 6335 | }, |
| 6336 | .chained = true, |
| 6337 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6338 | }, |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 6339 | [ALC275_FIXUP_DELL_XPS] = { |
| 6340 | .type = HDA_FIXUP_VERBS, |
| 6341 | .v.verbs = (const struct hda_verb[]) { |
| 6342 | /* Enables internal speaker */ |
| 6343 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1f}, |
| 6344 | {0x20, AC_VERB_SET_PROC_COEF, 0x00c0}, |
| 6345 | {0x20, AC_VERB_SET_COEF_INDEX, 0x30}, |
| 6346 | {0x20, AC_VERB_SET_PROC_COEF, 0x00b1}, |
| 6347 | {} |
| 6348 | } |
| 6349 | }, |
Hui Wang | 8c69729 | 2015-11-24 11:08:18 +0800 | [diff] [blame] | 6350 | [ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE] = { |
| 6351 | .type = HDA_FIXUP_VERBS, |
| 6352 | .v.verbs = (const struct hda_verb[]) { |
| 6353 | /* Disable pass-through path for FRONT 14h */ |
| 6354 | {0x20, AC_VERB_SET_COEF_INDEX, 0x36}, |
| 6355 | {0x20, AC_VERB_SET_PROC_COEF, 0x1737}, |
| 6356 | {} |
| 6357 | }, |
| 6358 | .chained = true, |
| 6359 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6360 | }, |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 6361 | [ALC293_FIXUP_LENOVO_SPK_NOISE] = { |
| 6362 | .type = HDA_FIXUP_FUNC, |
| 6363 | .v.func = alc_fixup_disable_aamix, |
| 6364 | .chained = true, |
| 6365 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
| 6366 | }, |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 6367 | [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = { |
| 6368 | .type = HDA_FIXUP_FUNC, |
| 6369 | .v.func = alc233_fixup_lenovo_line2_mic_hotkey, |
| 6370 | }, |
Kai-Heng Feng | 3b43b71 | 2016-02-25 15:19:38 +0800 | [diff] [blame] | 6371 | [ALC255_FIXUP_DELL_SPK_NOISE] = { |
| 6372 | .type = HDA_FIXUP_FUNC, |
| 6373 | .v.func = alc_fixup_disable_aamix, |
| 6374 | .chained = true, |
| 6375 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6376 | }, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 6377 | [ALC225_FIXUP_DISABLE_MIC_VREF] = { |
| 6378 | .type = HDA_FIXUP_FUNC, |
| 6379 | .v.func = alc_fixup_disable_mic_vref, |
| 6380 | .chained = true, |
| 6381 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6382 | }, |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 6383 | [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
| 6384 | .type = HDA_FIXUP_VERBS, |
| 6385 | .v.verbs = (const struct hda_verb[]) { |
| 6386 | /* Disable pass-through path for FRONT 14h */ |
| 6387 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, |
| 6388 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, |
| 6389 | {} |
| 6390 | }, |
| 6391 | .chained = true, |
Kailang Yang | d1dd421 | 2019-01-09 17:05:24 +0800 | [diff] [blame] | 6392 | .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 6393 | }, |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 6394 | [ALC280_FIXUP_HP_HEADSET_MIC] = { |
| 6395 | .type = HDA_FIXUP_FUNC, |
| 6396 | .v.func = alc_fixup_disable_aamix, |
| 6397 | .chained = true, |
| 6398 | .chain_id = ALC269_FIXUP_HEADSET_MIC, |
| 6399 | }, |
Hui Wang | e549d19 | 2016-04-01 11:00:15 +0800 | [diff] [blame] | 6400 | [ALC221_FIXUP_HP_FRONT_MIC] = { |
| 6401 | .type = HDA_FIXUP_PINS, |
| 6402 | .v.pins = (const struct hda_pintbl[]) { |
| 6403 | { 0x19, 0x02a19020 }, /* Front Mic */ |
| 6404 | { } |
| 6405 | }, |
| 6406 | }, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 6407 | [ALC292_FIXUP_TPT460] = { |
| 6408 | .type = HDA_FIXUP_FUNC, |
| 6409 | .v.func = alc_fixup_tpt440_dock, |
| 6410 | .chained = true, |
| 6411 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, |
| 6412 | }, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6413 | [ALC298_FIXUP_SPK_VOLUME] = { |
| 6414 | .type = HDA_FIXUP_FUNC, |
| 6415 | .v.func = alc298_fixup_speaker_volume, |
Hui Wang | 59ec4b5 | 2016-08-04 15:28:04 +0800 | [diff] [blame] | 6416 | .chained = true, |
Hui Wang | 2f726ae | 2017-03-31 10:31:40 +0800 | [diff] [blame] | 6417 | .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
Hui Wang | dd9aa33 | 2016-08-01 10:20:32 +0800 | [diff] [blame] | 6418 | }, |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 6419 | [ALC295_FIXUP_DISABLE_DAC3] = { |
| 6420 | .type = HDA_FIXUP_FUNC, |
| 6421 | .v.func = alc295_fixup_disable_dac3, |
| 6422 | }, |
Kai-Heng Feng | fd06c77 | 2016-08-30 15:36:34 +0800 | [diff] [blame] | 6423 | [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { |
| 6424 | .type = HDA_FIXUP_PINS, |
| 6425 | .v.pins = (const struct hda_pintbl[]) { |
| 6426 | { 0x1b, 0x90170151 }, |
| 6427 | { } |
| 6428 | }, |
| 6429 | .chained = true, |
| 6430 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6431 | }, |
Gabriele Mazzotta | 823ff16 | 2016-12-24 19:50:01 +0100 | [diff] [blame] | 6432 | [ALC269_FIXUP_ATIV_BOOK_8] = { |
| 6433 | .type = HDA_FIXUP_FUNC, |
| 6434 | .v.func = alc_fixup_auto_mute_via_amp, |
| 6435 | .chained = true, |
| 6436 | .chain_id = ALC269_FIXUP_NO_SHUTUP |
| 6437 | }, |
Kailang Yang | 9eb5d0e | 2017-01-17 15:40:25 +0800 | [diff] [blame] | 6438 | [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { |
| 6439 | .type = HDA_FIXUP_PINS, |
| 6440 | .v.pins = (const struct hda_pintbl[]) { |
| 6441 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6442 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ |
| 6443 | { } |
| 6444 | }, |
| 6445 | .chained = true, |
| 6446 | .chain_id = ALC269_FIXUP_HEADSET_MODE |
| 6447 | }, |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6448 | [ALC256_FIXUP_ASUS_HEADSET_MODE] = { |
| 6449 | .type = HDA_FIXUP_FUNC, |
| 6450 | .v.func = alc_fixup_headset_mode, |
| 6451 | }, |
| 6452 | [ALC256_FIXUP_ASUS_MIC] = { |
| 6453 | .type = HDA_FIXUP_PINS, |
| 6454 | .v.pins = (const struct hda_pintbl[]) { |
| 6455 | { 0x13, 0x90a60160 }, /* use as internal mic */ |
| 6456 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 6457 | { } |
| 6458 | }, |
| 6459 | .chained = true, |
| 6460 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
| 6461 | }, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 6462 | [ALC256_FIXUP_ASUS_AIO_GPIO2] = { |
Takashi Iwai | ae065f1 | 2018-06-19 23:00:03 +0200 | [diff] [blame] | 6463 | .type = HDA_FIXUP_FUNC, |
| 6464 | /* Set up GPIO2 for the speaker amp */ |
| 6465 | .v.func = alc_fixup_gpio4, |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 6466 | }, |
Chris Chiu | 216d7ae | 2017-02-28 14:17:14 -0600 | [diff] [blame] | 6467 | [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
| 6468 | .type = HDA_FIXUP_PINS, |
| 6469 | .v.pins = (const struct hda_pintbl[]) { |
| 6470 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6471 | { } |
| 6472 | }, |
| 6473 | .chained = true, |
| 6474 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 6475 | }, |
| 6476 | [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = { |
| 6477 | .type = HDA_FIXUP_VERBS, |
| 6478 | .v.verbs = (const struct hda_verb[]) { |
| 6479 | /* Enables internal speaker */ |
| 6480 | {0x20, AC_VERB_SET_COEF_INDEX, 0x40}, |
| 6481 | {0x20, AC_VERB_SET_PROC_COEF, 0x8800}, |
| 6482 | {} |
| 6483 | }, |
| 6484 | .chained = true, |
| 6485 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE |
| 6486 | }, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 6487 | [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { |
| 6488 | .type = HDA_FIXUP_FUNC, |
| 6489 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, |
| 6490 | }, |
Hui Wang | f33f79f | 2017-07-07 12:08:29 +0800 | [diff] [blame] | 6491 | [ALC294_FIXUP_LENOVO_MIC_LOCATION] = { |
| 6492 | .type = HDA_FIXUP_PINS, |
| 6493 | .v.pins = (const struct hda_pintbl[]) { |
| 6494 | /* Change the mic location from front to right, otherwise there are |
| 6495 | two front mics with the same name, pulseaudio can't handle them. |
| 6496 | This is just a temporary workaround, after applying this fixup, |
| 6497 | there will be one "Front Mic" and one "Mic" in this machine. |
| 6498 | */ |
| 6499 | { 0x1a, 0x04a19040 }, |
| 6500 | { } |
| 6501 | }, |
| 6502 | }, |
Kailang Yang | 5f36413 | 2017-07-25 16:28:16 +0800 | [diff] [blame] | 6503 | [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = { |
| 6504 | .type = HDA_FIXUP_PINS, |
| 6505 | .v.pins = (const struct hda_pintbl[]) { |
| 6506 | { 0x16, 0x0101102f }, /* Rear Headset HP */ |
| 6507 | { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */ |
| 6508 | { 0x1a, 0x01a19030 }, /* Rear Headset MIC */ |
| 6509 | { 0x1b, 0x02011020 }, |
| 6510 | { } |
| 6511 | }, |
| 6512 | .chained = true, |
| 6513 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6514 | }, |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 6515 | [ALC700_FIXUP_INTEL_REFERENCE] = { |
| 6516 | .type = HDA_FIXUP_VERBS, |
| 6517 | .v.verbs = (const struct hda_verb[]) { |
| 6518 | /* Enables internal speaker */ |
| 6519 | {0x20, AC_VERB_SET_COEF_INDEX, 0x45}, |
| 6520 | {0x20, AC_VERB_SET_PROC_COEF, 0x5289}, |
| 6521 | {0x20, AC_VERB_SET_COEF_INDEX, 0x4A}, |
| 6522 | {0x20, AC_VERB_SET_PROC_COEF, 0x001b}, |
| 6523 | {0x58, AC_VERB_SET_COEF_INDEX, 0x00}, |
| 6524 | {0x58, AC_VERB_SET_PROC_COEF, 0x3888}, |
| 6525 | {0x20, AC_VERB_SET_COEF_INDEX, 0x6f}, |
| 6526 | {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b}, |
| 6527 | {} |
| 6528 | } |
| 6529 | }, |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 6530 | [ALC274_FIXUP_DELL_BIND_DACS] = { |
| 6531 | .type = HDA_FIXUP_FUNC, |
| 6532 | .v.func = alc274_fixup_bind_dacs, |
| 6533 | .chained = true, |
| 6534 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6535 | }, |
| 6536 | [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = { |
| 6537 | .type = HDA_FIXUP_PINS, |
| 6538 | .v.pins = (const struct hda_pintbl[]) { |
| 6539 | { 0x1b, 0x0401102f }, |
| 6540 | { } |
| 6541 | }, |
| 6542 | .chained = true, |
| 6543 | .chain_id = ALC274_FIXUP_DELL_BIND_DACS |
| 6544 | }, |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6545 | [ALC298_FIXUP_TPT470_DOCK] = { |
| 6546 | .type = HDA_FIXUP_FUNC, |
| 6547 | .v.func = alc_fixup_tpt470_dock, |
| 6548 | .chained = true, |
| 6549 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE |
| 6550 | }, |
Kailang Yang | ae104a2 | 2018-02-05 16:07:20 +0800 | [diff] [blame] | 6551 | [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = { |
| 6552 | .type = HDA_FIXUP_PINS, |
| 6553 | .v.pins = (const struct hda_pintbl[]) { |
| 6554 | { 0x14, 0x0201101f }, |
| 6555 | { } |
| 6556 | }, |
| 6557 | .chained = true, |
| 6558 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE |
| 6559 | }, |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 6560 | [ALC255_FIXUP_DELL_HEADSET_MIC] = { |
| 6561 | .type = HDA_FIXUP_PINS, |
| 6562 | .v.pins = (const struct hda_pintbl[]) { |
| 6563 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6564 | { } |
| 6565 | }, |
Hui Wang | 3ce0d5a | 2018-04-19 13:29:04 +0800 | [diff] [blame] | 6566 | .chained = true, |
| 6567 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 6568 | }, |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 6569 | [ALC295_FIXUP_HP_X360] = { |
| 6570 | .type = HDA_FIXUP_FUNC, |
| 6571 | .v.func = alc295_fixup_hp_top_speakers, |
| 6572 | .chained = true, |
| 6573 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3 |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 6574 | }, |
| 6575 | [ALC221_FIXUP_HP_HEADSET_MIC] = { |
| 6576 | .type = HDA_FIXUP_PINS, |
| 6577 | .v.pins = (const struct hda_pintbl[]) { |
| 6578 | { 0x19, 0x0181313f}, |
| 6579 | { } |
| 6580 | }, |
| 6581 | .chained = true, |
| 6582 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 6583 | }, |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 6584 | [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = { |
| 6585 | .type = HDA_FIXUP_FUNC, |
| 6586 | .v.func = alc285_fixup_invalidate_dacs, |
Hui Wang | 6ba189c | 2018-12-09 09:16:43 +0800 | [diff] [blame] | 6587 | .chained = true, |
| 6588 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI |
Hui Wang | c4cfcf6 | 2018-11-26 14:17:16 +0800 | [diff] [blame] | 6589 | }, |
Girija Kumar Kasinadhuni | e8ed64b | 2018-11-26 13:40:46 -0500 | [diff] [blame] | 6590 | [ALC295_FIXUP_HP_AUTO_MUTE] = { |
| 6591 | .type = HDA_FIXUP_FUNC, |
| 6592 | .v.func = alc_fixup_auto_mute_via_amp, |
| 6593 | }, |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 6594 | [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = { |
| 6595 | .type = HDA_FIXUP_PINS, |
| 6596 | .v.pins = (const struct hda_pintbl[]) { |
| 6597 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6598 | { } |
| 6599 | }, |
| 6600 | .chained = true, |
| 6601 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
| 6602 | }, |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 6603 | [ALC294_FIXUP_ASUS_MIC] = { |
| 6604 | .type = HDA_FIXUP_PINS, |
| 6605 | .v.pins = (const struct hda_pintbl[]) { |
| 6606 | { 0x13, 0x90a60160 }, /* use as internal mic */ |
| 6607 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ |
| 6608 | { } |
| 6609 | }, |
| 6610 | .chained = true, |
| 6611 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6612 | }, |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 6613 | [ALC294_FIXUP_ASUS_HEADSET_MIC] = { |
| 6614 | .type = HDA_FIXUP_PINS, |
| 6615 | .v.pins = (const struct hda_pintbl[]) { |
Jian-Hong Pan | 82b0114 | 2018-12-27 16:46:31 +0800 | [diff] [blame] | 6616 | { 0x19, 0x01a1103c }, /* use as headset mic */ |
Jian-Hong Pan | 4e05110 | 2018-12-07 17:17:12 +0800 | [diff] [blame] | 6617 | { } |
| 6618 | }, |
| 6619 | .chained = true, |
| 6620 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6621 | }, |
| 6622 | [ALC294_FIXUP_ASUS_SPK] = { |
| 6623 | .type = HDA_FIXUP_VERBS, |
| 6624 | .v.verbs = (const struct hda_verb[]) { |
| 6625 | /* Set EAPD high */ |
| 6626 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 }, |
| 6627 | { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 }, |
| 6628 | { } |
| 6629 | }, |
| 6630 | .chained = true, |
| 6631 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
| 6632 | }, |
Jaroslav Kysela | c8a9afa | 2019-03-14 09:21:08 +0100 | [diff] [blame] | 6633 | [ALC295_FIXUP_CHROME_BOOK] = { |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 6634 | .type = HDA_FIXUP_FUNC, |
Jaroslav Kysela | c8a9afa | 2019-03-14 09:21:08 +0100 | [diff] [blame] | 6635 | .v.func = alc295_fixup_chromebook, |
Kailang Yang | e854747 | 2018-11-28 15:32:45 +0800 | [diff] [blame] | 6636 | }, |
Jeremy Soller | 89e3a56 | 2019-01-30 16:12:31 -0700 | [diff] [blame] | 6637 | [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { |
| 6638 | .type = HDA_FIXUP_PINS, |
| 6639 | .v.pins = (const struct hda_pintbl[]) { |
| 6640 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ |
| 6641 | { } |
| 6642 | }, |
| 6643 | .chained = true, |
| 6644 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6645 | }, |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 6646 | [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = { |
| 6647 | .type = HDA_FIXUP_VERBS, |
| 6648 | .v.verbs = (const struct hda_verb[]) { |
| 6649 | /* Disable PCBEEP-IN passthrough */ |
| 6650 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, |
| 6651 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, |
| 6652 | { } |
| 6653 | }, |
| 6654 | .chained = true, |
| 6655 | .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE |
| 6656 | }, |
Jian-Hong Pan | cbc05fd | 2019-03-13 17:33:24 +0800 | [diff] [blame] | 6657 | [ALC255_FIXUP_ACER_HEADSET_MIC] = { |
| 6658 | .type = HDA_FIXUP_PINS, |
| 6659 | .v.pins = (const struct hda_pintbl[]) { |
| 6660 | { 0x19, 0x03a11130 }, |
| 6661 | { 0x1a, 0x90a60140 }, /* use as internal mic */ |
| 6662 | { } |
| 6663 | }, |
| 6664 | .chained = true, |
| 6665 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6666 | }, |
Kailang Yang | 136824e | 2019-03-14 16:22:45 +0800 | [diff] [blame] | 6667 | [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = { |
| 6668 | .type = HDA_FIXUP_PINS, |
| 6669 | .v.pins = (const struct hda_pintbl[]) { |
| 6670 | { 0x16, 0x01011020 }, /* Rear Line out */ |
| 6671 | { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */ |
| 6672 | { } |
| 6673 | }, |
| 6674 | .chained = true, |
| 6675 | .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE |
| 6676 | }, |
| 6677 | [ALC225_FIXUP_WYSE_AUTO_MUTE] = { |
| 6678 | .type = HDA_FIXUP_FUNC, |
| 6679 | .v.func = alc_fixup_auto_mute_via_amp, |
| 6680 | .chained = true, |
| 6681 | .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF |
| 6682 | }, |
| 6683 | [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = { |
| 6684 | .type = HDA_FIXUP_FUNC, |
| 6685 | .v.func = alc_fixup_disable_mic_vref, |
| 6686 | .chained = true, |
| 6687 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 6688 | }, |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 6689 | [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = { |
| 6690 | .type = HDA_FIXUP_VERBS, |
| 6691 | .v.verbs = (const struct hda_verb[]) { |
| 6692 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f }, |
| 6693 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 }, |
| 6694 | { } |
| 6695 | }, |
| 6696 | .chained = true, |
| 6697 | .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE |
| 6698 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6699 | }; |
| 6700 | |
| 6701 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
Marius Knaust | a6b92b6 | 2014-03-03 01:48:58 +0100 | [diff] [blame] | 6702 | SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6703 | SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), |
| 6704 | SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 6705 | SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), |
Takashi Iwai | 7819717 | 2015-06-27 10:21:13 +0200 | [diff] [blame] | 6706 | SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
| 6707 | 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] | 6708 | SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), |
| 6709 | 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] | 6710 | 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] | 6711 | 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] | 6712 | 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] | 6713 | 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] | 6714 | SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), |
Chris Chiu | c7531e3 | 2019-03-21 17:17:31 +0800 | [diff] [blame^] | 6715 | SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
| 6716 | SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
Jian-Hong Pan | 667a8f7 | 2019-03-15 17:51:09 +0800 | [diff] [blame] | 6717 | SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
| 6718 | SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
| 6719 | 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] | 6720 | SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
Jian-Hong Pan | cbc05fd | 2019-03-13 17:33:24 +0800 | [diff] [blame] | 6721 | 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] | 6722 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
Kailang Yang | 6ed1131 | 2015-10-26 15:37:39 +0800 | [diff] [blame] | 6723 | 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] | 6724 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | cf52103 | 2016-01-15 12:59:25 +0100 | [diff] [blame] | 6725 | SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 6726 | SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X), |
| 6727 | SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6728 | SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 6729 | SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 6730 | SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 6731 | SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6732 | SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
| 6733 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
Takashi Iwai | 9807057 | 2016-01-12 21:06:39 +0100 | [diff] [blame] | 6734 | SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X), |
Takashi Iwai | 4275554 | 2015-06-29 10:56:53 +0200 | [diff] [blame] | 6735 | SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X), |
David Henningsson | 0f4881d | 2013-12-20 16:08:13 +0100 | [diff] [blame] | 6736 | 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] | 6737 | SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 6738 | SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Hui Wang | 831bfdf9 | 2015-06-26 12:35:17 +0800 | [diff] [blame] | 6739 | 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] | 6740 | 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] | 6741 | SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), |
Kailang Yang | 8b72415 | 2014-12-17 17:08:59 +0800 | [diff] [blame] | 6742 | SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
Kailang Yang | b734304 | 2014-12-02 14:50:45 +0800 | [diff] [blame] | 6743 | SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 6744 | SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
David Henningsson | c04017e | 2015-12-15 14:44:03 +0100 | [diff] [blame] | 6745 | SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 6746 | SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 6747 | SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 6748 | SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
| 6749 | SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
Kai-Heng Feng | 423cd78 | 2016-05-20 15:47:23 +0800 | [diff] [blame] | 6750 | 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] | 6751 | 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] | 6752 | 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] | 6753 | 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] | 6754 | 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] | 6755 | 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] | 6756 | SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), |
Takashi Iwai | e312a86 | 2018-03-06 12:14:17 +0100 | [diff] [blame] | 6757 | SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3), |
Takashi Iwai | 493de34 | 2017-02-28 17:27:57 +0100 | [diff] [blame] | 6758 | 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] | 6759 | 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] | 6760 | 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] | 6761 | SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
| 6762 | SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
Kailang Yang | f0ba9d6 | 2018-03-16 11:46:08 +0800 | [diff] [blame] | 6763 | SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
| 6764 | 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] | 6765 | 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] | 6766 | 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] | 6767 | 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] | 6768 | SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
Kailang Yang | a22aa26 | 2014-04-23 17:34:28 +0800 | [diff] [blame] | 6769 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 6770 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
Takashi Iwai | 08fb0d0 | 2013-01-10 17:33:58 +0100 | [diff] [blame] | 6771 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 6772 | SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), |
David Henningsson | 8e35cd4 | 2013-11-06 11:20:01 +0100 | [diff] [blame] | 6773 | 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] | 6774 | SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6775 | /* ALC282 */ |
Hui Wang | 7976eb4 | 2015-02-13 11:14:41 +0800 | [diff] [blame] | 6776 | SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 6777 | SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 6778 | SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6779 | SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 6780 | SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 6781 | SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
| 6782 | SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6783 | SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6784 | SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6785 | SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6786 | SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 6787 | SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | eaa8e5e | 2014-11-21 15:49:11 +0800 | [diff] [blame] | 6788 | SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED), |
TienFu Chen | b4b33f9 | 2015-01-20 15:06:21 +0100 | [diff] [blame] | 6789 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
TienFu Chen | 3271cb2 | 2015-02-10 09:09:41 +0100 | [diff] [blame] | 6790 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6791 | SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6792 | SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6793 | SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6794 | SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6795 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Keith Packard | 98973f2 | 2015-07-15 12:14:39 -0700 | [diff] [blame] | 6796 | SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6797 | SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6798 | SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6799 | /* ALC290 */ |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6800 | SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6801 | SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6802 | SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6803 | SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6804 | SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6805 | SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6806 | SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6807 | SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6808 | SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 6809 | 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] | 6810 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6811 | SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6812 | SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6813 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6814 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
| 6815 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | 9c5dc3b | 2014-06-19 16:11:36 +0800 | [diff] [blame] | 6816 | SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6817 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6818 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6819 | SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6820 | SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6821 | SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6822 | SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6823 | SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | c60666b | 2014-02-21 16:23:35 +0800 | [diff] [blame] | 6824 | SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Kailang Yang | 8a02b16 | 2014-06-13 17:16:31 +0800 | [diff] [blame] | 6825 | SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6826 | SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6827 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
| 6828 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
Takashi Iwai | f883982 | 2016-02-25 14:31:59 +0100 | [diff] [blame] | 6829 | 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] | 6830 | SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
| 6831 | 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] | 6832 | 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] | 6833 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), |
Tom Briden | bbf8ff6 | 2018-05-29 17:34:20 +0100 | [diff] [blame] | 6834 | SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), |
Jaroslav Kysela | 167897f | 2019-03-13 13:40:15 +0100 | [diff] [blame] | 6835 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
| 6836 | 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] | 6837 | 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] | 6838 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 7bba215 | 2013-09-06 15:45:38 +0200 | [diff] [blame] | 6839 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
David Henningsson | 3e0d611 | 2013-04-22 14:30:14 +0200 | [diff] [blame] | 6840 | 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] | 6841 | SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 6842 | SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
Takashi Iwai | 4eab0ea | 2017-06-06 12:33:17 +0200 | [diff] [blame] | 6843 | 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] | 6844 | 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] | 6845 | SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
| 6846 | SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), |
| 6847 | 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] | 6848 | SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), |
| 6849 | SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), |
| 6850 | SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), |
Oleksij Rempel | 2cede30 | 2013-11-27 17:12:03 +0100 | [diff] [blame] | 6851 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), |
Takashi Iwai | 2387083 | 2013-11-29 14:13:12 +0100 | [diff] [blame] | 6852 | 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] | 6853 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), |
Takashi Iwai | 017f2a1 | 2011-07-09 14:42:25 +0200 | [diff] [blame] | 6854 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
Chris Chiu | 28e8af8 | 2017-06-05 15:05:30 -0600 | [diff] [blame] | 6855 | SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), |
David Henningsson | 693b613 | 2012-06-22 19:12:10 +0200 | [diff] [blame] | 6856 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 6857 | 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] | 6858 | 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] | 6859 | SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), |
Chris Chiu | eeed4cd | 2017-02-28 14:17:15 -0600 | [diff] [blame] | 6860 | SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), |
Takashi Iwai | adabb3e | 2011-08-03 07:48:37 +0200 | [diff] [blame] | 6861 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), |
| 6862 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), |
| 6863 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
| 6864 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
David Henningsson | d240d1d | 2013-04-15 12:50:02 +0200 | [diff] [blame] | 6865 | SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), |
Takashi Iwai | f88abaa | 2014-02-07 12:07:59 +0100 | [diff] [blame] | 6866 | 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] | 6867 | 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] | 6868 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), |
| 6869 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
| 6870 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
Takashi Iwai | e9bd7d5 | 2014-05-21 11:06:49 +0200 | [diff] [blame] | 6871 | 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] | 6872 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), |
Takashi Iwai | 4df3fd1 | 2015-06-29 08:38:02 +0200 | [diff] [blame] | 6873 | 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] | 6874 | SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
Takashi Iwai | 88776f3 | 2015-05-01 09:20:34 +0200 | [diff] [blame] | 6875 | 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] | 6876 | 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] | 6877 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
PeiSen Hou | b84e843 | 2017-09-01 15:11:56 +0800 | [diff] [blame] | 6878 | SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), |
YOKOTA Hiroshi | 0fca97a | 2018-07-01 18:30:01 +0900 | [diff] [blame] | 6879 | SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), |
David Henningsson | a33cc48 | 2014-10-07 10:18:41 +0200 | [diff] [blame] | 6880 | 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] | 6881 | 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] | 6882 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |
| 6883 | 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] | 6884 | 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] | 6885 | SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 6886 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6887 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
| 6888 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), |
| 6889 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), |
| 6890 | SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), |
| 6891 | SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), |
Takashi Iwai | 707fba3 | 2012-08-02 09:04:39 +0200 | [diff] [blame] | 6892 | SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK), |
Felix Kaechele | c8415a4 | 2012-08-06 23:02:01 +0200 | [diff] [blame] | 6893 | SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), |
Stefán Freyr | 84f98fd | 2012-10-19 22:46:00 +0200 | [diff] [blame] | 6894 | SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), |
Philipp A. Mohrenweiser | 4407be6 | 2012-08-06 13:14:18 +0200 | [diff] [blame] | 6895 | SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | 108cc10 | 2012-07-20 10:37:25 +0200 | [diff] [blame] | 6896 | SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), |
David Henningsson | aaedfb4 | 2013-08-16 14:09:02 +0200 | [diff] [blame] | 6897 | SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 6898 | SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440), |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 6899 | SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | a12137e | 2014-06-27 12:14:35 +0200 | [diff] [blame] | 6900 | SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), |
Rick Sherman | 59a51a6 | 2015-08-18 21:04:30 -0500 | [diff] [blame] | 6901 | SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK), |
Takashi Iwai | 6d16941 | 2014-10-07 17:27:02 +0200 | [diff] [blame] | 6902 | SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), |
Lukas Bossard | 7c21539 | 2014-10-29 18:31:07 +0100 | [diff] [blame] | 6903 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 6904 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Takashi Iwai | b6903c0 | 2015-12-10 12:20:20 +0100 | [diff] [blame] | 6905 | 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] | 6906 | SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), |
Yves-Alexis Perez | c027866 | 2015-04-11 09:31:35 +0200 | [diff] [blame] | 6907 | SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6908 | SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 6909 | SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Torsten Hilbrich | dab38e4 | 2016-06-07 13:14:21 +0200 | [diff] [blame] | 6910 | SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460), |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 6911 | SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6912 | SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK), |
| 6913 | SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 6914 | SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Dennis Wassenberg | e4c07b3 | 2018-03-08 13:17:54 +0100 | [diff] [blame] | 6915 | SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6916 | SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 6917 | SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 6918 | SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
Benjamin Berg | 85981df | 2018-02-14 13:29:39 +0100 | [diff] [blame] | 6919 | SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang | 3694cb2 | 2015-12-28 11:35:24 +0800 | [diff] [blame] | 6920 | 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] | 6921 | 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] | 6922 | SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | e41fc8c | 2018-06-25 14:40:56 +0800 | [diff] [blame] | 6923 | SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Kailang Yang | 6581183 | 2018-04-25 17:07:27 +0800 | [diff] [blame] | 6924 | SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
Hui Wang | 8da5bbf | 2017-12-22 11:17:46 +0800 | [diff] [blame] | 6925 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
David Henningsson | 56f2701 | 2016-01-11 09:33:14 +0100 | [diff] [blame] | 6926 | 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] | 6927 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
Takashi Iwai | 9b745ab | 2014-03-07 08:37:19 +0100 | [diff] [blame] | 6928 | SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP), |
David Henningsson | a4a9e08 | 2013-08-16 14:09:01 +0200 | [diff] [blame] | 6929 | SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 1bb3e06 | 2013-09-27 13:10:25 +0200 | [diff] [blame] | 6930 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), |
Takashi Iwai | c497d9f | 2014-10-08 12:14:40 +0200 | [diff] [blame] | 6931 | SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 6932 | 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] | 6933 | SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), |
Sebastian Wicki | 80b311d | 2015-03-23 17:23:11 +0100 | [diff] [blame] | 6934 | SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), |
Ansgar Hegerfeld | 09ea997 | 2015-05-14 12:31:32 +0200 | [diff] [blame] | 6935 | SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), |
Conrad Kostecki | 037e119 | 2016-04-26 10:08:10 +0200 | [diff] [blame] | 6936 | SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK), |
Hui Wang | 23adc19 | 2015-12-08 12:27:18 +0800 | [diff] [blame] | 6937 | SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), |
Jaroslav Kysela | 0f087ee | 2016-06-24 15:13:16 +0200 | [diff] [blame] | 6938 | SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460), |
Torsten Hilbrich | 9cd2574 | 2016-07-05 10:40:22 +0200 | [diff] [blame] | 6939 | SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460), |
Jaroslav Kysela | 0f087ee | 2016-06-24 15:13:16 +0200 | [diff] [blame] | 6940 | SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6941 | SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 6942 | SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 6943 | SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
David Henningsson | cd5302c | 2013-08-19 12:22:33 +0200 | [diff] [blame] | 6944 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
Kailang Yang | 61fcf8e | 2018-02-02 15:26:46 +0800 | [diff] [blame] | 6945 | SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
| 6946 | SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
David Henningsson | 012e7eb | 2012-08-08 08:43:37 +0200 | [diff] [blame] | 6947 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 6948 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), |
Ayman Bagabas | e2744fd | 2018-12-12 18:07:59 -0500 | [diff] [blame] | 6949 | SND_PCI_QUIRK(0x19e5, 0x3200, "Huawei MBX", ALC255_FIXUP_MIC_MUTE_LED), |
| 6950 | SND_PCI_QUIRK(0x19e5, 0x3201, "Huawei MBX", ALC255_FIXUP_MIC_MUTE_LED), |
Ayman Bagabas | 8ac51bb | 2018-12-12 18:07:57 -0500 | [diff] [blame] | 6951 | SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MBXP", ALC256_FIXUP_HUAWEI_MBXP_PINS), |
Anisse Astier | 02b504d | 2013-06-03 11:53:10 +0200 | [diff] [blame] | 6952 | 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] | 6953 | |
Takashi Iwai | a7f3eed | 2012-02-16 13:03:18 +0100 | [diff] [blame] | 6954 | #if 0 |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6955 | /* Below is a quirk table taken from the old code. |
| 6956 | * Basically the device should work as is without the fixup table. |
| 6957 | * If BIOS doesn't give a proper info, enable the corresponding |
| 6958 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 6959 | */ |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6960 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", |
| 6961 | ALC269_FIXUP_AMIC), |
| 6962 | SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 6963 | SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), |
| 6964 | SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), |
| 6965 | SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), |
| 6966 | SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), |
| 6967 | SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), |
| 6968 | SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), |
| 6969 | SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), |
| 6970 | SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), |
| 6971 | SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), |
| 6972 | SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), |
| 6973 | SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), |
| 6974 | SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), |
| 6975 | SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), |
| 6976 | SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), |
| 6977 | SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), |
| 6978 | SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), |
| 6979 | SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), |
| 6980 | SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), |
| 6981 | SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), |
| 6982 | SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), |
| 6983 | SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), |
| 6984 | SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), |
| 6985 | SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), |
| 6986 | SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), |
| 6987 | SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), |
| 6988 | SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), |
| 6989 | SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), |
| 6990 | SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), |
| 6991 | SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), |
| 6992 | SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), |
| 6993 | SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), |
| 6994 | SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), |
| 6995 | SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), |
| 6996 | SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), |
| 6997 | SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), |
| 6998 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), |
| 6999 | SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), |
| 7000 | SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), |
| 7001 | #endif |
| 7002 | {} |
| 7003 | }; |
| 7004 | |
David Henningsson | 214eef7 | 2014-07-22 14:09:35 +0200 | [diff] [blame] | 7005 | static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = { |
| 7006 | SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), |
| 7007 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), |
| 7008 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), |
| 7009 | SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), |
| 7010 | {} |
| 7011 | }; |
| 7012 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7013 | static const struct hda_model_fixup alc269_fixup_models[] = { |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7014 | {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, |
| 7015 | {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 7016 | {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, |
| 7017 | {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, |
| 7018 | {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
David Henningsson | 7c478f0 | 2013-10-11 10:18:46 +0200 | [diff] [blame] | 7019 | {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, |
Takashi Iwai | b016951 | 2015-05-19 10:20:13 +0200 | [diff] [blame] | 7020 | {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, |
| 7021 | {.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] | 7022 | {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, |
Takashi Iwai | 9f5c6fa | 2013-03-18 14:15:58 +0100 | [diff] [blame] | 7023 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
Jaroslav Kysela | 04d5466 | 2017-03-09 13:29:13 +0100 | [diff] [blame] | 7024 | {.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] | 7025 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
| 7026 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7027 | {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"}, |
| 7028 | {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"}, |
Kailang Yang | be8ef16 | 2014-04-08 15:19:49 +0800 | [diff] [blame] | 7029 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, |
Kailang Yang | 0202e99 | 2013-12-02 15:20:15 +0800 | [diff] [blame] | 7030 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, |
Takashi Iwai | 1c37c22 | 2014-05-06 17:34:42 +0200 | [diff] [blame] | 7031 | {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, |
Takashi Iwai | 9a81123 | 2015-12-09 15:17:43 +0100 | [diff] [blame] | 7032 | {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, |
Sven Eckelmann | c636b95 | 2016-04-11 16:55:26 +0200 | [diff] [blame] | 7033 | {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7034 | {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 7035 | {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
Takashi Iwai | 28d1d6d | 2017-10-18 14:01:58 +0200 | [diff] [blame] | 7036 | {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7037 | {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"}, |
| 7038 | {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"}, |
| 7039 | {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"}, |
| 7040 | {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"}, |
| 7041 | {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"}, |
| 7042 | {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"}, |
| 7043 | {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"}, |
| 7044 | {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"}, |
| 7045 | {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"}, |
| 7046 | {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"}, |
| 7047 | {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"}, |
| 7048 | {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"}, |
| 7049 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"}, |
| 7050 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"}, |
| 7051 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"}, |
| 7052 | {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"}, |
| 7053 | {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"}, |
| 7054 | {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"}, |
| 7055 | {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"}, |
| 7056 | {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"}, |
| 7057 | {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"}, |
| 7058 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"}, |
| 7059 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"}, |
| 7060 | {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"}, |
| 7061 | {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"}, |
| 7062 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"}, |
| 7063 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"}, |
| 7064 | {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"}, |
| 7065 | {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"}, |
| 7066 | {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"}, |
| 7067 | {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"}, |
| 7068 | {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"}, |
| 7069 | {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"}, |
| 7070 | {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"}, |
| 7071 | {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"}, |
| 7072 | {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"}, |
| 7073 | {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"}, |
| 7074 | {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"}, |
| 7075 | {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"}, |
| 7076 | {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"}, |
Takashi Iwai | b380278 | 2018-11-26 17:47:46 +0100 | [diff] [blame] | 7077 | {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7078 | {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"}, |
| 7079 | {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"}, |
| 7080 | {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
| 7081 | {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"}, |
| 7082 | {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"}, |
| 7083 | {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"}, |
| 7084 | {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"}, |
| 7085 | {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"}, |
| 7086 | {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"}, |
| 7087 | {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"}, |
| 7088 | {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"}, |
| 7089 | {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"}, |
| 7090 | {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"}, |
| 7091 | {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"}, |
| 7092 | {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"}, |
| 7093 | {.id = ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE, .name = "alc256-dell-xps13"}, |
| 7094 | {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"}, |
| 7095 | {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"}, |
| 7096 | {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"}, |
Kailang Yang | 82aa0d7 | 2019-01-11 17:15:53 +0800 | [diff] [blame] | 7097 | {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"}, |
Takashi Iwai | a26d96c | 2018-06-26 15:09:25 +0200 | [diff] [blame] | 7098 | {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"}, |
| 7099 | {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"}, |
| 7100 | {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"}, |
| 7101 | {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"}, |
| 7102 | {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"}, |
| 7103 | {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"}, |
| 7104 | {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"}, |
| 7105 | {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"}, |
| 7106 | {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"}, |
| 7107 | {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"}, |
| 7108 | {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"}, |
| 7109 | {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"}, |
| 7110 | {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"}, |
| 7111 | {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"}, |
| 7112 | {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"}, |
| 7113 | {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, |
| 7114 | {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, |
| 7115 | {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, |
Kailang Yang | 10f5b1b | 2019-02-21 16:10:22 +0800 | [diff] [blame] | 7116 | {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-sense-combo"}, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7117 | {} |
| 7118 | }; |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 7119 | #define ALC225_STANDARD_PINS \ |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 7120 | {0x21, 0x04211020} |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7121 | |
Hui Wang | e8191a8 | 2015-04-24 13:39:59 +0800 | [diff] [blame] | 7122 | #define ALC256_STANDARD_PINS \ |
| 7123 | {0x12, 0x90a60140}, \ |
| 7124 | {0x14, 0x90170110}, \ |
Hui Wang | e8191a8 | 2015-04-24 13:39:59 +0800 | [diff] [blame] | 7125 | {0x21, 0x02211020} |
| 7126 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 7127 | #define ALC282_STANDARD_PINS \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7128 | {0x14, 0x90170110} |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 7129 | |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 7130 | #define ALC290_STANDARD_PINS \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7131 | {0x12, 0x99a30130} |
David Henningsson | fea185e | 2014-09-03 10:23:04 +0200 | [diff] [blame] | 7132 | |
| 7133 | #define ALC292_STANDARD_PINS \ |
| 7134 | {0x14, 0x90170110}, \ |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7135 | {0x15, 0x0221401f} |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 7136 | |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 7137 | #define ALC295_STANDARD_PINS \ |
| 7138 | {0x12, 0xb7a60130}, \ |
| 7139 | {0x14, 0x90170110}, \ |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 7140 | {0x21, 0x04211020} |
| 7141 | |
Woodrow Shen | 703867e | 2015-08-05 12:34:12 +0800 | [diff] [blame] | 7142 | #define ALC298_STANDARD_PINS \ |
| 7143 | {0x12, 0x90a60130}, \ |
| 7144 | {0x21, 0x03211020} |
| 7145 | |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 7146 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
Kailang Yang | 8a328ac | 2018-08-21 16:54:41 +0800 | [diff] [blame] | 7147 | SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC, |
| 7148 | {0x14, 0x01014020}, |
| 7149 | {0x17, 0x90170110}, |
| 7150 | {0x18, 0x02a11030}, |
| 7151 | {0x19, 0x0181303F}, |
| 7152 | {0x21, 0x0221102f}), |
Chris Chiu | 5824ce8 | 2017-02-28 14:17:11 -0600 | [diff] [blame] | 7153 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
| 7154 | {0x12, 0x90a601c0}, |
| 7155 | {0x14, 0x90171120}, |
| 7156 | {0x21, 0x02211030}), |
Chris Chiu | 615966a | 2017-02-28 14:17:12 -0600 | [diff] [blame] | 7157 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 7158 | {0x14, 0x90170110}, |
| 7159 | {0x1b, 0x90a70130}, |
| 7160 | {0x21, 0x03211020}), |
| 7161 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
| 7162 | {0x1a, 0x90a70130}, |
| 7163 | {0x1b, 0x90170110}, |
| 7164 | {0x21, 0x03211020}), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 7165 | 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] | 7166 | ALC225_STANDARD_PINS, |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 7167 | {0x12, 0xb7a60130}, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 7168 | {0x14, 0x901701a0}), |
David Henningsson | 2ae9557 | 2016-02-25 09:37:05 +0100 | [diff] [blame] | 7169 | 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] | 7170 | ALC225_STANDARD_PINS, |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 7171 | {0x12, 0xb7a60130}, |
Kailang Yang | cfc5a84 | 2016-02-03 15:20:39 +0800 | [diff] [blame] | 7172 | {0x14, 0x901701b0}), |
Hui Wang | 8a13209 | 2016-07-08 14:26:57 +0800 | [diff] [blame] | 7173 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7174 | ALC225_STANDARD_PINS, |
| 7175 | {0x12, 0xb7a60150}, |
| 7176 | {0x14, 0x901701a0}), |
| 7177 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7178 | ALC225_STANDARD_PINS, |
| 7179 | {0x12, 0xb7a60150}, |
| 7180 | {0x14, 0x901701b0}), |
| 7181 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7182 | ALC225_STANDARD_PINS, |
| 7183 | {0x12, 0xb7a60130}, |
| 7184 | {0x1b, 0x90170110}), |
Kai-Heng Feng | 0ce48e1 | 2017-11-20 02:29:13 -0500 | [diff] [blame] | 7185 | SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7186 | {0x1b, 0x01111010}, |
| 7187 | {0x1e, 0x01451130}, |
| 7188 | {0x21, 0x02211020}), |
Hui Wang | 986376b | 2018-05-30 12:33:07 +0800 | [diff] [blame] | 7189 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
| 7190 | {0x12, 0x90a60140}, |
| 7191 | {0x14, 0x90170110}, |
| 7192 | {0x19, 0x02a11030}, |
| 7193 | {0x21, 0x02211020}), |
Hui Wang | e41fc8c | 2018-06-25 14:40:56 +0800 | [diff] [blame] | 7194 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 7195 | {0x14, 0x90170110}, |
| 7196 | {0x19, 0x02a11030}, |
| 7197 | {0x1a, 0x02a11040}, |
| 7198 | {0x1b, 0x01014020}, |
| 7199 | {0x21, 0x0221101f}), |
Hui Wang | c6b17f1 | 2018-07-06 15:14:11 +0800 | [diff] [blame] | 7200 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 7201 | {0x14, 0x90170110}, |
Hui Wang | d06fb56 | 2018-10-10 11:57:25 +0800 | [diff] [blame] | 7202 | {0x19, 0x02a11030}, |
| 7203 | {0x1a, 0x02a11040}, |
| 7204 | {0x1b, 0x01011020}, |
| 7205 | {0x21, 0x0221101f}), |
| 7206 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
| 7207 | {0x14, 0x90170110}, |
Hui Wang | c6b17f1 | 2018-07-06 15:14:11 +0800 | [diff] [blame] | 7208 | {0x19, 0x02a11020}, |
| 7209 | {0x1a, 0x02a11030}, |
| 7210 | {0x21, 0x0221101f}), |
Hui Wang | f265788 | 2017-10-24 16:53:34 +0800 | [diff] [blame] | 7211 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7212 | {0x12, 0x90a60140}, |
| 7213 | {0x14, 0x90170110}, |
| 7214 | {0x21, 0x02211020}), |
| 7215 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7216 | {0x12, 0x90a60140}, |
| 7217 | {0x14, 0x90170150}, |
| 7218 | {0x21, 0x02211020}), |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 7219 | 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] | 7220 | {0x14, 0x90170110}, |
Hui Wang | c77900e | 2014-09-03 11:31:07 +0800 | [diff] [blame] | 7221 | {0x21, 0x02211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7222 | 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] | 7223 | {0x14, 0x90170130}, |
| 7224 | {0x21, 0x02211040}), |
| 7225 | 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] | 7226 | {0x12, 0x90a60140}, |
| 7227 | {0x14, 0x90170110}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7228 | {0x21, 0x02211020}), |
| 7229 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7230 | {0x12, 0x90a60160}, |
| 7231 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7232 | {0x21, 0x02211030}), |
| 7233 | 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] | 7234 | {0x14, 0x90170110}, |
| 7235 | {0x1b, 0x02011020}, |
| 7236 | {0x21, 0x0221101f}), |
| 7237 | 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] | 7238 | {0x14, 0x90170110}, |
| 7239 | {0x1b, 0x01011020}, |
| 7240 | {0x21, 0x0221101f}), |
| 7241 | 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] | 7242 | {0x14, 0x90170130}, |
David Henningsson | cba5997 | 2015-07-22 10:00:25 +0200 | [diff] [blame] | 7243 | {0x1b, 0x01014020}, |
David Henningsson | cba5997 | 2015-07-22 10:00:25 +0200 | [diff] [blame] | 7244 | {0x21, 0x0221103f}), |
| 7245 | 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] | 7246 | {0x14, 0x90170130}, |
Hui Wang | 6aecd87 | 2016-10-20 14:03:33 +0800 | [diff] [blame] | 7247 | {0x1b, 0x01011020}, |
| 7248 | {0x21, 0x0221103f}), |
| 7249 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7250 | {0x14, 0x90170130}, |
Hui Wang | 59ec4b5 | 2016-08-04 15:28:04 +0800 | [diff] [blame] | 7251 | {0x1b, 0x02011020}, |
| 7252 | {0x21, 0x0221103f}), |
| 7253 | 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] | 7254 | {0x14, 0x90170150}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 7255 | {0x1b, 0x02011020}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 7256 | {0x21, 0x0221105f}), |
| 7257 | 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] | 7258 | {0x14, 0x90170110}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 7259 | {0x1b, 0x01014020}, |
Woodrow Shen | e9c28e1 | 2015-07-25 10:36:16 +0800 | [diff] [blame] | 7260 | {0x21, 0x0221101f}), |
| 7261 | 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] | 7262 | {0x12, 0x90a60160}, |
| 7263 | {0x14, 0x90170120}, |
| 7264 | {0x17, 0x90170140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7265 | {0x21, 0x0321102f}), |
| 7266 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7267 | {0x12, 0x90a60160}, |
| 7268 | {0x14, 0x90170130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7269 | {0x21, 0x02211040}), |
| 7270 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7271 | {0x12, 0x90a60160}, |
| 7272 | {0x14, 0x90170140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7273 | {0x21, 0x02211050}), |
| 7274 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7275 | {0x12, 0x90a60170}, |
| 7276 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7277 | {0x21, 0x02211030}), |
| 7278 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7279 | {0x12, 0x90a60170}, |
| 7280 | {0x14, 0x90170130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7281 | {0x21, 0x02211040}), |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 7282 | 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] | 7283 | {0x12, 0x90a60170}, |
Hui Wang | 0a1f90a | 2016-01-13 11:51:38 +0800 | [diff] [blame] | 7284 | {0x14, 0x90171130}, |
| 7285 | {0x21, 0x02211040}), |
| 7286 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7287 | {0x12, 0x90a60170}, |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 7288 | {0x14, 0x90170140}, |
Hui Wang | 70658b9 | 2015-03-06 14:03:57 +0800 | [diff] [blame] | 7289 | {0x21, 0x02211050}), |
David Henningsson | 9b5a4e3 | 2015-05-11 14:04:14 +0200 | [diff] [blame] | 7290 | 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] | 7291 | {0x12, 0x90a60180}, |
| 7292 | {0x14, 0x90170130}, |
David Henningsson | 9b5a4e3 | 2015-05-11 14:04:14 +0200 | [diff] [blame] | 7293 | {0x21, 0x02211040}), |
AceLan Kao | f90d83b | 2016-06-03 14:45:25 +0800 | [diff] [blame] | 7294 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7295 | {0x12, 0x90a60180}, |
| 7296 | {0x14, 0x90170120}, |
| 7297 | {0x21, 0x02211030}), |
Hui Wang | 989dbe4 | 2016-11-23 16:05:38 +0800 | [diff] [blame] | 7298 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7299 | {0x1b, 0x01011020}, |
| 7300 | {0x21, 0x02211010}), |
Kailang Yang | 7081adf | 2015-03-30 17:05:37 +0800 | [diff] [blame] | 7301 | 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] | 7302 | {0x12, 0x90a60130}, |
| 7303 | {0x14, 0x90170110}, |
| 7304 | {0x1b, 0x01011020}, |
| 7305 | {0x21, 0x0221101f}), |
| 7306 | 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] | 7307 | {0x12, 0x90a60160}, |
| 7308 | {0x14, 0x90170120}, |
Kailang Yang | 81a1231 | 2015-05-28 16:48:22 +0800 | [diff] [blame] | 7309 | {0x21, 0x02211030}), |
| 7310 | 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] | 7311 | {0x12, 0x90a60170}, |
| 7312 | {0x14, 0x90170120}, |
| 7313 | {0x21, 0x02211030}), |
Shrirang Bagul | 311042d | 2016-08-29 15:19:27 +0800 | [diff] [blame] | 7314 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7315 | {0x12, 0x90a60180}, |
| 7316 | {0x14, 0x90170120}, |
| 7317 | {0x21, 0x02211030}), |
Woodrow Shen | f83c329 | 2016-06-24 15:58:34 +0800 | [diff] [blame] | 7318 | 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] | 7319 | {0x12, 0xb7a60130}, |
| 7320 | {0x14, 0x90170110}, |
| 7321 | {0x21, 0x02211020}), |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 7322 | 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] | 7323 | {0x12, 0x90a60130}, |
| 7324 | {0x14, 0x90170110}, |
| 7325 | {0x14, 0x01011020}, |
| 7326 | {0x21, 0x0221101f}), |
| 7327 | 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] | 7328 | ALC256_STANDARD_PINS), |
Chris Chiu | c1732ed | 2017-02-28 14:17:13 -0600 | [diff] [blame] | 7329 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
| 7330 | {0x14, 0x90170110}, |
| 7331 | {0x1b, 0x90a70130}, |
| 7332 | {0x21, 0x04211020}), |
| 7333 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
| 7334 | {0x14, 0x90170110}, |
| 7335 | {0x1b, 0x90a70130}, |
| 7336 | {0x21, 0x03211020}), |
Kailang Yang | 9226665 | 2017-12-14 15:28:58 +0800 | [diff] [blame] | 7337 | 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] | 7338 | {0x12, 0xb7a60130}, |
| 7339 | {0x13, 0xb8a61140}, |
| 7340 | {0x16, 0x90170110}, |
| 7341 | {0x21, 0x04211020}), |
David Henningsson | cf51eb9 | 2014-10-30 08:26:02 +0100 | [diff] [blame] | 7342 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, |
| 7343 | {0x12, 0x90a60130}, |
| 7344 | {0x14, 0x90170110}, |
| 7345 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7346 | {0x1a, 0x04a11020}), |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 7347 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, |
| 7348 | {0x12, 0x90a60140}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 7349 | {0x14, 0x90170110}, |
| 7350 | {0x15, 0x0421101f}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 7351 | {0x18, 0x02811030}, |
Hui Wang | 0279661 | 2014-09-03 11:31:11 +0800 | [diff] [blame] | 7352 | {0x1a, 0x04a1103f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7353 | {0x1b, 0x02011020}), |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 7354 | 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] | 7355 | ALC282_STANDARD_PINS, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 7356 | {0x12, 0x99a30130}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 7357 | {0x19, 0x03a11020}, |
David Henningsson | 4230447 | 2014-07-22 11:42:17 +0200 | [diff] [blame] | 7358 | {0x21, 0x0321101f}), |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7359 | 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] | 7360 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7361 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7362 | {0x19, 0x03a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7363 | {0x21, 0x03211040}), |
| 7364 | 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] | 7365 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7366 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7367 | {0x19, 0x03a11030}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7368 | {0x21, 0x03211020}), |
| 7369 | 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] | 7370 | ALC282_STANDARD_PINS, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7371 | {0x12, 0x99a30130}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7372 | {0x19, 0x04a11020}, |
Hui Wang | 2c60999 | 2014-09-03 11:31:08 +0800 | [diff] [blame] | 7373 | {0x21, 0x0421101f}), |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 7374 | 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] | 7375 | ALC282_STANDARD_PINS, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 7376 | {0x12, 0x90a60140}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 7377 | {0x19, 0x04a11030}, |
Hui Wang | 200afc0 | 2014-09-03 11:31:10 +0800 | [diff] [blame] | 7378 | {0x21, 0x04211020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7379 | 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] | 7380 | ALC282_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7381 | {0x12, 0x90a60130}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7382 | {0x21, 0x0321101f}), |
| 7383 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7384 | {0x12, 0x90a60160}, |
| 7385 | {0x14, 0x90170120}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7386 | {0x21, 0x02211030}), |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 7387 | 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] | 7388 | ALC282_STANDARD_PINS, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 7389 | {0x12, 0x90a60130}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 7390 | {0x19, 0x03a11020}, |
Hui Wang | bc26217 | 2014-09-03 11:31:05 +0800 | [diff] [blame] | 7391 | {0x21, 0x0321101f}), |
Hui Wang | c8c6ee6 | 2019-02-14 11:41:33 +0800 | [diff] [blame] | 7392 | 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] | 7393 | {0x12, 0x90a60130}, |
| 7394 | {0x14, 0x90170110}, |
| 7395 | {0x19, 0x04a11040}, |
| 7396 | {0x21, 0x04211020}), |
Chris Chiu | 33aaebd | 2018-12-05 14:48:53 +0800 | [diff] [blame] | 7397 | SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
| 7398 | {0x12, 0x90a60130}, |
| 7399 | {0x17, 0x90170110}, |
| 7400 | {0x21, 0x02211020}), |
Takashi Iwai | d44a686 | 2018-06-19 23:04:03 +0200 | [diff] [blame] | 7401 | 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] | 7402 | {0x12, 0x90a60120}, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 7403 | {0x14, 0x90170110}, |
Kailang Yang | e1e62b9 | 2015-04-08 16:01:22 +0800 | [diff] [blame] | 7404 | {0x21, 0x0321101f}), |
Hui Wang | d507819 | 2018-03-02 13:05:36 +0800 | [diff] [blame] | 7405 | 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] | 7406 | {0x12, 0xb7a60130}, |
| 7407 | {0x14, 0x90170110}, |
| 7408 | {0x21, 0x04211020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7409 | 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] | 7410 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7411 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7412 | {0x18, 0x90170112}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7413 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7414 | 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] | 7415 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7416 | {0x15, 0x04211040}, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7417 | {0x18, 0x90170110}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7418 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7419 | 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] | 7420 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7421 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7422 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7423 | 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] | 7424 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7425 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7426 | {0x1a, 0x04a11040}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7427 | 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] | 7428 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7429 | {0x14, 0x90170110}, |
| 7430 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7431 | {0x1a, 0x04a11040}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7432 | 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] | 7433 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7434 | {0x14, 0x90170110}, |
| 7435 | {0x15, 0x04211020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7436 | {0x1a, 0x04a11020}), |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7437 | 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] | 7438 | ALC290_STANDARD_PINS, |
Hui Wang | e4442bc | 2014-09-03 11:31:09 +0800 | [diff] [blame] | 7439 | {0x14, 0x90170110}, |
| 7440 | {0x15, 0x0421101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7441 | {0x1a, 0x04a11020}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7442 | 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] | 7443 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7444 | {0x12, 0x90a60140}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7445 | {0x16, 0x01014020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7446 | {0x19, 0x01a19030}), |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7447 | 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] | 7448 | ALC292_STANDARD_PINS, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7449 | {0x12, 0x90a60140}, |
Hui Wang | e8818fa | 2014-09-03 11:31:04 +0800 | [diff] [blame] | 7450 | {0x16, 0x01014020}, |
| 7451 | {0x18, 0x02a19031}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7452 | {0x19, 0x01a1903e}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7453 | 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] | 7454 | ALC292_STANDARD_PINS, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7455 | {0x12, 0x90a60140}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7456 | 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] | 7457 | ALC292_STANDARD_PINS, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7458 | {0x13, 0x90a60140}, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 7459 | {0x16, 0x21014020}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7460 | {0x19, 0x21a19030}), |
David Henningsson | e03fdbd | 2014-06-27 08:41:59 +0200 | [diff] [blame] | 7461 | 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] | 7462 | ALC292_STANDARD_PINS, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 7463 | {0x13, 0x90a60140}), |
Chris Chiu | d8ae458 | 2018-12-07 17:17:11 +0800 | [diff] [blame] | 7464 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC, |
| 7465 | {0x14, 0x90170110}, |
| 7466 | {0x1b, 0x90a70130}, |
| 7467 | {0x21, 0x04211020}), |
Jian-Hong Pan | 0bea4cc | 2018-12-07 17:17:13 +0800 | [diff] [blame] | 7468 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 7469 | {0x12, 0x90a60130}, |
| 7470 | {0x17, 0x90170110}, |
Jian-Hong Pan | 8bb37a2 | 2019-02-21 17:00:18 +0800 | [diff] [blame] | 7471 | {0x21, 0x03211020}), |
| 7472 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
| 7473 | {0x12, 0x90a60130}, |
| 7474 | {0x17, 0x90170110}, |
Jian-Hong Pan | 0bea4cc | 2018-12-07 17:17:13 +0800 | [diff] [blame] | 7475 | {0x21, 0x04211020}), |
Hui Wang | 3f640970 | 2016-09-11 11:26:16 +0800 | [diff] [blame] | 7476 | 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] | 7477 | ALC295_STANDARD_PINS, |
| 7478 | {0x17, 0x21014020}, |
| 7479 | {0x18, 0x21a19030}), |
| 7480 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7481 | ALC295_STANDARD_PINS, |
| 7482 | {0x17, 0x21014040}, |
| 7483 | {0x18, 0x21a19050}), |
Hui Wang | 3f30783 | 2017-03-23 10:00:25 +0800 | [diff] [blame] | 7484 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7485 | ALC295_STANDARD_PINS), |
Kailang Yang | 977e627 | 2015-05-18 15:31:20 +0800 | [diff] [blame] | 7486 | 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] | 7487 | ALC298_STANDARD_PINS, |
Takashi Iwai | 9f502ff | 2015-08-05 12:09:45 +0200 | [diff] [blame] | 7488 | {0x17, 0x90170110}), |
| 7489 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7490 | ALC298_STANDARD_PINS, |
Woodrow Shen | 703867e | 2015-08-05 12:34:12 +0800 | [diff] [blame] | 7491 | {0x17, 0x90170140}), |
| 7492 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 7493 | ALC298_STANDARD_PINS, |
Takashi Iwai | 9f502ff | 2015-08-05 12:09:45 +0200 | [diff] [blame] | 7494 | {0x17, 0x90170150}), |
Kai-Heng Feng | 9f1bc2c4 | 2017-02-16 15:26:54 +0800 | [diff] [blame] | 7495 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME, |
| 7496 | {0x12, 0xb7a60140}, |
| 7497 | {0x13, 0xb7a60150}, |
| 7498 | {0x17, 0x90170110}, |
| 7499 | {0x1a, 0x03011020}, |
| 7500 | {0x21, 0x03211030}), |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 7501 | SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
| 7502 | ALC225_STANDARD_PINS, |
| 7503 | {0x12, 0xb7a60130}, |
Kailang Yang | fcc6c87 | 2017-06-29 15:21:27 +0800 | [diff] [blame] | 7504 | {0x17, 0x90170110}), |
Hui Wang | e191893 | 2014-05-26 16:22:44 +0800 | [diff] [blame] | 7505 | {} |
| 7506 | }; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7507 | |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 7508 | static void alc269_fill_coef(struct hda_codec *codec) |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7509 | { |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 7510 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7511 | int val; |
| 7512 | |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 7513 | if (spec->codec_variant != ALC269_TYPE_ALC269VB) |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 7514 | return; |
Kailang Yang | 526af6e | 2012-03-07 08:25:20 +0100 | [diff] [blame] | 7515 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7516 | if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7517 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 7518 | alc_write_coef_idx(codec, 0xe, 0x8817); |
| 7519 | } |
| 7520 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7521 | if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7522 | alc_write_coef_idx(codec, 0xf, 0x960b); |
| 7523 | alc_write_coef_idx(codec, 0xe, 0x8814); |
| 7524 | } |
| 7525 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7526 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7527 | /* Power up output pin */ |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 7528 | alc_update_coef_idx(codec, 0x04, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7529 | } |
| 7530 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7531 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7532 | val = alc_read_coef_idx(codec, 0xd); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 7533 | if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7534 | /* Capless ramp up clock control */ |
| 7535 | alc_write_coef_idx(codec, 0xd, val | (1<<10)); |
| 7536 | } |
| 7537 | val = alc_read_coef_idx(codec, 0x17); |
Takashi Iwai | f3ee07d | 2014-08-15 17:35:00 +0200 | [diff] [blame] | 7538 | if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7539 | /* Class D power on reset */ |
| 7540 | alc_write_coef_idx(codec, 0x17, val | (1<<7)); |
| 7541 | } |
| 7542 | } |
| 7543 | |
Takashi Iwai | 98b2488 | 2014-08-18 13:47:50 +0200 | [diff] [blame] | 7544 | /* HP */ |
| 7545 | alc_update_coef_idx(codec, 0x4, 0, 1<<11); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7546 | } |
| 7547 | |
| 7548 | /* |
| 7549 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7550 | static int patch_alc269(struct hda_codec *codec) |
| 7551 | { |
| 7552 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7553 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7554 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7555 | err = alc_alloc_spec(codec, 0x0b); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7556 | if (err < 0) |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7557 | return err; |
| 7558 | |
| 7559 | spec = codec->spec; |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 7560 | spec->gen.shared_mic_vref_pin = 0x18; |
Takashi Iwai | 8b99aba | 2015-06-15 11:59:32 +0200 | [diff] [blame] | 7561 | codec->power_save_node = 1; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7562 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 7563 | #ifdef CONFIG_PM |
| 7564 | codec->patch_ops.suspend = alc269_suspend; |
| 7565 | codec->patch_ops.resume = alc269_resume; |
| 7566 | #endif |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 7567 | spec->shutup = alc_default_shutup; |
| 7568 | spec->init_hook = alc_default_init; |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 7569 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 7570 | switch (codec->core.vendor_id) { |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 7571 | case 0x10ec0269: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7572 | spec->codec_variant = ALC269_TYPE_ALC269VA; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7573 | switch (alc_get_coef0(codec) & 0x00f0) { |
| 7574 | case 0x0010: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 7575 | if (codec->bus->pci && |
| 7576 | codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7577 | spec->cdefine.platform_type == 1) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 7578 | err = alc_codec_rename(codec, "ALC271X"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7579 | spec->codec_variant = ALC269_TYPE_ALC269VB; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7580 | break; |
| 7581 | case 0x0020: |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 7582 | if (codec->bus->pci && |
| 7583 | codec->bus->pci->subsystem_vendor == 0x17aa && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7584 | codec->bus->pci->subsystem_device == 0x21f3) |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 7585 | err = alc_codec_rename(codec, "ALC3202"); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7586 | spec->codec_variant = ALC269_TYPE_ALC269VC; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7587 | break; |
Kailang Yang | adcc70b | 2012-05-25 08:08:38 +0200 | [diff] [blame] | 7588 | case 0x0030: |
| 7589 | spec->codec_variant = ALC269_TYPE_ALC269VD; |
| 7590 | break; |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7591 | default: |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7592 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 7593 | } |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7594 | if (err < 0) |
| 7595 | goto error; |
Kailang Yang | c2d6af5 | 2017-06-21 14:50:54 +0800 | [diff] [blame] | 7596 | spec->shutup = alc269_shutup; |
Takashi Iwai | 546bb67 | 2012-03-07 08:37:19 +0100 | [diff] [blame] | 7597 | spec->init_hook = alc269_fill_coef; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7598 | alc269_fill_coef(codec); |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 7599 | break; |
| 7600 | |
| 7601 | case 0x10ec0280: |
| 7602 | case 0x10ec0290: |
| 7603 | spec->codec_variant = ALC269_TYPE_ALC280; |
| 7604 | break; |
| 7605 | case 0x10ec0282: |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 7606 | spec->codec_variant = ALC269_TYPE_ALC282; |
Kailang Yang | 7b5c7a0 | 2014-03-18 16:15:54 +0800 | [diff] [blame] | 7607 | spec->shutup = alc282_shutup; |
| 7608 | spec->init_hook = alc282_init; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 7609 | break; |
Kailang Yang | 2af02be | 2013-08-22 10:03:50 +0200 | [diff] [blame] | 7610 | case 0x10ec0233: |
| 7611 | case 0x10ec0283: |
| 7612 | spec->codec_variant = ALC269_TYPE_ALC283; |
| 7613 | spec->shutup = alc283_shutup; |
| 7614 | spec->init_hook = alc283_init; |
| 7615 | break; |
Kailang Yang | 065380f | 2013-01-10 10:25:48 +0100 | [diff] [blame] | 7616 | case 0x10ec0284: |
| 7617 | case 0x10ec0292: |
| 7618 | spec->codec_variant = ALC269_TYPE_ALC284; |
| 7619 | break; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 7620 | case 0x10ec0293: |
Kailang Yang | 4731d5d | 2017-06-30 15:22:57 +0800 | [diff] [blame] | 7621 | spec->codec_variant = ALC269_TYPE_ALC293; |
Kailang Yang | 161ebf2 | 2013-10-24 11:36:33 +0200 | [diff] [blame] | 7622 | break; |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 7623 | case 0x10ec0286: |
Kailang Yang | 7c66593 | 2014-04-14 15:09:44 +0800 | [diff] [blame] | 7624 | case 0x10ec0288: |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 7625 | spec->codec_variant = ALC269_TYPE_ALC286; |
Kailang Yang | f7ae9ba | 2014-06-30 16:10:37 +0800 | [diff] [blame] | 7626 | spec->shutup = alc286_shutup; |
Kailang Yang | 7fc7d04 | 2013-04-25 11:04:43 +0200 | [diff] [blame] | 7627 | break; |
Kailang Yang | 506b62c | 2014-12-18 17:07:44 +0800 | [diff] [blame] | 7628 | case 0x10ec0298: |
| 7629 | spec->codec_variant = ALC269_TYPE_ALC298; |
| 7630 | break; |
Kailang Yang | ea04a1d | 2018-04-25 15:31:52 +0800 | [diff] [blame] | 7631 | case 0x10ec0235: |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 7632 | case 0x10ec0255: |
| 7633 | spec->codec_variant = ALC269_TYPE_ALC255; |
Kailang Yang | ab3b8e5 | 2018-04-25 16:05:27 +0800 | [diff] [blame] | 7634 | spec->shutup = alc256_shutup; |
| 7635 | spec->init_hook = alc256_init; |
Kailang Yang | 1d04c9d | 2013-10-24 11:35:18 +0200 | [diff] [blame] | 7636 | break; |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 7637 | case 0x10ec0236: |
Kailang Yang | 4344aec | 2014-12-17 17:39:05 +0800 | [diff] [blame] | 7638 | case 0x10ec0256: |
| 7639 | spec->codec_variant = ALC269_TYPE_ALC256; |
Kailang Yang | 4a219ef | 2017-06-16 16:54:35 +0800 | [diff] [blame] | 7640 | spec->shutup = alc256_shutup; |
| 7641 | spec->init_hook = alc256_init; |
David Henningsson | 7d1b6e2 | 2015-04-21 10:48:46 +0200 | [diff] [blame] | 7642 | 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] | 7643 | 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] | 7644 | break; |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 7645 | case 0x10ec0257: |
| 7646 | spec->codec_variant = ALC269_TYPE_ALC257; |
Kailang Yang | 88d42b2 | 2018-03-14 16:08:57 +0800 | [diff] [blame] | 7647 | spec->shutup = alc256_shutup; |
| 7648 | spec->init_hook = alc256_init; |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 7649 | spec->gen.mixer_nid = 0; |
| 7650 | break; |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 7651 | case 0x10ec0215: |
| 7652 | case 0x10ec0285: |
| 7653 | case 0x10ec0289: |
| 7654 | spec->codec_variant = ALC269_TYPE_ALC215; |
Kailang Yang | 1b6832be | 2018-01-17 15:32:03 +0800 | [diff] [blame] | 7655 | spec->shutup = alc225_shutup; |
| 7656 | spec->init_hook = alc225_init; |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 7657 | spec->gen.mixer_nid = 0; |
| 7658 | break; |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 7659 | case 0x10ec0225: |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 7660 | case 0x10ec0295: |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 7661 | case 0x10ec0299: |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 7662 | spec->codec_variant = ALC269_TYPE_ALC225; |
Kailang Yang | da911b1 | 2018-01-05 16:50:08 +0800 | [diff] [blame] | 7663 | spec->shutup = alc225_shutup; |
| 7664 | spec->init_hook = alc225_init; |
Takashi Iwai | c1350bf | 2017-12-27 09:03:45 +0100 | [diff] [blame] | 7665 | spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */ |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 7666 | break; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 7667 | case 0x10ec0234: |
| 7668 | case 0x10ec0274: |
| 7669 | case 0x10ec0294: |
| 7670 | spec->codec_variant = ALC269_TYPE_ALC294; |
Hui Wang | 532a778 | 2017-06-26 12:30:32 +0800 | [diff] [blame] | 7671 | 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] | 7672 | 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] | 7673 | spec->init_hook = alc294_init; |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 7674 | break; |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 7675 | case 0x10ec0300: |
| 7676 | spec->codec_variant = ALC269_TYPE_ALC300; |
| 7677 | spec->gen.mixer_nid = 0; /* no loopback on ALC300 */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7678 | break; |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 7679 | case 0x10ec0700: |
| 7680 | case 0x10ec0701: |
| 7681 | case 0x10ec0703: |
| 7682 | spec->codec_variant = ALC269_TYPE_ALC700; |
| 7683 | 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] | 7684 | 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] | 7685 | spec->init_hook = alc294_init; |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 7686 | break; |
| 7687 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7688 | } |
| 7689 | |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 7690 | 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] | 7691 | spec->has_alc5505_dsp = 1; |
Kailang Yang | ad60d50 | 2013-06-28 12:03:01 +0200 | [diff] [blame] | 7692 | spec->init_hook = alc5505_dsp_init; |
| 7693 | } |
| 7694 | |
Takashi Iwai | efe5573 | 2018-06-15 11:55:02 +0200 | [diff] [blame] | 7695 | snd_hda_pick_fixup(codec, alc269_fixup_models, |
| 7696 | alc269_fixup_tbl, alc269_fixups); |
| 7697 | snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups); |
| 7698 | snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, |
| 7699 | alc269_fixups); |
| 7700 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
| 7701 | |
| 7702 | alc_auto_parse_customize_define(codec); |
| 7703 | |
| 7704 | if (has_cdefine_beep(codec)) |
| 7705 | spec->gen.beep_nid = 0x01; |
| 7706 | |
Takashi Iwai | a4297b5 | 2011-08-23 18:40:12 +0200 | [diff] [blame] | 7707 | /* automatic parse from the BIOS config */ |
| 7708 | err = alc269_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7709 | if (err < 0) |
| 7710 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7711 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 7712 | if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) { |
| 7713 | err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT); |
| 7714 | if (err < 0) |
| 7715 | goto error; |
| 7716 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7717 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7718 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 7719 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7720 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7721 | |
| 7722 | error: |
| 7723 | alc_free(codec); |
| 7724 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7725 | } |
| 7726 | |
| 7727 | /* |
| 7728 | * ALC861 |
| 7729 | */ |
| 7730 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7731 | static int alc861_parse_auto_config(struct hda_codec *codec) |
| 7732 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7733 | static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 7734 | static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; |
| 7735 | return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7736 | } |
| 7737 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7738 | /* Pin config fixes */ |
| 7739 | enum { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7740 | ALC861_FIXUP_FSC_AMILO_PI1505, |
| 7741 | ALC861_FIXUP_AMP_VREF_0F, |
| 7742 | ALC861_FIXUP_NO_JACK_DETECT, |
| 7743 | ALC861_FIXUP_ASUS_A6RP, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 7744 | ALC660_FIXUP_ASUS_W7J, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7745 | }; |
| 7746 | |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7747 | /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ |
| 7748 | static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7749 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7750 | { |
| 7751 | struct alc_spec *spec = codec->spec; |
| 7752 | unsigned int val; |
| 7753 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7754 | if (action != HDA_FIXUP_ACT_INIT) |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7755 | return; |
Takashi Iwai | d3f02d6 | 2013-01-10 10:12:22 +0100 | [diff] [blame] | 7756 | val = snd_hda_codec_get_pin_target(codec, 0x0f); |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7757 | if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) |
| 7758 | val |= AC_PINCTL_IN_EN; |
| 7759 | val |= AC_PINCTL_VREF_50; |
Takashi Iwai | cdd03ce | 2012-04-20 12:34:50 +0200 | [diff] [blame] | 7760 | snd_hda_set_pin_ctl(codec, 0x0f, val); |
Takashi Iwai | 08c189f | 2012-12-19 15:22:24 +0100 | [diff] [blame] | 7761 | spec->gen.keep_vref_in_automute = 1; |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7762 | } |
| 7763 | |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7764 | /* suppress the jack-detection */ |
| 7765 | static void alc_fixup_no_jack_detect(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7766 | const struct hda_fixup *fix, int action) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7767 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7768 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7769 | codec->no_jack_detect = 1; |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 7770 | } |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7771 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7772 | static const struct hda_fixup alc861_fixups[] = { |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7773 | [ALC861_FIXUP_FSC_AMILO_PI1505] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7774 | .type = HDA_FIXUP_PINS, |
| 7775 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7776 | { 0x0b, 0x0221101f }, /* HP */ |
| 7777 | { 0x0f, 0x90170310 }, /* speaker */ |
| 7778 | { } |
| 7779 | } |
| 7780 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7781 | [ALC861_FIXUP_AMP_VREF_0F] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7782 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 31150f2 | 2012-01-30 10:54:08 +0100 | [diff] [blame] | 7783 | .v.func = alc861_fixup_asus_amp_vref_0f, |
Takashi Iwai | 3b25eb6 | 2012-01-25 09:55:46 +0100 | [diff] [blame] | 7784 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7785 | [ALC861_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7786 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7787 | .v.func = alc_fixup_no_jack_detect, |
| 7788 | }, |
| 7789 | [ALC861_FIXUP_ASUS_A6RP] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7790 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7791 | .v.func = alc861_fixup_asus_amp_vref_0f, |
| 7792 | .chained = true, |
| 7793 | .chain_id = ALC861_FIXUP_NO_JACK_DETECT, |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 7794 | }, |
| 7795 | [ALC660_FIXUP_ASUS_W7J] = { |
| 7796 | .type = HDA_FIXUP_VERBS, |
| 7797 | .v.verbs = (const struct hda_verb[]) { |
| 7798 | /* ASUS W7J needs a magic pin setup on unused NID 0x10 |
| 7799 | * for enabling outputs |
| 7800 | */ |
| 7801 | {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, |
| 7802 | { } |
| 7803 | }, |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7804 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7805 | }; |
| 7806 | |
| 7807 | static const struct snd_pci_quirk alc861_fixup_tbl[] = { |
Takashi Iwai | 6ddf0fd | 2013-11-29 12:47:34 +0100 | [diff] [blame] | 7808 | SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e7ca237 | 2013-12-02 15:27:19 +0100 | [diff] [blame] | 7809 | SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), |
Takashi Iwai | e652f4c | 2012-02-13 11:56:25 +0100 | [diff] [blame] | 7810 | SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), |
| 7811 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), |
| 7812 | SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), |
| 7813 | SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F), |
| 7814 | SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F), |
| 7815 | 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] | 7816 | {} |
| 7817 | }; |
| 7818 | |
| 7819 | /* |
| 7820 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7821 | static int patch_alc861(struct hda_codec *codec) |
| 7822 | { |
| 7823 | struct alc_spec *spec; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7824 | int err; |
| 7825 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7826 | err = alc_alloc_spec(codec, 0x15); |
| 7827 | if (err < 0) |
| 7828 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7829 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7830 | spec = codec->spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 7831 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7832 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 7833 | #ifdef CONFIG_PM |
| 7834 | spec->power_hook = alc_power_eapd; |
| 7835 | #endif |
| 7836 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7837 | snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); |
| 7838 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7839 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 7840 | /* automatic parse from the BIOS config */ |
| 7841 | err = alc861_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7842 | if (err < 0) |
| 7843 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7844 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 7845 | if (!spec->gen.no_analog) { |
| 7846 | err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); |
| 7847 | if (err < 0) |
| 7848 | goto error; |
| 7849 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7850 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7851 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 7852 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7853 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7854 | |
| 7855 | error: |
| 7856 | alc_free(codec); |
| 7857 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7858 | } |
| 7859 | |
| 7860 | /* |
| 7861 | * ALC861-VD support |
| 7862 | * |
| 7863 | * Based on ALC882 |
| 7864 | * |
| 7865 | * In addition, an independent DAC |
| 7866 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7867 | static int alc861vd_parse_auto_config(struct hda_codec *codec) |
| 7868 | { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7869 | static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 7870 | static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 7871 | return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7872 | } |
| 7873 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7874 | enum { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7875 | ALC660VD_FIX_ASUS_GPIO1, |
| 7876 | ALC861VD_FIX_DALLAS, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7877 | }; |
| 7878 | |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7879 | /* exclude VREF80 */ |
| 7880 | static void alc861vd_fixup_dallas(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7881 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7882 | { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7883 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | b78562b | 2012-12-17 20:06:49 +0100 | [diff] [blame] | 7884 | snd_hda_override_pin_caps(codec, 0x18, 0x00000734); |
| 7885 | snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7886 | } |
| 7887 | } |
| 7888 | |
Takashi Iwai | df73d83 | 2018-06-19 23:05:47 +0200 | [diff] [blame] | 7889 | /* reset GPIO1 */ |
| 7890 | static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec, |
| 7891 | const struct hda_fixup *fix, int action) |
| 7892 | { |
| 7893 | struct alc_spec *spec = codec->spec; |
| 7894 | |
| 7895 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
| 7896 | spec->gpio_mask |= 0x02; |
| 7897 | alc_fixup_gpio(codec, action, 0x01); |
| 7898 | } |
| 7899 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7900 | static const struct hda_fixup alc861vd_fixups[] = { |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7901 | [ALC660VD_FIX_ASUS_GPIO1] = { |
Takashi Iwai | df73d83 | 2018-06-19 23:05:47 +0200 | [diff] [blame] | 7902 | .type = HDA_FIXUP_FUNC, |
| 7903 | .v.func = alc660vd_fixup_asus_gpio1, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7904 | }, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7905 | [ALC861VD_FIX_DALLAS] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7906 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7907 | .v.func = alc861vd_fixup_dallas, |
| 7908 | }, |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7909 | }; |
| 7910 | |
| 7911 | static const struct snd_pci_quirk alc861vd_fixup_tbl[] = { |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7912 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7913 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), |
Takashi Iwai | 8fdcb6f | 2011-08-23 17:28:55 +0200 | [diff] [blame] | 7914 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7915 | {} |
| 7916 | }; |
| 7917 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7918 | /* |
| 7919 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7920 | static int patch_alc861vd(struct hda_codec *codec) |
| 7921 | { |
| 7922 | struct alc_spec *spec; |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 7923 | int err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7924 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7925 | err = alc_alloc_spec(codec, 0x0b); |
| 7926 | if (err < 0) |
| 7927 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7928 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 7929 | spec = codec->spec; |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 7930 | spec->gen.beep_nid = 0x23; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7931 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 7932 | spec->shutup = alc_eapd_shutup; |
| 7933 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7934 | snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); |
| 7935 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7936 | |
Takashi Iwai | cb4e482 | 2011-08-23 17:34:25 +0200 | [diff] [blame] | 7937 | /* automatic parse from the BIOS config */ |
| 7938 | err = alc861vd_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7939 | if (err < 0) |
| 7940 | goto error; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7941 | |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 7942 | if (!spec->gen.no_analog) { |
| 7943 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 7944 | if (err < 0) |
| 7945 | goto error; |
| 7946 | } |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7947 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7948 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 7949 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7950 | return 0; |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 7951 | |
| 7952 | error: |
| 7953 | alc_free(codec); |
| 7954 | return err; |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7955 | } |
| 7956 | |
| 7957 | /* |
| 7958 | * ALC662 support |
| 7959 | * |
| 7960 | * ALC662 is almost identical with ALC880 but has cleaner and more flexible |
| 7961 | * configuration. Each pin widget can choose any input DACs and a mixer. |
| 7962 | * Each ADC is connected from a mixer of all inputs. This makes possible |
| 7963 | * 6-channel independent captures. |
| 7964 | * |
| 7965 | * In addition, an independent DAC for the multi-playback (not used in this |
| 7966 | * driver yet). |
| 7967 | */ |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 7968 | |
| 7969 | /* |
| 7970 | * BIOS auto configuration |
| 7971 | */ |
| 7972 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 7973 | static int alc662_parse_auto_config(struct hda_codec *codec) |
| 7974 | { |
Takashi Iwai | 4c6d72d | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 7975 | static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 7976 | static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; |
| 7977 | static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
| 7978 | const hda_nid_t *ssids; |
Takashi Iwai | ee979a14 | 2008-09-02 15:42:20 +0200 | [diff] [blame] | 7979 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 7980 | if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || |
| 7981 | codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || |
| 7982 | codec->core.vendor_id == 0x10ec0671) |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 7983 | ssids = alc663_ssids; |
Kailang Yang | 6227cdc | 2010-02-25 08:36:52 +0100 | [diff] [blame] | 7984 | else |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 7985 | ssids = alc662_ssids; |
| 7986 | return alc_parse_auto_config(codec, alc662_ignore, ssids); |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 7987 | } |
| 7988 | |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 7989 | static void alc272_fixup_mario(struct hda_codec *codec, |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 7990 | const struct hda_fixup *fix, int action) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 7991 | { |
Takashi Iwai | 9bb1f06 | 2013-01-10 17:14:29 +0100 | [diff] [blame] | 7992 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
Takashi Iwai | 6fc398c | 2011-01-13 14:36:37 +0100 | [diff] [blame] | 7993 | return; |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 7994 | if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, |
| 7995 | (0x3b << AC_AMPCAP_OFFSET_SHIFT) | |
| 7996 | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | |
| 7997 | (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | |
| 7998 | (0 << AC_AMPCAP_MUTE_SHIFT))) |
Takashi Iwai | 4e76a88 | 2014-02-25 12:21:03 +0100 | [diff] [blame] | 7999 | codec_warn(codec, "failed to override amp caps for NID 0x2\n"); |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8000 | } |
| 8001 | |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 8002 | static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { |
| 8003 | { .channels = 2, |
| 8004 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, |
| 8005 | { .channels = 4, |
| 8006 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, |
| 8007 | SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ |
| 8008 | { } |
| 8009 | }; |
| 8010 | |
| 8011 | /* override the 2.1 chmap */ |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 8012 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 8013 | const struct hda_fixup *fix, int action) |
| 8014 | { |
| 8015 | if (action == HDA_FIXUP_ACT_BUILD) { |
| 8016 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | bbbc7e8 | 2015-02-27 17:43:19 +0100 | [diff] [blame] | 8017 | 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] | 8018 | } |
| 8019 | } |
| 8020 | |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 8021 | /* avoid D3 for keeping GPIO up */ |
| 8022 | static unsigned int gpio_led_power_filter(struct hda_codec *codec, |
| 8023 | hda_nid_t nid, |
| 8024 | unsigned int power_state) |
| 8025 | { |
| 8026 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | d261eec | 2018-06-19 22:32:29 +0200 | [diff] [blame] | 8027 | 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] | 8028 | return AC_PWRST_D0; |
| 8029 | return power_state; |
| 8030 | } |
| 8031 | |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8032 | static void alc662_fixup_led_gpio1(struct hda_codec *codec, |
| 8033 | const struct hda_fixup *fix, int action) |
| 8034 | { |
| 8035 | struct alc_spec *spec = codec->spec; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8036 | |
Takashi Iwai | 01e4a27 | 2018-06-19 22:47:30 +0200 | [diff] [blame] | 8037 | alc_fixup_hp_gpio_led(codec, action, 0x01, 0); |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8038 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
Takashi Iwai | 0f32fd19 | 2014-11-19 12:16:14 +0100 | [diff] [blame] | 8039 | spec->mute_led_polarity = 1; |
Takashi Iwai | bf68665 | 2014-01-13 16:18:25 +0100 | [diff] [blame] | 8040 | codec->power_filter = gpio_led_power_filter; |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8041 | } |
| 8042 | } |
| 8043 | |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 8044 | static void alc662_usi_automute_hook(struct hda_codec *codec, |
| 8045 | struct hda_jack_callback *jack) |
| 8046 | { |
| 8047 | struct alc_spec *spec = codec->spec; |
| 8048 | int vref; |
| 8049 | msleep(200); |
| 8050 | snd_hda_gen_hp_automute(codec, jack); |
| 8051 | |
| 8052 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; |
| 8053 | msleep(100); |
| 8054 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 8055 | vref); |
| 8056 | } |
| 8057 | |
| 8058 | static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, |
| 8059 | const struct hda_fixup *fix, int action) |
| 8060 | { |
| 8061 | struct alc_spec *spec = codec->spec; |
| 8062 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 8063 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; |
| 8064 | spec->gen.hp_automute_hook = alc662_usi_automute_hook; |
| 8065 | } |
| 8066 | } |
| 8067 | |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 8068 | static struct coef_fw alc668_coefs[] = { |
| 8069 | WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), |
| 8070 | WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), |
| 8071 | WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), |
| 8072 | WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), |
| 8073 | WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), |
| 8074 | WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), |
| 8075 | WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), |
| 8076 | WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), |
| 8077 | WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), |
| 8078 | WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), |
| 8079 | WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), |
| 8080 | WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), |
| 8081 | WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), |
| 8082 | WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), |
| 8083 | WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), |
| 8084 | WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), |
| 8085 | WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), |
| 8086 | WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), |
| 8087 | WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), |
| 8088 | WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), |
| 8089 | {} |
| 8090 | }; |
| 8091 | |
| 8092 | static void alc668_restore_default_value(struct hda_codec *codec) |
| 8093 | { |
| 8094 | alc_process_coef_fw(codec, alc668_coefs); |
| 8095 | } |
| 8096 | |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8097 | enum { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 8098 | ALC662_FIXUP_ASPIRE, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8099 | ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8100 | ALC662_FIXUP_IDEAPAD, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8101 | ALC272_FIXUP_MARIO, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 8102 | ALC662_FIXUP_CZC_P10T, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 8103 | ALC662_FIXUP_SKU_IGNORE, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 8104 | ALC662_FIXUP_HP_RP5800, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8105 | ALC662_FIXUP_ASUS_MODE1, |
| 8106 | ALC662_FIXUP_ASUS_MODE2, |
| 8107 | ALC662_FIXUP_ASUS_MODE3, |
| 8108 | ALC662_FIXUP_ASUS_MODE4, |
| 8109 | ALC662_FIXUP_ASUS_MODE5, |
| 8110 | ALC662_FIXUP_ASUS_MODE6, |
| 8111 | ALC662_FIXUP_ASUS_MODE7, |
| 8112 | ALC662_FIXUP_ASUS_MODE8, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 8113 | ALC662_FIXUP_NO_JACK_DETECT, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 8114 | ALC662_FIXUP_ZOTAC_Z68, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 8115 | ALC662_FIXUP_INV_DMIC, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8116 | ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 8117 | ALC668_FIXUP_DELL_MIC_NO_PRESENCE, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8118 | ALC662_FIXUP_HEADSET_MODE, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 8119 | ALC668_FIXUP_HEADSET_MODE, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8120 | ALC662_FIXUP_BASS_MODE4_CHMAP, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 8121 | ALC662_FIXUP_BASS_16, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 8122 | ALC662_FIXUP_BASS_1A, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8123 | ALC662_FIXUP_BASS_CHMAP, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 8124 | ALC668_FIXUP_AUTO_MUTE, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 8125 | ALC668_FIXUP_DELL_DISABLE_AAMIX, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 8126 | ALC668_FIXUP_DELL_XPS13, |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 8127 | ALC662_FIXUP_ASUS_Nx50, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 8128 | ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 8129 | ALC668_FIXUP_ASUS_Nx51, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 8130 | ALC668_FIXUP_MIC_COEF, |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 8131 | ALC668_FIXUP_ASUS_G751, |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 8132 | ALC891_FIXUP_HEADSET_MODE, |
| 8133 | ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 8134 | ALC662_FIXUP_ACER_VERITON, |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 8135 | ALC892_FIXUP_ASROCK_MOBO, |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 8136 | ALC662_FIXUP_USI_FUNC, |
| 8137 | ALC662_FIXUP_USI_HEADSET_MODE, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 8138 | ALC662_FIXUP_LENOVO_MULTI_CODECS, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8139 | }; |
| 8140 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8141 | static const struct hda_fixup alc662_fixups[] = { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 8142 | [ALC662_FIXUP_ASPIRE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8143 | .type = HDA_FIXUP_PINS, |
| 8144 | .v.pins = (const struct hda_pintbl[]) { |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 8145 | { 0x15, 0x99130112 }, /* subwoofer */ |
| 8146 | { } |
| 8147 | } |
| 8148 | }, |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8149 | [ALC662_FIXUP_LED_GPIO1] = { |
| 8150 | .type = HDA_FIXUP_FUNC, |
| 8151 | .v.func = alc662_fixup_led_gpio1, |
| 8152 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8153 | [ALC662_FIXUP_IDEAPAD] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8154 | .type = HDA_FIXUP_PINS, |
| 8155 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8156 | { 0x17, 0x99130112 }, /* subwoofer */ |
| 8157 | { } |
Takashi Iwai | 3e887f3 | 2014-01-10 17:50:58 +0100 | [diff] [blame] | 8158 | }, |
| 8159 | .chained = true, |
| 8160 | .chain_id = ALC662_FIXUP_LED_GPIO1, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8161 | }, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8162 | [ALC272_FIXUP_MARIO] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8163 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | b5bfbc6 | 2011-01-13 14:22:32 +0100 | [diff] [blame] | 8164 | .v.func = alc272_fixup_mario, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 8165 | }, |
| 8166 | [ALC662_FIXUP_CZC_P10T] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8167 | .type = HDA_FIXUP_VERBS, |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 8168 | .v.verbs = (const struct hda_verb[]) { |
| 8169 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, |
| 8170 | {} |
| 8171 | } |
| 8172 | }, |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 8173 | [ALC662_FIXUP_SKU_IGNORE] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8174 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 23d30f2 | 2012-05-07 17:17:32 +0200 | [diff] [blame] | 8175 | .v.func = alc_fixup_sku_ignore, |
Takashi Iwai | c6b3587 | 2011-03-28 12:05:31 +0200 | [diff] [blame] | 8176 | }, |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 8177 | [ALC662_FIXUP_HP_RP5800] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8178 | .type = HDA_FIXUP_PINS, |
| 8179 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 8180 | { 0x14, 0x0221201f }, /* HP out */ |
| 8181 | { } |
| 8182 | }, |
| 8183 | .chained = true, |
| 8184 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8185 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8186 | [ALC662_FIXUP_ASUS_MODE1] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8187 | .type = HDA_FIXUP_PINS, |
| 8188 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8189 | { 0x14, 0x99130110 }, /* speaker */ |
| 8190 | { 0x18, 0x01a19c20 }, /* mic */ |
| 8191 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 8192 | { 0x21, 0x0121401f }, /* HP out */ |
| 8193 | { } |
| 8194 | }, |
| 8195 | .chained = true, |
| 8196 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8197 | }, |
| 8198 | [ALC662_FIXUP_ASUS_MODE2] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8199 | .type = HDA_FIXUP_PINS, |
| 8200 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 8201 | { 0x14, 0x99130110 }, /* speaker */ |
| 8202 | { 0x18, 0x01a19820 }, /* mic */ |
| 8203 | { 0x19, 0x99a3092f }, /* int-mic */ |
| 8204 | { 0x1b, 0x0121401f }, /* HP out */ |
| 8205 | { } |
| 8206 | }, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8207 | .chained = true, |
| 8208 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8209 | }, |
| 8210 | [ALC662_FIXUP_ASUS_MODE3] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8211 | .type = HDA_FIXUP_PINS, |
| 8212 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8213 | { 0x14, 0x99130110 }, /* speaker */ |
| 8214 | { 0x15, 0x0121441f }, /* HP */ |
| 8215 | { 0x18, 0x01a19840 }, /* mic */ |
| 8216 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 8217 | { 0x21, 0x01211420 }, /* HP2 */ |
| 8218 | { } |
| 8219 | }, |
| 8220 | .chained = true, |
| 8221 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8222 | }, |
| 8223 | [ALC662_FIXUP_ASUS_MODE4] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8224 | .type = HDA_FIXUP_PINS, |
| 8225 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8226 | { 0x14, 0x99130110 }, /* speaker */ |
| 8227 | { 0x16, 0x99130111 }, /* speaker */ |
| 8228 | { 0x18, 0x01a19840 }, /* mic */ |
| 8229 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 8230 | { 0x21, 0x0121441f }, /* HP */ |
| 8231 | { } |
| 8232 | }, |
| 8233 | .chained = true, |
| 8234 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8235 | }, |
| 8236 | [ALC662_FIXUP_ASUS_MODE5] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8237 | .type = HDA_FIXUP_PINS, |
| 8238 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8239 | { 0x14, 0x99130110 }, /* speaker */ |
| 8240 | { 0x15, 0x0121441f }, /* HP */ |
| 8241 | { 0x16, 0x99130111 }, /* speaker */ |
| 8242 | { 0x18, 0x01a19840 }, /* mic */ |
| 8243 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 8244 | { } |
| 8245 | }, |
| 8246 | .chained = true, |
| 8247 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8248 | }, |
| 8249 | [ALC662_FIXUP_ASUS_MODE6] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8250 | .type = HDA_FIXUP_PINS, |
| 8251 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8252 | { 0x14, 0x99130110 }, /* speaker */ |
| 8253 | { 0x15, 0x01211420 }, /* HP2 */ |
| 8254 | { 0x18, 0x01a19840 }, /* mic */ |
| 8255 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 8256 | { 0x1b, 0x0121441f }, /* HP */ |
| 8257 | { } |
| 8258 | }, |
| 8259 | .chained = true, |
| 8260 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8261 | }, |
| 8262 | [ALC662_FIXUP_ASUS_MODE7] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8263 | .type = HDA_FIXUP_PINS, |
| 8264 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8265 | { 0x14, 0x99130110 }, /* speaker */ |
| 8266 | { 0x17, 0x99130111 }, /* speaker */ |
| 8267 | { 0x18, 0x01a19840 }, /* mic */ |
| 8268 | { 0x19, 0x99a3094f }, /* int-mic */ |
| 8269 | { 0x1b, 0x01214020 }, /* HP */ |
| 8270 | { 0x21, 0x0121401f }, /* HP */ |
| 8271 | { } |
| 8272 | }, |
| 8273 | .chained = true, |
| 8274 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
| 8275 | }, |
| 8276 | [ALC662_FIXUP_ASUS_MODE8] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8277 | .type = HDA_FIXUP_PINS, |
| 8278 | .v.pins = (const struct hda_pintbl[]) { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8279 | { 0x14, 0x99130110 }, /* speaker */ |
| 8280 | { 0x12, 0x99a30970 }, /* int-mic */ |
| 8281 | { 0x15, 0x01214020 }, /* HP */ |
| 8282 | { 0x17, 0x99130111 }, /* speaker */ |
| 8283 | { 0x18, 0x01a19840 }, /* mic */ |
| 8284 | { 0x21, 0x0121401f }, /* HP */ |
| 8285 | { } |
| 8286 | }, |
| 8287 | .chained = true, |
| 8288 | .chain_id = ALC662_FIXUP_SKU_IGNORE |
Takashi Iwai | 2996bdb | 2011-08-18 16:02:24 +0200 | [diff] [blame] | 8289 | }, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 8290 | [ALC662_FIXUP_NO_JACK_DETECT] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8291 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 8292 | .v.func = alc_fixup_no_jack_detect, |
| 8293 | }, |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 8294 | [ALC662_FIXUP_ZOTAC_Z68] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8295 | .type = HDA_FIXUP_PINS, |
| 8296 | .v.pins = (const struct hda_pintbl[]) { |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 8297 | { 0x1b, 0x02214020 }, /* Front HP */ |
| 8298 | { } |
| 8299 | } |
| 8300 | }, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 8301 | [ALC662_FIXUP_INV_DMIC] = { |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8302 | .type = HDA_FIXUP_FUNC, |
David Henningsson | 9d36a7d | 2014-10-07 10:18:42 +0200 | [diff] [blame] | 8303 | .v.func = alc_fixup_inv_dmic, |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 8304 | }, |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 8305 | [ALC668_FIXUP_DELL_XPS13] = { |
| 8306 | .type = HDA_FIXUP_FUNC, |
| 8307 | .v.func = alc_fixup_dell_xps13, |
| 8308 | .chained = true, |
| 8309 | .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX |
| 8310 | }, |
Gabriele Mazzotta | 5e6db66 | 2014-05-20 18:58:26 +0200 | [diff] [blame] | 8311 | [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { |
| 8312 | .type = HDA_FIXUP_FUNC, |
| 8313 | .v.func = alc_fixup_disable_aamix, |
| 8314 | .chained = true, |
| 8315 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 8316 | }, |
Hui Wang | 493a52a | 2014-01-14 14:07:36 +0800 | [diff] [blame] | 8317 | [ALC668_FIXUP_AUTO_MUTE] = { |
| 8318 | .type = HDA_FIXUP_FUNC, |
| 8319 | .v.func = alc_fixup_auto_mute_via_amp, |
| 8320 | .chained = true, |
| 8321 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE |
| 8322 | }, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8323 | [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 8324 | .type = HDA_FIXUP_PINS, |
| 8325 | .v.pins = (const struct hda_pintbl[]) { |
| 8326 | { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 8327 | /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */ |
| 8328 | { } |
| 8329 | }, |
| 8330 | .chained = true, |
| 8331 | .chain_id = ALC662_FIXUP_HEADSET_MODE |
| 8332 | }, |
| 8333 | [ALC662_FIXUP_HEADSET_MODE] = { |
| 8334 | .type = HDA_FIXUP_FUNC, |
| 8335 | .v.func = alc_fixup_headset_mode_alc662, |
| 8336 | }, |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 8337 | [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 8338 | .type = HDA_FIXUP_PINS, |
| 8339 | .v.pins = (const struct hda_pintbl[]) { |
| 8340 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 8341 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 8342 | { } |
| 8343 | }, |
| 8344 | .chained = true, |
| 8345 | .chain_id = ALC668_FIXUP_HEADSET_MODE |
| 8346 | }, |
| 8347 | [ALC668_FIXUP_HEADSET_MODE] = { |
| 8348 | .type = HDA_FIXUP_FUNC, |
| 8349 | .v.func = alc_fixup_headset_mode_alc668, |
| 8350 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8351 | [ALC662_FIXUP_BASS_MODE4_CHMAP] = { |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 8352 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 8353 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | 8e38395 | 2013-10-30 17:41:12 +0100 | [diff] [blame] | 8354 | .chained = true, |
| 8355 | .chain_id = ALC662_FIXUP_ASUS_MODE4 |
| 8356 | }, |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 8357 | [ALC662_FIXUP_BASS_16] = { |
| 8358 | .type = HDA_FIXUP_PINS, |
| 8359 | .v.pins = (const struct hda_pintbl[]) { |
| 8360 | {0x16, 0x80106111}, /* bass speaker */ |
| 8361 | {} |
| 8362 | }, |
| 8363 | .chained = true, |
| 8364 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
| 8365 | }, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 8366 | [ALC662_FIXUP_BASS_1A] = { |
| 8367 | .type = HDA_FIXUP_PINS, |
| 8368 | .v.pins = (const struct hda_pintbl[]) { |
| 8369 | {0x1a, 0x80106111}, /* bass speaker */ |
| 8370 | {} |
| 8371 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8372 | .chained = true, |
| 8373 | .chain_id = ALC662_FIXUP_BASS_CHMAP, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 8374 | }, |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8375 | [ALC662_FIXUP_BASS_CHMAP] = { |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 8376 | .type = HDA_FIXUP_FUNC, |
Takashi Iwai | eb9ca3a | 2013-11-28 15:24:34 +0100 | [diff] [blame] | 8377 | .v.func = alc_fixup_bass_chmap, |
Takashi Iwai | a30c9aa | 2013-11-21 08:00:20 +0100 | [diff] [blame] | 8378 | }, |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 8379 | [ALC662_FIXUP_ASUS_Nx50] = { |
| 8380 | .type = HDA_FIXUP_FUNC, |
| 8381 | .v.func = alc_fixup_auto_mute_via_amp, |
| 8382 | .chained = true, |
| 8383 | .chain_id = ALC662_FIXUP_BASS_1A |
| 8384 | }, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 8385 | [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = { |
| 8386 | .type = HDA_FIXUP_FUNC, |
| 8387 | .v.func = alc_fixup_headset_mode_alc668, |
| 8388 | .chain_id = ALC662_FIXUP_BASS_CHMAP |
| 8389 | }, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 8390 | [ALC668_FIXUP_ASUS_Nx51] = { |
| 8391 | .type = HDA_FIXUP_PINS, |
| 8392 | .v.pins = (const struct hda_pintbl[]) { |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 8393 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 8394 | { 0x1a, 0x90170151 }, /* bass speaker */ |
| 8395 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 8396 | {} |
| 8397 | }, |
| 8398 | .chained = true, |
Mikhail Paulyshka | fc7438b | 2017-04-21 08:52:42 +0200 | [diff] [blame] | 8399 | .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 8400 | }, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 8401 | [ALC668_FIXUP_MIC_COEF] = { |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 8402 | .type = HDA_FIXUP_VERBS, |
| 8403 | .v.verbs = (const struct hda_verb[]) { |
| 8404 | { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 }, |
| 8405 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 }, |
| 8406 | {} |
| 8407 | }, |
| 8408 | }, |
Takashi Iwai | 5b7c5e1 | 2018-10-09 14:20:17 +0200 | [diff] [blame] | 8409 | [ALC668_FIXUP_ASUS_G751] = { |
| 8410 | .type = HDA_FIXUP_PINS, |
| 8411 | .v.pins = (const struct hda_pintbl[]) { |
| 8412 | { 0x16, 0x0421101f }, /* HP */ |
| 8413 | {} |
| 8414 | }, |
| 8415 | .chained = true, |
| 8416 | .chain_id = ALC668_FIXUP_MIC_COEF |
| 8417 | }, |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 8418 | [ALC891_FIXUP_HEADSET_MODE] = { |
| 8419 | .type = HDA_FIXUP_FUNC, |
| 8420 | .v.func = alc_fixup_headset_mode, |
| 8421 | }, |
| 8422 | [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = { |
| 8423 | .type = HDA_FIXUP_PINS, |
| 8424 | .v.pins = (const struct hda_pintbl[]) { |
| 8425 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
| 8426 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ |
| 8427 | { } |
| 8428 | }, |
| 8429 | .chained = true, |
| 8430 | .chain_id = ALC891_FIXUP_HEADSET_MODE |
| 8431 | }, |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 8432 | [ALC662_FIXUP_ACER_VERITON] = { |
| 8433 | .type = HDA_FIXUP_PINS, |
| 8434 | .v.pins = (const struct hda_pintbl[]) { |
| 8435 | { 0x15, 0x50170120 }, /* no internal speaker */ |
| 8436 | { } |
| 8437 | } |
| 8438 | }, |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 8439 | [ALC892_FIXUP_ASROCK_MOBO] = { |
| 8440 | .type = HDA_FIXUP_PINS, |
| 8441 | .v.pins = (const struct hda_pintbl[]) { |
| 8442 | { 0x15, 0x40f000f0 }, /* disabled */ |
| 8443 | { 0x16, 0x40f000f0 }, /* disabled */ |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 8444 | { } |
| 8445 | } |
| 8446 | }, |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 8447 | [ALC662_FIXUP_USI_FUNC] = { |
| 8448 | .type = HDA_FIXUP_FUNC, |
| 8449 | .v.func = alc662_fixup_usi_headset_mic, |
| 8450 | }, |
| 8451 | [ALC662_FIXUP_USI_HEADSET_MODE] = { |
| 8452 | .type = HDA_FIXUP_PINS, |
| 8453 | .v.pins = (const struct hda_pintbl[]) { |
| 8454 | { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */ |
| 8455 | { 0x18, 0x01a1903d }, |
| 8456 | { } |
| 8457 | }, |
| 8458 | .chained = true, |
| 8459 | .chain_id = ALC662_FIXUP_USI_FUNC |
| 8460 | }, |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 8461 | [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { |
| 8462 | .type = HDA_FIXUP_FUNC, |
| 8463 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, |
| 8464 | }, |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8465 | }; |
| 8466 | |
Takashi Iwai | a911132 | 2011-05-02 11:30:18 +0200 | [diff] [blame] | 8467 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8468 | SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), |
Takashi Iwai | d3d3835 | 2013-08-19 20:05:50 +0200 | [diff] [blame] | 8469 | SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), |
David Henningsson | 02f6ff9 | 2015-12-07 11:29:31 +0100 | [diff] [blame] | 8470 | SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), |
David Henningsson | a6c47a8 | 2011-02-10 15:39:19 +0100 | [diff] [blame] | 8471 | SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), |
David Henningsson | 94024cd | 2011-04-29 14:10:55 +0200 | [diff] [blame] | 8472 | SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), |
Takashi Iwai | 125821a | 2012-06-22 14:30:29 +0200 | [diff] [blame] | 8473 | SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), |
Takashi Iwai | 1801928 | 2013-08-16 08:17:05 +0200 | [diff] [blame] | 8474 | SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), |
Daniel T Chen | 2df0351 | 2010-10-10 22:39:28 -0400 | [diff] [blame] | 8475 | SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), |
David Henningsson | 73bdd59 | 2013-04-15 15:44:14 +0200 | [diff] [blame] | 8476 | SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 8477 | SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | c5d019c | 2014-07-22 17:33:32 +0200 | [diff] [blame] | 8478 | SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), |
Gabriele Mazzotta | 033b0a7 | 2014-05-26 17:11:46 +0200 | [diff] [blame] | 8479 | SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), |
Niranjan Sivakumar | 467e143 | 2015-09-05 18:20:35 +0200 | [diff] [blame] | 8480 | SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13), |
David Henningsson | 09d2014 | 2013-11-20 11:43:30 +0100 | [diff] [blame] | 8481 | SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
David Henningsson | ad8ff99 | 2013-11-07 09:28:59 +0100 | [diff] [blame] | 8482 | SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 8dc9abb | 2014-04-16 15:53:12 +0800 | [diff] [blame] | 8483 | SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 8484 | SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Kailang Yang | 6a98e34 | 2014-10-27 16:20:30 +0800 | [diff] [blame] | 8485 | SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
Takashi Iwai | e59ea3e | 2011-06-29 17:21:00 +0200 | [diff] [blame] | 8486 | SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), |
Kaho Ng | 2da2dc9 | 2016-05-09 00:27:49 +0800 | [diff] [blame] | 8487 | SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), |
Bobi Mihalca | 83a9efb | 2016-03-23 13:32:33 +0200 | [diff] [blame] | 8488 | SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), |
Takashi Iwai | db8948e | 2016-01-18 09:17:30 +0100 | [diff] [blame] | 8489 | SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), |
Bobi Mihalca | 9d4dc58 | 2016-03-23 13:26:11 +0200 | [diff] [blame] | 8490 | SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), |
Takashi Iwai | 11ba611 | 2018-10-07 09:44:17 +0200 | [diff] [blame] | 8491 | SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8492 | SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 8493 | SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), |
Yura Pakhuchiy | 3231e20 | 2016-05-07 23:53:36 +0700 | [diff] [blame] | 8494 | SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51), |
| 8495 | SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51), |
Takashi Iwai | c7efff9 | 2017-01-04 21:38:16 +0100 | [diff] [blame] | 8496 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8), |
David Henningsson | 61a75f1 | 2014-02-07 09:31:08 +0100 | [diff] [blame] | 8497 | SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), |
David Henningsson | 8e54b4a | 2014-02-07 09:31:07 +0100 | [diff] [blame] | 8498 | SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
Takashi Iwai | 1565cc3 | 2012-02-13 12:03:25 +0100 | [diff] [blame] | 8499 | SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8500 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), |
Daniel T Chen | a0e90ac | 2010-11-20 10:20:35 -0500 | [diff] [blame] | 8501 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
Kailang Yang | c6790c8 | 2016-11-25 16:15:17 +0800 | [diff] [blame] | 8502 | SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), |
Kailang Yang | ca169cc | 2017-04-25 16:17:40 +0800 | [diff] [blame] | 8503 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), |
Valentine Sinitsyn | d411858 | 2010-10-01 22:24:08 +0600 | [diff] [blame] | 8504 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8505 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
Takashi Iwai | 1a3f099 | 2016-10-20 12:14:51 +0200 | [diff] [blame] | 8506 | SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), |
David Henningsson | edfe3bf | 2012-06-12 13:15:12 +0200 | [diff] [blame] | 8507 | SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), |
Shrirang Bagul | 9b51fe3 | 2016-08-01 13:16:17 +0800 | [diff] [blame] | 8508 | SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), |
Anisse Astier | d2ebd47 | 2011-01-20 12:36:21 +0100 | [diff] [blame] | 8509 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8510 | |
| 8511 | #if 0 |
| 8512 | /* Below is a quirk table taken from the old code. |
| 8513 | * Basically the device should work as is without the fixup table. |
| 8514 | * If BIOS doesn't give a proper info, enable the corresponding |
| 8515 | * fixup entry. |
Jesper Juhl | 7d7eb9e | 2012-04-12 22:11:25 +0200 | [diff] [blame] | 8516 | */ |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8517 | SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), |
| 8518 | SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), |
| 8519 | SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), |
| 8520 | SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), |
| 8521 | SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 8522 | SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8523 | SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 8524 | SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), |
| 8525 | SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), |
| 8526 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8527 | SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), |
| 8528 | SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), |
| 8529 | SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), |
| 8530 | SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), |
| 8531 | SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), |
| 8532 | SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8533 | SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), |
| 8534 | SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), |
| 8535 | SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8536 | SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 8537 | SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 8538 | SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8539 | SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), |
| 8540 | SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), |
| 8541 | SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), |
| 8542 | SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8543 | SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), |
| 8544 | SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), |
| 8545 | SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8546 | SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), |
| 8547 | SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8548 | SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8549 | SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), |
| 8550 | SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), |
| 8551 | SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), |
| 8552 | SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), |
| 8553 | SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), |
| 8554 | SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), |
| 8555 | SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), |
| 8556 | SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), |
| 8557 | SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), |
| 8558 | SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), |
| 8559 | SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 8560 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), |
| 8561 | SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), |
| 8562 | SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), |
| 8563 | SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), |
| 8564 | SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), |
| 8565 | SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), |
| 8566 | SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), |
| 8567 | #endif |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8568 | {} |
| 8569 | }; |
| 8570 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8571 | static const struct hda_model_fixup alc662_fixup_models[] = { |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 8572 | {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"}, |
| 8573 | {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"}, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8574 | {.id = ALC272_FIXUP_MARIO, .name = "mario"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 8575 | {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"}, |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8576 | {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, |
| 8577 | {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, |
| 8578 | {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, |
| 8579 | {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, |
| 8580 | {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, |
| 8581 | {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, |
| 8582 | {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, |
| 8583 | {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 8584 | {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"}, |
Takashi Iwai | 6e72aa5 | 2012-06-25 10:52:25 +0200 | [diff] [blame] | 8585 | {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 8586 | {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"}, |
David Henningsson | e32aa85 | 2013-06-17 11:04:02 +0200 | [diff] [blame] | 8587 | {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 8588 | {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"}, |
| 8589 | {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"}, |
| 8590 | {.id = ALC662_FIXUP_BASS_16, .name = "bass16"}, |
| 8591 | {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"}, |
| 8592 | {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"}, |
| 8593 | {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"}, |
| 8594 | {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"}, |
| 8595 | {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"}, |
Takashi Iwai | 40c5167 | 2018-10-07 09:47:39 +0200 | [diff] [blame] | 8596 | {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"}, |
Takashi Iwai | aa3841b | 2018-06-26 07:42:40 +0200 | [diff] [blame] | 8597 | {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"}, |
| 8598 | {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"}, |
| 8599 | {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"}, |
| 8600 | {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"}, |
| 8601 | {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"}, |
Takashi Iwai | ba90d6a | 2017-05-22 16:38:47 +0200 | [diff] [blame] | 8602 | {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
Todd Broch | 6be7948 | 2010-12-07 16:51:05 -0800 | [diff] [blame] | 8603 | {} |
| 8604 | }; |
David Henningsson | 6cb3b70 | 2010-09-09 08:51:44 +0200 | [diff] [blame] | 8605 | |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 8606 | static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 8607 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
| 8608 | {0x17, 0x02211010}, |
| 8609 | {0x18, 0x01a19030}, |
| 8610 | {0x1a, 0x01813040}, |
| 8611 | {0x21, 0x01014020}), |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8612 | 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] | 8613 | {0x14, 0x01014010}, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8614 | {0x18, 0x01a19020}, |
David Henningsson | 1f8b46c | 2015-05-12 14:38:15 +0200 | [diff] [blame] | 8615 | {0x1a, 0x0181302f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8616 | {0x1b, 0x0221401f}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8617 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 8618 | {0x12, 0x99a30130}, |
| 8619 | {0x14, 0x90170110}, |
| 8620 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8621 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8622 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 8623 | {0x12, 0x99a30140}, |
| 8624 | {0x14, 0x90170110}, |
| 8625 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8626 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8627 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
| 8628 | {0x12, 0x99a30150}, |
| 8629 | {0x14, 0x90170110}, |
| 8630 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8631 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8632 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8633 | {0x14, 0x90170110}, |
| 8634 | {0x15, 0x0321101f}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8635 | {0x16, 0x03011020}), |
David Henningsson | 76c2132 | 2014-06-24 14:46:54 +0200 | [diff] [blame] | 8636 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, |
| 8637 | {0x12, 0x90a60130}, |
| 8638 | {0x14, 0x90170110}, |
Hui Wang | 1158029 | 2015-08-03 11:03:49 +0800 | [diff] [blame] | 8639 | {0x15, 0x0321101f}), |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 8640 | {} |
| 8641 | }; |
| 8642 | |
Takashi Iwai | 1d045db | 2011-07-07 18:23:21 +0200 | [diff] [blame] | 8643 | /* |
| 8644 | */ |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8645 | static int patch_alc662(struct hda_codec *codec) |
| 8646 | { |
| 8647 | struct alc_spec *spec; |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8648 | int err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8649 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8650 | err = alc_alloc_spec(codec, 0x0b); |
| 8651 | if (err < 0) |
| 8652 | return err; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8653 | |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8654 | spec = codec->spec; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 8655 | |
Takashi Iwai | 225068a | 2015-05-29 10:42:14 +0200 | [diff] [blame] | 8656 | spec->shutup = alc_eapd_shutup; |
| 8657 | |
Takashi Iwai | 53c334a | 2011-08-23 18:27:14 +0200 | [diff] [blame] | 8658 | /* handle multiple HPs as is */ |
| 8659 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 8660 | |
Takashi Iwai | 2c3bf9a | 2008-06-04 12:39:38 +0200 | [diff] [blame] | 8661 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
| 8662 | |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 8663 | switch (codec->core.vendor_id) { |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 8664 | case 0x10ec0668: |
| 8665 | spec->init_hook = alc668_restore_default_value; |
| 8666 | break; |
Kailang Yang | f3f9185 | 2014-10-24 15:43:46 +0800 | [diff] [blame] | 8667 | } |
Kailang Yang | 8663ff7 | 2012-06-29 09:35:52 +0200 | [diff] [blame] | 8668 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8669 | snd_hda_pick_fixup(codec, alc662_fixup_models, |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 8670 | alc662_fixup_tbl, alc662_fixups); |
Hui Wang | 532895c | 2014-05-29 15:59:19 +0800 | [diff] [blame] | 8671 | snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups); |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8672 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
Takashi Iwai | 8e5a050 | 2012-06-21 15:49:33 +0200 | [diff] [blame] | 8673 | |
| 8674 | alc_auto_parse_customize_define(codec); |
| 8675 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 8676 | if (has_cdefine_beep(codec)) |
| 8677 | spec->gen.beep_nid = 0x01; |
| 8678 | |
Takashi Iwai | 1bb7e43 | 2011-10-17 16:50:59 +0200 | [diff] [blame] | 8679 | if ((alc_get_coef0(codec) & (1 << 14)) && |
Takashi Iwai | 5100cd0 | 2014-02-15 10:03:19 +0100 | [diff] [blame] | 8680 | codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8681 | spec->cdefine.platform_type == 1) { |
Wei Yongjun | 6134b1a | 2013-04-18 11:12:59 +0800 | [diff] [blame] | 8682 | err = alc_codec_rename(codec, "ALC272X"); |
| 8683 | if (err < 0) |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8684 | goto error; |
Takashi Iwai | 20ca0c3 | 2011-10-17 16:00:35 +0200 | [diff] [blame] | 8685 | } |
Kailang Yang | 274693f | 2009-12-03 10:07:50 +0100 | [diff] [blame] | 8686 | |
Takashi Iwai | b9c5106 | 2011-08-24 18:08:07 +0200 | [diff] [blame] | 8687 | /* automatic parse from the BIOS config */ |
| 8688 | err = alc662_parse_auto_config(codec); |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8689 | if (err < 0) |
| 8690 | goto error; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8691 | |
Takashi Iwai | 7504b6c | 2013-03-18 11:25:51 +0100 | [diff] [blame] | 8692 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
Takashi Iwai | 7639a06 | 2015-03-03 10:07:24 +0100 | [diff] [blame] | 8693 | switch (codec->core.vendor_id) { |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 8694 | case 0x10ec0662: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 8695 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 8696 | break; |
| 8697 | case 0x10ec0272: |
| 8698 | case 0x10ec0663: |
| 8699 | case 0x10ec0665: |
Kailang Yang | 9ad5454 | 2013-11-26 15:41:40 +0800 | [diff] [blame] | 8700 | case 0x10ec0668: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 8701 | err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 8702 | break; |
| 8703 | case 0x10ec0273: |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 8704 | err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); |
Kailang Yang | da00c24 | 2010-03-19 11:23:45 +0100 | [diff] [blame] | 8705 | break; |
| 8706 | } |
Takashi Iwai | fea80fa | 2018-06-20 12:52:46 +0200 | [diff] [blame] | 8707 | if (err < 0) |
| 8708 | goto error; |
Kailang Yang | cec27c8 | 2010-02-04 14:18:18 +0100 | [diff] [blame] | 8709 | } |
Takashi Iwai | 2134ea4 | 2008-01-10 16:53:55 +0100 | [diff] [blame] | 8710 | |
Takashi Iwai | 1727a77 | 2013-01-10 09:52:52 +0100 | [diff] [blame] | 8711 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
Takashi Iwai | 589876e | 2012-02-20 15:47:55 +0100 | [diff] [blame] | 8712 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8713 | return 0; |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8714 | |
Takashi Iwai | e16fb6d | 2011-10-17 16:39:09 +0200 | [diff] [blame] | 8715 | error: |
| 8716 | alc_free(codec); |
| 8717 | return err; |
Kailang Yang | b478b99 | 2011-05-18 11:51:15 +0200 | [diff] [blame] | 8718 | } |
| 8719 | |
Kailang Yang | bc9f98a | 2007-04-12 13:06:07 +0200 | [diff] [blame] | 8720 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8721 | * ALC680 support |
| 8722 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8723 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8724 | static int alc680_parse_auto_config(struct hda_codec *codec) |
| 8725 | { |
Takashi Iwai | 3e6179b | 2011-07-08 16:55:13 +0200 | [diff] [blame] | 8726 | return alc_parse_auto_config(codec, NULL, NULL); |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8727 | } |
| 8728 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8729 | /* |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8730 | */ |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8731 | static int patch_alc680(struct hda_codec *codec) |
| 8732 | { |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8733 | int err; |
| 8734 | |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 8735 | /* ALC680 has no aa-loopback mixer */ |
Takashi Iwai | 3de9517 | 2012-05-07 18:03:15 +0200 | [diff] [blame] | 8736 | err = alc_alloc_spec(codec, 0); |
| 8737 | if (err < 0) |
| 8738 | return err; |
Takashi Iwai | 1f0f4b8 | 2011-06-27 10:52:59 +0200 | [diff] [blame] | 8739 | |
Takashi Iwai | 1ebec5f | 2011-08-15 13:21:48 +0200 | [diff] [blame] | 8740 | /* automatic parse from the BIOS config */ |
| 8741 | err = alc680_parse_auto_config(codec); |
| 8742 | if (err < 0) { |
| 8743 | alc_free(codec); |
| 8744 | return err; |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8745 | } |
| 8746 | |
Kailang Yang | d1eb57f | 2010-06-23 16:25:26 +0200 | [diff] [blame] | 8747 | return 0; |
| 8748 | } |
| 8749 | |
| 8750 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8751 | * patch entries |
| 8752 | */ |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8753 | static const struct hda_device_id snd_hda_id_realtek[] = { |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 8754 | HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8755 | HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269), |
Kailang Yang | 4231430 | 2016-02-03 15:03:50 +0800 | [diff] [blame] | 8756 | HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8757 | HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269), |
| 8758 | HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 8759 | HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8760 | HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269), |
Kailang Yang | 736f20a | 2017-10-20 15:06:34 +0800 | [diff] [blame] | 8761 | HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8762 | HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269), |
| 8763 | HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269), |
Kailang Yang | f429e7e | 2017-12-05 15:38:24 +0800 | [diff] [blame] | 8764 | HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8765 | HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260), |
| 8766 | HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262), |
| 8767 | HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268), |
| 8768 | HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268), |
| 8769 | HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269), |
| 8770 | HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269), |
| 8771 | HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 8772 | HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8773 | HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269), |
| 8774 | HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269), |
| 8775 | HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269), |
| 8776 | HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269), |
| 8777 | HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269), |
| 8778 | HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269), |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 8779 | HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8780 | HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269), |
| 8781 | HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269), |
Kailang Yang | 0a6f060 | 2017-06-30 16:00:48 +0800 | [diff] [blame] | 8782 | HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8783 | HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269), |
| 8784 | HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269), |
| 8785 | HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269), |
Kailang Yang | dcd4f0d | 2016-05-04 15:50:18 +0800 | [diff] [blame] | 8786 | HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), |
Kailang Yang | 7d72786 | 2016-05-24 16:46:07 +0800 | [diff] [blame] | 8787 | HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8788 | HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), |
Kailang Yang | 28f1f9b | 2017-01-04 14:49:07 +0800 | [diff] [blame] | 8789 | HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), |
Kailang Yang | 1078bef | 2018-11-08 16:36:15 +0800 | [diff] [blame] | 8790 | HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8791 | HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), |
| 8792 | HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), |
| 8793 | HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), |
| 8794 | HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd), |
| 8795 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882), |
| 8796 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662), |
| 8797 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662), |
| 8798 | HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662), |
| 8799 | HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662), |
| 8800 | HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662), |
| 8801 | HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662), |
| 8802 | HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662), |
| 8803 | HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662), |
| 8804 | HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680), |
Kailang Yang | 6fbae35 | 2016-05-30 16:44:20 +0800 | [diff] [blame] | 8805 | HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269), |
| 8806 | HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269), |
| 8807 | HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269), |
Kailang Yang | 78f4f7c | 2016-06-07 11:31:34 +0800 | [diff] [blame] | 8808 | HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662), |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8809 | HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880), |
| 8810 | HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882), |
| 8811 | HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882), |
| 8812 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882), |
| 8813 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882), |
| 8814 | HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882), |
| 8815 | HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882), |
| 8816 | HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882), |
| 8817 | HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882), |
| 8818 | HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882), |
| 8819 | HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662), |
| 8820 | HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882), |
| 8821 | HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882), |
Kailang Yang | 65553b1 | 2017-07-11 15:15:47 +0800 | [diff] [blame] | 8822 | HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), |
Kailang Yang | a535ad5 | 2017-01-16 16:59:26 +0800 | [diff] [blame] | 8823 | HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8824 | {} /* terminator */ |
| 8825 | }; |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8826 | MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 8827 | |
| 8828 | MODULE_LICENSE("GPL"); |
| 8829 | MODULE_DESCRIPTION("Realtek HD-audio codec"); |
| 8830 | |
Takashi Iwai | d8a766a | 2015-02-17 15:25:37 +0100 | [diff] [blame] | 8831 | static struct hda_codec_driver realtek_driver = { |
Takashi Iwai | b9a94a9 | 2015-10-01 16:20:04 +0200 | [diff] [blame] | 8832 | .id = snd_hda_id_realtek, |
Takashi Iwai | 1289e9e | 2008-11-27 15:47:11 +0100 | [diff] [blame] | 8833 | }; |
| 8834 | |
Takashi Iwai | d8a766a | 2015-02-17 15:25:37 +0100 | [diff] [blame] | 8835 | module_hda_codec_driver(realtek_driver); |